<?xml version="1.0" encoding="utf-8"?><rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Fatkun's Blog</title><link>https://fatkun.github.io/</link><description>MemE 是一个强大且可高度定制的 GoHugo 博客主题，专为个人博客设计。</description><generator>Hugo 0.127.0 https://gohugo.io/</generator><language>zh-CN</language><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><lastBuildDate>Sun, 22 Feb 2026 15:26:30 +0000</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://fatkun.github.io/rss.xml"/><item><title>使用AI编程你需要了解的东西</title><link>https://fatkun.github.io/post/2026/ai_code/</link><guid isPermaLink="true">https://fatkun.github.io/post/2026/ai_code/</guid><pubDate>Sun, 22 Feb 2026 10:22:01 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="概括">概括&lt;/h1>
&lt;p>本文介绍使用AI编程相关内容，用于记录一些好用的提示词，MCP，Skills。不包含如何安装codex，claude code等。&lt;/p>
&lt;h1 id="好用的工具">好用的工具&lt;/h1>
&lt;h2 id="cc-switch中转站切换">CC Switch，中转站切换&lt;/h2>
&lt;p>如果你有多个中转站，使用这个工具能够很方便帮你管理配置，这个工具本来是帮你保存多个配置，随时切换。如果开启代理方式，就可以无缝切换站点，不需要重启AI客户端。&lt;/p>
&lt;h2 id="cliproxyapi">CliProxyAPI&lt;/h2>
&lt;p>如果需要反代一些官方服务，可以使用这个服务，例如OpenAI账号反代。&lt;/p>
&lt;h2 id="newapi">NewAPI&lt;/h2>
&lt;p>目前很多中转站使用的AI网关，如果有多个中转站，可以使用它统一配置，避免每个终端都要配置很多站点。&lt;/p>
&lt;h2 id="all-api-hubchrome扩展">All API Hub（chrome扩展）&lt;/h2>
&lt;p>用于管理多个公益站，可以自动添加站点，也可以比较方便用它在其他软件配置KEY（包括NewAPI，CC Switch）&lt;/p>
&lt;h1 id="提示词">提示词&lt;/h1>
&lt;p>每个软件的提示词名字不一样，例如claude的是CLAUDE.md，可以放在全局的目录或者在项目内.claude目录里面。CC Switch可以管理全局提示词。&lt;/p>
&lt;p>编写提示词可以让AI遵循你的规则，例如可以让它在开始编码之前，先说出他的计划，等待你确认后再开始编码。&lt;/p>
&lt;h1 id="skills">Skills&lt;/h1>
&lt;p>Skills是一些技能描述，其实也算是一种提示词，不过为了节省Token，避免把所有信息都塞进提示词里，所以推出了Skills。claude会搜索一些简单的技能描述，如果有需要调用，再读取完整的Skill能力，Skill里面包含描述和脚本(python之类)，这样就可以很精准的执行一些事情。
不过据说Skills可能不会调用，也可以在提示词里面告诉AI，或者直接用 &amp;quot;/xxxx&amp;quot; 指定某个Skill。&lt;/p>
&lt;p>Skills也可以用CC Switch管理。可以在这里面找Skills &lt;a href="https://skillsmp.com/zh">https://skillsmp.com/zh&lt;/a>&lt;/p>
&lt;h2 id="ui-ux-pro-max-skill">ui-ux-pro-max-skill&lt;/h2>
&lt;p>&lt;a href="https://github.com/nextlevelbuilder/ui-ux-pro-max-skill">https://github.com/nextlevelbuilder/ui-ux-pro-max-skill&lt;/a>&lt;/p>
&lt;p>这个是用于UI设计的技能&lt;/p>
&lt;h2 id="collaborating-with-codex">collaborating-with-codex&lt;/h2>
&lt;p>&lt;a href="https://github.com/GuDaStudio/collaborating-with-codex">https://github.com/GuDaStudio/collaborating-with-codex&lt;/a>&lt;/p>
&lt;p>这个是用于在claude里面调用codex&lt;/p>
&lt;h2 id="frida-17">frida-17&lt;/h2>
&lt;p>&lt;a href="https://github.com/NeverSight/skills_feed/tree/main/data/skills-md/yfe404/frida-17-skill/frida-17">https://github.com/NeverSight/skills_feed/tree/main/data/skills-md/yfe404/frida-17-skill/frida-17&lt;/a>&lt;/p>
&lt;p>frida-17 的API变更了，很多AI还是生成旧的API，所以需要Skill纠正AI&lt;/p>
&lt;h2 id="idapython">idapython&lt;/h2>
&lt;p>&lt;a href="https://github.com/mrexodia/ida-pro-mcp/tree/main/skills/idapython">https://github.com/mrexodia/ida-pro-mcp/tree/main/skills/idapython&lt;/a>&lt;/p>
&lt;p>ida pro分析必用&lt;/p>
&lt;h1 id="mcp">MCP&lt;/h1>
&lt;p>MCP是用于AI操作第三方软件的管道，MCP服务会返回一些tool的描述。我感觉MCP可以被Skills替代，但AI说两者有些不一样。&lt;/p>
&lt;h2 id="fast-context">fast-context&lt;/h2>
&lt;p>&lt;a href="https://github.com/SammySnake-d/fast-context-mcp">https://github.com/SammySnake-d/fast-context-mcp&lt;/a>&lt;/p>
&lt;p>这个是用于使用自然语言搜索代码，这个是逆向Windsurf的服务。理论上应该对比较大的项目搜寻代码简单一些。现在AI一般用grep找代码，需要阅读所有代码。&lt;/p>
&lt;h2 id="chrome-mcp-server">chrome-mcp-server&lt;/h2>
&lt;p>操作chrome&lt;/p>
&lt;h2 id="ida-pro-mcp">ida-pro-mcp&lt;/h2>
&lt;p>&lt;a href="https://github.com/mrexodia/ida-pro-mcp">https://github.com/mrexodia/ida-pro-mcp&lt;/a>&lt;/p>
&lt;p>操作ida pro&lt;/p>
&lt;h2 id="jadx">jadx&lt;/h2>
&lt;p>&lt;a href="https://github.com/zinja-coder/jadx-ai-mcp">https://github.com/zinja-coder/jadx-ai-mcp&lt;/a>&lt;/p>
&lt;p>操作jadx，需要使用steamable-http的方式才能连接&lt;/p>
&lt;pre tabindex="0">&lt;code>{
&amp;#34;startupTimeout&amp;#34;: 30000,
&amp;#34;toolTimeout&amp;#34;: 300000,
&amp;#34;type&amp;#34;: &amp;#34;steamable-http&amp;#34;,
&amp;#34;url&amp;#34;: &amp;#34;http://127.0.0.1:8651/mcp&amp;#34;
}
&lt;/code>&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%BC%96%E7%A8%8B/">编程</category><category domain="https://fatkun.github.io/tags/%E7%BC%96%E7%A8%8B/">编程</category><category domain="https://fatkun.github.io/tags/ai/">AI</category></item><item><title>使用AI和IDA Pro MCP逆向分析so</title><link>https://fatkun.github.io/post/2026/ida_pro_mcp/</link><guid isPermaLink="true">https://fatkun.github.io/post/2026/ida_pro_mcp/</guid><pubDate>Sun, 01 Feb 2026 10:22:01 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="背景">背景&lt;/h1>
&lt;p>有些安卓应用会使用so来实现加密算法，来提高逆向的成本，而且so本身还会做了些混淆，检测是否在真机上运行。&lt;/p>
&lt;p>一般逆向so的方法有这几种&lt;/p>
&lt;ul>
&lt;li>使用frida调用（最简单，但是需要真机/模拟器）&lt;/li>
&lt;li>使用unidbg模拟运行（有点复杂，需要补环境）&lt;/li>
&lt;li>直接分析so算法（最复杂，需要基于汇编/伪代码分析）&lt;/li>
&lt;/ul>
&lt;p>目前有了AI之后，就算对逆向不是很了解，也有可能进行分析。&lt;/p>
&lt;h1 id="分析">分析&lt;/h1>
&lt;p>如果so代码不多，可以把代码发给AI分析，如果比较多的话，还是通过MCP来分析。首先要安装 &lt;a href="https://github.com/mrexodia/ida-pro-mcp">IDA-PRO-MCP&lt;/a>, 按文档安装。
使用ida-pro打开so文件，然后再&lt;code>Edit/Plugins&lt;/code>里面开启MCP。&lt;/p>
&lt;h2 id="提示词">提示词&lt;/h2>
&lt;p>如果不添加提示词，AI可能处理不太准确，特别是一些数字的转换，首页上有提示词。这里给出我的提示词。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-md" data-lang="md">&lt;span class="line">&lt;span class="cl">你的任务是在 IDA Pro 中分析打开程序。
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">你可以使用 MCP 工具（如 ida-pro-mcp）来获取反编译、反汇编和程序结构信息。
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">请严格按照以下逆向分析策略执行：
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">1.&lt;/span> 首先检查 IDA 的反编译结果（F5 输出），结合语义理解代码逻辑，并在关键位置添加注释。
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">2.&lt;/span> 将无意义的变量名（如 v1、v3、a1 等）重命名为具有实际语义的名称。
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">3.&lt;/span> 如有必要，修改变量和函数参数的类型，尤其是指针、数组和结构体类型，以提高代码可读性。
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">4.&lt;/span> 将函数重命名为能够准确描述其行为的名称（例如校验函数、解密函数、初始化函数等）。
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">5.&lt;/span> 当反编译信息不足或存在歧义时，请查看对应的反汇编代码，并基于汇编指令补充注释和分析结论。
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">6.&lt;/span> 绝对不要自行进行任何数字进制转换（例如十六进制转十进制），如有需要，必须使用 int_convert MCP 工具。
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">7.&lt;/span> 禁止尝试任何形式的暴力破解，所有结论必须通过反汇编逻辑分析和必要的简单 Python 推导脚本得出。
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">8.&lt;/span> 分析过程中请始终关注：
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">-&lt;/span> 输入数据的来源与长度
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">-&lt;/span> 校验逻辑与失败分支
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">-&lt;/span> 字符串处理、循环结构、状态机或加密/混淆逻辑
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">9.&lt;/span> 在分析完成后，请生成一个 report.md 文件，内容包括：
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">-&lt;/span> 程序整体结构概览
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">-&lt;/span> 关键函数说明（含重命名理由）
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">-&lt;/span> 校验/解密流程的完整逻辑说明
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">-&lt;/span> 得出最终结论的推导过程
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">10.&lt;/span> 请不要随意生成文档，如果文档有更新，尽可能在原文档更新。代码也不要随意生成不同的文件。
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">请以“逆向工程师”的视角进行分析，避免臆测、过度抽象或脱离汇编语义的解释。
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="分析目标">分析目标&lt;/h2>
&lt;p>说明你要分析的方法，如果你使用frida抓取到了输入输出，可以单独保存到一个文件，也一并提供给AI分析，便于后期验证。&lt;/p>
&lt;p>另外由于这样分析so文件是静态的，可能有一些加密密钥是后面动态设置的，使用静态分析无法获取到正确的密钥。可以让AI帮你编写frida hook脚本，动态捕获信息。&lt;/p>
&lt;p>使用frida需要注意，frida17版本后，API有不兼容变更，默认AI生成的代码还是用旧的版本，就算你提醒它使用17版本，它也可能生成错误。所以要明确告诉AI frida版本变更，提示词如下：&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;span class="lnt">44
&lt;/span>&lt;span class="lnt">45
&lt;/span>&lt;span class="lnt">46
&lt;/span>&lt;span class="lnt">47
&lt;/span>&lt;span class="lnt">48
&lt;/span>&lt;span class="lnt">49
&lt;/span>&lt;span class="lnt">50
&lt;/span>&lt;span class="lnt">51
&lt;/span>&lt;span class="lnt">52
&lt;/span>&lt;span class="lnt">53
&lt;/span>&lt;span class="lnt">54
&lt;/span>&lt;span class="lnt">55
&lt;/span>&lt;span class="lnt">56
&lt;/span>&lt;span class="lnt">57
&lt;/span>&lt;span class="lnt">58
&lt;/span>&lt;span class="lnt">59
&lt;/span>&lt;span class="lnt">60
&lt;/span>&lt;span class="lnt">61
&lt;/span>&lt;span class="lnt">62
&lt;/span>&lt;span class="lnt">63
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="nx">frida17&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="mi">5&lt;/span>&lt;span class="nx">版本API说明&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Memory&lt;/span> &lt;span class="nx">read&lt;/span>&lt;span class="o">/&lt;/span>&lt;span class="nx">write&lt;/span> &lt;span class="nx">APIs&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Back&lt;/span> &lt;span class="k">in&lt;/span> &lt;span class="nx">the&lt;/span> &lt;span class="nx">day&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">you&lt;/span>&lt;span class="err">’&lt;/span>&lt;span class="nx">d&lt;/span> &lt;span class="nx">access&lt;/span> &lt;span class="nx">memory&lt;/span> &lt;span class="nx">like&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">playerHealthLocation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">ptr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;0x1234&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">playerHealth&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Memory&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">readU32&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">playerHealthLocation&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Memory&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">writeU32&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">playerHealthLocation&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">100&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">The&lt;/span> &lt;span class="nx">modern&lt;/span> &lt;span class="nx">equivalent&lt;/span> &lt;span class="nx">is&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">playerHealthLocation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">ptr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;0x1234&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">playerHealth&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">playerHealthLocation&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">readU32&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">playerHealthLocation&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">writeU32&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">100&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Where&lt;/span> &lt;span class="nx">each&lt;/span> &lt;span class="nx">write&lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="nx">counterpart&lt;/span> &lt;span class="nx">returns&lt;/span> &lt;span class="nx">the&lt;/span> &lt;span class="nx">NativePointer&lt;/span> &lt;span class="nx">itself&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">to&lt;/span> &lt;span class="nx">support&lt;/span> &lt;span class="nx">chaining&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">playerData&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">ptr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;0x1234&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">playerData&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">.&lt;/span>&lt;span class="nx">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">4&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">writeU32&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">13&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">.&lt;/span>&lt;span class="nx">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">4&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">writeU16&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">37&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">.&lt;/span>&lt;span class="nx">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">2&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">writeU16&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">42&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">The&lt;/span> &lt;span class="nx">legacy&lt;/span> &lt;span class="nx">versions&lt;/span> &lt;span class="k">of&lt;/span> &lt;span class="nx">these&lt;/span> &lt;span class="nx">are&lt;/span> &lt;span class="nx">now&lt;/span> &lt;span class="nx">also&lt;/span> &lt;span class="nx">gone&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">and&lt;/span> &lt;span class="nx">have&lt;/span> &lt;span class="nx">been&lt;/span> &lt;span class="nx">gone&lt;/span> &lt;span class="nx">from&lt;/span> &lt;span class="nx">our&lt;/span> &lt;span class="nx">TypeScript&lt;/span> &lt;span class="nx">bindings&lt;/span> &lt;span class="k">for&lt;/span> &lt;span class="nx">as&lt;/span> &lt;span class="kr">long&lt;/span> &lt;span class="nx">as&lt;/span> &lt;span class="nx">the&lt;/span> &lt;span class="nx">legacy&lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="nx">style&lt;/span> &lt;span class="nx">enumeration&lt;/span> &lt;span class="nx">APIs&lt;/span>&lt;span class="p">.&lt;/span> &lt;span class="nx">So&lt;/span> &lt;span class="k">this&lt;/span> &lt;span class="nx">change&lt;/span> &lt;span class="nx">should&lt;/span> &lt;span class="nx">also&lt;/span> &lt;span class="nx">not&lt;/span> &lt;span class="nx">be&lt;/span> &lt;span class="nx">noticable&lt;/span> &lt;span class="nx">to&lt;/span> &lt;span class="nx">most&lt;/span> &lt;span class="k">of&lt;/span> &lt;span class="nx">you&lt;/span>&lt;span class="p">.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Static&lt;/span> &lt;span class="nx">Module&lt;/span> &lt;span class="nx">APIs&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Now&lt;/span> &lt;span class="k">for&lt;/span> &lt;span class="nx">the&lt;/span> &lt;span class="nx">breaking&lt;/span> &lt;span class="nx">changes&lt;/span> &lt;span class="nx">that&lt;/span> &lt;span class="nx">also&lt;/span> &lt;span class="nx">affect&lt;/span> &lt;span class="nx">users&lt;/span> &lt;span class="nx">who&lt;/span> &lt;span class="nx">were&lt;/span> &lt;span class="nx">current&lt;/span> &lt;span class="kd">with&lt;/span> &lt;span class="nx">the&lt;/span> &lt;span class="nx">TypeScript&lt;/span> &lt;span class="nx">bindings&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">prior&lt;/span> &lt;span class="nx">to&lt;/span> &lt;span class="mf">19.0&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">released&lt;/span> &lt;span class="nx">together&lt;/span> &lt;span class="kd">with&lt;/span> &lt;span class="nx">Frida&lt;/span> &lt;span class="mf">17.&lt;/span> &lt;span class="nx">The&lt;/span> &lt;span class="nx">following&lt;/span> &lt;span class="kr">static&lt;/span> &lt;span class="nx">Module&lt;/span> &lt;span class="nx">methods&lt;/span> &lt;span class="nx">are&lt;/span> &lt;span class="nx">now&lt;/span> &lt;span class="nx">gone&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">ensureInitialized&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">findBaseAddress&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getBaseAddress&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">findExportByName&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">findSymbolByName&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getSymbolByName&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">These&lt;/span> &lt;span class="nx">are&lt;/span> &lt;span class="nx">all&lt;/span> &lt;span class="nx">straight&lt;/span>&lt;span class="o">-&lt;/span>&lt;span class="nx">forward&lt;/span> &lt;span class="nx">to&lt;/span> &lt;span class="nx">migrate&lt;/span> &lt;span class="nx">away&lt;/span> &lt;span class="nx">from&lt;/span>&lt;span class="p">.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">But&lt;/span> &lt;span class="nx">first&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="kd">let&lt;/span>&lt;span class="err">’&lt;/span>&lt;span class="nx">s&lt;/span> &lt;span class="nx">cover&lt;/span> &lt;span class="nx">the&lt;/span> &lt;span class="nx">odd&lt;/span> &lt;span class="nx">one&lt;/span> &lt;span class="nx">out&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getSymbolByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;open&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">This&lt;/span> &lt;span class="nx">is&lt;/span> &lt;span class="nx">now&lt;/span> &lt;span class="nx">accomplished&lt;/span> &lt;span class="nx">like&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getGlobalExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;open&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">For&lt;/span> &lt;span class="nx">the&lt;/span> &lt;span class="nx">rest&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">you&lt;/span> &lt;span class="nx">first&lt;/span> &lt;span class="nx">need&lt;/span> &lt;span class="nx">to&lt;/span> &lt;span class="nx">look&lt;/span> &lt;span class="nx">up&lt;/span> &lt;span class="nx">the&lt;/span> &lt;span class="nx">Module&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">and&lt;/span> &lt;span class="nx">then&lt;/span> &lt;span class="nx">access&lt;/span> &lt;span class="nx">the&lt;/span> &lt;span class="nx">desired&lt;/span> &lt;span class="nx">property&lt;/span> &lt;span class="nx">or&lt;/span> &lt;span class="nx">method&lt;/span> &lt;span class="nx">on&lt;/span> &lt;span class="nx">it&lt;/span>&lt;span class="p">.&lt;/span> &lt;span class="nx">For&lt;/span> &lt;span class="nx">example&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">instead&lt;/span> &lt;span class="k">of&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;libc.so&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;open&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">The&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">way&lt;/span> &lt;span class="nx">is&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getModuleByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;libc.so&amp;#39;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;open&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">The&lt;/span> &lt;span class="nx">equivalent&lt;/span> &lt;span class="k">for&lt;/span> &lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getBaseAddress&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="nx">is&lt;/span> &lt;span class="nx">thus&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getModuleByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;libc.so&amp;#39;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">base&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">This&lt;/span> &lt;span class="nx">means&lt;/span> &lt;span class="nx">there&lt;/span> &lt;span class="nx">is&lt;/span> &lt;span class="nx">now&lt;/span> &lt;span class="nx">only&lt;/span> &lt;span class="nx">one&lt;/span> &lt;span class="nx">way&lt;/span> &lt;span class="nx">to&lt;/span> &lt;span class="k">do&lt;/span> &lt;span class="nx">Module&lt;/span> &lt;span class="nx">introspection&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">and&lt;/span> &lt;span class="nx">the&lt;/span> &lt;span class="nx">API&lt;/span> &lt;span class="nx">design&lt;/span> &lt;span class="nx">is&lt;/span> &lt;span class="nx">such&lt;/span> &lt;span class="nx">that&lt;/span> &lt;span class="nx">we&lt;/span> &lt;span class="nx">encourage&lt;/span> &lt;span class="nx">you&lt;/span> &lt;span class="nx">to&lt;/span> &lt;span class="nx">write&lt;/span> &lt;span class="nx">performant&lt;/span> &lt;span class="nx">code&lt;/span>&lt;span class="p">.&lt;/span> &lt;span class="nx">For&lt;/span> &lt;span class="nx">example&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="k">in&lt;/span> &lt;span class="nx">the&lt;/span> &lt;span class="nx">past&lt;/span> &lt;span class="nx">you&lt;/span> &lt;span class="nx">might&lt;/span> &lt;span class="nx">have&lt;/span> &lt;span class="nx">been&lt;/span> &lt;span class="nx">tempted&lt;/span> &lt;span class="nx">to&lt;/span> &lt;span class="k">do&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">openImpl&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;libc.so&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;open&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">readImpl&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;libc.so&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;read&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">But&lt;/span> &lt;span class="nx">now&lt;/span> &lt;span class="nx">you&lt;/span>&lt;span class="err">’&lt;/span>&lt;span class="nx">ll&lt;/span> &lt;span class="nx">probably&lt;/span> &lt;span class="nx">think&lt;/span> &lt;span class="nx">twice&lt;/span> &lt;span class="nx">before&lt;/span> &lt;span class="nx">doing&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">openImpl&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getModuleByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;libc.so&amp;#39;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;open&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">readImpl&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getModuleByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;libc.so&amp;#39;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;read&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">And&lt;/span> &lt;span class="nx">instead&lt;/span> &lt;span class="k">do&lt;/span>&lt;span class="o">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">libc&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getModuleByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;libc.so&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">openImpl&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">libc&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;open&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">readImpl&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">libc&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;read&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Which&lt;/span> &lt;span class="nx">is&lt;/span> &lt;span class="nx">both&lt;/span> &lt;span class="nx">more&lt;/span> &lt;span class="nx">readable&lt;/span> &lt;span class="nx">and&lt;/span> &lt;span class="nx">more&lt;/span> &lt;span class="nx">performant&lt;/span>&lt;span class="p">.&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="分析过程">分析过程&lt;/h2>
&lt;p>分析过程中会对方法、字段做重命名，帮助了解。另外会总结一个report.md，如果中途没分析完成中断，就让它继续分析某些方法。
最后如何分析成功的话，可以让AI判断算法是否可以逆向还原，一般像AES\SM3之类的算法是可以还原的，可以让AI尝试用python实现还原算法，看看能否成功还原密文。&lt;/p>
&lt;h1 id="结论">结论&lt;/h1>
&lt;p>AI让一些简单的混淆无所遁形，不过一些复杂的混淆，控制流扁平化，还是要让AI花比较多时间分析，而且目前需要人的参与比较多，可能是我提示词不够好，不能让它一直工作下去。另外由于它要运行一些代码验证，也需要对他进行授权。
另外目前我也只是静态分析so，不知道有没有办法动态分析so，如果动态分析so的话，应该就不用使用frida了。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>某云盘脱壳</title><link>https://fatkun.github.io/post/2026/dump_ydyp/</link><guid isPermaLink="true">https://fatkun.github.io/post/2026/dump_ydyp/</guid><pubDate>Mon, 12 Jan 2026 10:22:01 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这个云盘使用梆*加固企业版，记录一下如何脱壳。&lt;/p>
&lt;p>这个加固会检测frida，暂时不知道怎么绕过frida检测，也不知道怎么把dex dump出来。找到一个网站 &lt;a href="https://56.al/upload.php">APK加固安全测试&lt;/a> ，上传APK，等待一段时间后，它就帮你把dex dump出来了。&lt;/p>
&lt;p>有了dex文件之后，怎么脱壳呢？可以看&lt;a href="https://www.bilibili.com/video/BV13EjdziE6c/">这个视频&lt;/a> 。&lt;/p>
&lt;p>首先要还原AndroidManifest.xml文件，首先是这两个需要修改&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-xml" data-lang="xml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">&amp;lt;application&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">android:name=&lt;/span>&lt;span class="s">&amp;#34;com.secneo.apkwrapper.AW&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">android:appComponentFactory=&lt;/span>&lt;span class="s">&amp;#34;com.secneo.apkwrapper.AP&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nt">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>那改成什么值呢？找到 com.secneo.apkwrapper.H 这个类查看&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">static&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">APPNAME&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;com.*******.client.CCloudApplication&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">// 对应 android:name&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">static&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ACFNAME&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;androidx.core.app.CoreComponentFactory&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">// 对应 android:appComponentFactory&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>然后拉到最后，去掉这个provider&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-xml" data-lang="xml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">&amp;lt;provider&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">android:name=&lt;/span>&lt;span class="s">&amp;#34;com.secneo.apkwrapper.CP&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">android:exported=&lt;/span>&lt;span class="s">&amp;#34;false&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">android:authorities=&lt;/span>&lt;span class="s">&amp;#34;com.*****.CP&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">android:initOrder=&lt;/span>&lt;span class="s">&amp;#34;2147483647&amp;#34;&lt;/span>&lt;span class="nt">/&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>如果在windows上修改，可以用APK.Tool.GUI解包后直接修改文件再打包。&lt;/p>
&lt;p>然后是要把dex塞回apk里面。塞回之前，需要先用MT管理器修复dex文件。另外apk里面已经有了一个classes.dex，如果直接覆盖，启动时会退出，使用android studio看日志报了一个NullPointer错误，原因是里面的代码还是要依赖classes.dex。所以得用MT管理器重命名文件，把classes2.dex开始重命名，然后把它们塞进去。&lt;/p>
&lt;p>最后使用MT管理器去掉签名验证后安装，然后运行。但是发现这个软件还做了检测，告诉我这个版本有问题，点击后进程就退出了。使用 android studio 查看日志可以看到退出堆栈，这里就能看到点击按钮的回调方法。&lt;/p>
&lt;p>使用frida hook这个方法，直接跳过退出代码。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">perform&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kd">function&lt;/span> &lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">ClsName&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s1">&amp;#39;com.******.client.ui.MenuActivity$28&amp;#39;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">C&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">use&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">ClsName&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">C&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">cancel&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">implementation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;[+] bypass &amp;#39;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">ClsName&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s1">&amp;#39;.cancel()&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// 不调用原 cancel()，直接返回
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">C&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">submit&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">implementation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;[+] bypass &amp;#39;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">ClsName&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s1">&amp;#39;.submit()&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// 不调用原 submit()，直接返回
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;[+] hooked &amp;#39;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">ClsName&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s1">&amp;#39;.cancel/submit as no-op&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>golang逆向，还原符号表</title><link>https://fatkun.github.io/post/2026/fill_golang_symbol/</link><guid isPermaLink="true">https://fatkun.github.io/post/2026/fill_golang_symbol/</guid><pubDate>Fri, 02 Jan 2026 00:22:01 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>查看是否加了upx壳，可以下载upx，使用&lt;code>upx -d&lt;/code>解压。&lt;/p>
&lt;p>使用 &lt;a href="https://github.com/mandiant/GoReSym">https://github.com/mandiant/GoReSym&lt;/a> 导出符号&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">GoReSym.exe -t -d -p /path/to/input.exe &amp;gt; symbol.json
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>导出之后，把 &lt;a href="https://github.com/mandiant/GoReSym/blob/master/IDAPython/goresym_rename.py">https://github.com/mandiant/GoReSym/blob/master/IDAPython/goresym_rename.py&lt;/a> 下载下来，然后用ida执行python脚本，选择刚才导出的json。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/golang/">Golang</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>逆向某TV 6.5.0(原某电新闻)</title><link>https://fatkun.github.io/post/2025/crack_itouch_6_5/</link><guid isPermaLink="true">https://fatkun.github.io/post/2025/crack_itouch_6_5/</guid><pubDate>Mon, 29 Dec 2025 00:22:01 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="背景">背景&lt;/h1>
&lt;p>应用：57KkVFY= 版本：6.5.0
本文只用于学习研究，请勿作为非法用途，关键信息已隐藏。&lt;/p>
&lt;p>这个APP使用某数字加固，发现这个东西居然检测frida了，如果后台启动了frida-server，启动APP就会直接退出，就算使用魔改版都被检测出来。&lt;/p>
&lt;h1 id="分析">分析&lt;/h1>
&lt;p>我的目标主要是查看代码，而不是为了修改应用，所以主要是想办法获得真实的dex，并不想要脱壳。但是不脱壳，如何dump dex呢？
首先尝试使用frida，如果使用新启动程序，发现进程马上退出&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl"> frida -U -f com.*****tv.*****tv -l .&lt;span class="se">\D&lt;/span>umpDex.js
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>当然也尝试一下网上的方法，替换创建线程的方法，但我并没有成功阻止进程退出。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">hook_dlopen&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">Func_sleep&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">NativeFunction&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getModuleByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;libc.so&amp;#39;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;sleep&amp;#39;&lt;/span>&lt;span class="p">),&lt;/span> &lt;span class="s1">&amp;#39;uint&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;uint&amp;#39;&lt;/span>&lt;span class="p">])&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// 安卓高版本使用android_dlopen_ext
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">Interceptor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">attach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">findGlobalExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;android_dlopen_ext&amp;#34;&lt;/span>&lt;span class="p">),&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onEnter&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">args&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">fileName&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">args&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">].&lt;/span>&lt;span class="nx">readCString&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`Current PID: &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">id&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`dlopen onEnter: &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">fileName&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// if(this.fileName != null &amp;amp;&amp;amp; this.fileName.indexOf(&amp;#34;libjiagu_64.so&amp;#34;) &amp;gt;= 0){
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// Func_sleep(10);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// }
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span> &lt;span class="nx">onLeave&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">retval&lt;/span>&lt;span class="p">){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`dlopen onLeave fileName: &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">fileName&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">setImmediate&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">hook_dlopen&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>尝试hook android_dlopen_ext，发现在加载libjiagu_64.so后，APP退出。&lt;/p>
&lt;p>在继续搜寻隐藏Frida中，发现了这个项目 &lt;a href="https://github.com/lico-n/ZygiskFrida">ZygiskFrida&lt;/a>。&lt;/p>
&lt;p>这个项目要求你的手机已ROOT，并且安装Magisk，开启Zygisk。
使用方法是下载 ZygiskFrida-v1.9.0-release.zip，上传到手机，使用Magisk安装模块，并重启手机。&lt;/p>
&lt;p>重启后，需要做一些配置。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">adb shell
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">su
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">cp /data/local/tmp/re.zyg.fri/config.json.example /data/local/tmp/re.zyg.fri/config.json
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">sed -i s/com.example.package/目标应用的包名/ /data/local/tmp/re.zyg.fri/config.json
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>改完之后，启动应用，会卡在首屏，不用怕。
然后可以通过两种命令attach。
&lt;code>frida -U -N your.target.application&lt;/code> 或 &lt;code>frida -U -n Gadget&lt;/code>&lt;/p>
&lt;p>我使用的是&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">frida -U -N com.*****tv.*****tv -l DumpDex.js
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>注意我用的frida的版本是17.x，和16.x和之前的版本API有不兼容变更，具体变化可以看&lt;a href="https://stackoverflow.com/questions/79700740/frida-17-module-getexportbyname-typeerror-not-a-function">这里&lt;/a>。&lt;/p>
&lt;p>其中DumpDex.js的内容是，记得改你自己的包名，否则会报错。
DumpDex代码来自：https://github.com/Alexjr2/Android_Dump_Dex&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt"> 10
&lt;/span>&lt;span class="lnt"> 11
&lt;/span>&lt;span class="lnt"> 12
&lt;/span>&lt;span class="lnt"> 13
&lt;/span>&lt;span class="lnt"> 14
&lt;/span>&lt;span class="lnt"> 15
&lt;/span>&lt;span class="lnt"> 16
&lt;/span>&lt;span class="lnt"> 17
&lt;/span>&lt;span class="lnt"> 18
&lt;/span>&lt;span class="lnt"> 19
&lt;/span>&lt;span class="lnt"> 20
&lt;/span>&lt;span class="lnt"> 21
&lt;/span>&lt;span class="lnt"> 22
&lt;/span>&lt;span class="lnt"> 23
&lt;/span>&lt;span class="lnt"> 24
&lt;/span>&lt;span class="lnt"> 25
&lt;/span>&lt;span class="lnt"> 26
&lt;/span>&lt;span class="lnt"> 27
&lt;/span>&lt;span class="lnt"> 28
&lt;/span>&lt;span class="lnt"> 29
&lt;/span>&lt;span class="lnt"> 30
&lt;/span>&lt;span class="lnt"> 31
&lt;/span>&lt;span class="lnt"> 32
&lt;/span>&lt;span class="lnt"> 33
&lt;/span>&lt;span class="lnt"> 34
&lt;/span>&lt;span class="lnt"> 35
&lt;/span>&lt;span class="lnt"> 36
&lt;/span>&lt;span class="lnt"> 37
&lt;/span>&lt;span class="lnt"> 38
&lt;/span>&lt;span class="lnt"> 39
&lt;/span>&lt;span class="lnt"> 40
&lt;/span>&lt;span class="lnt"> 41
&lt;/span>&lt;span class="lnt"> 42
&lt;/span>&lt;span class="lnt"> 43
&lt;/span>&lt;span class="lnt"> 44
&lt;/span>&lt;span class="lnt"> 45
&lt;/span>&lt;span class="lnt"> 46
&lt;/span>&lt;span class="lnt"> 47
&lt;/span>&lt;span class="lnt"> 48
&lt;/span>&lt;span class="lnt"> 49
&lt;/span>&lt;span class="lnt"> 50
&lt;/span>&lt;span class="lnt"> 51
&lt;/span>&lt;span class="lnt"> 52
&lt;/span>&lt;span class="lnt"> 53
&lt;/span>&lt;span class="lnt"> 54
&lt;/span>&lt;span class="lnt"> 55
&lt;/span>&lt;span class="lnt"> 56
&lt;/span>&lt;span class="lnt"> 57
&lt;/span>&lt;span class="lnt"> 58
&lt;/span>&lt;span class="lnt"> 59
&lt;/span>&lt;span class="lnt"> 60
&lt;/span>&lt;span class="lnt"> 61
&lt;/span>&lt;span class="lnt"> 62
&lt;/span>&lt;span class="lnt"> 63
&lt;/span>&lt;span class="lnt"> 64
&lt;/span>&lt;span class="lnt"> 65
&lt;/span>&lt;span class="lnt"> 66
&lt;/span>&lt;span class="lnt"> 67
&lt;/span>&lt;span class="lnt"> 68
&lt;/span>&lt;span class="lnt"> 69
&lt;/span>&lt;span class="lnt"> 70
&lt;/span>&lt;span class="lnt"> 71
&lt;/span>&lt;span class="lnt"> 72
&lt;/span>&lt;span class="lnt"> 73
&lt;/span>&lt;span class="lnt"> 74
&lt;/span>&lt;span class="lnt"> 75
&lt;/span>&lt;span class="lnt"> 76
&lt;/span>&lt;span class="lnt"> 77
&lt;/span>&lt;span class="lnt"> 78
&lt;/span>&lt;span class="lnt"> 79
&lt;/span>&lt;span class="lnt"> 80
&lt;/span>&lt;span class="lnt"> 81
&lt;/span>&lt;span class="lnt"> 82
&lt;/span>&lt;span class="lnt"> 83
&lt;/span>&lt;span class="lnt"> 84
&lt;/span>&lt;span class="lnt"> 85
&lt;/span>&lt;span class="lnt"> 86
&lt;/span>&lt;span class="lnt"> 87
&lt;/span>&lt;span class="lnt"> 88
&lt;/span>&lt;span class="lnt"> 89
&lt;/span>&lt;span class="lnt"> 90
&lt;/span>&lt;span class="lnt"> 91
&lt;/span>&lt;span class="lnt"> 92
&lt;/span>&lt;span class="lnt"> 93
&lt;/span>&lt;span class="lnt"> 94
&lt;/span>&lt;span class="lnt"> 95
&lt;/span>&lt;span class="lnt"> 96
&lt;/span>&lt;span class="lnt"> 97
&lt;/span>&lt;span class="lnt"> 98
&lt;/span>&lt;span class="lnt"> 99
&lt;/span>&lt;span class="lnt">100
&lt;/span>&lt;span class="lnt">101
&lt;/span>&lt;span class="lnt">102
&lt;/span>&lt;span class="lnt">103
&lt;/span>&lt;span class="lnt">104
&lt;/span>&lt;span class="lnt">105
&lt;/span>&lt;span class="lnt">106
&lt;/span>&lt;span class="lnt">107
&lt;/span>&lt;span class="lnt">108
&lt;/span>&lt;span class="lnt">109
&lt;/span>&lt;span class="lnt">110
&lt;/span>&lt;span class="lnt">111
&lt;/span>&lt;span class="lnt">112
&lt;/span>&lt;span class="lnt">113
&lt;/span>&lt;span class="lnt">114
&lt;/span>&lt;span class="lnt">115
&lt;/span>&lt;span class="lnt">116
&lt;/span>&lt;span class="lnt">117
&lt;/span>&lt;span class="lnt">118
&lt;/span>&lt;span class="lnt">119
&lt;/span>&lt;span class="lnt">120
&lt;/span>&lt;span class="lnt">121
&lt;/span>&lt;span class="lnt">122
&lt;/span>&lt;span class="lnt">123
&lt;/span>&lt;span class="lnt">124
&lt;/span>&lt;span class="lnt">125
&lt;/span>&lt;span class="lnt">126
&lt;/span>&lt;span class="lnt">127
&lt;/span>&lt;span class="lnt">128
&lt;/span>&lt;span class="lnt">129
&lt;/span>&lt;span class="lnt">130
&lt;/span>&lt;span class="lnt">131
&lt;/span>&lt;span class="lnt">132
&lt;/span>&lt;span class="lnt">133
&lt;/span>&lt;span class="lnt">134
&lt;/span>&lt;span class="lnt">135
&lt;/span>&lt;span class="lnt">136
&lt;/span>&lt;span class="lnt">137
&lt;/span>&lt;span class="lnt">138
&lt;/span>&lt;span class="lnt">139
&lt;/span>&lt;span class="lnt">140
&lt;/span>&lt;span class="lnt">141
&lt;/span>&lt;span class="lnt">142
&lt;/span>&lt;span class="lnt">143
&lt;/span>&lt;span class="lnt">144
&lt;/span>&lt;span class="lnt">145
&lt;/span>&lt;span class="lnt">146
&lt;/span>&lt;span class="lnt">147
&lt;/span>&lt;span class="lnt">148
&lt;/span>&lt;span class="lnt">149
&lt;/span>&lt;span class="lnt">150
&lt;/span>&lt;span class="lnt">151
&lt;/span>&lt;span class="lnt">152
&lt;/span>&lt;span class="lnt">153
&lt;/span>&lt;span class="lnt">154
&lt;/span>&lt;span class="lnt">155
&lt;/span>&lt;span class="lnt">156
&lt;/span>&lt;span class="lnt">157
&lt;/span>&lt;span class="lnt">158
&lt;/span>&lt;span class="lnt">159
&lt;/span>&lt;span class="lnt">160
&lt;/span>&lt;span class="lnt">161
&lt;/span>&lt;span class="lnt">162
&lt;/span>&lt;span class="lnt">163
&lt;/span>&lt;span class="lnt">164
&lt;/span>&lt;span class="lnt">165
&lt;/span>&lt;span class="lnt">166
&lt;/span>&lt;span class="lnt">167
&lt;/span>&lt;span class="lnt">168
&lt;/span>&lt;span class="lnt">169
&lt;/span>&lt;span class="lnt">170
&lt;/span>&lt;span class="lnt">171
&lt;/span>&lt;span class="lnt">172
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="cm">/*
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm">Hook fork to prevent child processes from interrupting Frida
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm">Returns -1 with errno EPERM
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm">*/&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">(()&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">forkSymbol&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">findGlobalExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;fork&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">forkSymbol&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">warn&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[-] fork() not found&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">errnoPtr&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">(()&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">errnoLocation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">findGlobalExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;__errno_location&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">errnoLocation&lt;/span> &lt;span class="o">?&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">NativeFunction&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">errnoLocation&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;pointer&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">[])()&lt;/span> &lt;span class="o">:&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">})();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">safeForkHandler&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">NativeCallback&lt;/span>&lt;span class="p">(()&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">warn&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[!] Fork intercepted - returning -1 (EPERM)&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">errnoPtr&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="nx">errnoPtr&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">writeS32&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="o">-&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span> &lt;span class="s1">&amp;#39;int&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">[]);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Interceptor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">replace&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">forkSymbol&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">safeForkHandler&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">warn&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[+] Fork hook: ACTIVE&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">})();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm">/* 要改你的应用包名！！！ */&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">TARGET_PKG&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;com.*****tv.*****tv&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">SAFE_DIR&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sb">`/data/data/&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">TARGET_PKG&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">/`&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">DETECTION_LIBRARIES&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span> &lt;span class="nx">pattern&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;libdexprotector&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">message&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;DexProtector: https://licelus.com&amp;#34;&lt;/span> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span> &lt;span class="nx">pattern&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;libjiagu&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">message&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;Jiagu360: https://jiagu.360.cn&amp;#34;&lt;/span> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span> &lt;span class="nx">pattern&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;libAppGuard&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">message&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;AppGuard: http://appguard.nprotect.com&amp;#34;&lt;/span> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span> &lt;span class="nx">pattern&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;libDexHelper&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">message&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;Secneo: http://www.secneo.com&amp;#34;&lt;/span> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span> &lt;span class="nx">pattern&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;libsecexe|libsecmain|libSecShell&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">message&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;Bangcle: https://github.com/woxihuannisja/Bangcle&amp;#34;&lt;/span> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span> &lt;span class="nx">pattern&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;libprotectt|libapp-protectt&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">message&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;Protectt: https://www.protectt.ai&amp;#34;&lt;/span> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span> &lt;span class="nx">pattern&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;libkonyjsvm&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">message&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;Kony: http://www.kony.com/&amp;#34;&lt;/span> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span> &lt;span class="nx">pattern&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;libnesec&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">message&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;Yidun: https://dun.163.com/product/app-protect&amp;#34;&lt;/span> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span> &lt;span class="nx">pattern&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;libcovault&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">message&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;AppSealing: https://www.appsealing.com/&amp;#34;&lt;/span> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span> &lt;span class="nx">pattern&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;libpairipcore&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">message&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;Pairip: https://github.com/rednaga/APKiD/issues/329&amp;#34;&lt;/span> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">hookDlopen&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nb">Promise&lt;/span>&lt;span class="p">((&lt;/span>&lt;span class="nx">resolve&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">reject&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">isArm&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">arch&lt;/span> &lt;span class="o">===&lt;/span> &lt;span class="s2">&amp;#34;arm&amp;#34;&lt;/span> &lt;span class="o">?&lt;/span> &lt;span class="s2">&amp;#34;linker&amp;#34;&lt;/span> &lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;linker64&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">reg&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">arch&lt;/span> &lt;span class="o">===&lt;/span> &lt;span class="s2">&amp;#34;arm&amp;#34;&lt;/span> &lt;span class="o">?&lt;/span> &lt;span class="s2">&amp;#34;r0&amp;#34;&lt;/span> &lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;x0&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">linker&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">findModuleByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">isArm&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">linker&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">reject&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span> &lt;span class="nb">Error&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Linker module not found&amp;#34;&lt;/span>&lt;span class="p">));&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">resolved&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">false&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">resolveOnce&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">()&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">resolved&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">resolved&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">true&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">resolve&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">sym&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">linker&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">enumerateExports&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="nx">find&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">name&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">includes&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;android_dlopen_ext&amp;#39;&lt;/span>&lt;span class="p">));&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Interceptor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">attach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">sym&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">address&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onEnter&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">args&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">libPath&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">context&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">reg&lt;/span>&lt;span class="p">].&lt;/span>&lt;span class="nx">readUtf8String&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">libPath&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="kr">const&lt;/span> &lt;span class="p">{&lt;/span> &lt;span class="nx">pattern&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">message&lt;/span> &lt;span class="p">}&lt;/span> &lt;span class="k">of&lt;/span> &lt;span class="nx">DETECTION_LIBRARIES&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span> &lt;span class="nb">RegExp&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">pattern&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">test&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">libPath&lt;/span>&lt;span class="p">))&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">warn&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`\n[*] Packer Detected: &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">message&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">resolveOnce&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">setTimeout&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">resolveOnce&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">3000&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span> &lt;span class="k">catch&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">reject&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span> &lt;span class="nb">Error&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Unsupported architecture/emulator&amp;#34;&lt;/span>&lt;span class="p">));&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">processDex&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Buf&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">C&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">Path&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Ensure the buffer is valid
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">Buf&lt;/span> &lt;span class="o">||&lt;/span> &lt;span class="nx">Buf&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">error&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`[!] Invalid buffer for classes&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">C&lt;/span> &lt;span class="o">-&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">.dex`&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">DumpDex&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Buf&lt;/span> &lt;span class="k">instanceof&lt;/span> &lt;span class="nx">Uint8Array&lt;/span> &lt;span class="o">?&lt;/span> &lt;span class="nx">Buf&lt;/span> &lt;span class="o">:&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">Uint8Array&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Buf&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">Count&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">C&lt;/span> &lt;span class="o">-&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Signatures for detecting CDEX, Empty Header, and Wiped Header
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kr">const&lt;/span> &lt;span class="nx">CDEX_SIGNATURE&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="mh">0x63&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x64&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x65&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x78&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x30&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x30&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x31&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">EMPTY_HEADER&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="mh">0x00&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x00&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x00&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x00&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">WIPED_HEADER&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="mh">0x64&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Detect CDEX
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">CDEX_SIGNATURE&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">every&lt;/span>&lt;span class="p">((&lt;/span>&lt;span class="nx">val&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">i&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="nx">DumpDex&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">i&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="nx">val&lt;/span>&lt;span class="p">))&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">warn&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`[*] classes&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">Count&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">.dex is a Compact Dex (CDEX). Ignoring.`&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Detect Empty Header (DexProtector)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">EMPTY_HEADER&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">every&lt;/span>&lt;span class="p">((&lt;/span>&lt;span class="nx">val&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">i&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="nx">DumpDex&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">i&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="nx">val&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="nx">DumpDex&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">7&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="mh">0x00&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">warn&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`[*] 00000 Header detected in classes&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">Count&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">.dex, possible DexProtector.`&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">writeDexFile&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Count&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">Buf&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">Path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Detect Wiped Header (Obfuscation/Tampered)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">DumpDex&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="mh">0x00&lt;/span> &lt;span class="o">||&lt;/span> &lt;span class="nx">WIPED_HEADER&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">every&lt;/span>&lt;span class="p">((&lt;/span>&lt;span class="nx">val&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">i&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="nx">DumpDex&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">i&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">!=&lt;/span> &lt;span class="nx">val&lt;/span>&lt;span class="p">))&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">warn&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`[*] Wiped Header detected, classes&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">Count&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">.dex might be interesting.`&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">writeDexFile&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Count&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">Buf&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">Path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Default: Consider it as a normal Dex file
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">writeDexFile&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Count&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">Buf&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">Path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">writeDexFile&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">count&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">buffer&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">isValid&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">file&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">File&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;wb&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">file&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">write&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">buffer&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">file&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">close&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`[Dex&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">count&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">] Saved to: &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">path&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb"> &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">isValid&lt;/span> &lt;span class="o">?&lt;/span> &lt;span class="s1">&amp;#39;(valid)&amp;#39;&lt;/span> &lt;span class="o">:&lt;/span> &lt;span class="s1">&amp;#39;(modified)&amp;#39;&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span> &lt;span class="k">catch&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">error&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">error&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`[!] Failed to save Dex&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">count&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb"> to &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">path&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">: &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">error&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">message&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">findDefineClass&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">libart&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">matcher&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sr">/ClassLinker.*DefineClass.*Thread.*DexFile/&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">search&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">items&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">type&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="nx">items&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">find&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">item&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="nx">matcher&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">test&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">item&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">name&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="o">?&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">address&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">search&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">libart&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">enumerateSymbols&lt;/span>&lt;span class="p">(),&lt;/span> &lt;span class="s1">&amp;#39;symbols&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">||&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">search&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">libart&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">enumerateImports&lt;/span>&lt;span class="p">(),&lt;/span> &lt;span class="s1">&amp;#39;imports&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">||&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">search&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">libart&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">enumerateExports&lt;/span>&lt;span class="p">(),&lt;/span> &lt;span class="s1">&amp;#39;exports&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">dumpDex&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">libart&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">findModuleByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;libart.so&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">libart&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">return&lt;/span> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">error&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[!] libart.so not found&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">defineClassAddr&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">findDefineClass&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">libart&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">warn&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[*] DefineClass found at : &amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">defineClassAddr&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">defineClassAddr&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">return&lt;/span> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">error&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[!] DefineClass not found&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">seenDex&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">Set&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">dexCount&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Interceptor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">attach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">defineClassAddr&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onEnter&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">args&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">dexFilePtr&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">args&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">5&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">base&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">dexFilePtr&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">pointerSize&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">readPointer&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">size&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">dexFilePtr&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">pointerSize&lt;/span> &lt;span class="o">*&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">readUInt&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">seenDex&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">has&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">base&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">toString&lt;/span>&lt;span class="p">()))&lt;/span> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">seenDex&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">base&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">toString&lt;/span>&lt;span class="p">());&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">dexBuffer&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">base&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">readByteArray&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">size&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">dexBuffer&lt;/span> &lt;span class="o">||&lt;/span> &lt;span class="nx">dexBuffer&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span> &lt;span class="o">!==&lt;/span> &lt;span class="nx">size&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">path&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sb">`&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">SAFE_DIR&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">classes&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">dexCount&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">.dex`&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">processDex&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">dexBuffer&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">dexCount&lt;/span>&lt;span class="o">++&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">path&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">async&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="nx">main&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">await&lt;/span> &lt;span class="nx">hookDlopen&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">warn&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[*] Hooking Finished. Starting dex dump...&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">dumpDex&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span> &lt;span class="k">catch&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">error&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`[!] Error: &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">message&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">setImmediate&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">main&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>dump出dex文件在上面的/data/data/{应用包名}目录下，把文件下载下来，拖入jadx，直接就看到源码了。&lt;/p>
&lt;p>有了源码，分析就简单了，先抓包看看有什么变化。大概看了下，加密都没怎么变。
只有这个请求&lt;code>v3/tvChannelList&lt;/code>变为&lt;code>v5/tvChannelList&lt;/code>，另外APP也需要登录才能使用，那对应的接口也增加了两个Header验证。
分别是&lt;/p>
&lt;pre tabindex="0">&lt;code>X-*****TV-USER-ID
Authorization
&lt;/code>&lt;/pre>&lt;p>补上就可以用了，其他参数和之前一样。
但是还不清楚这个验证能用多久，需要长时间验证看看能用多久。&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>逆向unity游戏myyx3，使用dump.cs还原ida方法名</title><link>https://fatkun.github.io/post/2025/crack_unity_game_myyx3/</link><guid isPermaLink="true">https://fatkun.github.io/post/2025/crack_unity_game_myyx3/</guid><pubDate>Fri, 12 Dec 2025 10:55:33 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="声明">声明&lt;/h1>
&lt;p>仅用于学习记录，关键信息隐藏。&lt;/p>
&lt;h1 id="背景">背景&lt;/h1>
&lt;p>游戏是unity+windows平台，使用il2cpp。&lt;/p>
&lt;h1 id="分析">分析&lt;/h1>
&lt;p>首先，先尝试使用Il2CppDumper反编译&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">Il2CppDumper GameAssembly.dll global-metadata.dat out
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>但是报错&lt;/p>
&lt;pre tabindex="0">&lt;code>System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Il2CppDumper.Metadata..ctor(Stream stream) in C:\projects\il2cppdumper\Il2CppDumper\Il2Cpp\Metadata.cs:line 41
&lt;/code>&lt;/pre>&lt;p>应该是做了某种加密，查看了一下global-metadata.dat文件头，是正确的 AF 1B B1 FA。&lt;/p>
&lt;p>那就从加载metadata的代码看起。打开IDA，Shift+F12打开Strings列表，查找global-metadata.dat，发现字符串有。
双击字符串，按下x找关联的代码，找到一个方法&lt;/p>
&lt;pre tabindex="0">&lt;code> v4 = sub_xxxxx(&amp;#34;global-metadata.dat&amp;#34;);
&lt;/code>&lt;/pre>&lt;p>那这个方法应该是il2cpp::vm::MetadataLoader::LoadMetadataFile
尝试把这个方法发给AI分析，写成python代码，但是解密没成功，还是报错。&lt;/p>
&lt;p>换一个思路，发现使用frida-il2cpp-bridge是可以dump cs的。&lt;/p>
&lt;pre tabindex="0">&lt;code>import &amp;#34;frida-il2cpp-bridge&amp;#34;;
Il2Cpp.perform(() =&amp;gt; {
Il2Cpp.dump(&amp;#34;dump.cs&amp;#34;, &amp;#34;./&amp;#34;);
}
&lt;/code>&lt;/pre>&lt;p>dump完之后，可以看一下里面的方法，里面的偏移地址看起来都没什么问题。那能不能利用dump.cs修改IDA的方法名呢？
把想法发给AI，让它生成一个python代码提取dump.cs的名字和偏移地址。AI生成了一个代码，实际地址是：ImageBase + RVA。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;span class="lnt">44
&lt;/span>&lt;span class="lnt">45
&lt;/span>&lt;span class="lnt">46
&lt;/span>&lt;span class="lnt">47
&lt;/span>&lt;span class="lnt">48
&lt;/span>&lt;span class="lnt">49
&lt;/span>&lt;span class="lnt">50
&lt;/span>&lt;span class="lnt">51
&lt;/span>&lt;span class="lnt">52
&lt;/span>&lt;span class="lnt">53
&lt;/span>&lt;span class="lnt">54
&lt;/span>&lt;span class="lnt">55
&lt;/span>&lt;span class="lnt">56
&lt;/span>&lt;span class="lnt">57
&lt;/span>&lt;span class="lnt">58
&lt;/span>&lt;span class="lnt">59
&lt;/span>&lt;span class="lnt">60
&lt;/span>&lt;span class="lnt">61
&lt;/span>&lt;span class="lnt">62
&lt;/span>&lt;span class="lnt">63
&lt;/span>&lt;span class="lnt">64
&lt;/span>&lt;span class="lnt">65
&lt;/span>&lt;span class="lnt">66
&lt;/span>&lt;span class="lnt">67
&lt;/span>&lt;span class="lnt">68
&lt;/span>&lt;span class="lnt">69
&lt;/span>&lt;span class="lnt">70
&lt;/span>&lt;span class="lnt">71
&lt;/span>&lt;span class="lnt">72
&lt;/span>&lt;span class="lnt">73
&lt;/span>&lt;span class="lnt">74
&lt;/span>&lt;span class="lnt">75
&lt;/span>&lt;span class="lnt">76
&lt;/span>&lt;span class="lnt">77
&lt;/span>&lt;span class="lnt">78
&lt;/span>&lt;span class="lnt">79
&lt;/span>&lt;span class="lnt">80
&lt;/span>&lt;span class="lnt">81
&lt;/span>&lt;span class="lnt">82
&lt;/span>&lt;span class="lnt">83
&lt;/span>&lt;span class="lnt">84
&lt;/span>&lt;span class="lnt">85
&lt;/span>&lt;span class="lnt">86
&lt;/span>&lt;span class="lnt">87
&lt;/span>&lt;span class="lnt">88
&lt;/span>&lt;span class="lnt">89
&lt;/span>&lt;span class="lnt">90
&lt;/span>&lt;span class="lnt">91
&lt;/span>&lt;span class="lnt">92
&lt;/span>&lt;span class="lnt">93
&lt;/span>&lt;span class="lnt">94
&lt;/span>&lt;span class="lnt">95
&lt;/span>&lt;span class="lnt">96
&lt;/span>&lt;span class="lnt">97
&lt;/span>&lt;span class="lnt">98
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-py" data-lang="py">&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">idautils&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">idaapi&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">idc&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">ida_funcs&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">re&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">os&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># --- 用户配置 ---&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 文件路径&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">DUMP_FILE_PATH&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sa">r&lt;/span>&lt;span class="s2">&amp;#34;E:/dump.cs&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># ----------------&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">auto_rename_from_dump&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_path&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;&amp;#34;&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> 解析 dump.cs 文件，自动在 IDA 中重命名函数。
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> 脚本会动态识别类名，并用 &amp;#39;类名::函数名&amp;#39; 的格式进行重命名。
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#34;&amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="ow">not&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">path&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">exists&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_path&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;❌ 错误：文件未找到，请检查路径：&lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">file_path&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 1. 获取 IDA 数据库的基地址 (ImageBase)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">image_base&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">idaapi&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">get_imagebase&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">image_base&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="n">idaapi&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">BADADDR&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;❌ 错误：无法获取 ImageBase。请确保已加载有效的 IDA 数据库。&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;🌟 当前 IDA 数据库 ImageBase: 0x&lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">image_base&lt;/span>&lt;span class="si">:&lt;/span>&lt;span class="s2">X&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;🔬 正在解析文件: &lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">file_path&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">functions_to_rename&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">{}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">current_class_name&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span> &lt;span class="c1"># 用于跟踪当前解析到的类名&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 正则表达式&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 匹配类定义行: class Name: Inherit...&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">class_pattern&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">re&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">compile&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">r&lt;/span>&lt;span class="s1">&amp;#39;^\s*class\s+([\w\.]+)\s*:&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 匹配函数定义行: 返回类型 函数名(参数); // 0xRVA&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">func_pattern&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">re&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">compile&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">r&lt;/span>&lt;span class="s1">&amp;#39;\s*System\.[\w\.&amp;lt;&amp;gt;\[\]]*\s+([\w\.]+)\(.*?\);\s*//\s*(0x[0-9a-fA-F]+)&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">with&lt;/span> &lt;span class="nb">open&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;r&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">encoding&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s1">&amp;#39;utf-8&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">as&lt;/span> &lt;span class="n">f&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">line&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">f&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 尝试匹配类定义&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">class_match&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">class_pattern&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">search&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">line&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">class_match&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 找到新的类定义，更新当前类名&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">current_class_name&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">class_match&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">strip&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;-&amp;gt; 发现类: &lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">current_class_name&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">continue&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 尝试匹配函数定义&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">func_match&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">func_pattern&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">search&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">line&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">func_match&lt;/span> &lt;span class="ow">and&lt;/span> &lt;span class="n">current_class_name&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">func_name&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">func_match&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">strip&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">rva_str&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">func_match&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">2&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">strip&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 格式化新函数名： 类名::函数名&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">full_name&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">current_class_name&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">::&lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">func_name&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 转换 RVA 为 VA&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">rva&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">int&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">rva_str&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">16&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">va&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">image_base&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="n">rva&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">functions_to_rename&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="n">va&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">full_name&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">except&lt;/span> &lt;span class="ne">ValueError&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;⚠️ 警告：跳过无效 RVA 行: &lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">line&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">strip&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">except&lt;/span> &lt;span class="ne">Exception&lt;/span> &lt;span class="k">as&lt;/span> &lt;span class="n">e&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;❌ 读取或解析文件时发生错误: &lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">e&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 2. 在 IDA 中重命名&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">total_found&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">functions_to_rename&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;🔍 成功从 dump 文件中解析到 &lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">total_found&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2"> 个待重命名地址。&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">renamed_count&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">va&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">name&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">functions_to_rename&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">items&lt;/span>&lt;span class="p">():&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 检查地址是否在可访问的段内&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">idc&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">get_full_flags&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">va&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">continue&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 尝试将地址定义为函数（如果还没有）&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="ow">not&lt;/span> &lt;span class="n">ida_funcs&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">get_func&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">va&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">ida_funcs&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">add_func&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">va&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 执行重命名操作&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">idc&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">set_name&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">va&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">name&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">idc&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">SN_NOWARN&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="n">idc&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">SN_NOCHECK&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">renamed_count&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;--- 重命名报告 ---&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;🎉 任务完成！&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;总计解析函数数: &lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">total_found&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;成功重命名函数数: &lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">renamed_count&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;------------------&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 执行主函数&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 注意：现在调用时不需要传入 CLASS_NAME_PREFIX 参数了&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">auto_rename_from_dump&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">DUMP_FILE_PATH&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>在IDA执行脚本之后，大部分方法名就改过来了。&lt;/p>
&lt;p>使用Reqable抓包发现，有部分请求是加密的。从代码浏览，SteamWindowsAgent看起来和登录有关系&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ts" data-lang="ts">&lt;span class="line">&lt;span class="cl">&lt;span class="kr">import&lt;/span> &lt;span class="s2">&amp;#34;frida-il2cpp-bridge&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">perform&lt;/span>&lt;span class="p">(()&lt;/span> &lt;span class="o">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">CSharp&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">domain&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">assembly&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Assembly-CSharp&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">image&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">trace&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">classes&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">CSharp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kr">class&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Script.***.SdkAgent.SteamWindowsAgent&amp;#34;&lt;/span>&lt;span class="p">)).&lt;/span>&lt;span class="nx">and&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="nx">attach&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>尝试trace代码，这里看起来是上层调用，具体底层调用了哪些方法，没有trace到。
想着换一种思路，Hook网络请求，然后再从backtrace看调用链路。一般游戏都通过UnityEngine.Networking.UnityWebRequest发送请求，但是发现根本没有。
既然上面的SteamWindowsAgent是上层调用，进入IDA，找到对应的方法，按F5切换到伪代码查看，找到了一些蛛丝马迹。
它和KarmaSDK有关，KarmaSDK有多个类，把多个类都加入trace里面来。
为了提取密钥，尝试trace改成&lt;code>Il2Cpp.trace(true)&lt;/code>，发现可以获取参数（很多时候会报错）。那这里就可以拿到加解密了。&lt;/p>
&lt;p>IDA进入加解密的方法，我找到的伪代码发给AI分析，让它帮我们实现解密方法。
发现这个游戏用两种加密方式
第一种是AES（AES-128-CBC），请求参数加密：&lt;code>KarmaSDK.ex::Encrypt&lt;/code> trace这个方法获取key和IV。
第二种是RSA（PKCS1_v1_5），返回内容加密：&lt;code>KarmaSDK.fb::Decrypt&lt;/code>，trace获取RSA key。&lt;/p>
&lt;p>里面很多子方法调用，可以先把主方法发给AI，然后问它还需要提供哪些子方法，继续提供信息给AI就行。提供的信息越多，实现越准确。不过GROK有点奇怪，老会吹牛逼，分析DLL的时候让我上传文件给我解密，说它解密好了，给我一个下载链接，发现根本不存在这个链接。&lt;/p>
&lt;h1 id="ida动态分析">IDA动态分析&lt;/h1>
&lt;p>有一些qword_7FFF0AFECAE8，静态分析是查不到值的，需要attach进程，实时查看内存。&lt;/p>
&lt;p>这里是一个MD5的伪代码，sub_7FFF09EFF080是一个字符串拼接的方法&lt;/p>
&lt;pre tabindex="0">&lt;code> v3 = **(_QWORD **)(qword_7FFF0AFEEA28 + 184);
if ( !v3 )
sub_7FFF091B94D0();
v4 = sub_7FFF09EFF080(a2, qword_7FFF0AFECAE8, *(_QWORD *)(v3 + 56));
v16 = (__int64 *)System_Security_Cryptography_MD5::Create(0);
v14 = 0;
v15 = &amp;amp;v16;
try
{
v5 = v16;
UTF8 = System_Text_Encoding::get_UTF8(0);
if ( !UTF8 )
sub_7FFF091B94D0();
v7 = (*(__int64 (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)UTF8 + 600LL))(
UTF8,
v4,
*(_QWORD *)(*(_QWORD *)UTF8 + 608LL));
if ( !v5 )
sub_7FFF091B94D0();
v8 = System_Security_Cryptography_HashAlgorithm::ComputeHash(v5, v7, 0);
v9 = sub_7FFF0A011DE0(v8, 0);
}
&lt;/code>&lt;/pre>&lt;p>假如我想获得qword_7FFF0AFECAE8的内容，在v16这行加上一个断点，双击qword_7FFF0AFECAE8，后面有一个地址&lt;/p>
&lt;p>&lt;code>qword_7FFED50DCAE8 dq 14D112E5840h&lt;/code>&lt;/p>
&lt;p>再双击后面的地址，这是一个unity的字符串，前面会有一些header，实际这个是“_”。可以让AI解析。&lt;/p>
&lt;pre tabindex="0">&lt;code>debug1506:0000014D112E5840 db 0D0h
debug1506:0000014D112E5841 db 0A6h
debug1506:0000014D112E5842 db 25h ; %
debug1506:0000014D112E5843 db 0A0h
debug1506:0000014D112E5844 db 4Bh ; K
debug1506:0000014D112E5845 db 1
debug1506:0000014D112E5846 db 0
debug1506:0000014D112E5847 db 0
debug1506:0000014D112E5848 db 0
debug1506:0000014D112E5849 db 0
debug1506:0000014D112E584A db 0
debug1506:0000014D112E584B db 0
debug1506:0000014D112E584C db 0
debug1506:0000014D112E584D db 0
debug1506:0000014D112E584E db 0
debug1506:0000014D112E584F db 0
debug1506:0000014D112E5850 db 1
debug1506:0000014D112E5851 db 0
debug1506:0000014D112E5852 db 0
debug1506:0000014D112E5853 db 0
debug1506:0000014D112E5854 db 5Fh ; _
debug1506:0000014D112E5855 db 0
debug1506:0000014D112E5856 db 0
debug1506:0000014D112E5857 db 0
debug1506:0000014D112E5858 db 0
debug1506:0000014D112E5859 db 0
debug1506:0000014D112E585A db 0
&lt;/code>&lt;/pre>&lt;p>再看V4变量，可以直接双击，直接跳转到内存值。可以把光标移动到文字开始的地址，在&lt;code>Edit&amp;gt;Strings&amp;gt;Unicode&lt;/code>，可以转成字符串。&lt;/p>
&lt;pre tabindex="0">&lt;code>debug1553:0000014D9D91CF44 text &amp;#34;UTF-16LE&amp;#34;, &amp;#39;1765897011173_CJui24lxxxxxxxxxxxxxxxxxx&amp;#39;
debug1553:0000014D9D91CFAA text &amp;#34;UTF-16LE&amp;#34;, &amp;#39;WLy22Nr&amp;#39;,0
&lt;/code>&lt;/pre>&lt;p>多抓取几次，发现后面这个字符串是固定的。最终获得了这个md5是如何hash的。&lt;/p>
&lt;p>另外这次也尝试了使用ida-pro-mcp，使用claude-sonet-4.5，它帮我分析了一下代码，但是看起来前面有些分析是错的。后面在read_qword的时候地址是错的，不知道是不是mcp错误的问题。不过帮它纠正一下还能继续分析下去。但是读取上面的String时也有问题，没给我读取完整，还得自己去分析。&lt;/p>
&lt;h1 id="结尾">结尾&lt;/h1>
&lt;p>到这里基本就结束了，使用解密方法尝试解密抓包的内容，发现都成功了。&lt;/p>
&lt;p>自从有了AI之后，分析代码的活都给AI干了，不用一行行的盯着伪代码看，试错也简单，如果AI有验证能力的话更好一些，有时候就是乱说一通。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>破解Unity游戏联网验证(Mono)</title><link>https://fatkun.github.io/post/2025/crack_unity_mono/</link><guid isPermaLink="true">https://fatkun.github.io/post/2025/crack_unity_mono/</guid><pubDate>Sat, 01 Nov 2025 10:55:33 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="背景">背景&lt;/h1>
&lt;p>一个windows unity游戏，代码没有加密，没有热加载，使用UnityPlayer.dll。名字是：哎呦,xxxxx。
这个没逆向成功，只是提供一些思路。&lt;/p>
&lt;h1 id="目标">目标&lt;/h1>
&lt;p>游戏启动后，界面停留在连接中，该游戏有联网验证。那这部分的代码是哪个类呢？我们需要找出对应的代码。&lt;/p>
&lt;h1 id="尝试">尝试&lt;/h1>
&lt;p>首先从网络请求入手，猜测它会有网络请求，所以使用了Reqable这类http/https抓包工具，但是没有任何请求。
又尝试使用Proxifier拦截请求，但是还是没能抓取到http/https请求，但是在关闭游戏的时候，看到请求了某个域名。（后面查看代码知道实际上是TCP请求，但这个时候我不是太懂，如果知道域名后，应该可以使用tcp的抓包工具筛选请求）&lt;/p>
&lt;p>由于这个游戏没有用IL2CPP，直接用dnspy反编译***Data/Managed目录的dll文件就可以看到完整的代码。&lt;/p>
&lt;p>从网络这边无法入手，继续尝试能不能通过frida来hook代码，发现之前主要是hook il2cpp 的代码，mono的反而不知道怎么操作。咨询AI说使用frida-mono-api，但实际使用下来比较老旧了，几年前的代码，最终这条路还是走不通。&lt;/p>
&lt;p>那还有种办法通过Debug.Log写日志，日志路径在&lt;code>C:\Users\用户名\AppData\LocalLow\公司名\游戏名\Player.log&lt;/code>。但是呢，一般Release版本是不会输出debug日志的。所以我跟了一下Debug.Log的代码看哪里可以修改可以输出。然而呢，我看了一下日志居然是输出的，那就可以插入日志来跟踪代码。&lt;/p>
&lt;p>前面浏览代码发现一个可疑的类，SteamManger。其中有一段代码涉及到SetCallback方法，我想用dnspy的分析功能，但找不到调用方。（这里是dnspy的局限，如果代码使用实例的方式调用，就找不到谁调用它，而且搜索字符串也不好用，不能全局搜索代码，只能在一个类内搜索。后面可能要先导出所有代码，然后在vscode搜索。）
当时想看谁调用了SetCallback，我需要打印一下堆栈。&lt;/p>
&lt;p>使用dnspy右键编辑方法，增加以下代码，点击编译（如果编译失败，请尝试把目录下的所有dll文件都拖入dnspy），然后在文件-》保存模块。&lt;/p>
&lt;pre tabindex="0">&lt;code> string stack = Environment.StackTrace;
Debug.Log(&amp;#34;SetCallback&amp;#34; + stack);
&lt;/code>&lt;/pre>&lt;p>查看日志，这时就可以找对应代码了。&lt;/p>
&lt;pre tabindex="0">&lt;code>SetCallback at System.Environment.get_StackTrace () [0x00000] in &amp;lt;0de99929796b4095b47389e59e446fbd&amp;gt;:0
at PlatformSteam.SetCallback (EventCallbackDelegate callback) [0x00000] in &amp;lt;749c0f0f9b7e45cbb9255a71a40a8e11&amp;gt;:0
at PlatformManager.SetCallback (EventCallbackDelegate callback) [0x00000] in &amp;lt;749c0f0f9b7e45cbb9255a71a40a8e11&amp;gt;:0
at MainGame.StartPlatform (PlatformType platformType) [0x00000] in &amp;lt;749c0f0f9b7e45cbb9255a71a40a8e11&amp;gt;:0
at Loading.Init () [0x00000] in &amp;lt;749c0f0f9b7e45cbb9255a71a40a8e11&amp;gt;:0
at Loading.Start () [0x00000] in &amp;lt;749c0f0f9b7e45cbb9255a71a40a8e11&amp;gt;:0 EventCallbackDelegate
&lt;/code>&lt;/pre>&lt;p>跟踪代码，最后发现有一个NetWork类。前面其实发现了一个域名，其实也可以尝试根据字符串查询，域名可能是在代码里面或者读取外部配置。在dnspy搜索字符串时，记得在搜索程序集，选择字符串（默认是以上所有，搜不到字符串）。&lt;/p>
&lt;p>到这里可以看到这是一个TCP的连接，使用TCP倒是很少见，一般都用HTTPS。&lt;/p>
&lt;pre tabindex="0">&lt;code>this.m_Socket = new Socket(SocketType.Stream, ProtocolType.Tcp);
this.m_Socket.Connect(this.ServerAddress, 7788);
&lt;/code>&lt;/pre>&lt;p>对这种TCP二进制通信还是比较烦，粗略看了代码，没有加密内容，理论上抓包分析二进制可以写个程序解包。
看了一下游戏对视频做了加密，而且key是通过上面的网络请求获取的，不过这里没加密，如果有正版游戏，应该能提取出来，并且日志也会输出。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-c#" data-lang="c#">&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">public&lt;/span> &lt;span class="k">void&lt;/span> &lt;span class="n">OnRecvVideoKey&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kt">string&lt;/span> &lt;span class="n">name&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">VideoKey&lt;/span> &lt;span class="n">key&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">Debug&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">Log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;-------------&amp;gt;OnRecvVideoKey:&amp;#34;&lt;/span> &lt;span class="p">+&lt;/span> &lt;span class="n">name&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">Dictionary&lt;/span>&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="kt">string&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">VideoKey&lt;/span>&lt;span class="p">&amp;gt;&lt;/span> &lt;span class="n">videoKeys&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">m_VideoKeys&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>看起来这个游戏反逆向做的还好，每个视频的key可能不一样，都需要通过服务器获取。看到这里，不继续进行下去了，已经基本分析清楚，如果要完全破解，就要有正版账号，分析TCP请求，完成模拟发送和接收。&lt;/p>
&lt;h1 id="总结">总结&lt;/h1>
&lt;p>总结一下优势劣势&lt;/p>
&lt;p>优势&lt;/p>
&lt;ul>
&lt;li>这个游戏使用TCP请求来代替https请求，提高了一点难度，当前https很容易使用本地ca证书分析密文，除非在代码中做证书校验。但是就算做了证书校验，实际上也是可以分析去掉的。&lt;/li>
&lt;li>从服务端获取key等&lt;/li>
&lt;/ul>
&lt;p>缺点&lt;/p>
&lt;ul>
&lt;li>没有使用IL2CPP，导致代码完全暴露。如果使用IL2CPP就要使用汇编方式分析了，难度更大一些。不过也可以用frida来分析代码&lt;/li>
&lt;li>TCP明文通信？不过暴露代码了，是否明文也不重要，而且也是二进制的&lt;/li>
&lt;/ul></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>逆向使用HybridCLR热更新的Unity游戏</title><link>https://fatkun.github.io/post/2025/crack_unity_with_hybridclr/</link><guid isPermaLink="true">https://fatkun.github.io/post/2025/crack_unity_with_hybridclr/</guid><pubDate>Sat, 27 Sep 2025 10:55:33 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="声明">声明&lt;/h1>
&lt;p>仅用于学习记录，请勿用于非法用途。&lt;/p>
&lt;h1 id="分析">分析&lt;/h1>
&lt;p>这个游戏使用了il2cpp，首先想到的是用Il2CppDumper反编译，找到GameAssembly.dll和global-metadata.dat。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">mkdir -p out
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Il2CppDumper GameAssembly.dll global-metadata.dat out
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>还好这两个文件都没有加密，但发现在DummyDll没找到核心的代码，但找到HybridCLR.Runtime.dll，这个应该是用了热加载功能。&lt;/p>
&lt;p>尝试使用 &lt;code>frida-il2cpp-bridge&lt;/code> trace 代码, 同时也可以dump代码出来&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ts" data-lang="ts">&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">perform&lt;/span>&lt;span class="p">(()&lt;/span> &lt;span class="o">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">unityVersion&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">dump&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;dump.cs&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;./&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>从dump.cs看出，多出了一个Game.dll，看了一下方法确实是核心代码。尝试对Game里面的代码进行trace，但是发现不是所有的方法都可以trace到。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ts" data-lang="ts">&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">perform&lt;/span>&lt;span class="p">(()&lt;/span> &lt;span class="o">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">unityVersion&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">trace&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">classes&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">domain&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">assembly&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Game&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">image&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kr">class&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Tower.NetworkManager&amp;#34;&lt;/span>&lt;span class="p">)).&lt;/span>&lt;span class="nx">and&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="nx">attach&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>从dump.cs看到，有些方法的地址是一样的，应该是由于动态加载的问题，找到的地址是错误的，这样就导致无法通过trace。&lt;/p>
&lt;p>回到前面看到的HybridCLR.Runtime.dll，用dnSpy查看方法&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-c#" data-lang="c#">&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">public&lt;/span> &lt;span class="kd">static&lt;/span> &lt;span class="kd">extern&lt;/span> &lt;span class="n">LoadImageErrorCode&lt;/span> &lt;span class="n">LoadMetadataForAOTAssembly&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kt">byte&lt;/span>&lt;span class="p">[]&lt;/span> &lt;span class="n">dllBytes&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">HomologousImageMode&lt;/span> &lt;span class="n">mode&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>可以看到这个方法是传入了一个dllBytes参数，我们要找到这个bytes是如何传入进来的。
这里我们要用到ida pro，加载GameAssembly.dll，并且使用script和Il2CppDumper反编译的内容把方法名称补充进来（可以看之前的文档操作）
找到LoadMetadataForAOTAssembly这个方法，然后在方法名上面按X，查找引用，F5分析伪代码&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;span class="lnt">8
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-C" data-lang="C">&lt;span class="line">&lt;span class="cl"> &lt;span class="n">s_assetDatas&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">System_Collections_Generic_Dictionary_object__object__o&lt;/span> &lt;span class="o">*&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="n">DllManager_TypeInfo&lt;/span>&lt;span class="o">-&amp;gt;&lt;/span>&lt;span class="n">static_fields&lt;/span>&lt;span class="o">-&amp;gt;&lt;/span>&lt;span class="n">s_assetDatas&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span> &lt;span class="o">!&lt;/span>&lt;span class="n">s_assetDatas&lt;/span> &lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nf">sub_180332070&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">v3&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">Item&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">System_Byte_array&lt;/span> &lt;span class="o">*&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="nf">System_Collections_Generic_Dictionary_object__object___get_Item&lt;/span>&lt;span class="p">(&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">s_assetDatas&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">key&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">Method_System_Collections_Generic_Dictionary_string__byte____get_Item__&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">MetadataForAOTAssembly&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nf">HybridCLR_RuntimeApi__LoadMetadataForAOTAssembly&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Item&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>可以看到是从s_assetDatas这个List里面获取的，继续跟踪这个s_assetDatas如何获取。另外看到这个类DllManager不是动态加载的，这时候我们可以使用frida来trace代码。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ts" data-lang="ts">&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">perform&lt;/span>&lt;span class="p">(()&lt;/span> &lt;span class="o">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">ScriptMain&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">domain&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">assembly&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;ScriptMain&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">image&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">trace&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">classes&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">ScriptMain&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kr">class&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;DllManager&amp;#34;&lt;/span>&lt;span class="p">)).&lt;/span>&lt;span class="nx">and&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="nx">attach&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Il2Cpp.trace(true).methods(ScriptMain.class(&amp;#34;DllManager&amp;#34;).method(&amp;#34;GetWebRequestPath&amp;#34;)).and().attach();
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>trace有个参数可以指定为true，打印参数，但是经常出错，目前不知道怎么解决，可以针对局部方法开启。
从上面的trace看，dll文件是从.ab文件读取出来的，找到对应的ab文件，使用AssetStudioModGUI解包获取DLL文件，把文件丢到dnSpy里，发现代码完全没有混淆和加密。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>破解某金融终端APK</title><link>https://fatkun.github.io/post/2025/crack_winxxxx/</link><guid isPermaLink="true">https://fatkun.github.io/post/2025/crack_winxxxx/</guid><pubDate>Tue, 16 Sep 2025 10:55:33 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="背景">背景&lt;/h1>
&lt;p>这个软件查看深度资料需要开户才可以，但看到实际是后台已经加载数据了，但是会弹一个对话框提示要开户。
本文仅用于记录学习，隐藏部分细节。&lt;/p>
&lt;h1 id="操作">操作&lt;/h1>
&lt;p>使用MT管理器查看没有加固，然后使用MT管理器2.15.0学习版去掉签名校验（如果不去掉，后面改完代码签名后，启动会马上退出）。&lt;/p>
&lt;p>使用jadx反编译代码，搜索对话框里面的内容，记得要勾选资源文件。刚好在strings资源里面找到文字，然后根据变量(fund_auth_tip)找到使用的地方。&lt;/p>
&lt;p>对应的代码在 smali_classes3\l30\m0.smali ，可以看到里面的代码就是创建一个对话框提醒，我们只要在这个方法最开始直接return就可以去掉弹窗了。&lt;/p>
&lt;p>使用APK.Tool.GUI.v3.3.1.6（最新版本可能会反编译报错，可以试一下这个版本）反编译代码，修改上面的smali文件。直接在方法最开始加一个 return-void 就行了。&lt;/p>
&lt;pre tabindex="0">&lt;code>.method public static final g(Ll30/m0;)V
.locals 3
return-void
.line 1
:try_start_0
const-string v0, &amp;#34;this$0&amp;#34;
.line 2
.line 3
invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;-&amp;gt;checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 4
.line 5
.line 6
sget v0, Lk30/l;-&amp;gt;warm_reminder:I
&lt;/code>&lt;/pre>&lt;p>改完之后，重新编译回去，安装软件即可。安装后验证确实不再弹窗了。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>使用Frida-il2cpp-bridge</title><link>https://fatkun.github.io/post/2025/use-frida-il2cpp-bridge/</link><guid isPermaLink="true">https://fatkun.github.io/post/2025/use-frida-il2cpp-bridge/</guid><pubDate>Thu, 31 Jul 2025 10:55:33 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="说明">说明&lt;/h1>
&lt;p>代码仓库： &lt;a href="https://github.com/vfsfitvnm/frida-il2cpp-bridge">https://github.com/vfsfitvnm/frida-il2cpp-bridge&lt;/a>&lt;/p>
&lt;p>这是一个用来hook Il2Cpp 程序的模块，可以用它dump class，跟踪代码执行，覆盖方法等&lt;/p>
&lt;h1 id="安装">安装&lt;/h1>
&lt;p>参考 &lt;a href="https://github.com/vfsfitvnm/frida-il2cpp-bridge/wiki/Installation">wiki的安装说明&lt;/a>&lt;/p>
&lt;p>新建一个 index.ts&lt;/p>
&lt;pre tabindex="0">&lt;code>import &amp;#34;frida-il2cpp-bridge&amp;#34;;
Il2Cpp.perform(() =&amp;gt; {
// code here
console.log(Il2Cpp.unityVersion);
});
&lt;/code>&lt;/pre>&lt;p>新建一个 packages.json&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;name&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;playground&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;main&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;index.ts&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;version&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;1.0.0&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;private&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="kc">true&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;type&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;module&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;scripts&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;build&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;frida-compile -o _.js -w index.ts&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;attach&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;run() { frida -U \&amp;#34;$1\&amp;#34; -l _.js --runtime=v8; }; run&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;spawn&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;run() { frida -U -f \&amp;#34;$1\&amp;#34; -l _.js --no-pause --runtime=v8; }; run&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;app0-spawn&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;npm run spawn com.example.application0&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;app1&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;npm run \&amp;#34;Application1 Name\&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;app1-spawn&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;npm run spawn com.example.application1&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;devDependencies&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;@types/frida-gum&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;^18.3.1&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;frida-compile&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;^16.2.2&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;frida-il2cpp-bridge&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s2">&amp;#34;*&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>新建一个 tsconfig.json&lt;/p>
&lt;pre tabindex="0">&lt;code>{
&amp;#34;compilerOptions&amp;#34;: {
&amp;#34;target&amp;#34;: &amp;#34;esnext&amp;#34;,
&amp;#34;lib&amp;#34;: [ &amp;#34;es2022&amp;#34; ],
&amp;#34;experimentalDecorators&amp;#34;: true,
&amp;#34;module&amp;#34;: &amp;#34;esnext&amp;#34;,
&amp;#34;allowJs&amp;#34;: false,
&amp;#34;noEmit&amp;#34;: false,
&amp;#34;esModuleInterop&amp;#34;: false,
&amp;#34;moduleResolution&amp;#34;: &amp;#34;nodenext&amp;#34;,
&amp;#34;strict&amp;#34;: true,
&amp;#34;sourceMap&amp;#34;: true
},
&amp;#34;files&amp;#34;: [ &amp;#34;index.ts&amp;#34; ]
}
&lt;/code>&lt;/pre>&lt;p>安装&lt;/p>
&lt;pre tabindex="0">&lt;code>npm install --save-dev frida-il2cpp-bridge
&lt;/code>&lt;/pre>&lt;h1 id="执行">执行&lt;/h1>
&lt;pre tabindex="0">&lt;code># 由ts代码构建js代码，里面有-w参数，如果ts变更会重新编译js
npm run build
&lt;/code>&lt;/pre>&lt;p>由于我是在windows下执行，packages.json 需要修改一下运行命令&lt;/p>
&lt;pre tabindex="0">&lt;code>&amp;#34;attach&amp;#34;: &amp;#34;run() { frida -U \&amp;#34;$1\&amp;#34; -l _.js --runtime=v8; }; run&amp;#34;,
&lt;/code>&lt;/pre>&lt;p>改为&lt;/p>
&lt;pre tabindex="0">&lt;code>&amp;#34;attach&amp;#34;: &amp;#34;frida 进程名称.exe -l _.js&amp;#34;,
&lt;/code>&lt;/pre>&lt;p>然后执行&lt;/p>
&lt;pre tabindex="0">&lt;code>npm run attach
&lt;/code>&lt;/pre>&lt;h1 id="使用例子">使用例子&lt;/h1>
&lt;p>可以看官方的wiki &lt;a href="https://github.com/vfsfitvnm/frida-il2cpp-bridge/wiki/Snippets">https://github.com/vfsfitvnm/frida-il2cpp-bridge/wiki/Snippets&lt;/a>&lt;/p>
&lt;h2 id="调用堆栈">调用堆栈&lt;/h2>
&lt;p>看这里的&lt;a href="https://github.com/vfsfitvnm/frida-il2cpp-bridge/issues/10#issuecomment-1680834010">讨论&lt;/a>&lt;/p>
&lt;p>方法一（受限frida默认只有16个backtrace，信息很少）&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ts" data-lang="ts">&lt;span class="line">&lt;span class="cl">&lt;span class="kr">import&lt;/span> &lt;span class="s2">&amp;#34;frida-il2cpp-bridge&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">perform&lt;/span>&lt;span class="p">(()&lt;/span> &lt;span class="o">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">UnityWebRequest&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">domain&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">assembly&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;UnityEngine&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">image&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kr">class&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;UnityEngine.Networking.UnityWebRequest&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">backtrace&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="nx">methods&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">UnityWebRequest&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">method&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Send&amp;#34;&lt;/span>&lt;span class="p">)).&lt;/span>&lt;span class="nx">and&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="nx">attach&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>方法二（更详细）&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ts" data-lang="ts">&lt;span class="line">&lt;span class="cl">&lt;span class="kr">import&lt;/span> &lt;span class="s2">&amp;#34;frida-il2cpp-bridge&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">perform&lt;/span>&lt;span class="p">(()&lt;/span> &lt;span class="o">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">get_StackTrace&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">corlib&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kr">class&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;System.Environment&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">method&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;get_StackTrace&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">UnityWebRequest&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">domain&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">assembly&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;UnityEngine&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">image&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kr">class&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;UnityEngine.Networking.UnityWebRequest&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// 重写 SendWebRequest 方法的实现
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">UnityWebRequest&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">method&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;SendWebRequest&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">implementation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nb">Object&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;TRACE!!!&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">get_StackTrace&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">invoke&lt;/span>&lt;span class="p">());&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// 调用原始方法
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">return&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">method&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;SendWebRequest&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">invoke&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="跟踪方法trace">跟踪方法（Trace）&lt;/h2>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ts" data-lang="ts">&lt;span class="line">&lt;span class="cl">&lt;span class="kr">import&lt;/span> &lt;span class="s2">&amp;#34;frida-il2cpp-bridge&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">perform&lt;/span>&lt;span class="p">(()&lt;/span> &lt;span class="o">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">UnityWebRequest&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">domain&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">assembly&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;UnityEngine&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">image&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kr">class&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;UnityEngine.Networking.UnityWebRequest&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">trace&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">classes&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">UnityWebRequest&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">and&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="nx">attach&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="覆盖方法2">覆盖方法2&lt;/h2>
&lt;p>覆盖方法的时候要注意，要记得参数有几个
如果trace返回输出（Il2Cpp.trace(true)），也会导致无法覆盖方法
Il2Cpp.trace(true).classes(CSharp.class(&amp;quot;KarmaSDK.AsyncRequest&amp;quot;)).and().attach();&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;span class="lnt">8
&lt;/span>&lt;span class="lnt">9
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ts" data-lang="ts">&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">dekMethod&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">domain&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">assembly&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Assembly-CSharp&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">image&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kr">class&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;KarmaSDK.AsyncRequest&amp;#34;&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">tryMethod&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;dek&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// 需要使用ts-ignore，否则类型检查会不通过
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// https://github.com/vfsfitvnm/frida-il2cpp-bridge/issues/428#issuecomment-1793728571
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// @ts-ignore
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">dekMethod&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">implementation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">Class&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">a1&lt;/span>: &lt;span class="kt">Il2Cpp.String&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nb">String&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;dekMethod&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">a1&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">Il2Cpp&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kt">string&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>WEB前端逆向TS NALU解密</title><link>https://fatkun.github.io/post/2025/crack_ts/</link><guid isPermaLink="true">https://fatkun.github.io/post/2025/crack_ts/</guid><pubDate>Mon, 28 Jul 2025 10:55:33 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="背景">背景&lt;/h1>
&lt;p>使用浏览器可以找到m3u8链接，把ts文件下载下来播放，发现有声音但是花屏。&lt;/p>
&lt;p>这里面可能是对TS帧加密。&lt;/p>
&lt;p>上网搜索找到这篇文章，&lt;a href="https://www.52pojie.cn/forum.php?mod=viewthread&amp;amp;tid=1957747&amp;amp;extra=page%3D1&amp;amp;page=1">WEB前端逆向TS PES NALU解密&lt;/a>，但这篇文章是针对视频的，我是想对直播解密，使用&lt;a href="https://www.initialsky.com/archives/104">上述的脚本&lt;/a>，解密出来，底下有一点花屏。&lt;/p>
&lt;h1 id="分析">分析&lt;/h1>
&lt;p>从其他文章知道这个网站是使用wasm加密，所以可以先找到wasm，然后找到对应的js文件，js文件比较重要的有&lt;/p>
&lt;pre tabindex="0">&lt;code>h5.worker%3Fv=220805
wasm文件，会构造一个对象 CNTVModule，这个js有一点点混淆，反混淆就好。可以在chrome浏览器里面Override反混淆后的代码。
liveplayer.js
可以根据CNTVModule找到CNTVH5PlayerModule = CNTVModule();
liveplayer_controls.js
根据CNTVH5PlayerModule找到，解密代码调用位置
&lt;/code>&lt;/pre>&lt;p>先来到liveplayer_controls.js这个文件，主要的解密方法是在x.prototype._parseAVCPES里。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">x&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">prototype&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_parseAVCPES&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">h&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">g&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">y&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">m&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">v&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">E&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_avcTrack&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">t&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_parseAVCNALu&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">h&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">data&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">_&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">avcSample&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">T&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">false&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">S&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">false&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">b&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">pushAccesUnit&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">bind&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">h&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">data&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">_&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="nx">t&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">length&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="o">!&lt;/span>&lt;span class="nx">E&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">audFound&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">b&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">_&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">E&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">_&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">avcSample&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">p&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">h&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">pts&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">h&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">dts&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">...&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">uint8ToHex&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">uint8Array&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// 确保输入是 Uint8Array 或类数组
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">ArrayBuffer&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">isView&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">uint8Array&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="o">!&lt;/span>&lt;span class="nb">Array&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">isArray&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">uint8Array&lt;/span>&lt;span class="p">))&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">throw&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nb">Error&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;Input must be a Uint8Array or an array of numbers&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nb">Array&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">from&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">uint8Array&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">.&lt;/span>&lt;span class="nx">map&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kr">byte&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="kr">byte&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">toString&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">16&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">padStart&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">2&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;0&amp;#39;&lt;/span>&lt;span class="p">))&lt;/span> &lt;span class="c1">// 转为两位小写 hex
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="p">.&lt;/span>&lt;span class="nx">join&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39; &amp;#39;&lt;/span>&lt;span class="p">);&lt;/span> &lt;span class="c1">// 用空格分隔每个字节
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">t&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">forEach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">y&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">L&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">false&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// 可以插入一些代码测试
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;e.type&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">type&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">uint8ToHex&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">data&lt;/span>&lt;span class="p">));&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">type&lt;/span> &lt;span class="o">!==&lt;/span> &lt;span class="mi">5&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">type&lt;/span> &lt;span class="o">!==&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">))&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">F&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">data&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">A&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">data&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span> &lt;span class="k">else&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">M&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">data&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">A&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">data&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">...&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">S&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>从代码看到 &lt;code>t = this._parseAVCNALu(h.data);&lt;/code>先把NALu解析出来，然后调用 &lt;code>t.forEach&lt;/code> 遍历，如果类型是1或5才做解密。其中直播是调用 &lt;code>A(e.data, 0)&lt;/code>。&lt;/p>
&lt;p>来到看解密方法&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">function&lt;/span> &lt;span class="nx">A&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">t&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">r&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">i&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">a&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">n&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">Uint8Array&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">r&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_jsmalloc&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">1024&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="kd">var&lt;/span> &lt;span class="nx">o&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">o&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">o&lt;/span>&lt;span class="o">++&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">HEAP8&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">r&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">o&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">o&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">v&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">signalUrlSend&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">a&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">v&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">rootURL&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">length&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="kd">var&lt;/span> &lt;span class="nx">s&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">s&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="nx">a&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">s&lt;/span>&lt;span class="o">++&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">HEAP8&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">r&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">s&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">v&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">rootURL&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">charCodeAt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">s&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">v&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">signalUrlSend&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">true&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">t&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">i&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_nalplay2&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">r&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">a&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span> &lt;span class="k">else&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">t&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">i&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_vodplay&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">r&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">a&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">n&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">Uint8Array&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">i&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="kd">var&lt;/span> &lt;span class="nx">l&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">l&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="nx">n&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">l&lt;/span>&lt;span class="o">++&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">n&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">l&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">HEAP8&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">r&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">l&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span> &lt;span class="k">catch&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_jsfree&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">r&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">r&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">n&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>解密方法看到前面把地址放到CNTVH5PlayerModule.HEAP8[r + e.byteLength]之后，直播调用 &lt;code>i = CNTVH5PlayerModule._nalplay2(r, e.byteLength, a);&lt;/code> 解密，视频是调用 &lt;code>_vodplay&lt;/code>，实际上调用wasm里面的方法。&lt;/p>
&lt;p>根据文档 &lt;a href="https://www.52pojie.cn/thread-1875225-1-1.html">ts帧加密案例(一)&lt;/a> 我们知道如果直接调用这个方法的话，wasm里面会有很多env import，会针对浏览器很多检查，他第一次调用的时候发现还是有一些花屏，在第二篇文章里 &lt;a href="https://www.52pojie.cn/thread-1882587-1-1.html">ts帧加密案例(二)&lt;/a> 发现是环境没补全。&lt;/p>
&lt;p>但是作者跟踪代码可以绕过这个方法调用，跳过这些检查，这里不清楚作者是如何发现这个内部调用的。&lt;/p>
&lt;p>如果想要分析，可以使用&lt;a href="https://github.com/WebAssembly/wabt">wabt工具&lt;/a>来反编译，可以编译成c或者wat格式。跟踪代码可以看到，直播调用的是func58_tea，和视频调用的func60_tea不一样。&lt;/p>
&lt;p>根据文章我们可以把内部方法暴露出来，wasm是base64格式的文本，可以让AI写一个方法保存为文件&lt;/p>
&lt;p>先转为wat格式&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">wasm2wat xxx.wasm -o xxx.wat
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>修改wat，在导出表里增加两行(搜索export)&lt;/p>
&lt;pre tabindex="0">&lt;code>(export &amp;#34;func58_TEA&amp;#34; (func 58))
(export &amp;#34;func60_TEA&amp;#34; (func 60))
&lt;/code>&lt;/pre>&lt;p>最后再转回wasm，然后再转回base64的格式填回代码里面&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">wat2wasm xxx.wat -o xxx_out.wasm
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h1 id="ts-格式分析">TS 格式分析&lt;/h1>
&lt;p>分析一下 &lt;a href="https://www.52pojie.cn/forum.php?mod=viewthread&amp;amp;tid=1957747&amp;amp;extra=page%3D1&amp;amp;page=1">WEB前端逆向TS PES NALU解密&lt;/a> 文章里面的代码之前，先来简单理解一下TS格式，我也不太懂，根据自己理解描述一下。&lt;/p>
&lt;p>TS每个Frame 188个字节，第一个字节固定是0x47，每个Frame包含Header和数据，里面可能是一些属性数据或者视频流、音频流，我们可以用010Editor来辅助分析。&lt;/p>
&lt;p>在010Editor里面我们可以下载模板，在Templates &amp;gt; Templates Repository 里面下载 TS/H264 的模板，然后再选择Templates &amp;gt; Video &amp;gt; TS 就可以看到解析后的格式了。如果选择H264也可以找到H264的解析。&lt;/p>
&lt;img src="https://fatkun.github.io/img/crack_ts/image-20250728181702806.png" alt="image-20250728181702806" style="zoom: 67%;" />
&lt;p>TSHeader里面有一个PID，表示一个编号，也是一个类型，我们需要根据PID找到哪个是视频流，我们只对视频流解密。文章作者说通过软件看到视频流的PID是0x100，在代码中也做了这个过滤，那这个是怎么看出来的呢？&lt;/p>
&lt;p>可以先找到PAT，PAT是在PID=0的Frame里面，可以找到PMT的PID。&lt;/p>
&lt;img src="https://fatkun.github.io/img/crack_ts/image-20250728182603674.png" alt="image-20250728182603674" style="zoom:67%;" />
&lt;p>如果你的Value不是按16进制显示，可以在标题栏右键，选择Value &amp;gt; Hex。可以看到PMT的PID在0x1001，文件我看是在第二个Frame里面。&lt;/p>
&lt;img src="https://fatkun.github.io/img/crack_ts/image-20250728182859581.png" alt="image-20250728182859581" style="zoom:67%;" />
&lt;p>这里看到PMTElementary有多个，这里是定义stream_type对应的PID是什么，这里第一个stream_type是 0x1B ，这个是h264类型，我们可以看到PID是 0x100。但我实际运行下来，这个一般是0x100，但实际有时候会变的，所以需要动态的读取这个值。原作者是固定使用了这个值，会导致有部分时候花屏。&lt;/p>
&lt;p>然后我们就可以根据前面得到的PID得到视频流，解析里面的NALu。&lt;/p>
&lt;p>回到代码，代码Parse_TS_Packet里面会涉及到一些合并Frame，没了解很多TS结构，我不懂。然后再在这里面找NALu的开头，它是以&lt;code>0x 00 00 01&lt;/code> 或者 &lt;code>0x 00 00 00 01&lt;/code> 开头，FindNalUnitStart方法就是找这些开头。&lt;/p>
&lt;p>但代码里面有种情况没有处理，就是如果payload里面有&lt;code>0x000003&lt;/code> ，需要替换成 &lt;code>0x0000&lt;/code>，它是为了避免分隔符和数据混淆做了替换（H264的 Encapsulated Byte Sequence Payload编码），对数据做了替换。不过这种情况可能很少，偶尔出错一次应该也不太影响。&lt;/p>
&lt;pre tabindex="0">&lt;code>0x000000--&amp;gt;0x00000300
0x000001--&amp;gt;0x00000301
0x000002--&amp;gt;0x00000302
0x000003--&amp;gt;0x00000303
&lt;/code>&lt;/pre>&lt;p>原有代码调用的是FUNC60，是针对视频的，如果是直播，内部调用的是FUNC58，可以断点进入wasm里面看到。&lt;/p>
&lt;p>参考原有js代码实现，另外func58_TEA的参数和原代码有点不一样，可以断点调试对比对应的值是什么，也可以把xx.wat发给AI，让它给你分析，才发现第二个和第三个参数是一样的。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">XOR&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">r&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">i&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">a&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">n&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">Uint8Array&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">r&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_jsmalloc&lt;/span>&lt;span class="p">(&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">1024&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="kd">var&lt;/span> &lt;span class="nx">o&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">o&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">o&lt;/span>&lt;span class="o">++&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">HEAP8&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">r&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">o&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">o&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">i&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">asm&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">func58_TEA&lt;/span>&lt;span class="p">(&lt;/span> &lt;span class="nx">r&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">n&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">Uint8Array&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">i&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="kd">var&lt;/span> &lt;span class="nx">l&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">l&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="nx">n&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byteLength&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">l&lt;/span>&lt;span class="o">++&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">n&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">l&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">HEAP8&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">r&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">l&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span> &lt;span class="k">catch&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;err&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">CNTVH5PlayerModule&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_jsfree&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">r&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">r&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">n&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h1 id="排查问题">排查问题&lt;/h1>
&lt;p>改完这个发现可以直播观看了，但是后台还是时不时会报错，画面有部分花屏。&lt;/p>
&lt;p>这时可以在network找到ts文件的下载，在后面找到调用的js地址，下断点，每次下载ts的时候，我们可以暂停，在解析的地方可以增加一些日志调试，也可以把对应的ts文件下载下来本地分析。&lt;/p>
&lt;p>有一些报错是 &lt;code>RuntimeError: memory access out of bounds&lt;/code> ，解密失败了，发现问题是原代码写死视频的PID是0x100，但实际上还是偶尔有不一样的。&lt;/p>
&lt;p>我们可以从PMT里面找到视频流的PID，让AI帮我写了一些方法。这里吐槽一下qwen3 coder，让它改了好几次才正确。不过对于这个文件位运算的代码，我还真不保证我能写明白，当前AI还是牛的。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;span class="lnt">44
&lt;/span>&lt;span class="lnt">45
&lt;/span>&lt;span class="lnt">46
&lt;/span>&lt;span class="lnt">47
&lt;/span>&lt;span class="lnt">48
&lt;/span>&lt;span class="lnt">49
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">Parse_PAT&lt;/span> &lt;span class="p">(&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">index&lt;/span> &lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// PAT PID is always 0x0000
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">PID&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">((&lt;/span>&lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;amp;&lt;/span> &lt;span class="mh">0x1f&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// console.log(&amp;#34;Parsing PAT at index:&amp;#34;, index, &amp;#34;PID:&amp;#34;, PID.toString(16));
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">PID&lt;/span> &lt;span class="o">!==&lt;/span> &lt;span class="mh">0x0000&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip TS header (4 bytes) + adaptation field (if exists)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">AdaptationFieldControl&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">3&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;amp;&lt;/span> &lt;span class="mh">0x30&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;gt;&amp;gt;&amp;gt;&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">AdaptationFieldControl&lt;/span> &lt;span class="o">===&lt;/span> &lt;span class="mi">2&lt;/span> &lt;span class="o">||&lt;/span> &lt;span class="nx">AdaptationFieldControl&lt;/span> &lt;span class="o">===&lt;/span> &lt;span class="mi">3&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">AdaptationFieldLength&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">1&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">AdaptationFieldLength&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip pointer_field
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">pointer_field&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">1&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">pointer_field&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Check table_id
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">table_id&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// console.log(&amp;#34;PAT table_id:&amp;#34;, table_id);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">table_id&lt;/span> &lt;span class="o">!==&lt;/span> &lt;span class="mh">0x00&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Invalid PAT table_id:&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">table_id&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip table_id
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Get section_length (first 2 bits are reserved)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">section_length&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">((&lt;/span>&lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;amp;&lt;/span> &lt;span class="mh">0x0f&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// console.log(&amp;#34;PAT section_length:&amp;#34;, section_length);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip reserved, version_number, current_next_indicator, section_number, last_section_number
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">5&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Get program_number and PMT PID
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// program_number is 2 bytes
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// PMT PID is in the next 2 bytes (with first 3 bits as reserved)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">program_number&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">pmt_pid&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">((&lt;/span>&lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;amp;&lt;/span> &lt;span class="mh">0x1f&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">3&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// console.log(&amp;#34;PAT program_number:&amp;#34;, program_number, &amp;#34;PMT PID:&amp;#34;, pmt_pid.toString(16));
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">pmt_pid&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;span class="lnt">44
&lt;/span>&lt;span class="lnt">45
&lt;/span>&lt;span class="lnt">46
&lt;/span>&lt;span class="lnt">47
&lt;/span>&lt;span class="lnt">48
&lt;/span>&lt;span class="lnt">49
&lt;/span>&lt;span class="lnt">50
&lt;/span>&lt;span class="lnt">51
&lt;/span>&lt;span class="lnt">52
&lt;/span>&lt;span class="lnt">53
&lt;/span>&lt;span class="lnt">54
&lt;/span>&lt;span class="lnt">55
&lt;/span>&lt;span class="lnt">56
&lt;/span>&lt;span class="lnt">57
&lt;/span>&lt;span class="lnt">58
&lt;/span>&lt;span class="lnt">59
&lt;/span>&lt;span class="lnt">60
&lt;/span>&lt;span class="lnt">61
&lt;/span>&lt;span class="lnt">62
&lt;/span>&lt;span class="lnt">63
&lt;/span>&lt;span class="lnt">64
&lt;/span>&lt;span class="lnt">65
&lt;/span>&lt;span class="lnt">66
&lt;/span>&lt;span class="lnt">67
&lt;/span>&lt;span class="lnt">68
&lt;/span>&lt;span class="lnt">69
&lt;/span>&lt;span class="lnt">70
&lt;/span>&lt;span class="lnt">71
&lt;/span>&lt;span class="lnt">72
&lt;/span>&lt;span class="lnt">73
&lt;/span>&lt;span class="lnt">74
&lt;/span>&lt;span class="lnt">75
&lt;/span>&lt;span class="lnt">76
&lt;/span>&lt;span class="lnt">77
&lt;/span>&lt;span class="lnt">78
&lt;/span>&lt;span class="lnt">79
&lt;/span>&lt;span class="lnt">80
&lt;/span>&lt;span class="lnt">81
&lt;/span>&lt;span class="lnt">82
&lt;/span>&lt;span class="lnt">83
&lt;/span>&lt;span class="lnt">84
&lt;/span>&lt;span class="lnt">85
&lt;/span>&lt;span class="lnt">86
&lt;/span>&lt;span class="lnt">87
&lt;/span>&lt;span class="lnt">88
&lt;/span>&lt;span class="lnt">89
&lt;/span>&lt;span class="lnt">90
&lt;/span>&lt;span class="lnt">91
&lt;/span>&lt;span class="lnt">92
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">Parse_PMT&lt;/span> &lt;span class="p">(&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">index&lt;/span> &lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Parse PMT to find video stream PID
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">PID&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">((&lt;/span>&lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;amp;&lt;/span> &lt;span class="mh">0x1f&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// console.log(&amp;#34;Parsing PMT at index:&amp;#34;, index, &amp;#34;PID:&amp;#34;, PID.toString(16));
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip TS header (4 bytes) + adaptation field (if exists)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">AdaptationFieldControl&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">3&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;amp;&lt;/span> &lt;span class="mh">0x30&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;gt;&amp;gt;&amp;gt;&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">AdaptationFieldControl&lt;/span> &lt;span class="o">===&lt;/span> &lt;span class="mi">2&lt;/span> &lt;span class="o">||&lt;/span> &lt;span class="nx">AdaptationFieldControl&lt;/span> &lt;span class="o">===&lt;/span> &lt;span class="mi">3&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">AdaptationFieldLength&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">1&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">AdaptationFieldLength&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip pointer_field
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">pointer_field&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">1&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">pointer_field&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Check table_id
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">table_id&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// console.log(&amp;#34;PMT table_id:&amp;#34;, table_id);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">table_id&lt;/span> &lt;span class="o">!==&lt;/span> &lt;span class="mh">0x02&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Invalid PMT table_id:&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">table_id&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip table_id
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Get section_length (first 2 bits are reserved)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">section_length&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">((&lt;/span>&lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;amp;&lt;/span> &lt;span class="mh">0x0f&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// console.log(&amp;#34;PMT section_length:&amp;#34;, section_length);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip program_number (2 bytes)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip reserved (2 bits) + version_number (5 bits) + current_next_indicator (1 bit) = 1 byte
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip section_number (1 byte) + last_section_number (1 byte) = 2 bytes
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip reserved (3 bits) + PCR_PID (13 bits) = 2 bytes
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip program_info_length (first 4 bits are reserved)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">program_info_length&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">((&lt;/span>&lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;amp;&lt;/span> &lt;span class="mh">0x0f&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// console.log(&amp;#34;PMT program_info_length:&amp;#34;, program_info_length);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip program descriptors
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="nx">program_info_length&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Parse elementary streams
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">video_pid&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">end_position&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">4&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">section_length&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="c1">// 4 bytes for TS header + section_length
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// console.log(&amp;#34;PMT end_position:&amp;#34;, end_position, &amp;#34;payload_index:&amp;#34;, payload_index);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">while&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="nx">end_position&lt;/span> &lt;span class="o">-&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span> &lt;span class="c1">// -4 to ensure we have enough bytes for stream_type and PID
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// Ensure we have enough bytes for stream_type and PID
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">2&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">length&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Not enough bytes for stream_type and PID&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">break&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">stream_type&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">stream_pid&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">((&lt;/span>&lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;amp;&lt;/span> &lt;span class="mh">0x1f&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// console.log(&amp;#34;Stream type:&amp;#34;, stream_type, &amp;#34;PID:&amp;#34;, stream_pid.toString(16));
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// H.264 stream type is 0x1b
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">stream_type&lt;/span> &lt;span class="o">===&lt;/span> &lt;span class="mh">0x1b&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">video_pid&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">stream_pid&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// console.log(&amp;#34;Found H.264 video stream PID:&amp;#34;, video_pid.toString(16));
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">break&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Check if we have enough bytes for ES_info_length
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">4&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">length&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Not enough bytes for ES_info_length&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">break&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Skip ES_info_length (first 2 bits are reserved)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">let&lt;/span> &lt;span class="nx">es_info_length&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">((&lt;/span>&lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">3&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">&amp;amp;&lt;/span> &lt;span class="mh">0x0f&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="nx">buf&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// console.log(&amp;#34;ES info length:&amp;#34;, es_info_length);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">payload_index&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">5&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">es_info_length&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">video_pid&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>拿到视频PID之后，就可以在里面过滤了。&lt;/p>
&lt;h1 id="总结">总结&lt;/h1>
&lt;p>最终测试下来，虽然还是偶尔有报错，但总体基本可用了。&lt;/p>
&lt;h1 id="参考">参考&lt;/h1>
&lt;p>&lt;a href="https://www.52pojie.cn/forum.php?mod=viewthread&amp;amp;tid=1957747&amp;amp;extra=page%3D1&amp;amp;page=1">WEB前端逆向TS PES NALU解密&lt;/a>&lt;/p>
&lt;p>&lt;a href="https://www.52pojie.cn/thread-1875225-1-1.html">ts帧加密案例(一)&lt;/a>&lt;/p>
&lt;p>&lt;a href="https://www.52pojie.cn/thread-1882587-1-1.html">ts帧加密案例(二)&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>破解Unity游戏联网验证</title><link>https://fatkun.github.io/post/2025/crack_movie_game/</link><guid isPermaLink="true">https://fatkun.github.io/post/2025/crack_movie_game/</guid><pubDate>Sat, 19 Jul 2025 10:55:33 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="说明">说明&lt;/h1>
&lt;p>本文只是用于学习攻防技术，不用于盈利，请勿利用技术用于非法用途。&lt;/p>
&lt;h1 id="背景">背景&lt;/h1>
&lt;p>目前有些游戏会使用联网验证，检查你是否已经购买这个游戏。它会向服务端发起请求，并且返回一些加密串，最终在本地也做一遍加密比较两边结果是否一致。&lt;/p>
&lt;p>对称加密相对容易一些，非对称加密的话你就无法获得服务端的密钥，无法伪造请求。&lt;/p>
&lt;h1 id="一般防逆向措施">一般防逆向措施&lt;/h1>
&lt;ol>
&lt;li>每次请求加上时间戳，防止重放攻击&lt;/li>
&lt;li>校验码，或者对返回值加密，使用某种方式加密&lt;/li>
&lt;li>使用TLS通信，客户端校验证书&lt;/li>
&lt;/ol>
&lt;h1 id="破解过程">破解过程&lt;/h1>
&lt;p>我们知道这个游戏会联网验证，首先想到的是抓包。我用到的工具是Reqable，这个工具抓https比较方便，记得要安装CA证书。&lt;/p>
&lt;p>抓包工具开启系统代理，开启抓包，启动游戏，能看到游戏发起了一个请求，但看不到内容。只看到一个CONNECT的请求，提示SSL客户端错误。这个问题是客户端做了证书校验，由于Reqable这类软件抓取https请求是利用中间人的方式，替换了服务器返回的证书才实现的解密，客户端拿到不是真实的证书，拒绝了请求。当然，有些客户端不做校验是可以抓取到的。&lt;/p>
&lt;h2 id="使用ida-pro-跳过证书验证">使用IDA Pro 跳过证书验证&lt;/h2>
&lt;p>我们得首先解决掉证书校验的问题，才能够抓包查看请求。这时要用到IDA Pro来分析，参考这篇文章处理：&lt;a href="https://web.archive.org/web/20230324165058/https://jev0n.com/2022/01/16/steam-1.html">去除Steam中Unity单机游戏的联网登录验证（Mono&amp;amp;IL2CPP）&lt;/a> 原文已经删除，只能在web archive查看了。&lt;/p>
&lt;p>游戏使用的是IL2CPP，为了查看真实的类名和方法名，先将游戏目录下的GameAssembly.dll（安卓的为libil2cpp.so）和游戏_data\il2cpp_data\Metadata\global-metadata.dat 复制到同一目录。
使用Il2CppDumper工具，生成几个json和il2cpp.h。&lt;/p>
&lt;p>执行命令&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">mkdir ./out
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">Il2CppDumper GameAssembly.dll global-metadata.dat ./out
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>生成的文件有&lt;/p>
&lt;pre tabindex="0">&lt;code>stringliteral.json：所有的字符串
dump.cs：所有类和方法
DummyDll/Assembly-CSharp.dll: 可以用ILSpy查看，也是类和方法
&lt;/code>&lt;/pre>&lt;p>我们用IDA打开DLL文件，然后在 &lt;code>File-&amp;gt;Script file&lt;/code> 选择Il2CppDumper里的ida_with_struct_py3.py，然后载入script.json和il2cpp.h，耐心等待执行完成。如果执行完成后还是很卡，试试关掉functions窗口。&lt;/p>
&lt;p>在做完上面的工作后，寻找蛛丝马迹，看看哪里的代码涉及到登录。&lt;/p>
&lt;p>先从字符串入手，我们之前抓包时知道了会请求哪个域名，然后在字符串列表里刚好看到有一个域名。在IDA里面找到这个域名，在IDA VIEW下按下 &lt;code>Ctrl+F&lt;/code> 可以查找字符串，不过会比较慢。
在stringliteral.json也有字符串&lt;/p>
&lt;pre tabindex="0">&lt;code> {
&amp;#34;value&amp;#34;: &amp;#34;XXX.com&amp;#34;,
&amp;#34;address&amp;#34;: &amp;#34;0x3047F40&amp;#34;
},
&lt;/code>&lt;/pre>&lt;p>忘记在ida怎么跳转到这个地址了，我发现使用G跳转不到，实际地址不一样。&lt;/p>
&lt;p>浏览方法列表看到一个可疑的方法(&lt;code>Youda_MineCertificateHandler__ValidateCertificate&lt;/code>)，可能和证书验证相关。使用IDA按F2下一个断点，开启断点调试。断点调试需要在Debugger选择Local Window应用，在 &lt;code>Debugger-&amp;gt;Process Option&lt;/code> 里面配置exe程序。&lt;/p>
&lt;p>启动调试后，可以看到有进入断点，可以把伪代码/汇编码发给AI，让它来帮我们分析，需要在哪里绕过这个检查。&lt;/p>
&lt;p>一般来说，这个方法返回一个bool类型，在方法开头直接返回true就行，但是担心会漏掉某些逻辑没执行，还是做谨慎一点，可以交给AI分析在哪里处理。&lt;/p>
&lt;p>&lt;img src="https://fatkun.github.io/img/crack_movie_game/image-20250719165403102.png" alt="image-20250719165403102">&lt;/p>
&lt;p>这里我根据AI的提示，把某处的 &lt;code>xor a1,a1&lt;/code> 改成了 &lt;code>mov a1,1&lt;/code>，这里表示给a1赋值为1，也就是返回true。修改指令可以在 &lt;code>Edit-&amp;gt;Patch Program-&amp;gt;Assemble&lt;/code> 修改，改完之后还不会真正在文件中修改，需要在&lt;code>Edit-&amp;gt;Patch Program-&amp;gt;Apply patches to input file&lt;/code> 才真正生效。&lt;/p>
&lt;p>IDA在IDA View界面可以按空格切换两种视图模式，按F5可以看到伪代码。&lt;/p>
&lt;p>改完后，发现抓包软件这时终于可以抓取到具体内容了。&lt;/p>
&lt;h2 id="如何构造返回的请求">如何构造返回的请求？&lt;/h2>
&lt;p>上面抓包返回我没有权限，因为我没有买这个游戏，不过就算我买了这个游戏，抓包的内容直接返回也不行，客户端每次发起的请求都带有一个随机值，每次返回的sign不一样。&lt;/p>
&lt;p>如何找到处理登录请求的代码呢？我看到请求是Post请求，同时看到一个类和请求相关，找到一些Post方法，断点调试了一下，果然找对方法了。我是如何判断我找对方法的？我是从传入的参数判断的。&lt;/p>
&lt;p>在IDA的寄存器里面存储着参数，对于Windows 64位程序，使用以下寄存器存储&lt;/p>
&lt;pre tabindex="0">&lt;code>RCX: 第一个参数
RDX: 第二个参数
R8: 第三个参数
R9: 第四个参数
&lt;/code>&lt;/pre>&lt;p>有一些参数是字符串，是一个指针，但是我对IDA还是不太了解，实际指向的地址不是字符串的开头，可能有一些头吧，要往下拉一下。如果字符串显示成一列不好看，可以选择第一个字符，在 &lt;code>Edit-&amp;gt;Strings-&amp;gt;Unicode&lt;/code> ，这样会好看很多。&lt;/p>
&lt;p>随意在代码漫游，断点跟踪代码，但是汇编代码实在太难看了，跟踪代码下去看到和lua的交互，但是实在不知道怎么才能看到处理的代码。想着能不能在IDA中找到实际的lua代码，但是不熟悉，还是没找到。&lt;/p>
&lt;h2 id="寻找lua代码">寻找LUA代码&lt;/h2>
&lt;p>在调试的过程中，看到一个luapath，这个可能是存储lua的路径吧，在文件中找到一个xxx.ab文件，这个看起来是Unity的AssetBundle，尝试使用AssetStudio工具解包，发现没用，我就知道没那么简单，肯定做了什么加密。偶然尝试用vscode打开这个ab文件，发现开头有个特征码 &lt;code>YoudaFS&lt;/code> ，搜索一下，果然有惊喜，&lt;a href="https://bbs.kanxue.com/thread-279685.htm">别人已经解密&lt;/a>出来了，我把代码贴在下面。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt"> 10
&lt;/span>&lt;span class="lnt"> 11
&lt;/span>&lt;span class="lnt"> 12
&lt;/span>&lt;span class="lnt"> 13
&lt;/span>&lt;span class="lnt"> 14
&lt;/span>&lt;span class="lnt"> 15
&lt;/span>&lt;span class="lnt"> 16
&lt;/span>&lt;span class="lnt"> 17
&lt;/span>&lt;span class="lnt"> 18
&lt;/span>&lt;span class="lnt"> 19
&lt;/span>&lt;span class="lnt"> 20
&lt;/span>&lt;span class="lnt"> 21
&lt;/span>&lt;span class="lnt"> 22
&lt;/span>&lt;span class="lnt"> 23
&lt;/span>&lt;span class="lnt"> 24
&lt;/span>&lt;span class="lnt"> 25
&lt;/span>&lt;span class="lnt"> 26
&lt;/span>&lt;span class="lnt"> 27
&lt;/span>&lt;span class="lnt"> 28
&lt;/span>&lt;span class="lnt"> 29
&lt;/span>&lt;span class="lnt"> 30
&lt;/span>&lt;span class="lnt"> 31
&lt;/span>&lt;span class="lnt"> 32
&lt;/span>&lt;span class="lnt"> 33
&lt;/span>&lt;span class="lnt"> 34
&lt;/span>&lt;span class="lnt"> 35
&lt;/span>&lt;span class="lnt"> 36
&lt;/span>&lt;span class="lnt"> 37
&lt;/span>&lt;span class="lnt"> 38
&lt;/span>&lt;span class="lnt"> 39
&lt;/span>&lt;span class="lnt"> 40
&lt;/span>&lt;span class="lnt"> 41
&lt;/span>&lt;span class="lnt"> 42
&lt;/span>&lt;span class="lnt"> 43
&lt;/span>&lt;span class="lnt"> 44
&lt;/span>&lt;span class="lnt"> 45
&lt;/span>&lt;span class="lnt"> 46
&lt;/span>&lt;span class="lnt"> 47
&lt;/span>&lt;span class="lnt"> 48
&lt;/span>&lt;span class="lnt"> 49
&lt;/span>&lt;span class="lnt"> 50
&lt;/span>&lt;span class="lnt"> 51
&lt;/span>&lt;span class="lnt"> 52
&lt;/span>&lt;span class="lnt"> 53
&lt;/span>&lt;span class="lnt"> 54
&lt;/span>&lt;span class="lnt"> 55
&lt;/span>&lt;span class="lnt"> 56
&lt;/span>&lt;span class="lnt"> 57
&lt;/span>&lt;span class="lnt"> 58
&lt;/span>&lt;span class="lnt"> 59
&lt;/span>&lt;span class="lnt"> 60
&lt;/span>&lt;span class="lnt"> 61
&lt;/span>&lt;span class="lnt"> 62
&lt;/span>&lt;span class="lnt"> 63
&lt;/span>&lt;span class="lnt"> 64
&lt;/span>&lt;span class="lnt"> 65
&lt;/span>&lt;span class="lnt"> 66
&lt;/span>&lt;span class="lnt"> 67
&lt;/span>&lt;span class="lnt"> 68
&lt;/span>&lt;span class="lnt"> 69
&lt;/span>&lt;span class="lnt"> 70
&lt;/span>&lt;span class="lnt"> 71
&lt;/span>&lt;span class="lnt"> 72
&lt;/span>&lt;span class="lnt"> 73
&lt;/span>&lt;span class="lnt"> 74
&lt;/span>&lt;span class="lnt"> 75
&lt;/span>&lt;span class="lnt"> 76
&lt;/span>&lt;span class="lnt"> 77
&lt;/span>&lt;span class="lnt"> 78
&lt;/span>&lt;span class="lnt"> 79
&lt;/span>&lt;span class="lnt"> 80
&lt;/span>&lt;span class="lnt"> 81
&lt;/span>&lt;span class="lnt"> 82
&lt;/span>&lt;span class="lnt"> 83
&lt;/span>&lt;span class="lnt"> 84
&lt;/span>&lt;span class="lnt"> 85
&lt;/span>&lt;span class="lnt"> 86
&lt;/span>&lt;span class="lnt"> 87
&lt;/span>&lt;span class="lnt"> 88
&lt;/span>&lt;span class="lnt"> 89
&lt;/span>&lt;span class="lnt"> 90
&lt;/span>&lt;span class="lnt"> 91
&lt;/span>&lt;span class="lnt"> 92
&lt;/span>&lt;span class="lnt"> 93
&lt;/span>&lt;span class="lnt"> 94
&lt;/span>&lt;span class="lnt"> 95
&lt;/span>&lt;span class="lnt"> 96
&lt;/span>&lt;span class="lnt"> 97
&lt;/span>&lt;span class="lnt"> 98
&lt;/span>&lt;span class="lnt"> 99
&lt;/span>&lt;span class="lnt">100
&lt;/span>&lt;span class="lnt">101
&lt;/span>&lt;span class="lnt">102
&lt;/span>&lt;span class="lnt">103
&lt;/span>&lt;span class="lnt">104
&lt;/span>&lt;span class="lnt">105
&lt;/span>&lt;span class="lnt">106
&lt;/span>&lt;span class="lnt">107
&lt;/span>&lt;span class="lnt">108
&lt;/span>&lt;span class="lnt">109
&lt;/span>&lt;span class="lnt">110
&lt;/span>&lt;span class="lnt">111
&lt;/span>&lt;span class="lnt">112
&lt;/span>&lt;span class="lnt">113
&lt;/span>&lt;span class="lnt">114
&lt;/span>&lt;span class="lnt">115
&lt;/span>&lt;span class="lnt">116
&lt;/span>&lt;span class="lnt">117
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">os&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">subprocess&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kn">from&lt;/span> &lt;span class="nn">hashlib&lt;/span> &lt;span class="kn">import&lt;/span> &lt;span class="n">md5&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">decompile_lua&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">input_file&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">output_file&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">command&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;java&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;-jar&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;unluac.jar&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">input_file&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;&amp;gt;&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">output_file&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">subprocess&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">run&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">command&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">shell&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="kc">True&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">stderr&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="n">subprocess&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">PIPE&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">text&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="kc">True&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">decode_lua&lt;/span>&lt;span class="p">():&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">root&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">dirs&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">files&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">walk&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">r&lt;/span>&lt;span class="s1">&amp;#39;D:\cr\test\TextAsset&amp;#39;&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">file&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">files&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_path&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">path&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">join&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">root&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">file&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_name&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">ext&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">path&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">splitext&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">out_file&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">path&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">join&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">r&lt;/span>&lt;span class="s1">&amp;#39;D:\cr\test\TextAsset\lua&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">file_name&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">with&lt;/span> &lt;span class="nb">open&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;rb+&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">as&lt;/span> &lt;span class="n">f&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">data&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">bytearray&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">f&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">read&lt;/span>&lt;span class="p">())&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">data&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">5&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">data&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">5&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">data&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">insert&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">12&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">f&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">seek&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">f&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">write&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">data&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">decompile_lua&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">out_file&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">decode_unity&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">file_bytes&lt;/span> &lt;span class="ow">is&lt;/span> &lt;span class="kc">None&lt;/span> &lt;span class="ow">or&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="mi">7&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">file_bytes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">file_bytes&lt;/span>&lt;span class="p">[:&lt;/span>&lt;span class="mi">7&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="sa">b&lt;/span>&lt;span class="s2">&amp;#34;YoudaFS&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_bytes&lt;/span>&lt;span class="p">[:&lt;/span>&lt;span class="mi">7&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sa">b&lt;/span>&lt;span class="s2">&amp;#34;UnityFS&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">decode_len&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">37&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">max_length&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">max_length&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="n">decode_len&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">decode_len&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">max_length&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">i&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="nb">range&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">7&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">decode_len&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_bytes&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="n">i&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">^=&lt;/span> &lt;span class="mi">9&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">file_bytes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">decode_full&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">file_bytes&lt;/span> &lt;span class="ow">and&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="ow">not&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">file_bytes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">file_bytes&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;=&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">file_bytes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">file_bytes&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="mi">65&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">max_length&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">v3&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">2&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">max_length&lt;/span> &lt;span class="o">&amp;gt;&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">while&lt;/span> &lt;span class="n">v3&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_bytes&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="n">v3&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">^=&lt;/span> &lt;span class="mi">9&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">v3&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">break&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">v4&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">v3&lt;/span> &lt;span class="o">-&lt;/span> &lt;span class="mi">2&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">v4&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">break&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">v5&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">v3&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_bytes&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="n">v4&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">file_bytes&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="n">v5&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">v3&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="mi">1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">max_length&lt;/span> &lt;span class="o">-&lt;/span> &lt;span class="mi">1&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">file_bytes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_bytes&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="n">max_length&lt;/span> &lt;span class="o">-&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">10&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">max_length&lt;/span> &lt;span class="o">-&lt;/span> &lt;span class="mi">2&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="nb">len&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">file_bytes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_bytes&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="n">max_length&lt;/span> &lt;span class="o">-&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">10&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">file_bytes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">de_ab&lt;/span>&lt;span class="p">():&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">root&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">dirs&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">files&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">walk&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">r&lt;/span>&lt;span class="s1">&amp;#39;D:\cr\test&amp;#39;&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">file&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">files&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_path&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">path&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">join&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">root&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">file&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">with&lt;/span> &lt;span class="nb">open&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;rb+&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">as&lt;/span> &lt;span class="n">f&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_bytes&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">bytearray&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">f&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">read&lt;/span>&lt;span class="p">())&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">decoded_bytes&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">decode_unity&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">f&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">seek&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">f&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">write&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">decoded_bytes&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">de_allfile&lt;/span>&lt;span class="p">():&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">root&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">dirs&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">files&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">walk&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">r&lt;/span>&lt;span class="s1">&amp;#39;D:\cr\test\Datas&amp;#39;&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">file&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">files&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_path&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">path&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">join&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">root&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">file&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">with&lt;/span> &lt;span class="nb">open&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;rb+&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">as&lt;/span> &lt;span class="n">f&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">file_bytes&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nb">bytearray&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">f&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">read&lt;/span>&lt;span class="p">())&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">decoded_bytes&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">decode_full&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">file_bytes&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">f&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">seek&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">f&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">write&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">decoded_bytes&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">renname&lt;/span>&lt;span class="p">():&lt;/span> &lt;span class="c1"># 重命名字幕 重命名webm算法一样自行处理&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">root&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="sa">r&lt;/span>&lt;span class="s1">&amp;#39;D:\cr\test\zh-CN&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="n">i&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="nb">range&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">1001&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">3001&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">video_name&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s1">&amp;#39;youdakejiyjtv_&lt;/span>&lt;span class="si">%d&lt;/span>&lt;span class="s1">&amp;#39;&lt;/span> &lt;span class="o">%&lt;/span> &lt;span class="n">i&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">m&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">md5&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">m&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">update&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">video_name&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">encode&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;utf8&amp;#39;&lt;/span>&lt;span class="p">))&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">sign&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">m&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">hexdigest&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">video_name&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">sign&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">webmfile&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">path&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">join&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">root&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">sign&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s1">&amp;#39;.srt&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">path&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">exists&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">webmfile&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">newfile&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">path&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">join&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">root&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;tv_&lt;/span>&lt;span class="si">%d&lt;/span>&lt;span class="s1">.srt&amp;#39;&lt;/span> &lt;span class="o">%&lt;/span> &lt;span class="n">i&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">os&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">rename&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">webmfile&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">newfile&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">webmfile&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">newfile&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 原始webm、mp3、ab 调用函数 de_ab() 解密后用 AssetStudio导即可&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 其它的文件都是调用de_allfile()解即可&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 导出的lua只是简单的抽掉字节 补上后用现成的unluac解&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 为了更方便播放顺序重命名文件是必要的&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">if&lt;/span> &lt;span class="vm">__name__&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="s2">&amp;#34;__main__&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># de_ab()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">de_allfile&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>如果是我自己找，估计还不一定能找到解密的方法，估计要看汇编里怎么读取哪个文件解包的，才能写出上面的代码。使用上面的代码调用函数 de_ab() 解密后用 AssetStudio导出文件，然后再用上面的代码对lua解密。看起来没那么复杂的加密，但是如果让我自己搞，估计还不一定能找到这些解密方法，需要找到ab文件的加载过程，然后lua文件读取过程的汇编代码位置，我自己跟踪代码只找到执行回调的地方 &lt;code>XLua_DelegateBridge____Gen_Delegate_Imp6&lt;/code>。&lt;/p>
&lt;p>&lt;img src="https://fatkun.github.io/img/crack_movie_game/image-20250719172732303.png" alt="image-20250719172732303">&lt;/p>
&lt;p>拿到所有的lua代码就好办了，看了一下代码，简直明文啊，参数命名什么的都很好。搜索一些请求地址，找到登录的代码。刚开始想着能不能把lua代码改了，然后塞回去，发现没我想的那么简单，不知道怎么把lua塞回去，重新封装为ab文件。&lt;/p>
&lt;p>那还是老老实实的看代码是如何验证的，实际上代码很清晰，每次登录请求会发送一个随机字符串，要求服务端也返回这个字符串，如果不一致就报错。要求返回一个sign字段，这是验证的重点。逻辑就是按字段排序，加上一些字符串做md5。&lt;/p>
&lt;p>到了最终验证成果了，在本地用python实现一个https服务，修改hosts文件，把域名指向本地。开启游戏测试，我擦，验证失败！！！再回去看代码，发现从代码看是lua代码调用了unity的UtilTool__MD5ForPHP方法，可以回到IDA看看具体实现，用AI使用python改写一个，和python默认的md5好像有点不太一样。&lt;/p>
&lt;p>再来试一次，发现还是签名失败，这种签名非常烦，也不太好调试是输入内容的问题，还是哪里的问题。最后还是仔细检查代码，发现我用了请求的参数签名了，实际应该用返回的内容做签名的，自己傻逼了。完成后，最终能够顺利进入游戏，当然，进入后游戏马上退出了，从抓包工具看还有其他的请求没实现，这些都比较简单，找到代码就按照要求的字段实现服务端就行了。最终能够成功的游玩游戏。&lt;/p>
&lt;h1 id="总结">总结&lt;/h1>
&lt;p>破解游戏联网验证主要的难点是在如何找到代码位置，一般都是通过字符串查询找到相应的位置，但很多时候，你不一定能找到字符串，有可能字符串加密了，或者在某个文件里面。&lt;/p>
&lt;p>其次是代码方法没有混淆，容易根据方法名猜测代码用途，不清楚Unity有没有混淆代码方法名的工具。&lt;/p>
&lt;p>这次的破解也是运气好，别人把主要的lua解包逻辑实现了，不然我自己还不好找到这个解包逻辑。而且这lua代码居然也没做混淆，只是做了一点简单的文件插值。有了lua代码之后如入无人之地。&lt;/p>
&lt;p>我自己对IDA只是第一次用，通过汇编来看代码果然没那么简单，里面的栈调用理解也不是很足，这次能破解只能说运气好，也学习了一些防破解的知识，代码最好还是做一些混淆，至少能够阻碍一点点时间，但对于大神来说，里面的字节偏移这些小把戏，在IDA面前简直是脱裤子放屁，如果找对了位置，这些实现用途不是很大。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category></item><item><title>avahi服务发现</title><link>https://fatkun.github.io/post/2025/avahi/</link><guid isPermaLink="true">https://fatkun.github.io/post/2025/avahi/</guid><pubDate>Mon, 26 May 2025 10:55:33 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="背景">背景&lt;/h2>
&lt;p>之前使用OMV，由于安装到U盘，U盘损坏，尝试使用飞牛os。但是在使用VRTV的时候，发现只能使用SMB，SMB在快进的时候，总是停顿几秒，很不爽，只有用FTP才能不停顿。
但是OMV是怎么让VRTV发现的，尝试OMV就算改了端口也一样能被发现，一定是有什么东西在广播。问了AI之后，发现是使用了avahi，可以在飞牛OS上安装。&lt;/p>
&lt;h2 id="安装">安装&lt;/h2>
&lt;p>以下命令需要在root账号执行&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">apt install avahi-daemon avahi-utils
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>新增配置文件 /etc/avahi/services/smb.service&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-xml" data-lang="xml">&lt;span class="line">&lt;span class="cl">&lt;span class="cp">&amp;lt;!DOCTYPE service-group SYSTEM &amp;#34;avahi-service.dtd&amp;#34;&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nt">&amp;lt;service-group&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;name&lt;/span> &lt;span class="na">replace-wildcards=&lt;/span>&lt;span class="s">&amp;#34;yes&amp;#34;&lt;/span>&lt;span class="nt">&amp;gt;&lt;/span>%h(SMB)&lt;span class="nt">&amp;lt;/name&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;service&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;type&amp;gt;&lt;/span>_device-info._tcp&lt;span class="nt">&amp;lt;/type&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;txt-record&amp;gt;&lt;/span>model=Xserve&lt;span class="nt">&amp;lt;/txt-record&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;/service&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;service&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;type&amp;gt;&lt;/span>_smb._tcp&lt;span class="nt">&amp;lt;/type&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;port&amp;gt;&lt;/span>445&lt;span class="nt">&amp;lt;/port&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;/service&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nt">&amp;lt;/service-group&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>重启和开机启动&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">systemctl restart avahi
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">systemctl &lt;span class="nb">enable&lt;/span> avahi
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>停止原来的nmbd&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">systemctl stop nmbd
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">systemctl disable nmbd
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>avahi-tools 软件包包括许多方便的实用程序，可用于检查系统上的 mDNS 服务的工作情况。比如：&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 查看局域网内所有已注册的 mDNS 服务&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">$ avahi-browse -a -r
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="绑定local域名">绑定.local域名&lt;/h2>
&lt;p>在 /etc/avahi/hosts 目录添加域名&lt;/p>
&lt;pre tabindex="0">&lt;code>10.0.0.210 xxx.local
&lt;/code>&lt;/pre>&lt;p>修改完后重启&lt;/p>
&lt;pre tabindex="0">&lt;code>sudo systemctl restart avahi
# 查看日志
sudo systemctl status avahi
sudo journalctl -u avahi
&lt;/code>&lt;/pre>&lt;p>如果IP重复，日志里面会报错误，貌似一个IP只能配置一个域名。
mdns在windows可以解析，但是在安卓我解析不了。&lt;/p>
&lt;h2 id="匿名ftp">匿名FTP&lt;/h2>
&lt;p>为了使用匿名用户登录FTP，我安装了proftpd，匿名用户会使用ftp账户的目录。&lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="https://www.hi-linux.com/posts/45401.html">如何使用 Avahi 在局域网轻松发现你的系统服务&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/nas/">Nas</category><category domain="https://fatkun.github.io/tags/nas/">Nas</category></item><item><title>在debian安装proftpd，配置匿名用户和虚拟路径</title><link>https://fatkun.github.io/post/2025/proftpd/</link><guid isPermaLink="true">https://fatkun.github.io/post/2025/proftpd/</guid><pubDate>Mon, 26 May 2025 10:55:33 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="安装">安装&lt;/h2>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">apt install proftpd
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">apt install proftpd-mod-vroot
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">useradd -md /var/ftp ftp
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="修改配置">修改配置&lt;/h2>
&lt;p>配置目录在/etc/proftpd&lt;/p>
&lt;p>修改 /etc/proftpd/proftpd.conf，去掉下面这句的#号。&lt;/p>
&lt;pre tabindex="0">&lt;code>DefaultRoot ~
Include /etc/proftpd/virtuals.conf
# 解决登录慢
UseReverseDNS off
&lt;/code>&lt;/pre>&lt;p>在/etc/proftpd/virtuals.conf增加配置
VRootAlias的写法 &lt;code>VRootAlias 原路径 虚拟路径&lt;/code>&lt;/p>
&lt;pre tabindex="0">&lt;code># 加载模块
LoadModule mod_vroot.c
&amp;lt;IfModule mod_vroot.c&amp;gt;
VRootEngine on
VRootAlias /vol00/xxxx n8t
&amp;lt;/IfModule&amp;gt;
&lt;/code>&lt;/pre>&lt;h2 id="权限问题">权限问题&lt;/h2>
&lt;p>如果权限后面还有个+号，表示用了acl，需要使用getfacl查看&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 查看acl&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">getfacl vol1
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 移除所有的acl&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">setfacl -R -b vol1
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">chown -R admin:Users vol1
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">chmod -R &lt;span class="m">751&lt;/span> vol1
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description><category domain="https://fatkun.github.io/categories/nas/">Nas</category><category domain="https://fatkun.github.io/tags/nas/">Nas</category></item><item><title>JS逆向之JsRpc</title><link>https://fatkun.github.io/post/2025/reverse_jsrpc/</link><guid isPermaLink="true">https://fatkun.github.io/post/2025/reverse_jsrpc/</guid><pubDate>Tue, 18 Mar 2025 10:55:33 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="概要">概要&lt;/h1>
&lt;p>最近在学习补环境，补到哭，学艺不精，虽然代码没报错，但是就是得不到想要的结果，肯定是哪里环境没补到位。
焦头烂额，灰心丧气中发现JsRpc这个东西。&lt;/p>
&lt;h1 id="什么是jsrpc">什么是JsRpc&lt;/h1>
&lt;p>JsRpc是指在控制台新建一个WebScoket客户端链接到服务器通信，服务端可以发送命令在浏览器执行js代码。这样就天然不需要补环境，因为本身就在浏览器下运行。
适用场景：&lt;/p>
&lt;ul>
&lt;li>允许使用浏览器&lt;/li>
&lt;li>能找到加密方法如何执行&lt;/li>
&lt;/ul>
&lt;h1 id="回到具体场景">回到具体场景&lt;/h1>
&lt;p>我测试的是一个小程序，同时也有一个APP。小程序代码可以使用网上的工具解包还原，但是里面只找到一些加密和解密的逻辑，它还做了防重放处理。它会在url加上一个参数，每隔一段时间只能访问一次。
转而去分析APP应用，发现APP有两种请求，一种是不带参数的，一种的带参数的。不带参数的header里额外加了参数，跟踪代码发现通过native方法来加密，触发知识盲区，放弃跟踪，而且没带参数的请求类型不多。这个APP更像是一个webview，把小程序的代码放进来了。话说回来，好像也有通过RPC调用的方式，执行某些方法来调用so。
偶尔通过抓包发现有部分网址可以在浏览器访问，这真的是帮了大忙。可以使用控制台看输出了，并且可以单点调试。&lt;/p>
&lt;p>首先遇到的第一个问题是js代码防断点，里面有非常多的debugger，不过chrome浏览器可以一键把所有忽略匿名方法里的debugger，直接就跳过了。
我测试的这个网页非常像瑞数，代码类似，验证的环境也比较像，但是和网上的又不一样，只请求一次，只设置一次cookies。回到代码本身，我要找到什么时候在请求的时候，增加了校验参数。代码使用了axios来请求，我在它的拦截器里面打死找不到哪里改了url。分析axios实际是使用XMLHttpRequest来请求的，在XMLHttpRequest.open可以对URL做出修改。
尝试把关键代码提取出来，构造一个XMLHttpRequest请求，发现主要逻辑在混淆代码上，有两个js，第一段js只是设置一些值，第二段js是真正的逻辑，里面有非常多的浏览器环境检测，以及我们想要的添加token代码。
尝试把两段代码都保存到本地，发现执行会报错，可能对时间还是什么做了校验，只好第一段保存，第二段还是从网络获取了。我在补环境的时候，使用nodejs也是动态加载的。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kr">async&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="nx">downloadAndExecute&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">url&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">response&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kr">await&lt;/span> &lt;span class="nx">fetch&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">url&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kr">const&lt;/span> &lt;span class="nx">code&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kr">await&lt;/span> &lt;span class="nx">response&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">text&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">window&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">fetch&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="nx">fetch&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nb">eval&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">code&lt;/span>&lt;span class="p">);&lt;/span> &lt;span class="c1">// 不推荐，因为 eval 有安全隐患
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>上面代码只是补环境需要，使用JsRpc不需要用到。
尝试hook XMLHttpRequest.open方法&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">// 保存原始的 XMLHttpRequest 对象
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="kr">const&lt;/span> &lt;span class="nx">originalOpen&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">XMLHttpRequest&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">prototype&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">open&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">// 覆盖 open 方法
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="nx">XMLHttpRequest&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">prototype&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">open&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kd">function&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">method&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">url&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="kr">async&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">user&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">password&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// 在这里添加你的自定义逻辑
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;自定义逻辑：&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">method&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">url&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_url&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">url&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// 调用原始的 open 方法
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">return&lt;/span> &lt;span class="nx">originalOpen&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">apply&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">arguments&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>但是发现加了之后，就不增加加密参数了。之前在做断点调试分析时发现有用到toString，有用正则表达式判断是否是native方法。所以还得还原toString()，欺骗它还是native方法。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;span class="lnt">8
&lt;/span>&lt;span class="lnt">9
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">// 修改 toString 方法以模仿原生方法的行为
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="nb">Object&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">defineProperty&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">XMLHttpRequest&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">prototype&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">open&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;toString&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">value&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="s1">&amp;#39;function open() { [native code] }&amp;#39;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">writable&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">enumerable&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">configurable&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kc">true&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>果然，改了之后又正常了。能够正常调用之后，JsRpc就可以进场了。理论上在原来网页上也可以做的，不用抽取代码。只是当时提取了，就用提取的代码操作了，构造一个方法方便我获取加参数的URL。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;span class="lnt">8
&lt;/span>&lt;span class="lnt">9
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">enc&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">url&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">xhr&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">XMLHttpRequest&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">//console.log(url)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">xhr&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">open&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;POST&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">url&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="kc">true&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">url&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">xhr&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_url&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">cookies&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nb">document&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">cookie&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>由于xhr.open之后无法获取它的url，我在前面覆盖了open方法，设置url后保存在_url上，后面就可以用xhr._url获取到最终的url。注意前面代码覆盖的时机，我是先覆盖，然后再加载加密方法，里面会再覆盖一次xhr.open方法，这样我们覆盖的方法就能拿到加密后的url。&lt;/p>
&lt;p>增加额外方法之后，就可以使用JsRpc了，很简单，可以看首页上的说明。
主要步骤有：&lt;/p>
&lt;ol>
&lt;li>下载程序和config.yaml，运行起来&lt;/li>
&lt;li>在控制台填入JsEnv_Dev.js的代码&lt;/li>
&lt;li>连接你的程序，然后可以注册一个方法调用你自己的方法&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">var&lt;/span> &lt;span class="nx">demo&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">Hlclient&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;ws://127.0.0.1:12080/ws?group=zzz&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">demo&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">regAction&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;enc&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">resolve&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">param&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">//这样添加了一个param参数，http接口带上它，这里就能获得
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">var&lt;/span> &lt;span class="nx">value&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">enc&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">param&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">resolve&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">value&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;ol start="4">
&lt;li>最后浏览器尝试调用一下就完成了&lt;/li>
&lt;/ol>
&lt;pre tabindex="0">&lt;code>http://127.0.0.1:12080/go?group=zzz&amp;amp;action=enc&amp;amp;param=https://xxx.com/xxx
&lt;/code>&lt;/pre>&lt;h1 id="总结">总结&lt;/h1>
&lt;p>使用JsRpc真的非常省时间，你只要能够找到调用入口就行了，浏览器原生环境，不需要补环境。缺点当然是要求浏览器运行，而且现在我有些是手工操作，不能自动运行，WebSocket也可能被针对，但是对于当前我的用途已经足够了。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>nextjs v15.x独立部署</title><link>https://fatkun.github.io/post/2024/nextjs_standalone_deploy/</link><guid isPermaLink="true">https://fatkun.github.io/post/2024/nextjs_standalone_deploy/</guid><pubDate>Sun, 22 Dec 2024 12:30:46 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="概要">概要&lt;/h1>
&lt;p>官方的&lt;a href="https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile">部署文档&lt;/a>告诉我们用&lt;code>npm run build&lt;/code>和&lt;code>npm run start&lt;/code>启动，但是有时在服务器上不想安装一个很大的node_modules，在我开发环境都有1G左右了，所以要看怎么减少部署大小。&lt;/p>
&lt;p>官方还有种方案是Docker部署，可以看&lt;a href="https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile">Dockerfile&lt;/a>它是怎么构建的。&lt;/p>
&lt;h1 id="步骤">步骤&lt;/h1>
&lt;p>默认使用 &lt;code>yarn run build&lt;/code>，在.next目录下是没有standalone这个目录的。需要参考&lt;a href="https://nextjs.org/docs/pages/api-reference/config/next-config-js/output">这个文档&lt;/a>的步骤做一个配置。&lt;/p>
&lt;p>我使用mantine模板，我的配置文件为next.config.mjs，如果你的不同，可以参考文档的。&lt;/p>
&lt;pre tabindex="0">&lt;code>export default withBundleAnalyzer({
... 省略代码，加上以下这一行代码
output: &amp;#39;standalone&amp;#39;,
});
&lt;/code>&lt;/pre>&lt;p>加上配置之后，就可以执行&lt;code>yarn run build&lt;/code>构建项目，构建完成后，需要把这几个目录拷贝一下，这里我用linux命令来表示拷贝过程。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">cp .next/standalone/* ./tmp/
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">cp .next/static ./tmp/.next/
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">cp public ./tmp/
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>如果你有环境配置，也需要拷贝进来，例如&lt;code>.env.local&lt;/code>文件&lt;/p>
&lt;p>拷贝完成之后，可以执行以下命令启动&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">node server.js
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description><category domain="https://fatkun.github.io/categories/%E5%89%8D%E7%AB%AF/">前端</category><category domain="https://fatkun.github.io/tags/%E5%89%8D%E7%AB%AF/">前端</category><category domain="https://fatkun.github.io/tags/nextjs/">Nextjs</category><category domain="https://fatkun.github.io/tags/react/">React</category></item><item><title>frida Hook一个类下的所有方法</title><link>https://fatkun.github.io/post/2024/frida_hook_all_methods/</link><guid isPermaLink="true">https://fatkun.github.io/post/2024/frida_hook_all_methods/</guid><pubDate>Sat, 30 Nov 2024 14:51:54 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>代码来自于&lt;a href="https://github.com/hluwa/ZenTracer/blob/master/trace.js">ZenTracer&lt;/a>这个项目，获取类的地方做了修改。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;span class="lnt">44
&lt;/span>&lt;span class="lnt">45
&lt;/span>&lt;span class="lnt">46
&lt;/span>&lt;span class="lnt">47
&lt;/span>&lt;span class="lnt">48
&lt;/span>&lt;span class="lnt">49
&lt;/span>&lt;span class="lnt">50
&lt;/span>&lt;span class="lnt">51
&lt;/span>&lt;span class="lnt">52
&lt;/span>&lt;span class="lnt">53
&lt;/span>&lt;span class="lnt">54
&lt;/span>&lt;span class="lnt">55
&lt;/span>&lt;span class="lnt">56
&lt;/span>&lt;span class="lnt">57
&lt;/span>&lt;span class="lnt">58
&lt;/span>&lt;span class="lnt">59
&lt;/span>&lt;span class="lnt">60
&lt;/span>&lt;span class="lnt">61
&lt;/span>&lt;span class="lnt">62
&lt;/span>&lt;span class="lnt">63
&lt;/span>&lt;span class="lnt">64
&lt;/span>&lt;span class="lnt">65
&lt;/span>&lt;span class="lnt">66
&lt;/span>&lt;span class="lnt">67
&lt;/span>&lt;span class="lnt">68
&lt;/span>&lt;span class="lnt">69
&lt;/span>&lt;span class="lnt">70
&lt;/span>&lt;span class="lnt">71
&lt;/span>&lt;span class="lnt">72
&lt;/span>&lt;span class="lnt">73
&lt;/span>&lt;span class="lnt">74
&lt;/span>&lt;span class="lnt">75
&lt;/span>&lt;span class="lnt">76
&lt;/span>&lt;span class="lnt">77
&lt;/span>&lt;span class="lnt">78
&lt;/span>&lt;span class="lnt">79
&lt;/span>&lt;span class="lnt">80
&lt;/span>&lt;span class="lnt">81
&lt;/span>&lt;span class="lnt">82
&lt;/span>&lt;span class="lnt">83
&lt;/span>&lt;span class="lnt">84
&lt;/span>&lt;span class="lnt">85
&lt;/span>&lt;span class="lnt">86
&lt;/span>&lt;span class="lnt">87
&lt;/span>&lt;span class="lnt">88
&lt;/span>&lt;span class="lnt">89
&lt;/span>&lt;span class="lnt">90
&lt;/span>&lt;span class="lnt">91
&lt;/span>&lt;span class="lnt">92
&lt;/span>&lt;span class="lnt">93
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">text&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">packet&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s1">&amp;#39;cmd&amp;#39;&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s1">&amp;#39;log&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s1">&amp;#39;data&amp;#39;&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">text&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">send&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;ZenTracer:::&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">JSON&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">stringify&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">packet&lt;/span>&lt;span class="p">))&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">enter&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">tid&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">tname&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">cls&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">method&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">args&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">packet&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s1">&amp;#39;cmd&amp;#39;&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s1">&amp;#39;enter&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s1">&amp;#39;data&amp;#39;&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="nx">tid&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">tname&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">cls&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">method&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">args&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">send&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;ZenTracer:::&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">JSON&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">stringify&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">packet&lt;/span>&lt;span class="p">))&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">exit&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">tid&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">retval&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">packet&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s1">&amp;#39;cmd&amp;#39;&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s1">&amp;#39;exit&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s1">&amp;#39;data&amp;#39;&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="nx">tid&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">retval&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">send&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;ZenTracer:::&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">JSON&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">stringify&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">packet&lt;/span>&lt;span class="p">))&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">getTid&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">Thread&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">use&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;java.lang.Thread&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">Thread&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">currentThread&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="nx">getId&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">getTName&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">Thread&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">use&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;java.lang.Thread&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">Thread&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">currentThread&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="nx">getName&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">traceClass&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">target&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">clsname&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">target&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kr">class&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getName&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">methods&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">target&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="kr">class&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getDeclaredMethods&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// log(methods);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">methods&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">forEach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">method&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">methodName&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">method&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getName&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">overloads&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">target&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">methodName&lt;/span>&lt;span class="p">].&lt;/span>&lt;span class="nx">overloads&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">overloads&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">forEach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">overload&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">proto&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;(&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">overload&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">argumentTypes&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">forEach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">type&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">proto&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="nx">type&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">className&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s2">&amp;#34;, &amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">proto&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">length&lt;/span> &lt;span class="o">&amp;gt;&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">proto&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">proto&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">substr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">proto&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">length&lt;/span> &lt;span class="o">-&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">proto&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="s2">&amp;#34;)&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;hooking: &amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">clsname&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s2">&amp;#34;.&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">methodName&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">proto&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">overload&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">implementation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">args&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">tid&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">getTid&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">tName&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">getTName&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="kd">var&lt;/span> &lt;span class="nx">j&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">j&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="nx">arguments&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">length&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">j&lt;/span>&lt;span class="o">++&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">args&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">j&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">arguments&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">j&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">enter&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">tid&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">tName&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">clsname&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">methodName&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">proto&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">args&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">retval&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">methodName&lt;/span>&lt;span class="p">].&lt;/span>&lt;span class="nx">apply&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">arguments&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">exit&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">tid&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">retval&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">retval&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span> &lt;span class="k">catch&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">error&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// var stackTrace = Java.use(&amp;#39;android.util.Log&amp;#39;).getStackTraceString(Java.use(&amp;#39;java.lang.Exception&amp;#39;).$new());
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// console.log(stackTrace);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;&amp;#39;&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">clsname&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s2">&amp;#34;&amp;#39; hook fail: &amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">perform&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kd">function&lt;/span>&lt;span class="p">(){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">choose&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;dalvik.system.PathClassLoader&amp;#34;&lt;/span>&lt;span class="p">,{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onMatch&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">instance&lt;/span>&lt;span class="p">){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">loader&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">ClassFactory&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">get&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">instance&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">clazz&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">loader&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">use&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;com.douyu.sdk.ad.douyu.video.AdVideoPlayerPresenter&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;-------------clazz&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">clazz&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">traceClass&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">clazz&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="s2">&amp;#34;stop&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>&lt;span class="k">catch&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">//console.log(&amp;#34;next&amp;#34;)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">//console.log(e)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onComplete&lt;/span>&lt;span class="o">:&lt;/span>&lt;span class="kd">function&lt;/span>&lt;span class="p">(){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Done&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>某枝网wasm签名验证逆向</title><link>https://fatkun.github.io/post/2024/crack_gdtv/</link><guid isPermaLink="true">https://fatkun.github.io/post/2024/crack_gdtv/</guid><pubDate>Wed, 27 Nov 2024 22:36:34 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="声明">声明&lt;/h1>
&lt;p>只用于学习，不可用于非法用途，参考 &lt;a href="https://www.bilibili.com/video/BV1eEyoYAEcM/?vd_source=cae69f5f7f437d5b10d6bfe1a9306e80">分析视频&lt;/a> 学习。&lt;/p>
&lt;h1 id="概要">概要&lt;/h1>
&lt;p>某枝网的加密算法是在wasm上实现的，由于直接分析wasm文件比较困难，还是采用直接调用wasm文件的方式。&lt;/p>
&lt;h1 id="分析">分析&lt;/h1>
&lt;p>网站核心请求会调用wasm生成header信息，其中带有签名。调用wasm的代码在&lt;code>/sitecdn/platforms/**tv/js/vendor_w_dceabe2b.js&lt;/code>里面。&lt;/p>
&lt;img src="https://fatkun.github.io/img/crack_gdtv/image-20241127225618140.png" alt="image-20241127225618140" style="zoom:60%;" />
&lt;p>代码里面使用webpack打包，不太熟悉怎样单独抽取出来，所以不太好在浏览器提取出来验证，只好手工抽取代码出来验证。&lt;/p>
&lt;p>代码入口在B.a方法，这里会生成header信息。代码抽取的时候，注意有一些局部变量也要提取出来，而且有些变量的赋值在后面。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-javascript" data-lang="javascript">&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">B&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">a&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kd">function&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">A&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">g&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">I&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">B&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">Q&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">C&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">E&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">L&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">A&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">w&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">__wbindgen_export_0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">w&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">__wbindgen_export_1&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">D&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">h&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">i&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">L&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">g&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">w&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">__wbindgen_export_0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">w&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">__wbindgen_export_1&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">o&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">h&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">Y&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">L&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">I&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">w&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">__wbindgen_export_0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">w&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">__wbindgen_export_1&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">N&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">h&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">J&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">L&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">B&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">w&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">__wbindgen_export_0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">w&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">__wbindgen_export_1&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">k&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">h&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">K&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">L&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Q&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">w&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">__wbindgen_export_0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">w&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">__wbindgen_export_1&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">y&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">h&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">G&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">w&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">a&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">E&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">D&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">i&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">o&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">Y&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">N&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">J&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">k&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">K&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">y&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="kd">function&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">A&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="mi">1&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="nx">H&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">throw&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nb">Error&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;out of js stack&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">M&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="o">--&lt;/span>&lt;span class="nx">H&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">A&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">H&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}(&lt;/span>&lt;span class="nx">C&lt;/span>&lt;span class="p">)))&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span> &lt;span class="k">finally&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">M&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">H&lt;/span>&lt;span class="o">++&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">void&lt;/span> &lt;span class="mi">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>代码里面用到wasm，所以要读取并且执行方法。WebAssembly使用&lt;code>WebAssembly.instantiate(wasmBuffer, importObject)&lt;/code>初始化，第一个参数是wasm的内容，第二个参数是为了可以让wasm获取浏览器的一些对象，并且执行一些动态js代码。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">dataUrl&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;data:application/wasm;base64,AGFzb省略...&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">O&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">A&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">g&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">w&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">A&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">exports&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">//r.__wbindgen_wasm_module = g,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">c&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">J&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">w&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">url&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;https://****-api.**tv.cn/api/tvColumn/v1/tvColumn/43&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">fetch&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">dataUrl&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">then&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">response&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">response&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">arrayBuffer&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}).&lt;/span>&lt;span class="nx">then&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">wasmBuffer&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">delete&lt;/span> &lt;span class="nx">global&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="c1">// 里面会检测global
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">WebAssembly&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">instantiate&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">wasmBuffer&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">importObject&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">then&lt;/span>&lt;span class="p">((&lt;/span>&lt;span class="nx">obj&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">O&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">obj&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">instance&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">obj&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">module&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">header&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">B&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">a&lt;/span>&lt;span class="p">(&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;GET&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">url&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;WEB_aa55cd50-3be4-11ef-2323-c127ac36c210&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;WEB_PC&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kc">undefined&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">JSON&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">stringify&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nb">Object&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">fromEntries&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">header&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">entries&lt;/span>&lt;span class="p">())));&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>wasm除了生成header外，还会做额外的环境验证，确认是浏览器执行的，如果环境验证不正确，会报错unreachable，错误信息很有限，补环境非常困难。&lt;/p>
&lt;h2 id="补环境">补环境&lt;/h2>
&lt;p>由于wasm不能直接操控浏览器，都是通过ImportObject来通信的，wasm会通过ImportObject获取一些对象。&lt;/p>
&lt;h3 id="第一种获取标准对象如window-document-location等">第一种：获取标准对象，如window, document, location等&lt;/h3>
&lt;p>验证是否正确，也有可能验证对象的原型，使用proxy的方式，能发现哪些对象被调用了。但是像原型判断（typeof）这种判断暂时不清楚怎么发现，我目前只能从代码判断。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">myProxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">obj&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nx">name&lt;/span>&lt;span class="p">){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nb">Proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">obj&lt;/span>&lt;span class="p">,{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">get&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">target&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">propKey&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">receiver&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">temp&lt;/span> &lt;span class="o">=&lt;/span>&lt;span class="nx">Reflect&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">get&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">target&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nx">propKey&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nx">receiver&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="k">typeof&lt;/span> &lt;span class="nx">temp&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="s1">&amp;#39;object&amp;#39;&lt;/span>&lt;span class="p">){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">temp&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="nx">myProxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">temp&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nx">name&lt;/span>&lt;span class="o">+&lt;/span>&lt;span class="s1">&amp;#39;=&amp;gt;&amp;#39;&lt;/span>&lt;span class="o">+&lt;/span>&lt;span class="nx">propKey&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">toString&lt;/span>&lt;span class="p">())&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">name&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">-&amp;gt;get &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">propKey&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">toString&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb"> return -&amp;gt;&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">temp&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">temp&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">set&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">target&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">propKey&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">value&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">receiver&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">temp&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Reflect&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">set&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">target&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nx">propKey&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nx">value&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">name&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">-&amp;gt;set &lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">propKey&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">toString&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb"> value -&amp;gt;&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">value&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">temp&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">window&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">myProxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">global&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;window&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">XMLHttpRequest&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">myProxy&lt;/span>&lt;span class="p">({},&lt;/span> &lt;span class="s1">&amp;#39;XMLHttpRequest&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">document&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">myProxy&lt;/span>&lt;span class="p">({},&lt;/span> &lt;span class="s1">&amp;#39;document&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="第二种检测nodejs存在的但浏览器不存在的">第二种：检测nodejs存在的，但浏览器不存在的&lt;/h3>
&lt;p>例如像global、process、require等，在使用完之后可以delete掉这些对象&lt;/p>
&lt;h3 id="第三种wasm执行检测js">第三种：wasm执行检测js&lt;/h3>
&lt;p>代码中是&lt;code>g.wbg.__wbg_newnoargs_xxxx&lt;/code>把js内容存储到map里，然后再调用&lt;code>g.wbg.__wbg_call_xxxx&lt;/code>执行js函数，执行完之后和预期的结果对比，结果有时候是true，有时候是false，或者是具体的值，这些里面也有检测代码。&lt;/p>
&lt;p>执行的代码是混淆过的，可以用一些反混淆的工具或者AI把代码还原。&lt;/p>
&lt;p>这里的技巧是要阅读清楚代码逻辑（还好代码比较短），看看做了哪些检测，有针对性的补全环境。其中有些恶心的是里面判断如果不是nodejs，会执行一些nodejs比较慢，但浏览器很快的代码，其中有一个填充数组的，会导致nodejs内存溢出。&lt;/p>
&lt;p>如果不确定哪个条件检查不通过，还有个技巧是判断代码内容，替换回还原后的内容，然后进行单步调试。如果实在不清楚怎么绕过，就直接把要执行的代码改了，跳过检测部分。&lt;/p>
&lt;h1 id="尝试使用python调用">尝试使用python调用&lt;/h1>
&lt;p>试了几个lib使用python来调用js代码，但是用起来不理想。首先global对象是nodejs独有的，那就要自己模拟window对象了。其次有些函数是浏览器/nodejs实现的（如fetch、atob等），哪些lib都没有实现这些，所以会执行失败。所以还是直接调用node命令执行，或者使用nodejs实现一个httpserver来给python调用了。&lt;/p>
&lt;h1 id="总结">总结&lt;/h1>
&lt;p>难点主要在于补环境，wasm里面有不少检测点，后面也可能会更新。而且因为环境的问题，出错也没有具体错误信息。不过好在检测的手段主要都是在ImportObject的方法里面，虽然增加了一些隐藏的js，但是还是可以获取到分析的。尝试使用一个补环境框架，也不是用上了就行的。&lt;/p>
&lt;h1 id="参考">参考&lt;/h1>
&lt;p>&lt;a href="https://github.com/claviering/gdtv">nodejs项目，已失效&lt;/a>&lt;/p>
&lt;p>&lt;a href="https://www.52pojie.cn/thread-1900845-1-1.html">某视频解析网站js逆向分析——学会wasm文件类型逆向&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>逆向某音弹幕签名</title><link>https://fatkun.github.io/post/2024/crack_douyin_sign/</link><guid isPermaLink="true">https://fatkun.github.io/post/2024/crack_douyin_sign/</guid><pubDate>Mon, 25 Nov 2024 00:25:08 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="概要">概要&lt;/h1>
&lt;p>基于学习的目的，根据&lt;a href="https://www.bilibili.com/video/BV149D9YPELn?vd_source=62d2cb1e3ff62f323aa467f88c49d589&amp;amp;spm_id_from=333.788.videopod.episodes">这个视频&lt;/a>学习逆向某音弹幕签名。&lt;/p>
&lt;h1 id="步骤">步骤&lt;/h1>
&lt;h2 id="断点调试跟踪代码入口">断点调试跟踪代码入口&lt;/h2>
&lt;p>首先，打开一个直播间，在web控制台&lt;code>Network&lt;/code>里面，找到websocket，这里可以获取ws链接。可以用&lt;a href="https://wstool.js.org/">ws在线工具&lt;/a>确认这个ws链接可以正常使用。&lt;/p>
&lt;p>在&lt;code>Network&lt;/code>里面，链接的右边有一个Initiator列，可以找到对应的代码。&lt;/p>
&lt;p>&lt;img src="https://fatkun.github.io/img/crack_douyin_sign/image-20241125004545702.png" alt="image-20241125004545702">&lt;/p>
&lt;p>然后可以使用断点调试，找到对应的代码。&lt;/p>
&lt;p>可以看到是调用_getSocketParams获取ws地址，主要是下面的&lt;code>V(s, i);&lt;/code>方法获取签名。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">ee&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">_getSocketParams&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">e&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="nx">app_name&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">t&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">routeParams&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">n&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">pushServer&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">r&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">websocket_key&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">i&lt;/span>&lt;span class="p">}&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">e&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">o&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">J&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;app_name&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;routeParams&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;pushServer&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;websocket_key&amp;#34;&lt;/span>&lt;span class="p">])&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">s&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">$&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">$&lt;/span>&lt;span class="p">({&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">app_name&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">t&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">version_code&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">a&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">ry&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">webcast_sdk_version&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">ee&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">VERSION&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">update_version_code&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">ee&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">VERSION&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">compress&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;gzip&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span> &lt;span class="nx">n&lt;/span>&lt;span class="p">),&lt;/span> &lt;span class="nx">o&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">c&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">V&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">s&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">i&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="sb">`&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">r&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">?&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">_&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">$&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">$&lt;/span>&lt;span class="p">({&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">, s), c))}`&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>再来看&lt;code>V(s, i);&lt;/code>这个方法&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">V&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">t&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">[])&lt;/span> &lt;span class="p">=&amp;gt;&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">n&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">r&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">i&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">o&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="kd">let&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="nx">param_name&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">r&lt;/span>&lt;span class="p">}&lt;/span> &lt;span class="k">of&lt;/span> &lt;span class="nx">t&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">o&lt;/span> &lt;span class="o">+=&lt;/span> &lt;span class="sb">`,&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">r&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">=&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="kc">null&lt;/span> &lt;span class="o">!=&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">n&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">e&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">r&lt;/span>&lt;span class="p">])&lt;/span> &lt;span class="o">?&lt;/span> &lt;span class="nx">n&lt;/span> &lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">a&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">X&lt;/span>&lt;span class="p">()(&lt;/span>&lt;span class="nx">o&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">substring&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">))&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">,&lt;/span> &lt;span class="nx">s&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">{};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nb">window&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byted_acrawler&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">s&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">null&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">r&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">null&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="nb">window&lt;/span> &lt;span class="o">?&lt;/span> &lt;span class="k">void&lt;/span> &lt;span class="mi">0&lt;/span> &lt;span class="o">:&lt;/span> &lt;span class="nb">window&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">byted_acrawler&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">?&lt;/span> &lt;span class="k">void&lt;/span> &lt;span class="mi">0&lt;/span> &lt;span class="o">:&lt;/span> &lt;span class="nx">r&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">frontierSign&lt;/span>&lt;span class="p">({&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;X-MS-STUB&amp;#34;&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">a&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">})),&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">signature&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kc">null&lt;/span> &lt;span class="o">!=&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">i&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">s&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;X-Bogus&amp;#34;&lt;/span>&lt;span class="p">])&lt;/span> &lt;span class="o">?&lt;/span> &lt;span class="nx">i&lt;/span> &lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>这里主要有几个值，o、a和s。&lt;/p>
&lt;p>o是传入的一堆参数拼接成一个字符串，o=&amp;quot;,live_id=1,aid=6383...&amp;quot;，o参数拼接里面有一个roomId，可以访问直播链接里面提取，在源码里面搜索roomId。&lt;/p>
&lt;p>X()方法根据视频这里是一个MD5算法，怎么判断是MD5?可以断点进去，复制代码给AI分析，也可以用md5验证一下。那么相当于 a = MD5(o.substring(1))&lt;/p>
&lt;p>s的取值主要是 &lt;code>s = r.frontierSign({&amp;quot;X-MS-STUB&amp;quot;: a})&lt;/code>, 鼠标移上去可以找到代码位置。&lt;/p>
&lt;img src="https://fatkun.github.io/img/crack_douyin_sign/image-20241125010326187.png" alt="image-20241125010326187" style="zoom:50%;" />
&lt;p>所有签名的代码都在webmssdk.es5.js里面了，我分析的版本是&lt;code>1.0.0.53&lt;/code>&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">function&lt;/span> &lt;span class="nx">_0x5c2014&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">_0x1fa689&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">w_0x5c3140&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;484e4f4a403f5243...&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">get&lt;/span> &lt;span class="mh">0x0&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">_0x5dd467&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">get&lt;/span> &lt;span class="mh">0x1&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">_0x34c70a&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="mh">0x2&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">arguments&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="mh">0x3&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">_0x1fa689&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>这里第一个参数是一个字符串，第二个是一个字典，里面的get表示是只读，0x0是一个方法，在某个地方会调用这里的方法，可以提前先对这些方法加一个断点，第三个是window。&lt;/p>
&lt;p>可以把webmssdk.es5.js复制到本地，写一个html引用这个js&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-html" data-lang="html">&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">script&lt;/span> &lt;span class="na">src&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;./webmssdk.js&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&amp;lt;/&lt;/span>&lt;span class="nt">script&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>在js的最后调用加密方法&lt;/p>
&lt;pre tabindex="0">&lt;code>window.sign = _0x5c2014;
sign = window.sign({
&amp;#34;X-MS-STUB&amp;#34;: &amp;#34;b7d22ba3f49ffd02ef417b3c6b8b1ca2&amp;#34;
});
console.log(sign);
&lt;/code>&lt;/pre>&lt;p>在浏览器打开HTML，在控制台获取签名，先用这个签名拼接ws地址，试一下这个地址是否正确。我测试在浏览器下是正确的，但是我们需要在nodejs或其他环境里面运行，厂商为了对抗会对浏览器进行一些检测。&lt;/p>
&lt;h2 id="补环境">补环境&lt;/h2>
&lt;p>复制一份js，尝试一下在nodejs里面是否可以运行，先使用jsdom补充一下基础环境，在js文件前面加入以下内容。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;span class="lnt">44
&lt;/span>&lt;span class="lnt">45
&lt;/span>&lt;span class="lnt">46
&lt;/span>&lt;span class="lnt">47
&lt;/span>&lt;span class="lnt">48
&lt;/span>&lt;span class="lnt">49
&lt;/span>&lt;span class="lnt">50
&lt;/span>&lt;span class="lnt">51
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">jsdom&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">require&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;jsdom&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span> &lt;span class="c1">// 引入 jsdom
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="kr">const&lt;/span> &lt;span class="p">{&lt;/span> &lt;span class="nx">JSDOM&lt;/span> &lt;span class="p">}&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">jsdom&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="c1">// 引出 JSDOM 类， 等同于 JSDOM = jsdom.JSDOM
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="kr">const&lt;/span> &lt;span class="nx">userAgent&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s1">&amp;#39;Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">resourceLoader&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">jsdom&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">ResourceLoader&lt;/span>&lt;span class="p">({&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">userAgent&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">userAgent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kr">const&lt;/span> &lt;span class="nx">dom&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">JSDOM&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`&amp;lt;!DOCTYPE html&amp;gt;&amp;lt;p&amp;gt;Hello world&amp;lt;/p&amp;gt;`&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">url&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;https://www.douyin.com/&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">referrer&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;https://www.douyin.com/&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">resources&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">resourceLoader&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">window&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">global&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">document&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">dom&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nb">window&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nb">document&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">Object&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">assign&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">global&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">location&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">hash&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">host&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;www.douyin.com&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">hostname&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;www.douyin.com&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">href&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;https://www.douyin.com/&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">origin&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;https://www.douyin.com/&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">pathname&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;/&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">port&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">protocol&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;https:&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">search&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">assign&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">reload&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">replace&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">navigator&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">appCodeName&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;Mozilla&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">appName&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;Netscape&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">appVersion&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">userAgent&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">cookieEnabled&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kc">true&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">deviceMemory&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">doNotTrack&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">hardwareConcurrency&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="mi">4&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">language&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;zh-CN&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">languages&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;zh-CN&amp;#34;&lt;/span>&lt;span class="p">],&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">maxTouchPoints&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onLine&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kc">true&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">platform&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;MacIntel&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">plugins&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="p">[],&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">product&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;Gecko&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">productSub&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;20100101&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">userAgent&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">userAgent&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">vendor&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;Google Inc.&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">vendorSub&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">webdriver&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kc">false&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>执行&lt;code>node sdk2.js&lt;/code>能够生成，但是使用ws验证签名是错误的，厂商还做了其他的验证。&lt;/p>
&lt;p>怎么找出厂商做的检测呢？只能单步调试，对比nodejs和浏览器执行的差异，如果有差异，要看是哪里造成的。这一步肯定是很枯燥的，代码非常长，要一步步调试。这里我也没有仔细跟踪，按着视频的方法调试。&lt;/p>
&lt;h2 id="反混淆">反混淆&lt;/h2>
&lt;p>里面的代码有些被混淆了，可以先反混淆。视频教的方法是看到代码总会跳转到前面几十行代码，能判断前面几十行是做混淆还原的，他写了一个脚本去调用nodejs还原字符串，再替换回文本。&lt;/p>
&lt;p>我找了一个取巧的方法，使用&lt;a href="https://js-deobfuscator.vercel.app/">在线反混淆的网站&lt;/a>处理，注意在设置里面不要更改变量名称，不然不太好和原来的代码对应看。尝试执行一下，发现nodejs执行失败，提示缺少方法，发现是缺少了混淆的方法，补回去就正常了。&lt;/p>
&lt;p>剩下的步骤就是断点执行对比nodejs的差异了，可以一个个方法的比较两边的返回值是否一致，在nodejs里面可以用&lt;code>console.log()&lt;/code>输出，也可以采用断点调试的方式。&lt;/p>
&lt;p>在vscode的终端里面，在右边加号那里，添加一个JavaScript调试终端，然后在代码断点，执行node sdk2.js就可以断点调试了。&lt;/p>
&lt;p>跟着视频分析是这里面做了一些检测&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">function&lt;/span> &lt;span class="nx">_0x34c70a&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">_0xf6b3d0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x289075&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x2c48ed&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;X-Bogus&amp;#34;&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">_0x1633f2&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x462335&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">initialized&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0xf6b3d0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x2c48ed&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">function&lt;/span> &lt;span class="nx">_0x1633f2&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">_0x48f290&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x504655&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x4fa808&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x1a5c57&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x3a4737&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">_0x5863d1&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">_0x26d461&lt;/span>&lt;span class="p">();&lt;/span> &lt;span class="c1">// 这个方法有检测
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">function&lt;/span> &lt;span class="nx">_0x26d461&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">_0x5e9ee6&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">false&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">_0x499168&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// try {
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// if (document &amp;amp;&amp;amp; document.createEvent) {
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// document.createEvent(&amp;#34;TouchEvent&amp;#34;);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// _0x5e9ee6 = true;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// }
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// } catch (_0x4b2baa) {}
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// 修改
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;_0x5e9ee6&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x5e9ee6&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>我注释的这个地方，在浏览器上&lt;code>_0x5e9ee6&lt;/code>返回false，但在nodejs返回true，所以保持和浏览器一致，直接把它注释了。改完这里可以试一下生成签名是否正确，可惜是还是不正确，继续找。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">function&lt;/span> &lt;span class="nx">_0x1633f2&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">_0x48f290&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x504655&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x4fa808&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x1a5c57&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">_0x3a4737&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">_0x5863d1&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">_0x26d461&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">_0x1a5c57&lt;/span> &lt;span class="o">!==&lt;/span> &lt;span class="kc">undefined&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="nx">_0x1a5c57&lt;/span> &lt;span class="o">!==&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">_0x1a5c57&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">_0x21ca02&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">_0x5dd467&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">_0x1a5c57&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="nx">_0x3a4737&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">_0x3a4737&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;00000000000000000000000000000000&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">_0x1fb174&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">ArrayBuffer&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">9&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">_0x1ffaa7&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">Uint8Array&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">_0x1fb174&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">_0xeefda2&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">_0x48f290&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">6&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="mi">0&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="nx">_0x504655&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">5&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nb">Math&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">floor&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nb">Math&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">random&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="o">*&lt;/span> &lt;span class="mi">100&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;amp;&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="mi">4&lt;/span> &lt;span class="o">|&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">_0x6caf&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">bogusIndex&lt;/span>&lt;span class="o">++&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">_0x6caf&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">envcode&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">513&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="c1">// 修改
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>还有一个地方是&lt;code>_0x6caf&lt;/code>这个变量，我不清楚视频作者是怎么定位到这里不一致的，不过可以从这个方法的返回值对比可以发现，返回的第二个参数是一个bytes数组对不上。对不上的话只能在这个方法里面断点对比那个对象不一样了。&lt;/p>
&lt;p>我这里看到后面的计算主要是依赖这个envcode，我从浏览器的值复制了过来，也不知道后面会不会变。&lt;code>_0x6caf&lt;/code>这个变量是一个局部变量，在哪个地方变更了这个变量的值，nodejs执行的值和浏览器的不一样。&lt;/p>
&lt;p>最终，使用ws在线测试服务，验证生成的签名是有效的。&lt;/p>
&lt;p>&lt;img src="https://fatkun.github.io/img/crack_douyin_sign/image-20241125015103917.png" alt="image-20241125015103917">&lt;/p>
&lt;h1 id="总结">总结&lt;/h1>
&lt;p>逆向非常的枯燥，如果没有跟着视频一步步操作，需要断点调试对比结果应该需要花费很多时间。这里面重点是怎么补环境，要找出代码的检测点，只能通过对比返回值一步步筛查。&lt;/p>
&lt;p>如果不使用nodejs访问，估计使用headless浏览器也一样会被拦截。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E9%80%86%E5%90%91/">逆向</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>使用podman部署nginx和php</title><link>https://fatkun.github.io/post/2024/podman_nginx_php/</link><guid isPermaLink="true">https://fatkun.github.io/post/2024/podman_nginx_php/</guid><pubDate>Fri, 30 Aug 2024 14:22:01 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="背景">背景&lt;/h1>
&lt;p>podman不需要常驻进程，能够节省一些内存，但是启动服务需要放入systemd。&lt;/p>
&lt;p>这次目标是部署nginx和php-fpm，一般使用默认配置，非生产环境。&lt;/p>
&lt;h1 id="步骤">步骤&lt;/h1>
&lt;p>我们需要启动php-fpm，然后nginx通过端口和php-fpm通信，这里使用pod的方式进行。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 需要指定端口&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">podman pod create --name nginxpod -p 80:80 -p 443:443
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="php-fpm部署">php-fpm部署&lt;/h2>
&lt;p>创建conf目录，创建php.ini和www.conf&lt;/p>
&lt;p>php.ini&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt"> 10
&lt;/span>&lt;span class="lnt"> 11
&lt;/span>&lt;span class="lnt"> 12
&lt;/span>&lt;span class="lnt"> 13
&lt;/span>&lt;span class="lnt"> 14
&lt;/span>&lt;span class="lnt"> 15
&lt;/span>&lt;span class="lnt"> 16
&lt;/span>&lt;span class="lnt"> 17
&lt;/span>&lt;span class="lnt"> 18
&lt;/span>&lt;span class="lnt"> 19
&lt;/span>&lt;span class="lnt"> 20
&lt;/span>&lt;span class="lnt"> 21
&lt;/span>&lt;span class="lnt"> 22
&lt;/span>&lt;span class="lnt"> 23
&lt;/span>&lt;span class="lnt"> 24
&lt;/span>&lt;span class="lnt"> 25
&lt;/span>&lt;span class="lnt"> 26
&lt;/span>&lt;span class="lnt"> 27
&lt;/span>&lt;span class="lnt"> 28
&lt;/span>&lt;span class="lnt"> 29
&lt;/span>&lt;span class="lnt"> 30
&lt;/span>&lt;span class="lnt"> 31
&lt;/span>&lt;span class="lnt"> 32
&lt;/span>&lt;span class="lnt"> 33
&lt;/span>&lt;span class="lnt"> 34
&lt;/span>&lt;span class="lnt"> 35
&lt;/span>&lt;span class="lnt"> 36
&lt;/span>&lt;span class="lnt"> 37
&lt;/span>&lt;span class="lnt"> 38
&lt;/span>&lt;span class="lnt"> 39
&lt;/span>&lt;span class="lnt"> 40
&lt;/span>&lt;span class="lnt"> 41
&lt;/span>&lt;span class="lnt"> 42
&lt;/span>&lt;span class="lnt"> 43
&lt;/span>&lt;span class="lnt"> 44
&lt;/span>&lt;span class="lnt"> 45
&lt;/span>&lt;span class="lnt"> 46
&lt;/span>&lt;span class="lnt"> 47
&lt;/span>&lt;span class="lnt"> 48
&lt;/span>&lt;span class="lnt"> 49
&lt;/span>&lt;span class="lnt"> 50
&lt;/span>&lt;span class="lnt"> 51
&lt;/span>&lt;span class="lnt"> 52
&lt;/span>&lt;span class="lnt"> 53
&lt;/span>&lt;span class="lnt"> 54
&lt;/span>&lt;span class="lnt"> 55
&lt;/span>&lt;span class="lnt"> 56
&lt;/span>&lt;span class="lnt"> 57
&lt;/span>&lt;span class="lnt"> 58
&lt;/span>&lt;span class="lnt"> 59
&lt;/span>&lt;span class="lnt"> 60
&lt;/span>&lt;span class="lnt"> 61
&lt;/span>&lt;span class="lnt"> 62
&lt;/span>&lt;span class="lnt"> 63
&lt;/span>&lt;span class="lnt"> 64
&lt;/span>&lt;span class="lnt"> 65
&lt;/span>&lt;span class="lnt"> 66
&lt;/span>&lt;span class="lnt"> 67
&lt;/span>&lt;span class="lnt"> 68
&lt;/span>&lt;span class="lnt"> 69
&lt;/span>&lt;span class="lnt"> 70
&lt;/span>&lt;span class="lnt"> 71
&lt;/span>&lt;span class="lnt"> 72
&lt;/span>&lt;span class="lnt"> 73
&lt;/span>&lt;span class="lnt"> 74
&lt;/span>&lt;span class="lnt"> 75
&lt;/span>&lt;span class="lnt"> 76
&lt;/span>&lt;span class="lnt"> 77
&lt;/span>&lt;span class="lnt"> 78
&lt;/span>&lt;span class="lnt"> 79
&lt;/span>&lt;span class="lnt"> 80
&lt;/span>&lt;span class="lnt"> 81
&lt;/span>&lt;span class="lnt"> 82
&lt;/span>&lt;span class="lnt"> 83
&lt;/span>&lt;span class="lnt"> 84
&lt;/span>&lt;span class="lnt"> 85
&lt;/span>&lt;span class="lnt"> 86
&lt;/span>&lt;span class="lnt"> 87
&lt;/span>&lt;span class="lnt"> 88
&lt;/span>&lt;span class="lnt"> 89
&lt;/span>&lt;span class="lnt"> 90
&lt;/span>&lt;span class="lnt"> 91
&lt;/span>&lt;span class="lnt"> 92
&lt;/span>&lt;span class="lnt"> 93
&lt;/span>&lt;span class="lnt"> 94
&lt;/span>&lt;span class="lnt"> 95
&lt;/span>&lt;span class="lnt"> 96
&lt;/span>&lt;span class="lnt"> 97
&lt;/span>&lt;span class="lnt"> 98
&lt;/span>&lt;span class="lnt"> 99
&lt;/span>&lt;span class="lnt"> 100
&lt;/span>&lt;span class="lnt"> 101
&lt;/span>&lt;span class="lnt"> 102
&lt;/span>&lt;span class="lnt"> 103
&lt;/span>&lt;span class="lnt"> 104
&lt;/span>&lt;span class="lnt"> 105
&lt;/span>&lt;span class="lnt"> 106
&lt;/span>&lt;span class="lnt"> 107
&lt;/span>&lt;span class="lnt"> 108
&lt;/span>&lt;span class="lnt"> 109
&lt;/span>&lt;span class="lnt"> 110
&lt;/span>&lt;span class="lnt"> 111
&lt;/span>&lt;span class="lnt"> 112
&lt;/span>&lt;span class="lnt"> 113
&lt;/span>&lt;span class="lnt"> 114
&lt;/span>&lt;span class="lnt"> 115
&lt;/span>&lt;span class="lnt"> 116
&lt;/span>&lt;span class="lnt"> 117
&lt;/span>&lt;span class="lnt"> 118
&lt;/span>&lt;span class="lnt"> 119
&lt;/span>&lt;span class="lnt"> 120
&lt;/span>&lt;span class="lnt"> 121
&lt;/span>&lt;span class="lnt"> 122
&lt;/span>&lt;span class="lnt"> 123
&lt;/span>&lt;span class="lnt"> 124
&lt;/span>&lt;span class="lnt"> 125
&lt;/span>&lt;span class="lnt"> 126
&lt;/span>&lt;span class="lnt"> 127
&lt;/span>&lt;span class="lnt"> 128
&lt;/span>&lt;span class="lnt"> 129
&lt;/span>&lt;span class="lnt"> 130
&lt;/span>&lt;span class="lnt"> 131
&lt;/span>&lt;span class="lnt"> 132
&lt;/span>&lt;span class="lnt"> 133
&lt;/span>&lt;span class="lnt"> 134
&lt;/span>&lt;span class="lnt"> 135
&lt;/span>&lt;span class="lnt"> 136
&lt;/span>&lt;span class="lnt"> 137
&lt;/span>&lt;span class="lnt"> 138
&lt;/span>&lt;span class="lnt"> 139
&lt;/span>&lt;span class="lnt"> 140
&lt;/span>&lt;span class="lnt"> 141
&lt;/span>&lt;span class="lnt"> 142
&lt;/span>&lt;span class="lnt"> 143
&lt;/span>&lt;span class="lnt"> 144
&lt;/span>&lt;span class="lnt"> 145
&lt;/span>&lt;span class="lnt"> 146
&lt;/span>&lt;span class="lnt"> 147
&lt;/span>&lt;span class="lnt"> 148
&lt;/span>&lt;span class="lnt"> 149
&lt;/span>&lt;span class="lnt"> 150
&lt;/span>&lt;span class="lnt"> 151
&lt;/span>&lt;span class="lnt"> 152
&lt;/span>&lt;span class="lnt"> 153
&lt;/span>&lt;span class="lnt"> 154
&lt;/span>&lt;span class="lnt"> 155
&lt;/span>&lt;span class="lnt"> 156
&lt;/span>&lt;span class="lnt"> 157
&lt;/span>&lt;span class="lnt"> 158
&lt;/span>&lt;span class="lnt"> 159
&lt;/span>&lt;span class="lnt"> 160
&lt;/span>&lt;span class="lnt"> 161
&lt;/span>&lt;span class="lnt"> 162
&lt;/span>&lt;span class="lnt"> 163
&lt;/span>&lt;span class="lnt"> 164
&lt;/span>&lt;span class="lnt"> 165
&lt;/span>&lt;span class="lnt"> 166
&lt;/span>&lt;span class="lnt"> 167
&lt;/span>&lt;span class="lnt"> 168
&lt;/span>&lt;span class="lnt"> 169
&lt;/span>&lt;span class="lnt"> 170
&lt;/span>&lt;span class="lnt"> 171
&lt;/span>&lt;span class="lnt"> 172
&lt;/span>&lt;span class="lnt"> 173
&lt;/span>&lt;span class="lnt"> 174
&lt;/span>&lt;span class="lnt"> 175
&lt;/span>&lt;span class="lnt"> 176
&lt;/span>&lt;span class="lnt"> 177
&lt;/span>&lt;span class="lnt"> 178
&lt;/span>&lt;span class="lnt"> 179
&lt;/span>&lt;span class="lnt"> 180
&lt;/span>&lt;span class="lnt"> 181
&lt;/span>&lt;span class="lnt"> 182
&lt;/span>&lt;span class="lnt"> 183
&lt;/span>&lt;span class="lnt"> 184
&lt;/span>&lt;span class="lnt"> 185
&lt;/span>&lt;span class="lnt"> 186
&lt;/span>&lt;span class="lnt"> 187
&lt;/span>&lt;span class="lnt"> 188
&lt;/span>&lt;span class="lnt"> 189
&lt;/span>&lt;span class="lnt"> 190
&lt;/span>&lt;span class="lnt"> 191
&lt;/span>&lt;span class="lnt"> 192
&lt;/span>&lt;span class="lnt"> 193
&lt;/span>&lt;span class="lnt"> 194
&lt;/span>&lt;span class="lnt"> 195
&lt;/span>&lt;span class="lnt"> 196
&lt;/span>&lt;span class="lnt"> 197
&lt;/span>&lt;span class="lnt"> 198
&lt;/span>&lt;span class="lnt"> 199
&lt;/span>&lt;span class="lnt"> 200
&lt;/span>&lt;span class="lnt"> 201
&lt;/span>&lt;span class="lnt"> 202
&lt;/span>&lt;span class="lnt"> 203
&lt;/span>&lt;span class="lnt"> 204
&lt;/span>&lt;span class="lnt"> 205
&lt;/span>&lt;span class="lnt"> 206
&lt;/span>&lt;span class="lnt"> 207
&lt;/span>&lt;span class="lnt"> 208
&lt;/span>&lt;span class="lnt"> 209
&lt;/span>&lt;span class="lnt"> 210
&lt;/span>&lt;span class="lnt"> 211
&lt;/span>&lt;span class="lnt"> 212
&lt;/span>&lt;span class="lnt"> 213
&lt;/span>&lt;span class="lnt"> 214
&lt;/span>&lt;span class="lnt"> 215
&lt;/span>&lt;span class="lnt"> 216
&lt;/span>&lt;span class="lnt"> 217
&lt;/span>&lt;span class="lnt"> 218
&lt;/span>&lt;span class="lnt"> 219
&lt;/span>&lt;span class="lnt"> 220
&lt;/span>&lt;span class="lnt"> 221
&lt;/span>&lt;span class="lnt"> 222
&lt;/span>&lt;span class="lnt"> 223
&lt;/span>&lt;span class="lnt"> 224
&lt;/span>&lt;span class="lnt"> 225
&lt;/span>&lt;span class="lnt"> 226
&lt;/span>&lt;span class="lnt"> 227
&lt;/span>&lt;span class="lnt"> 228
&lt;/span>&lt;span class="lnt"> 229
&lt;/span>&lt;span class="lnt"> 230
&lt;/span>&lt;span class="lnt"> 231
&lt;/span>&lt;span class="lnt"> 232
&lt;/span>&lt;span class="lnt"> 233
&lt;/span>&lt;span class="lnt"> 234
&lt;/span>&lt;span class="lnt"> 235
&lt;/span>&lt;span class="lnt"> 236
&lt;/span>&lt;span class="lnt"> 237
&lt;/span>&lt;span class="lnt"> 238
&lt;/span>&lt;span class="lnt"> 239
&lt;/span>&lt;span class="lnt"> 240
&lt;/span>&lt;span class="lnt"> 241
&lt;/span>&lt;span class="lnt"> 242
&lt;/span>&lt;span class="lnt"> 243
&lt;/span>&lt;span class="lnt"> 244
&lt;/span>&lt;span class="lnt"> 245
&lt;/span>&lt;span class="lnt"> 246
&lt;/span>&lt;span class="lnt"> 247
&lt;/span>&lt;span class="lnt"> 248
&lt;/span>&lt;span class="lnt"> 249
&lt;/span>&lt;span class="lnt"> 250
&lt;/span>&lt;span class="lnt"> 251
&lt;/span>&lt;span class="lnt"> 252
&lt;/span>&lt;span class="lnt"> 253
&lt;/span>&lt;span class="lnt"> 254
&lt;/span>&lt;span class="lnt"> 255
&lt;/span>&lt;span class="lnt"> 256
&lt;/span>&lt;span class="lnt"> 257
&lt;/span>&lt;span class="lnt"> 258
&lt;/span>&lt;span class="lnt"> 259
&lt;/span>&lt;span class="lnt"> 260
&lt;/span>&lt;span class="lnt"> 261
&lt;/span>&lt;span class="lnt"> 262
&lt;/span>&lt;span class="lnt"> 263
&lt;/span>&lt;span class="lnt"> 264
&lt;/span>&lt;span class="lnt"> 265
&lt;/span>&lt;span class="lnt"> 266
&lt;/span>&lt;span class="lnt"> 267
&lt;/span>&lt;span class="lnt"> 268
&lt;/span>&lt;span class="lnt"> 269
&lt;/span>&lt;span class="lnt"> 270
&lt;/span>&lt;span class="lnt"> 271
&lt;/span>&lt;span class="lnt"> 272
&lt;/span>&lt;span class="lnt"> 273
&lt;/span>&lt;span class="lnt"> 274
&lt;/span>&lt;span class="lnt"> 275
&lt;/span>&lt;span class="lnt"> 276
&lt;/span>&lt;span class="lnt"> 277
&lt;/span>&lt;span class="lnt"> 278
&lt;/span>&lt;span class="lnt"> 279
&lt;/span>&lt;span class="lnt"> 280
&lt;/span>&lt;span class="lnt"> 281
&lt;/span>&lt;span class="lnt"> 282
&lt;/span>&lt;span class="lnt"> 283
&lt;/span>&lt;span class="lnt"> 284
&lt;/span>&lt;span class="lnt"> 285
&lt;/span>&lt;span class="lnt"> 286
&lt;/span>&lt;span class="lnt"> 287
&lt;/span>&lt;span class="lnt"> 288
&lt;/span>&lt;span class="lnt"> 289
&lt;/span>&lt;span class="lnt"> 290
&lt;/span>&lt;span class="lnt"> 291
&lt;/span>&lt;span class="lnt"> 292
&lt;/span>&lt;span class="lnt"> 293
&lt;/span>&lt;span class="lnt"> 294
&lt;/span>&lt;span class="lnt"> 295
&lt;/span>&lt;span class="lnt"> 296
&lt;/span>&lt;span class="lnt"> 297
&lt;/span>&lt;span class="lnt"> 298
&lt;/span>&lt;span class="lnt"> 299
&lt;/span>&lt;span class="lnt"> 300
&lt;/span>&lt;span class="lnt"> 301
&lt;/span>&lt;span class="lnt"> 302
&lt;/span>&lt;span class="lnt"> 303
&lt;/span>&lt;span class="lnt"> 304
&lt;/span>&lt;span class="lnt"> 305
&lt;/span>&lt;span class="lnt"> 306
&lt;/span>&lt;span class="lnt"> 307
&lt;/span>&lt;span class="lnt"> 308
&lt;/span>&lt;span class="lnt"> 309
&lt;/span>&lt;span class="lnt"> 310
&lt;/span>&lt;span class="lnt"> 311
&lt;/span>&lt;span class="lnt"> 312
&lt;/span>&lt;span class="lnt"> 313
&lt;/span>&lt;span class="lnt"> 314
&lt;/span>&lt;span class="lnt"> 315
&lt;/span>&lt;span class="lnt"> 316
&lt;/span>&lt;span class="lnt"> 317
&lt;/span>&lt;span class="lnt"> 318
&lt;/span>&lt;span class="lnt"> 319
&lt;/span>&lt;span class="lnt"> 320
&lt;/span>&lt;span class="lnt"> 321
&lt;/span>&lt;span class="lnt"> 322
&lt;/span>&lt;span class="lnt"> 323
&lt;/span>&lt;span class="lnt"> 324
&lt;/span>&lt;span class="lnt"> 325
&lt;/span>&lt;span class="lnt"> 326
&lt;/span>&lt;span class="lnt"> 327
&lt;/span>&lt;span class="lnt"> 328
&lt;/span>&lt;span class="lnt"> 329
&lt;/span>&lt;span class="lnt"> 330
&lt;/span>&lt;span class="lnt"> 331
&lt;/span>&lt;span class="lnt"> 332
&lt;/span>&lt;span class="lnt"> 333
&lt;/span>&lt;span class="lnt"> 334
&lt;/span>&lt;span class="lnt"> 335
&lt;/span>&lt;span class="lnt"> 336
&lt;/span>&lt;span class="lnt"> 337
&lt;/span>&lt;span class="lnt"> 338
&lt;/span>&lt;span class="lnt"> 339
&lt;/span>&lt;span class="lnt"> 340
&lt;/span>&lt;span class="lnt"> 341
&lt;/span>&lt;span class="lnt"> 342
&lt;/span>&lt;span class="lnt"> 343
&lt;/span>&lt;span class="lnt"> 344
&lt;/span>&lt;span class="lnt"> 345
&lt;/span>&lt;span class="lnt"> 346
&lt;/span>&lt;span class="lnt"> 347
&lt;/span>&lt;span class="lnt"> 348
&lt;/span>&lt;span class="lnt"> 349
&lt;/span>&lt;span class="lnt"> 350
&lt;/span>&lt;span class="lnt"> 351
&lt;/span>&lt;span class="lnt"> 352
&lt;/span>&lt;span class="lnt"> 353
&lt;/span>&lt;span class="lnt"> 354
&lt;/span>&lt;span class="lnt"> 355
&lt;/span>&lt;span class="lnt"> 356
&lt;/span>&lt;span class="lnt"> 357
&lt;/span>&lt;span class="lnt"> 358
&lt;/span>&lt;span class="lnt"> 359
&lt;/span>&lt;span class="lnt"> 360
&lt;/span>&lt;span class="lnt"> 361
&lt;/span>&lt;span class="lnt"> 362
&lt;/span>&lt;span class="lnt"> 363
&lt;/span>&lt;span class="lnt"> 364
&lt;/span>&lt;span class="lnt"> 365
&lt;/span>&lt;span class="lnt"> 366
&lt;/span>&lt;span class="lnt"> 367
&lt;/span>&lt;span class="lnt"> 368
&lt;/span>&lt;span class="lnt"> 369
&lt;/span>&lt;span class="lnt"> 370
&lt;/span>&lt;span class="lnt"> 371
&lt;/span>&lt;span class="lnt"> 372
&lt;/span>&lt;span class="lnt"> 373
&lt;/span>&lt;span class="lnt"> 374
&lt;/span>&lt;span class="lnt"> 375
&lt;/span>&lt;span class="lnt"> 376
&lt;/span>&lt;span class="lnt"> 377
&lt;/span>&lt;span class="lnt"> 378
&lt;/span>&lt;span class="lnt"> 379
&lt;/span>&lt;span class="lnt"> 380
&lt;/span>&lt;span class="lnt"> 381
&lt;/span>&lt;span class="lnt"> 382
&lt;/span>&lt;span class="lnt"> 383
&lt;/span>&lt;span class="lnt"> 384
&lt;/span>&lt;span class="lnt"> 385
&lt;/span>&lt;span class="lnt"> 386
&lt;/span>&lt;span class="lnt"> 387
&lt;/span>&lt;span class="lnt"> 388
&lt;/span>&lt;span class="lnt"> 389
&lt;/span>&lt;span class="lnt"> 390
&lt;/span>&lt;span class="lnt"> 391
&lt;/span>&lt;span class="lnt"> 392
&lt;/span>&lt;span class="lnt"> 393
&lt;/span>&lt;span class="lnt"> 394
&lt;/span>&lt;span class="lnt"> 395
&lt;/span>&lt;span class="lnt"> 396
&lt;/span>&lt;span class="lnt"> 397
&lt;/span>&lt;span class="lnt"> 398
&lt;/span>&lt;span class="lnt"> 399
&lt;/span>&lt;span class="lnt"> 400
&lt;/span>&lt;span class="lnt"> 401
&lt;/span>&lt;span class="lnt"> 402
&lt;/span>&lt;span class="lnt"> 403
&lt;/span>&lt;span class="lnt"> 404
&lt;/span>&lt;span class="lnt"> 405
&lt;/span>&lt;span class="lnt"> 406
&lt;/span>&lt;span class="lnt"> 407
&lt;/span>&lt;span class="lnt"> 408
&lt;/span>&lt;span class="lnt"> 409
&lt;/span>&lt;span class="lnt"> 410
&lt;/span>&lt;span class="lnt"> 411
&lt;/span>&lt;span class="lnt"> 412
&lt;/span>&lt;span class="lnt"> 413
&lt;/span>&lt;span class="lnt"> 414
&lt;/span>&lt;span class="lnt"> 415
&lt;/span>&lt;span class="lnt"> 416
&lt;/span>&lt;span class="lnt"> 417
&lt;/span>&lt;span class="lnt"> 418
&lt;/span>&lt;span class="lnt"> 419
&lt;/span>&lt;span class="lnt"> 420
&lt;/span>&lt;span class="lnt"> 421
&lt;/span>&lt;span class="lnt"> 422
&lt;/span>&lt;span class="lnt"> 423
&lt;/span>&lt;span class="lnt"> 424
&lt;/span>&lt;span class="lnt"> 425
&lt;/span>&lt;span class="lnt"> 426
&lt;/span>&lt;span class="lnt"> 427
&lt;/span>&lt;span class="lnt"> 428
&lt;/span>&lt;span class="lnt"> 429
&lt;/span>&lt;span class="lnt"> 430
&lt;/span>&lt;span class="lnt"> 431
&lt;/span>&lt;span class="lnt"> 432
&lt;/span>&lt;span class="lnt"> 433
&lt;/span>&lt;span class="lnt"> 434
&lt;/span>&lt;span class="lnt"> 435
&lt;/span>&lt;span class="lnt"> 436
&lt;/span>&lt;span class="lnt"> 437
&lt;/span>&lt;span class="lnt"> 438
&lt;/span>&lt;span class="lnt"> 439
&lt;/span>&lt;span class="lnt"> 440
&lt;/span>&lt;span class="lnt"> 441
&lt;/span>&lt;span class="lnt"> 442
&lt;/span>&lt;span class="lnt"> 443
&lt;/span>&lt;span class="lnt"> 444
&lt;/span>&lt;span class="lnt"> 445
&lt;/span>&lt;span class="lnt"> 446
&lt;/span>&lt;span class="lnt"> 447
&lt;/span>&lt;span class="lnt"> 448
&lt;/span>&lt;span class="lnt"> 449
&lt;/span>&lt;span class="lnt"> 450
&lt;/span>&lt;span class="lnt"> 451
&lt;/span>&lt;span class="lnt"> 452
&lt;/span>&lt;span class="lnt"> 453
&lt;/span>&lt;span class="lnt"> 454
&lt;/span>&lt;span class="lnt"> 455
&lt;/span>&lt;span class="lnt"> 456
&lt;/span>&lt;span class="lnt"> 457
&lt;/span>&lt;span class="lnt"> 458
&lt;/span>&lt;span class="lnt"> 459
&lt;/span>&lt;span class="lnt"> 460
&lt;/span>&lt;span class="lnt"> 461
&lt;/span>&lt;span class="lnt"> 462
&lt;/span>&lt;span class="lnt"> 463
&lt;/span>&lt;span class="lnt"> 464
&lt;/span>&lt;span class="lnt"> 465
&lt;/span>&lt;span class="lnt"> 466
&lt;/span>&lt;span class="lnt"> 467
&lt;/span>&lt;span class="lnt"> 468
&lt;/span>&lt;span class="lnt"> 469
&lt;/span>&lt;span class="lnt"> 470
&lt;/span>&lt;span class="lnt"> 471
&lt;/span>&lt;span class="lnt"> 472
&lt;/span>&lt;span class="lnt"> 473
&lt;/span>&lt;span class="lnt"> 474
&lt;/span>&lt;span class="lnt"> 475
&lt;/span>&lt;span class="lnt"> 476
&lt;/span>&lt;span class="lnt"> 477
&lt;/span>&lt;span class="lnt"> 478
&lt;/span>&lt;span class="lnt"> 479
&lt;/span>&lt;span class="lnt"> 480
&lt;/span>&lt;span class="lnt"> 481
&lt;/span>&lt;span class="lnt"> 482
&lt;/span>&lt;span class="lnt"> 483
&lt;/span>&lt;span class="lnt"> 484
&lt;/span>&lt;span class="lnt"> 485
&lt;/span>&lt;span class="lnt"> 486
&lt;/span>&lt;span class="lnt"> 487
&lt;/span>&lt;span class="lnt"> 488
&lt;/span>&lt;span class="lnt"> 489
&lt;/span>&lt;span class="lnt"> 490
&lt;/span>&lt;span class="lnt"> 491
&lt;/span>&lt;span class="lnt"> 492
&lt;/span>&lt;span class="lnt"> 493
&lt;/span>&lt;span class="lnt"> 494
&lt;/span>&lt;span class="lnt"> 495
&lt;/span>&lt;span class="lnt"> 496
&lt;/span>&lt;span class="lnt"> 497
&lt;/span>&lt;span class="lnt"> 498
&lt;/span>&lt;span class="lnt"> 499
&lt;/span>&lt;span class="lnt"> 500
&lt;/span>&lt;span class="lnt"> 501
&lt;/span>&lt;span class="lnt"> 502
&lt;/span>&lt;span class="lnt"> 503
&lt;/span>&lt;span class="lnt"> 504
&lt;/span>&lt;span class="lnt"> 505
&lt;/span>&lt;span class="lnt"> 506
&lt;/span>&lt;span class="lnt"> 507
&lt;/span>&lt;span class="lnt"> 508
&lt;/span>&lt;span class="lnt"> 509
&lt;/span>&lt;span class="lnt"> 510
&lt;/span>&lt;span class="lnt"> 511
&lt;/span>&lt;span class="lnt"> 512
&lt;/span>&lt;span class="lnt"> 513
&lt;/span>&lt;span class="lnt"> 514
&lt;/span>&lt;span class="lnt"> 515
&lt;/span>&lt;span class="lnt"> 516
&lt;/span>&lt;span class="lnt"> 517
&lt;/span>&lt;span class="lnt"> 518
&lt;/span>&lt;span class="lnt"> 519
&lt;/span>&lt;span class="lnt"> 520
&lt;/span>&lt;span class="lnt"> 521
&lt;/span>&lt;span class="lnt"> 522
&lt;/span>&lt;span class="lnt"> 523
&lt;/span>&lt;span class="lnt"> 524
&lt;/span>&lt;span class="lnt"> 525
&lt;/span>&lt;span class="lnt"> 526
&lt;/span>&lt;span class="lnt"> 527
&lt;/span>&lt;span class="lnt"> 528
&lt;/span>&lt;span class="lnt"> 529
&lt;/span>&lt;span class="lnt"> 530
&lt;/span>&lt;span class="lnt"> 531
&lt;/span>&lt;span class="lnt"> 532
&lt;/span>&lt;span class="lnt"> 533
&lt;/span>&lt;span class="lnt"> 534
&lt;/span>&lt;span class="lnt"> 535
&lt;/span>&lt;span class="lnt"> 536
&lt;/span>&lt;span class="lnt"> 537
&lt;/span>&lt;span class="lnt"> 538
&lt;/span>&lt;span class="lnt"> 539
&lt;/span>&lt;span class="lnt"> 540
&lt;/span>&lt;span class="lnt"> 541
&lt;/span>&lt;span class="lnt"> 542
&lt;/span>&lt;span class="lnt"> 543
&lt;/span>&lt;span class="lnt"> 544
&lt;/span>&lt;span class="lnt"> 545
&lt;/span>&lt;span class="lnt"> 546
&lt;/span>&lt;span class="lnt"> 547
&lt;/span>&lt;span class="lnt"> 548
&lt;/span>&lt;span class="lnt"> 549
&lt;/span>&lt;span class="lnt"> 550
&lt;/span>&lt;span class="lnt"> 551
&lt;/span>&lt;span class="lnt"> 552
&lt;/span>&lt;span class="lnt"> 553
&lt;/span>&lt;span class="lnt"> 554
&lt;/span>&lt;span class="lnt"> 555
&lt;/span>&lt;span class="lnt"> 556
&lt;/span>&lt;span class="lnt"> 557
&lt;/span>&lt;span class="lnt"> 558
&lt;/span>&lt;span class="lnt"> 559
&lt;/span>&lt;span class="lnt"> 560
&lt;/span>&lt;span class="lnt"> 561
&lt;/span>&lt;span class="lnt"> 562
&lt;/span>&lt;span class="lnt"> 563
&lt;/span>&lt;span class="lnt"> 564
&lt;/span>&lt;span class="lnt"> 565
&lt;/span>&lt;span class="lnt"> 566
&lt;/span>&lt;span class="lnt"> 567
&lt;/span>&lt;span class="lnt"> 568
&lt;/span>&lt;span class="lnt"> 569
&lt;/span>&lt;span class="lnt"> 570
&lt;/span>&lt;span class="lnt"> 571
&lt;/span>&lt;span class="lnt"> 572
&lt;/span>&lt;span class="lnt"> 573
&lt;/span>&lt;span class="lnt"> 574
&lt;/span>&lt;span class="lnt"> 575
&lt;/span>&lt;span class="lnt"> 576
&lt;/span>&lt;span class="lnt"> 577
&lt;/span>&lt;span class="lnt"> 578
&lt;/span>&lt;span class="lnt"> 579
&lt;/span>&lt;span class="lnt"> 580
&lt;/span>&lt;span class="lnt"> 581
&lt;/span>&lt;span class="lnt"> 582
&lt;/span>&lt;span class="lnt"> 583
&lt;/span>&lt;span class="lnt"> 584
&lt;/span>&lt;span class="lnt"> 585
&lt;/span>&lt;span class="lnt"> 586
&lt;/span>&lt;span class="lnt"> 587
&lt;/span>&lt;span class="lnt"> 588
&lt;/span>&lt;span class="lnt"> 589
&lt;/span>&lt;span class="lnt"> 590
&lt;/span>&lt;span class="lnt"> 591
&lt;/span>&lt;span class="lnt"> 592
&lt;/span>&lt;span class="lnt"> 593
&lt;/span>&lt;span class="lnt"> 594
&lt;/span>&lt;span class="lnt"> 595
&lt;/span>&lt;span class="lnt"> 596
&lt;/span>&lt;span class="lnt"> 597
&lt;/span>&lt;span class="lnt"> 598
&lt;/span>&lt;span class="lnt"> 599
&lt;/span>&lt;span class="lnt"> 600
&lt;/span>&lt;span class="lnt"> 601
&lt;/span>&lt;span class="lnt"> 602
&lt;/span>&lt;span class="lnt"> 603
&lt;/span>&lt;span class="lnt"> 604
&lt;/span>&lt;span class="lnt"> 605
&lt;/span>&lt;span class="lnt"> 606
&lt;/span>&lt;span class="lnt"> 607
&lt;/span>&lt;span class="lnt"> 608
&lt;/span>&lt;span class="lnt"> 609
&lt;/span>&lt;span class="lnt"> 610
&lt;/span>&lt;span class="lnt"> 611
&lt;/span>&lt;span class="lnt"> 612
&lt;/span>&lt;span class="lnt"> 613
&lt;/span>&lt;span class="lnt"> 614
&lt;/span>&lt;span class="lnt"> 615
&lt;/span>&lt;span class="lnt"> 616
&lt;/span>&lt;span class="lnt"> 617
&lt;/span>&lt;span class="lnt"> 618
&lt;/span>&lt;span class="lnt"> 619
&lt;/span>&lt;span class="lnt"> 620
&lt;/span>&lt;span class="lnt"> 621
&lt;/span>&lt;span class="lnt"> 622
&lt;/span>&lt;span class="lnt"> 623
&lt;/span>&lt;span class="lnt"> 624
&lt;/span>&lt;span class="lnt"> 625
&lt;/span>&lt;span class="lnt"> 626
&lt;/span>&lt;span class="lnt"> 627
&lt;/span>&lt;span class="lnt"> 628
&lt;/span>&lt;span class="lnt"> 629
&lt;/span>&lt;span class="lnt"> 630
&lt;/span>&lt;span class="lnt"> 631
&lt;/span>&lt;span class="lnt"> 632
&lt;/span>&lt;span class="lnt"> 633
&lt;/span>&lt;span class="lnt"> 634
&lt;/span>&lt;span class="lnt"> 635
&lt;/span>&lt;span class="lnt"> 636
&lt;/span>&lt;span class="lnt"> 637
&lt;/span>&lt;span class="lnt"> 638
&lt;/span>&lt;span class="lnt"> 639
&lt;/span>&lt;span class="lnt"> 640
&lt;/span>&lt;span class="lnt"> 641
&lt;/span>&lt;span class="lnt"> 642
&lt;/span>&lt;span class="lnt"> 643
&lt;/span>&lt;span class="lnt"> 644
&lt;/span>&lt;span class="lnt"> 645
&lt;/span>&lt;span class="lnt"> 646
&lt;/span>&lt;span class="lnt"> 647
&lt;/span>&lt;span class="lnt"> 648
&lt;/span>&lt;span class="lnt"> 649
&lt;/span>&lt;span class="lnt"> 650
&lt;/span>&lt;span class="lnt"> 651
&lt;/span>&lt;span class="lnt"> 652
&lt;/span>&lt;span class="lnt"> 653
&lt;/span>&lt;span class="lnt"> 654
&lt;/span>&lt;span class="lnt"> 655
&lt;/span>&lt;span class="lnt"> 656
&lt;/span>&lt;span class="lnt"> 657
&lt;/span>&lt;span class="lnt"> 658
&lt;/span>&lt;span class="lnt"> 659
&lt;/span>&lt;span class="lnt"> 660
&lt;/span>&lt;span class="lnt"> 661
&lt;/span>&lt;span class="lnt"> 662
&lt;/span>&lt;span class="lnt"> 663
&lt;/span>&lt;span class="lnt"> 664
&lt;/span>&lt;span class="lnt"> 665
&lt;/span>&lt;span class="lnt"> 666
&lt;/span>&lt;span class="lnt"> 667
&lt;/span>&lt;span class="lnt"> 668
&lt;/span>&lt;span class="lnt"> 669
&lt;/span>&lt;span class="lnt"> 670
&lt;/span>&lt;span class="lnt"> 671
&lt;/span>&lt;span class="lnt"> 672
&lt;/span>&lt;span class="lnt"> 673
&lt;/span>&lt;span class="lnt"> 674
&lt;/span>&lt;span class="lnt"> 675
&lt;/span>&lt;span class="lnt"> 676
&lt;/span>&lt;span class="lnt"> 677
&lt;/span>&lt;span class="lnt"> 678
&lt;/span>&lt;span class="lnt"> 679
&lt;/span>&lt;span class="lnt"> 680
&lt;/span>&lt;span class="lnt"> 681
&lt;/span>&lt;span class="lnt"> 682
&lt;/span>&lt;span class="lnt"> 683
&lt;/span>&lt;span class="lnt"> 684
&lt;/span>&lt;span class="lnt"> 685
&lt;/span>&lt;span class="lnt"> 686
&lt;/span>&lt;span class="lnt"> 687
&lt;/span>&lt;span class="lnt"> 688
&lt;/span>&lt;span class="lnt"> 689
&lt;/span>&lt;span class="lnt"> 690
&lt;/span>&lt;span class="lnt"> 691
&lt;/span>&lt;span class="lnt"> 692
&lt;/span>&lt;span class="lnt"> 693
&lt;/span>&lt;span class="lnt"> 694
&lt;/span>&lt;span class="lnt"> 695
&lt;/span>&lt;span class="lnt"> 696
&lt;/span>&lt;span class="lnt"> 697
&lt;/span>&lt;span class="lnt"> 698
&lt;/span>&lt;span class="lnt"> 699
&lt;/span>&lt;span class="lnt"> 700
&lt;/span>&lt;span class="lnt"> 701
&lt;/span>&lt;span class="lnt"> 702
&lt;/span>&lt;span class="lnt"> 703
&lt;/span>&lt;span class="lnt"> 704
&lt;/span>&lt;span class="lnt"> 705
&lt;/span>&lt;span class="lnt"> 706
&lt;/span>&lt;span class="lnt"> 707
&lt;/span>&lt;span class="lnt"> 708
&lt;/span>&lt;span class="lnt"> 709
&lt;/span>&lt;span class="lnt"> 710
&lt;/span>&lt;span class="lnt"> 711
&lt;/span>&lt;span class="lnt"> 712
&lt;/span>&lt;span class="lnt"> 713
&lt;/span>&lt;span class="lnt"> 714
&lt;/span>&lt;span class="lnt"> 715
&lt;/span>&lt;span class="lnt"> 716
&lt;/span>&lt;span class="lnt"> 717
&lt;/span>&lt;span class="lnt"> 718
&lt;/span>&lt;span class="lnt"> 719
&lt;/span>&lt;span class="lnt"> 720
&lt;/span>&lt;span class="lnt"> 721
&lt;/span>&lt;span class="lnt"> 722
&lt;/span>&lt;span class="lnt"> 723
&lt;/span>&lt;span class="lnt"> 724
&lt;/span>&lt;span class="lnt"> 725
&lt;/span>&lt;span class="lnt"> 726
&lt;/span>&lt;span class="lnt"> 727
&lt;/span>&lt;span class="lnt"> 728
&lt;/span>&lt;span class="lnt"> 729
&lt;/span>&lt;span class="lnt"> 730
&lt;/span>&lt;span class="lnt"> 731
&lt;/span>&lt;span class="lnt"> 732
&lt;/span>&lt;span class="lnt"> 733
&lt;/span>&lt;span class="lnt"> 734
&lt;/span>&lt;span class="lnt"> 735
&lt;/span>&lt;span class="lnt"> 736
&lt;/span>&lt;span class="lnt"> 737
&lt;/span>&lt;span class="lnt"> 738
&lt;/span>&lt;span class="lnt"> 739
&lt;/span>&lt;span class="lnt"> 740
&lt;/span>&lt;span class="lnt"> 741
&lt;/span>&lt;span class="lnt"> 742
&lt;/span>&lt;span class="lnt"> 743
&lt;/span>&lt;span class="lnt"> 744
&lt;/span>&lt;span class="lnt"> 745
&lt;/span>&lt;span class="lnt"> 746
&lt;/span>&lt;span class="lnt"> 747
&lt;/span>&lt;span class="lnt"> 748
&lt;/span>&lt;span class="lnt"> 749
&lt;/span>&lt;span class="lnt"> 750
&lt;/span>&lt;span class="lnt"> 751
&lt;/span>&lt;span class="lnt"> 752
&lt;/span>&lt;span class="lnt"> 753
&lt;/span>&lt;span class="lnt"> 754
&lt;/span>&lt;span class="lnt"> 755
&lt;/span>&lt;span class="lnt"> 756
&lt;/span>&lt;span class="lnt"> 757
&lt;/span>&lt;span class="lnt"> 758
&lt;/span>&lt;span class="lnt"> 759
&lt;/span>&lt;span class="lnt"> 760
&lt;/span>&lt;span class="lnt"> 761
&lt;/span>&lt;span class="lnt"> 762
&lt;/span>&lt;span class="lnt"> 763
&lt;/span>&lt;span class="lnt"> 764
&lt;/span>&lt;span class="lnt"> 765
&lt;/span>&lt;span class="lnt"> 766
&lt;/span>&lt;span class="lnt"> 767
&lt;/span>&lt;span class="lnt"> 768
&lt;/span>&lt;span class="lnt"> 769
&lt;/span>&lt;span class="lnt"> 770
&lt;/span>&lt;span class="lnt"> 771
&lt;/span>&lt;span class="lnt"> 772
&lt;/span>&lt;span class="lnt"> 773
&lt;/span>&lt;span class="lnt"> 774
&lt;/span>&lt;span class="lnt"> 775
&lt;/span>&lt;span class="lnt"> 776
&lt;/span>&lt;span class="lnt"> 777
&lt;/span>&lt;span class="lnt"> 778
&lt;/span>&lt;span class="lnt"> 779
&lt;/span>&lt;span class="lnt"> 780
&lt;/span>&lt;span class="lnt"> 781
&lt;/span>&lt;span class="lnt"> 782
&lt;/span>&lt;span class="lnt"> 783
&lt;/span>&lt;span class="lnt"> 784
&lt;/span>&lt;span class="lnt"> 785
&lt;/span>&lt;span class="lnt"> 786
&lt;/span>&lt;span class="lnt"> 787
&lt;/span>&lt;span class="lnt"> 788
&lt;/span>&lt;span class="lnt"> 789
&lt;/span>&lt;span class="lnt"> 790
&lt;/span>&lt;span class="lnt"> 791
&lt;/span>&lt;span class="lnt"> 792
&lt;/span>&lt;span class="lnt"> 793
&lt;/span>&lt;span class="lnt"> 794
&lt;/span>&lt;span class="lnt"> 795
&lt;/span>&lt;span class="lnt"> 796
&lt;/span>&lt;span class="lnt"> 797
&lt;/span>&lt;span class="lnt"> 798
&lt;/span>&lt;span class="lnt"> 799
&lt;/span>&lt;span class="lnt"> 800
&lt;/span>&lt;span class="lnt"> 801
&lt;/span>&lt;span class="lnt"> 802
&lt;/span>&lt;span class="lnt"> 803
&lt;/span>&lt;span class="lnt"> 804
&lt;/span>&lt;span class="lnt"> 805
&lt;/span>&lt;span class="lnt"> 806
&lt;/span>&lt;span class="lnt"> 807
&lt;/span>&lt;span class="lnt"> 808
&lt;/span>&lt;span class="lnt"> 809
&lt;/span>&lt;span class="lnt"> 810
&lt;/span>&lt;span class="lnt"> 811
&lt;/span>&lt;span class="lnt"> 812
&lt;/span>&lt;span class="lnt"> 813
&lt;/span>&lt;span class="lnt"> 814
&lt;/span>&lt;span class="lnt"> 815
&lt;/span>&lt;span class="lnt"> 816
&lt;/span>&lt;span class="lnt"> 817
&lt;/span>&lt;span class="lnt"> 818
&lt;/span>&lt;span class="lnt"> 819
&lt;/span>&lt;span class="lnt"> 820
&lt;/span>&lt;span class="lnt"> 821
&lt;/span>&lt;span class="lnt"> 822
&lt;/span>&lt;span class="lnt"> 823
&lt;/span>&lt;span class="lnt"> 824
&lt;/span>&lt;span class="lnt"> 825
&lt;/span>&lt;span class="lnt"> 826
&lt;/span>&lt;span class="lnt"> 827
&lt;/span>&lt;span class="lnt"> 828
&lt;/span>&lt;span class="lnt"> 829
&lt;/span>&lt;span class="lnt"> 830
&lt;/span>&lt;span class="lnt"> 831
&lt;/span>&lt;span class="lnt"> 832
&lt;/span>&lt;span class="lnt"> 833
&lt;/span>&lt;span class="lnt"> 834
&lt;/span>&lt;span class="lnt"> 835
&lt;/span>&lt;span class="lnt"> 836
&lt;/span>&lt;span class="lnt"> 837
&lt;/span>&lt;span class="lnt"> 838
&lt;/span>&lt;span class="lnt"> 839
&lt;/span>&lt;span class="lnt"> 840
&lt;/span>&lt;span class="lnt"> 841
&lt;/span>&lt;span class="lnt"> 842
&lt;/span>&lt;span class="lnt"> 843
&lt;/span>&lt;span class="lnt"> 844
&lt;/span>&lt;span class="lnt"> 845
&lt;/span>&lt;span class="lnt"> 846
&lt;/span>&lt;span class="lnt"> 847
&lt;/span>&lt;span class="lnt"> 848
&lt;/span>&lt;span class="lnt"> 849
&lt;/span>&lt;span class="lnt"> 850
&lt;/span>&lt;span class="lnt"> 851
&lt;/span>&lt;span class="lnt"> 852
&lt;/span>&lt;span class="lnt"> 853
&lt;/span>&lt;span class="lnt"> 854
&lt;/span>&lt;span class="lnt"> 855
&lt;/span>&lt;span class="lnt"> 856
&lt;/span>&lt;span class="lnt"> 857
&lt;/span>&lt;span class="lnt"> 858
&lt;/span>&lt;span class="lnt"> 859
&lt;/span>&lt;span class="lnt"> 860
&lt;/span>&lt;span class="lnt"> 861
&lt;/span>&lt;span class="lnt"> 862
&lt;/span>&lt;span class="lnt"> 863
&lt;/span>&lt;span class="lnt"> 864
&lt;/span>&lt;span class="lnt"> 865
&lt;/span>&lt;span class="lnt"> 866
&lt;/span>&lt;span class="lnt"> 867
&lt;/span>&lt;span class="lnt"> 868
&lt;/span>&lt;span class="lnt"> 869
&lt;/span>&lt;span class="lnt"> 870
&lt;/span>&lt;span class="lnt"> 871
&lt;/span>&lt;span class="lnt"> 872
&lt;/span>&lt;span class="lnt"> 873
&lt;/span>&lt;span class="lnt"> 874
&lt;/span>&lt;span class="lnt"> 875
&lt;/span>&lt;span class="lnt"> 876
&lt;/span>&lt;span class="lnt"> 877
&lt;/span>&lt;span class="lnt"> 878
&lt;/span>&lt;span class="lnt"> 879
&lt;/span>&lt;span class="lnt"> 880
&lt;/span>&lt;span class="lnt"> 881
&lt;/span>&lt;span class="lnt"> 882
&lt;/span>&lt;span class="lnt"> 883
&lt;/span>&lt;span class="lnt"> 884
&lt;/span>&lt;span class="lnt"> 885
&lt;/span>&lt;span class="lnt"> 886
&lt;/span>&lt;span class="lnt"> 887
&lt;/span>&lt;span class="lnt"> 888
&lt;/span>&lt;span class="lnt"> 889
&lt;/span>&lt;span class="lnt"> 890
&lt;/span>&lt;span class="lnt"> 891
&lt;/span>&lt;span class="lnt"> 892
&lt;/span>&lt;span class="lnt"> 893
&lt;/span>&lt;span class="lnt"> 894
&lt;/span>&lt;span class="lnt"> 895
&lt;/span>&lt;span class="lnt"> 896
&lt;/span>&lt;span class="lnt"> 897
&lt;/span>&lt;span class="lnt"> 898
&lt;/span>&lt;span class="lnt"> 899
&lt;/span>&lt;span class="lnt"> 900
&lt;/span>&lt;span class="lnt"> 901
&lt;/span>&lt;span class="lnt"> 902
&lt;/span>&lt;span class="lnt"> 903
&lt;/span>&lt;span class="lnt"> 904
&lt;/span>&lt;span class="lnt"> 905
&lt;/span>&lt;span class="lnt"> 906
&lt;/span>&lt;span class="lnt"> 907
&lt;/span>&lt;span class="lnt"> 908
&lt;/span>&lt;span class="lnt"> 909
&lt;/span>&lt;span class="lnt"> 910
&lt;/span>&lt;span class="lnt"> 911
&lt;/span>&lt;span class="lnt"> 912
&lt;/span>&lt;span class="lnt"> 913
&lt;/span>&lt;span class="lnt"> 914
&lt;/span>&lt;span class="lnt"> 915
&lt;/span>&lt;span class="lnt"> 916
&lt;/span>&lt;span class="lnt"> 917
&lt;/span>&lt;span class="lnt"> 918
&lt;/span>&lt;span class="lnt"> 919
&lt;/span>&lt;span class="lnt"> 920
&lt;/span>&lt;span class="lnt"> 921
&lt;/span>&lt;span class="lnt"> 922
&lt;/span>&lt;span class="lnt"> 923
&lt;/span>&lt;span class="lnt"> 924
&lt;/span>&lt;span class="lnt"> 925
&lt;/span>&lt;span class="lnt"> 926
&lt;/span>&lt;span class="lnt"> 927
&lt;/span>&lt;span class="lnt"> 928
&lt;/span>&lt;span class="lnt"> 929
&lt;/span>&lt;span class="lnt"> 930
&lt;/span>&lt;span class="lnt"> 931
&lt;/span>&lt;span class="lnt"> 932
&lt;/span>&lt;span class="lnt"> 933
&lt;/span>&lt;span class="lnt"> 934
&lt;/span>&lt;span class="lnt"> 935
&lt;/span>&lt;span class="lnt"> 936
&lt;/span>&lt;span class="lnt"> 937
&lt;/span>&lt;span class="lnt"> 938
&lt;/span>&lt;span class="lnt"> 939
&lt;/span>&lt;span class="lnt"> 940
&lt;/span>&lt;span class="lnt"> 941
&lt;/span>&lt;span class="lnt"> 942
&lt;/span>&lt;span class="lnt"> 943
&lt;/span>&lt;span class="lnt"> 944
&lt;/span>&lt;span class="lnt"> 945
&lt;/span>&lt;span class="lnt"> 946
&lt;/span>&lt;span class="lnt"> 947
&lt;/span>&lt;span class="lnt"> 948
&lt;/span>&lt;span class="lnt"> 949
&lt;/span>&lt;span class="lnt"> 950
&lt;/span>&lt;span class="lnt"> 951
&lt;/span>&lt;span class="lnt"> 952
&lt;/span>&lt;span class="lnt"> 953
&lt;/span>&lt;span class="lnt"> 954
&lt;/span>&lt;span class="lnt"> 955
&lt;/span>&lt;span class="lnt"> 956
&lt;/span>&lt;span class="lnt"> 957
&lt;/span>&lt;span class="lnt"> 958
&lt;/span>&lt;span class="lnt"> 959
&lt;/span>&lt;span class="lnt"> 960
&lt;/span>&lt;span class="lnt"> 961
&lt;/span>&lt;span class="lnt"> 962
&lt;/span>&lt;span class="lnt"> 963
&lt;/span>&lt;span class="lnt"> 964
&lt;/span>&lt;span class="lnt"> 965
&lt;/span>&lt;span class="lnt"> 966
&lt;/span>&lt;span class="lnt"> 967
&lt;/span>&lt;span class="lnt"> 968
&lt;/span>&lt;span class="lnt"> 969
&lt;/span>&lt;span class="lnt"> 970
&lt;/span>&lt;span class="lnt"> 971
&lt;/span>&lt;span class="lnt"> 972
&lt;/span>&lt;span class="lnt"> 973
&lt;/span>&lt;span class="lnt"> 974
&lt;/span>&lt;span class="lnt"> 975
&lt;/span>&lt;span class="lnt"> 976
&lt;/span>&lt;span class="lnt"> 977
&lt;/span>&lt;span class="lnt"> 978
&lt;/span>&lt;span class="lnt"> 979
&lt;/span>&lt;span class="lnt"> 980
&lt;/span>&lt;span class="lnt"> 981
&lt;/span>&lt;span class="lnt"> 982
&lt;/span>&lt;span class="lnt"> 983
&lt;/span>&lt;span class="lnt"> 984
&lt;/span>&lt;span class="lnt"> 985
&lt;/span>&lt;span class="lnt"> 986
&lt;/span>&lt;span class="lnt"> 987
&lt;/span>&lt;span class="lnt"> 988
&lt;/span>&lt;span class="lnt"> 989
&lt;/span>&lt;span class="lnt"> 990
&lt;/span>&lt;span class="lnt"> 991
&lt;/span>&lt;span class="lnt"> 992
&lt;/span>&lt;span class="lnt"> 993
&lt;/span>&lt;span class="lnt"> 994
&lt;/span>&lt;span class="lnt"> 995
&lt;/span>&lt;span class="lnt"> 996
&lt;/span>&lt;span class="lnt"> 997
&lt;/span>&lt;span class="lnt"> 998
&lt;/span>&lt;span class="lnt"> 999
&lt;/span>&lt;span class="lnt">1000
&lt;/span>&lt;span class="lnt">1001
&lt;/span>&lt;span class="lnt">1002
&lt;/span>&lt;span class="lnt">1003
&lt;/span>&lt;span class="lnt">1004
&lt;/span>&lt;span class="lnt">1005
&lt;/span>&lt;span class="lnt">1006
&lt;/span>&lt;span class="lnt">1007
&lt;/span>&lt;span class="lnt">1008
&lt;/span>&lt;span class="lnt">1009
&lt;/span>&lt;span class="lnt">1010
&lt;/span>&lt;span class="lnt">1011
&lt;/span>&lt;span class="lnt">1012
&lt;/span>&lt;span class="lnt">1013
&lt;/span>&lt;span class="lnt">1014
&lt;/span>&lt;span class="lnt">1015
&lt;/span>&lt;span class="lnt">1016
&lt;/span>&lt;span class="lnt">1017
&lt;/span>&lt;span class="lnt">1018
&lt;/span>&lt;span class="lnt">1019
&lt;/span>&lt;span class="lnt">1020
&lt;/span>&lt;span class="lnt">1021
&lt;/span>&lt;span class="lnt">1022
&lt;/span>&lt;span class="lnt">1023
&lt;/span>&lt;span class="lnt">1024
&lt;/span>&lt;span class="lnt">1025
&lt;/span>&lt;span class="lnt">1026
&lt;/span>&lt;span class="lnt">1027
&lt;/span>&lt;span class="lnt">1028
&lt;/span>&lt;span class="lnt">1029
&lt;/span>&lt;span class="lnt">1030
&lt;/span>&lt;span class="lnt">1031
&lt;/span>&lt;span class="lnt">1032
&lt;/span>&lt;span class="lnt">1033
&lt;/span>&lt;span class="lnt">1034
&lt;/span>&lt;span class="lnt">1035
&lt;/span>&lt;span class="lnt">1036
&lt;/span>&lt;span class="lnt">1037
&lt;/span>&lt;span class="lnt">1038
&lt;/span>&lt;span class="lnt">1039
&lt;/span>&lt;span class="lnt">1040
&lt;/span>&lt;span class="lnt">1041
&lt;/span>&lt;span class="lnt">1042
&lt;/span>&lt;span class="lnt">1043
&lt;/span>&lt;span class="lnt">1044
&lt;/span>&lt;span class="lnt">1045
&lt;/span>&lt;span class="lnt">1046
&lt;/span>&lt;span class="lnt">1047
&lt;/span>&lt;span class="lnt">1048
&lt;/span>&lt;span class="lnt">1049
&lt;/span>&lt;span class="lnt">1050
&lt;/span>&lt;span class="lnt">1051
&lt;/span>&lt;span class="lnt">1052
&lt;/span>&lt;span class="lnt">1053
&lt;/span>&lt;span class="lnt">1054
&lt;/span>&lt;span class="lnt">1055
&lt;/span>&lt;span class="lnt">1056
&lt;/span>&lt;span class="lnt">1057
&lt;/span>&lt;span class="lnt">1058
&lt;/span>&lt;span class="lnt">1059
&lt;/span>&lt;span class="lnt">1060
&lt;/span>&lt;span class="lnt">1061
&lt;/span>&lt;span class="lnt">1062
&lt;/span>&lt;span class="lnt">1063
&lt;/span>&lt;span class="lnt">1064
&lt;/span>&lt;span class="lnt">1065
&lt;/span>&lt;span class="lnt">1066
&lt;/span>&lt;span class="lnt">1067
&lt;/span>&lt;span class="lnt">1068
&lt;/span>&lt;span class="lnt">1069
&lt;/span>&lt;span class="lnt">1070
&lt;/span>&lt;span class="lnt">1071
&lt;/span>&lt;span class="lnt">1072
&lt;/span>&lt;span class="lnt">1073
&lt;/span>&lt;span class="lnt">1074
&lt;/span>&lt;span class="lnt">1075
&lt;/span>&lt;span class="lnt">1076
&lt;/span>&lt;span class="lnt">1077
&lt;/span>&lt;span class="lnt">1078
&lt;/span>&lt;span class="lnt">1079
&lt;/span>&lt;span class="lnt">1080
&lt;/span>&lt;span class="lnt">1081
&lt;/span>&lt;span class="lnt">1082
&lt;/span>&lt;span class="lnt">1083
&lt;/span>&lt;span class="lnt">1084
&lt;/span>&lt;span class="lnt">1085
&lt;/span>&lt;span class="lnt">1086
&lt;/span>&lt;span class="lnt">1087
&lt;/span>&lt;span class="lnt">1088
&lt;/span>&lt;span class="lnt">1089
&lt;/span>&lt;span class="lnt">1090
&lt;/span>&lt;span class="lnt">1091
&lt;/span>&lt;span class="lnt">1092
&lt;/span>&lt;span class="lnt">1093
&lt;/span>&lt;span class="lnt">1094
&lt;/span>&lt;span class="lnt">1095
&lt;/span>&lt;span class="lnt">1096
&lt;/span>&lt;span class="lnt">1097
&lt;/span>&lt;span class="lnt">1098
&lt;/span>&lt;span class="lnt">1099
&lt;/span>&lt;span class="lnt">1100
&lt;/span>&lt;span class="lnt">1101
&lt;/span>&lt;span class="lnt">1102
&lt;/span>&lt;span class="lnt">1103
&lt;/span>&lt;span class="lnt">1104
&lt;/span>&lt;span class="lnt">1105
&lt;/span>&lt;span class="lnt">1106
&lt;/span>&lt;span class="lnt">1107
&lt;/span>&lt;span class="lnt">1108
&lt;/span>&lt;span class="lnt">1109
&lt;/span>&lt;span class="lnt">1110
&lt;/span>&lt;span class="lnt">1111
&lt;/span>&lt;span class="lnt">1112
&lt;/span>&lt;span class="lnt">1113
&lt;/span>&lt;span class="lnt">1114
&lt;/span>&lt;span class="lnt">1115
&lt;/span>&lt;span class="lnt">1116
&lt;/span>&lt;span class="lnt">1117
&lt;/span>&lt;span class="lnt">1118
&lt;/span>&lt;span class="lnt">1119
&lt;/span>&lt;span class="lnt">1120
&lt;/span>&lt;span class="lnt">1121
&lt;/span>&lt;span class="lnt">1122
&lt;/span>&lt;span class="lnt">1123
&lt;/span>&lt;span class="lnt">1124
&lt;/span>&lt;span class="lnt">1125
&lt;/span>&lt;span class="lnt">1126
&lt;/span>&lt;span class="lnt">1127
&lt;/span>&lt;span class="lnt">1128
&lt;/span>&lt;span class="lnt">1129
&lt;/span>&lt;span class="lnt">1130
&lt;/span>&lt;span class="lnt">1131
&lt;/span>&lt;span class="lnt">1132
&lt;/span>&lt;span class="lnt">1133
&lt;/span>&lt;span class="lnt">1134
&lt;/span>&lt;span class="lnt">1135
&lt;/span>&lt;span class="lnt">1136
&lt;/span>&lt;span class="lnt">1137
&lt;/span>&lt;span class="lnt">1138
&lt;/span>&lt;span class="lnt">1139
&lt;/span>&lt;span class="lnt">1140
&lt;/span>&lt;span class="lnt">1141
&lt;/span>&lt;span class="lnt">1142
&lt;/span>&lt;span class="lnt">1143
&lt;/span>&lt;span class="lnt">1144
&lt;/span>&lt;span class="lnt">1145
&lt;/span>&lt;span class="lnt">1146
&lt;/span>&lt;span class="lnt">1147
&lt;/span>&lt;span class="lnt">1148
&lt;/span>&lt;span class="lnt">1149
&lt;/span>&lt;span class="lnt">1150
&lt;/span>&lt;span class="lnt">1151
&lt;/span>&lt;span class="lnt">1152
&lt;/span>&lt;span class="lnt">1153
&lt;/span>&lt;span class="lnt">1154
&lt;/span>&lt;span class="lnt">1155
&lt;/span>&lt;span class="lnt">1156
&lt;/span>&lt;span class="lnt">1157
&lt;/span>&lt;span class="lnt">1158
&lt;/span>&lt;span class="lnt">1159
&lt;/span>&lt;span class="lnt">1160
&lt;/span>&lt;span class="lnt">1161
&lt;/span>&lt;span class="lnt">1162
&lt;/span>&lt;span class="lnt">1163
&lt;/span>&lt;span class="lnt">1164
&lt;/span>&lt;span class="lnt">1165
&lt;/span>&lt;span class="lnt">1166
&lt;/span>&lt;span class="lnt">1167
&lt;/span>&lt;span class="lnt">1168
&lt;/span>&lt;span class="lnt">1169
&lt;/span>&lt;span class="lnt">1170
&lt;/span>&lt;span class="lnt">1171
&lt;/span>&lt;span class="lnt">1172
&lt;/span>&lt;span class="lnt">1173
&lt;/span>&lt;span class="lnt">1174
&lt;/span>&lt;span class="lnt">1175
&lt;/span>&lt;span class="lnt">1176
&lt;/span>&lt;span class="lnt">1177
&lt;/span>&lt;span class="lnt">1178
&lt;/span>&lt;span class="lnt">1179
&lt;/span>&lt;span class="lnt">1180
&lt;/span>&lt;span class="lnt">1181
&lt;/span>&lt;span class="lnt">1182
&lt;/span>&lt;span class="lnt">1183
&lt;/span>&lt;span class="lnt">1184
&lt;/span>&lt;span class="lnt">1185
&lt;/span>&lt;span class="lnt">1186
&lt;/span>&lt;span class="lnt">1187
&lt;/span>&lt;span class="lnt">1188
&lt;/span>&lt;span class="lnt">1189
&lt;/span>&lt;span class="lnt">1190
&lt;/span>&lt;span class="lnt">1191
&lt;/span>&lt;span class="lnt">1192
&lt;/span>&lt;span class="lnt">1193
&lt;/span>&lt;span class="lnt">1194
&lt;/span>&lt;span class="lnt">1195
&lt;/span>&lt;span class="lnt">1196
&lt;/span>&lt;span class="lnt">1197
&lt;/span>&lt;span class="lnt">1198
&lt;/span>&lt;span class="lnt">1199
&lt;/span>&lt;span class="lnt">1200
&lt;/span>&lt;span class="lnt">1201
&lt;/span>&lt;span class="lnt">1202
&lt;/span>&lt;span class="lnt">1203
&lt;/span>&lt;span class="lnt">1204
&lt;/span>&lt;span class="lnt">1205
&lt;/span>&lt;span class="lnt">1206
&lt;/span>&lt;span class="lnt">1207
&lt;/span>&lt;span class="lnt">1208
&lt;/span>&lt;span class="lnt">1209
&lt;/span>&lt;span class="lnt">1210
&lt;/span>&lt;span class="lnt">1211
&lt;/span>&lt;span class="lnt">1212
&lt;/span>&lt;span class="lnt">1213
&lt;/span>&lt;span class="lnt">1214
&lt;/span>&lt;span class="lnt">1215
&lt;/span>&lt;span class="lnt">1216
&lt;/span>&lt;span class="lnt">1217
&lt;/span>&lt;span class="lnt">1218
&lt;/span>&lt;span class="lnt">1219
&lt;/span>&lt;span class="lnt">1220
&lt;/span>&lt;span class="lnt">1221
&lt;/span>&lt;span class="lnt">1222
&lt;/span>&lt;span class="lnt">1223
&lt;/span>&lt;span class="lnt">1224
&lt;/span>&lt;span class="lnt">1225
&lt;/span>&lt;span class="lnt">1226
&lt;/span>&lt;span class="lnt">1227
&lt;/span>&lt;span class="lnt">1228
&lt;/span>&lt;span class="lnt">1229
&lt;/span>&lt;span class="lnt">1230
&lt;/span>&lt;span class="lnt">1231
&lt;/span>&lt;span class="lnt">1232
&lt;/span>&lt;span class="lnt">1233
&lt;/span>&lt;span class="lnt">1234
&lt;/span>&lt;span class="lnt">1235
&lt;/span>&lt;span class="lnt">1236
&lt;/span>&lt;span class="lnt">1237
&lt;/span>&lt;span class="lnt">1238
&lt;/span>&lt;span class="lnt">1239
&lt;/span>&lt;span class="lnt">1240
&lt;/span>&lt;span class="lnt">1241
&lt;/span>&lt;span class="lnt">1242
&lt;/span>&lt;span class="lnt">1243
&lt;/span>&lt;span class="lnt">1244
&lt;/span>&lt;span class="lnt">1245
&lt;/span>&lt;span class="lnt">1246
&lt;/span>&lt;span class="lnt">1247
&lt;/span>&lt;span class="lnt">1248
&lt;/span>&lt;span class="lnt">1249
&lt;/span>&lt;span class="lnt">1250
&lt;/span>&lt;span class="lnt">1251
&lt;/span>&lt;span class="lnt">1252
&lt;/span>&lt;span class="lnt">1253
&lt;/span>&lt;span class="lnt">1254
&lt;/span>&lt;span class="lnt">1255
&lt;/span>&lt;span class="lnt">1256
&lt;/span>&lt;span class="lnt">1257
&lt;/span>&lt;span class="lnt">1258
&lt;/span>&lt;span class="lnt">1259
&lt;/span>&lt;span class="lnt">1260
&lt;/span>&lt;span class="lnt">1261
&lt;/span>&lt;span class="lnt">1262
&lt;/span>&lt;span class="lnt">1263
&lt;/span>&lt;span class="lnt">1264
&lt;/span>&lt;span class="lnt">1265
&lt;/span>&lt;span class="lnt">1266
&lt;/span>&lt;span class="lnt">1267
&lt;/span>&lt;span class="lnt">1268
&lt;/span>&lt;span class="lnt">1269
&lt;/span>&lt;span class="lnt">1270
&lt;/span>&lt;span class="lnt">1271
&lt;/span>&lt;span class="lnt">1272
&lt;/span>&lt;span class="lnt">1273
&lt;/span>&lt;span class="lnt">1274
&lt;/span>&lt;span class="lnt">1275
&lt;/span>&lt;span class="lnt">1276
&lt;/span>&lt;span class="lnt">1277
&lt;/span>&lt;span class="lnt">1278
&lt;/span>&lt;span class="lnt">1279
&lt;/span>&lt;span class="lnt">1280
&lt;/span>&lt;span class="lnt">1281
&lt;/span>&lt;span class="lnt">1282
&lt;/span>&lt;span class="lnt">1283
&lt;/span>&lt;span class="lnt">1284
&lt;/span>&lt;span class="lnt">1285
&lt;/span>&lt;span class="lnt">1286
&lt;/span>&lt;span class="lnt">1287
&lt;/span>&lt;span class="lnt">1288
&lt;/span>&lt;span class="lnt">1289
&lt;/span>&lt;span class="lnt">1290
&lt;/span>&lt;span class="lnt">1291
&lt;/span>&lt;span class="lnt">1292
&lt;/span>&lt;span class="lnt">1293
&lt;/span>&lt;span class="lnt">1294
&lt;/span>&lt;span class="lnt">1295
&lt;/span>&lt;span class="lnt">1296
&lt;/span>&lt;span class="lnt">1297
&lt;/span>&lt;span class="lnt">1298
&lt;/span>&lt;span class="lnt">1299
&lt;/span>&lt;span class="lnt">1300
&lt;/span>&lt;span class="lnt">1301
&lt;/span>&lt;span class="lnt">1302
&lt;/span>&lt;span class="lnt">1303
&lt;/span>&lt;span class="lnt">1304
&lt;/span>&lt;span class="lnt">1305
&lt;/span>&lt;span class="lnt">1306
&lt;/span>&lt;span class="lnt">1307
&lt;/span>&lt;span class="lnt">1308
&lt;/span>&lt;span class="lnt">1309
&lt;/span>&lt;span class="lnt">1310
&lt;/span>&lt;span class="lnt">1311
&lt;/span>&lt;span class="lnt">1312
&lt;/span>&lt;span class="lnt">1313
&lt;/span>&lt;span class="lnt">1314
&lt;/span>&lt;span class="lnt">1315
&lt;/span>&lt;span class="lnt">1316
&lt;/span>&lt;span class="lnt">1317
&lt;/span>&lt;span class="lnt">1318
&lt;/span>&lt;span class="lnt">1319
&lt;/span>&lt;span class="lnt">1320
&lt;/span>&lt;span class="lnt">1321
&lt;/span>&lt;span class="lnt">1322
&lt;/span>&lt;span class="lnt">1323
&lt;/span>&lt;span class="lnt">1324
&lt;/span>&lt;span class="lnt">1325
&lt;/span>&lt;span class="lnt">1326
&lt;/span>&lt;span class="lnt">1327
&lt;/span>&lt;span class="lnt">1328
&lt;/span>&lt;span class="lnt">1329
&lt;/span>&lt;span class="lnt">1330
&lt;/span>&lt;span class="lnt">1331
&lt;/span>&lt;span class="lnt">1332
&lt;/span>&lt;span class="lnt">1333
&lt;/span>&lt;span class="lnt">1334
&lt;/span>&lt;span class="lnt">1335
&lt;/span>&lt;span class="lnt">1336
&lt;/span>&lt;span class="lnt">1337
&lt;/span>&lt;span class="lnt">1338
&lt;/span>&lt;span class="lnt">1339
&lt;/span>&lt;span class="lnt">1340
&lt;/span>&lt;span class="lnt">1341
&lt;/span>&lt;span class="lnt">1342
&lt;/span>&lt;span class="lnt">1343
&lt;/span>&lt;span class="lnt">1344
&lt;/span>&lt;span class="lnt">1345
&lt;/span>&lt;span class="lnt">1346
&lt;/span>&lt;span class="lnt">1347
&lt;/span>&lt;span class="lnt">1348
&lt;/span>&lt;span class="lnt">1349
&lt;/span>&lt;span class="lnt">1350
&lt;/span>&lt;span class="lnt">1351
&lt;/span>&lt;span class="lnt">1352
&lt;/span>&lt;span class="lnt">1353
&lt;/span>&lt;span class="lnt">1354
&lt;/span>&lt;span class="lnt">1355
&lt;/span>&lt;span class="lnt">1356
&lt;/span>&lt;span class="lnt">1357
&lt;/span>&lt;span class="lnt">1358
&lt;/span>&lt;span class="lnt">1359
&lt;/span>&lt;span class="lnt">1360
&lt;/span>&lt;span class="lnt">1361
&lt;/span>&lt;span class="lnt">1362
&lt;/span>&lt;span class="lnt">1363
&lt;/span>&lt;span class="lnt">1364
&lt;/span>&lt;span class="lnt">1365
&lt;/span>&lt;span class="lnt">1366
&lt;/span>&lt;span class="lnt">1367
&lt;/span>&lt;span class="lnt">1368
&lt;/span>&lt;span class="lnt">1369
&lt;/span>&lt;span class="lnt">1370
&lt;/span>&lt;span class="lnt">1371
&lt;/span>&lt;span class="lnt">1372
&lt;/span>&lt;span class="lnt">1373
&lt;/span>&lt;span class="lnt">1374
&lt;/span>&lt;span class="lnt">1375
&lt;/span>&lt;span class="lnt">1376
&lt;/span>&lt;span class="lnt">1377
&lt;/span>&lt;span class="lnt">1378
&lt;/span>&lt;span class="lnt">1379
&lt;/span>&lt;span class="lnt">1380
&lt;/span>&lt;span class="lnt">1381
&lt;/span>&lt;span class="lnt">1382
&lt;/span>&lt;span class="lnt">1383
&lt;/span>&lt;span class="lnt">1384
&lt;/span>&lt;span class="lnt">1385
&lt;/span>&lt;span class="lnt">1386
&lt;/span>&lt;span class="lnt">1387
&lt;/span>&lt;span class="lnt">1388
&lt;/span>&lt;span class="lnt">1389
&lt;/span>&lt;span class="lnt">1390
&lt;/span>&lt;span class="lnt">1391
&lt;/span>&lt;span class="lnt">1392
&lt;/span>&lt;span class="lnt">1393
&lt;/span>&lt;span class="lnt">1394
&lt;/span>&lt;span class="lnt">1395
&lt;/span>&lt;span class="lnt">1396
&lt;/span>&lt;span class="lnt">1397
&lt;/span>&lt;span class="lnt">1398
&lt;/span>&lt;span class="lnt">1399
&lt;/span>&lt;span class="lnt">1400
&lt;/span>&lt;span class="lnt">1401
&lt;/span>&lt;span class="lnt">1402
&lt;/span>&lt;span class="lnt">1403
&lt;/span>&lt;span class="lnt">1404
&lt;/span>&lt;span class="lnt">1405
&lt;/span>&lt;span class="lnt">1406
&lt;/span>&lt;span class="lnt">1407
&lt;/span>&lt;span class="lnt">1408
&lt;/span>&lt;span class="lnt">1409
&lt;/span>&lt;span class="lnt">1410
&lt;/span>&lt;span class="lnt">1411
&lt;/span>&lt;span class="lnt">1412
&lt;/span>&lt;span class="lnt">1413
&lt;/span>&lt;span class="lnt">1414
&lt;/span>&lt;span class="lnt">1415
&lt;/span>&lt;span class="lnt">1416
&lt;/span>&lt;span class="lnt">1417
&lt;/span>&lt;span class="lnt">1418
&lt;/span>&lt;span class="lnt">1419
&lt;/span>&lt;span class="lnt">1420
&lt;/span>&lt;span class="lnt">1421
&lt;/span>&lt;span class="lnt">1422
&lt;/span>&lt;span class="lnt">1423
&lt;/span>&lt;span class="lnt">1424
&lt;/span>&lt;span class="lnt">1425
&lt;/span>&lt;span class="lnt">1426
&lt;/span>&lt;span class="lnt">1427
&lt;/span>&lt;span class="lnt">1428
&lt;/span>&lt;span class="lnt">1429
&lt;/span>&lt;span class="lnt">1430
&lt;/span>&lt;span class="lnt">1431
&lt;/span>&lt;span class="lnt">1432
&lt;/span>&lt;span class="lnt">1433
&lt;/span>&lt;span class="lnt">1434
&lt;/span>&lt;span class="lnt">1435
&lt;/span>&lt;span class="lnt">1436
&lt;/span>&lt;span class="lnt">1437
&lt;/span>&lt;span class="lnt">1438
&lt;/span>&lt;span class="lnt">1439
&lt;/span>&lt;span class="lnt">1440
&lt;/span>&lt;span class="lnt">1441
&lt;/span>&lt;span class="lnt">1442
&lt;/span>&lt;span class="lnt">1443
&lt;/span>&lt;span class="lnt">1444
&lt;/span>&lt;span class="lnt">1445
&lt;/span>&lt;span class="lnt">1446
&lt;/span>&lt;span class="lnt">1447
&lt;/span>&lt;span class="lnt">1448
&lt;/span>&lt;span class="lnt">1449
&lt;/span>&lt;span class="lnt">1450
&lt;/span>&lt;span class="lnt">1451
&lt;/span>&lt;span class="lnt">1452
&lt;/span>&lt;span class="lnt">1453
&lt;/span>&lt;span class="lnt">1454
&lt;/span>&lt;span class="lnt">1455
&lt;/span>&lt;span class="lnt">1456
&lt;/span>&lt;span class="lnt">1457
&lt;/span>&lt;span class="lnt">1458
&lt;/span>&lt;span class="lnt">1459
&lt;/span>&lt;span class="lnt">1460
&lt;/span>&lt;span class="lnt">1461
&lt;/span>&lt;span class="lnt">1462
&lt;/span>&lt;span class="lnt">1463
&lt;/span>&lt;span class="lnt">1464
&lt;/span>&lt;span class="lnt">1465
&lt;/span>&lt;span class="lnt">1466
&lt;/span>&lt;span class="lnt">1467
&lt;/span>&lt;span class="lnt">1468
&lt;/span>&lt;span class="lnt">1469
&lt;/span>&lt;span class="lnt">1470
&lt;/span>&lt;span class="lnt">1471
&lt;/span>&lt;span class="lnt">1472
&lt;/span>&lt;span class="lnt">1473
&lt;/span>&lt;span class="lnt">1474
&lt;/span>&lt;span class="lnt">1475
&lt;/span>&lt;span class="lnt">1476
&lt;/span>&lt;span class="lnt">1477
&lt;/span>&lt;span class="lnt">1478
&lt;/span>&lt;span class="lnt">1479
&lt;/span>&lt;span class="lnt">1480
&lt;/span>&lt;span class="lnt">1481
&lt;/span>&lt;span class="lnt">1482
&lt;/span>&lt;span class="lnt">1483
&lt;/span>&lt;span class="lnt">1484
&lt;/span>&lt;span class="lnt">1485
&lt;/span>&lt;span class="lnt">1486
&lt;/span>&lt;span class="lnt">1487
&lt;/span>&lt;span class="lnt">1488
&lt;/span>&lt;span class="lnt">1489
&lt;/span>&lt;span class="lnt">1490
&lt;/span>&lt;span class="lnt">1491
&lt;/span>&lt;span class="lnt">1492
&lt;/span>&lt;span class="lnt">1493
&lt;/span>&lt;span class="lnt">1494
&lt;/span>&lt;span class="lnt">1495
&lt;/span>&lt;span class="lnt">1496
&lt;/span>&lt;span class="lnt">1497
&lt;/span>&lt;span class="lnt">1498
&lt;/span>&lt;span class="lnt">1499
&lt;/span>&lt;span class="lnt">1500
&lt;/span>&lt;span class="lnt">1501
&lt;/span>&lt;span class="lnt">1502
&lt;/span>&lt;span class="lnt">1503
&lt;/span>&lt;span class="lnt">1504
&lt;/span>&lt;span class="lnt">1505
&lt;/span>&lt;span class="lnt">1506
&lt;/span>&lt;span class="lnt">1507
&lt;/span>&lt;span class="lnt">1508
&lt;/span>&lt;span class="lnt">1509
&lt;/span>&lt;span class="lnt">1510
&lt;/span>&lt;span class="lnt">1511
&lt;/span>&lt;span class="lnt">1512
&lt;/span>&lt;span class="lnt">1513
&lt;/span>&lt;span class="lnt">1514
&lt;/span>&lt;span class="lnt">1515
&lt;/span>&lt;span class="lnt">1516
&lt;/span>&lt;span class="lnt">1517
&lt;/span>&lt;span class="lnt">1518
&lt;/span>&lt;span class="lnt">1519
&lt;/span>&lt;span class="lnt">1520
&lt;/span>&lt;span class="lnt">1521
&lt;/span>&lt;span class="lnt">1522
&lt;/span>&lt;span class="lnt">1523
&lt;/span>&lt;span class="lnt">1524
&lt;/span>&lt;span class="lnt">1525
&lt;/span>&lt;span class="lnt">1526
&lt;/span>&lt;span class="lnt">1527
&lt;/span>&lt;span class="lnt">1528
&lt;/span>&lt;span class="lnt">1529
&lt;/span>&lt;span class="lnt">1530
&lt;/span>&lt;span class="lnt">1531
&lt;/span>&lt;span class="lnt">1532
&lt;/span>&lt;span class="lnt">1533
&lt;/span>&lt;span class="lnt">1534
&lt;/span>&lt;span class="lnt">1535
&lt;/span>&lt;span class="lnt">1536
&lt;/span>&lt;span class="lnt">1537
&lt;/span>&lt;span class="lnt">1538
&lt;/span>&lt;span class="lnt">1539
&lt;/span>&lt;span class="lnt">1540
&lt;/span>&lt;span class="lnt">1541
&lt;/span>&lt;span class="lnt">1542
&lt;/span>&lt;span class="lnt">1543
&lt;/span>&lt;span class="lnt">1544
&lt;/span>&lt;span class="lnt">1545
&lt;/span>&lt;span class="lnt">1546
&lt;/span>&lt;span class="lnt">1547
&lt;/span>&lt;span class="lnt">1548
&lt;/span>&lt;span class="lnt">1549
&lt;/span>&lt;span class="lnt">1550
&lt;/span>&lt;span class="lnt">1551
&lt;/span>&lt;span class="lnt">1552
&lt;/span>&lt;span class="lnt">1553
&lt;/span>&lt;span class="lnt">1554
&lt;/span>&lt;span class="lnt">1555
&lt;/span>&lt;span class="lnt">1556
&lt;/span>&lt;span class="lnt">1557
&lt;/span>&lt;span class="lnt">1558
&lt;/span>&lt;span class="lnt">1559
&lt;/span>&lt;span class="lnt">1560
&lt;/span>&lt;span class="lnt">1561
&lt;/span>&lt;span class="lnt">1562
&lt;/span>&lt;span class="lnt">1563
&lt;/span>&lt;span class="lnt">1564
&lt;/span>&lt;span class="lnt">1565
&lt;/span>&lt;span class="lnt">1566
&lt;/span>&lt;span class="lnt">1567
&lt;/span>&lt;span class="lnt">1568
&lt;/span>&lt;span class="lnt">1569
&lt;/span>&lt;span class="lnt">1570
&lt;/span>&lt;span class="lnt">1571
&lt;/span>&lt;span class="lnt">1572
&lt;/span>&lt;span class="lnt">1573
&lt;/span>&lt;span class="lnt">1574
&lt;/span>&lt;span class="lnt">1575
&lt;/span>&lt;span class="lnt">1576
&lt;/span>&lt;span class="lnt">1577
&lt;/span>&lt;span class="lnt">1578
&lt;/span>&lt;span class="lnt">1579
&lt;/span>&lt;span class="lnt">1580
&lt;/span>&lt;span class="lnt">1581
&lt;/span>&lt;span class="lnt">1582
&lt;/span>&lt;span class="lnt">1583
&lt;/span>&lt;span class="lnt">1584
&lt;/span>&lt;span class="lnt">1585
&lt;/span>&lt;span class="lnt">1586
&lt;/span>&lt;span class="lnt">1587
&lt;/span>&lt;span class="lnt">1588
&lt;/span>&lt;span class="lnt">1589
&lt;/span>&lt;span class="lnt">1590
&lt;/span>&lt;span class="lnt">1591
&lt;/span>&lt;span class="lnt">1592
&lt;/span>&lt;span class="lnt">1593
&lt;/span>&lt;span class="lnt">1594
&lt;/span>&lt;span class="lnt">1595
&lt;/span>&lt;span class="lnt">1596
&lt;/span>&lt;span class="lnt">1597
&lt;/span>&lt;span class="lnt">1598
&lt;/span>&lt;span class="lnt">1599
&lt;/span>&lt;span class="lnt">1600
&lt;/span>&lt;span class="lnt">1601
&lt;/span>&lt;span class="lnt">1602
&lt;/span>&lt;span class="lnt">1603
&lt;/span>&lt;span class="lnt">1604
&lt;/span>&lt;span class="lnt">1605
&lt;/span>&lt;span class="lnt">1606
&lt;/span>&lt;span class="lnt">1607
&lt;/span>&lt;span class="lnt">1608
&lt;/span>&lt;span class="lnt">1609
&lt;/span>&lt;span class="lnt">1610
&lt;/span>&lt;span class="lnt">1611
&lt;/span>&lt;span class="lnt">1612
&lt;/span>&lt;span class="lnt">1613
&lt;/span>&lt;span class="lnt">1614
&lt;/span>&lt;span class="lnt">1615
&lt;/span>&lt;span class="lnt">1616
&lt;/span>&lt;span class="lnt">1617
&lt;/span>&lt;span class="lnt">1618
&lt;/span>&lt;span class="lnt">1619
&lt;/span>&lt;span class="lnt">1620
&lt;/span>&lt;span class="lnt">1621
&lt;/span>&lt;span class="lnt">1622
&lt;/span>&lt;span class="lnt">1623
&lt;/span>&lt;span class="lnt">1624
&lt;/span>&lt;span class="lnt">1625
&lt;/span>&lt;span class="lnt">1626
&lt;/span>&lt;span class="lnt">1627
&lt;/span>&lt;span class="lnt">1628
&lt;/span>&lt;span class="lnt">1629
&lt;/span>&lt;span class="lnt">1630
&lt;/span>&lt;span class="lnt">1631
&lt;/span>&lt;span class="lnt">1632
&lt;/span>&lt;span class="lnt">1633
&lt;/span>&lt;span class="lnt">1634
&lt;/span>&lt;span class="lnt">1635
&lt;/span>&lt;span class="lnt">1636
&lt;/span>&lt;span class="lnt">1637
&lt;/span>&lt;span class="lnt">1638
&lt;/span>&lt;span class="lnt">1639
&lt;/span>&lt;span class="lnt">1640
&lt;/span>&lt;span class="lnt">1641
&lt;/span>&lt;span class="lnt">1642
&lt;/span>&lt;span class="lnt">1643
&lt;/span>&lt;span class="lnt">1644
&lt;/span>&lt;span class="lnt">1645
&lt;/span>&lt;span class="lnt">1646
&lt;/span>&lt;span class="lnt">1647
&lt;/span>&lt;span class="lnt">1648
&lt;/span>&lt;span class="lnt">1649
&lt;/span>&lt;span class="lnt">1650
&lt;/span>&lt;span class="lnt">1651
&lt;/span>&lt;span class="lnt">1652
&lt;/span>&lt;span class="lnt">1653
&lt;/span>&lt;span class="lnt">1654
&lt;/span>&lt;span class="lnt">1655
&lt;/span>&lt;span class="lnt">1656
&lt;/span>&lt;span class="lnt">1657
&lt;/span>&lt;span class="lnt">1658
&lt;/span>&lt;span class="lnt">1659
&lt;/span>&lt;span class="lnt">1660
&lt;/span>&lt;span class="lnt">1661
&lt;/span>&lt;span class="lnt">1662
&lt;/span>&lt;span class="lnt">1663
&lt;/span>&lt;span class="lnt">1664
&lt;/span>&lt;span class="lnt">1665
&lt;/span>&lt;span class="lnt">1666
&lt;/span>&lt;span class="lnt">1667
&lt;/span>&lt;span class="lnt">1668
&lt;/span>&lt;span class="lnt">1669
&lt;/span>&lt;span class="lnt">1670
&lt;/span>&lt;span class="lnt">1671
&lt;/span>&lt;span class="lnt">1672
&lt;/span>&lt;span class="lnt">1673
&lt;/span>&lt;span class="lnt">1674
&lt;/span>&lt;span class="lnt">1675
&lt;/span>&lt;span class="lnt">1676
&lt;/span>&lt;span class="lnt">1677
&lt;/span>&lt;span class="lnt">1678
&lt;/span>&lt;span class="lnt">1679
&lt;/span>&lt;span class="lnt">1680
&lt;/span>&lt;span class="lnt">1681
&lt;/span>&lt;span class="lnt">1682
&lt;/span>&lt;span class="lnt">1683
&lt;/span>&lt;span class="lnt">1684
&lt;/span>&lt;span class="lnt">1685
&lt;/span>&lt;span class="lnt">1686
&lt;/span>&lt;span class="lnt">1687
&lt;/span>&lt;span class="lnt">1688
&lt;/span>&lt;span class="lnt">1689
&lt;/span>&lt;span class="lnt">1690
&lt;/span>&lt;span class="lnt">1691
&lt;/span>&lt;span class="lnt">1692
&lt;/span>&lt;span class="lnt">1693
&lt;/span>&lt;span class="lnt">1694
&lt;/span>&lt;span class="lnt">1695
&lt;/span>&lt;span class="lnt">1696
&lt;/span>&lt;span class="lnt">1697
&lt;/span>&lt;span class="lnt">1698
&lt;/span>&lt;span class="lnt">1699
&lt;/span>&lt;span class="lnt">1700
&lt;/span>&lt;span class="lnt">1701
&lt;/span>&lt;span class="lnt">1702
&lt;/span>&lt;span class="lnt">1703
&lt;/span>&lt;span class="lnt">1704
&lt;/span>&lt;span class="lnt">1705
&lt;/span>&lt;span class="lnt">1706
&lt;/span>&lt;span class="lnt">1707
&lt;/span>&lt;span class="lnt">1708
&lt;/span>&lt;span class="lnt">1709
&lt;/span>&lt;span class="lnt">1710
&lt;/span>&lt;span class="lnt">1711
&lt;/span>&lt;span class="lnt">1712
&lt;/span>&lt;span class="lnt">1713
&lt;/span>&lt;span class="lnt">1714
&lt;/span>&lt;span class="lnt">1715
&lt;/span>&lt;span class="lnt">1716
&lt;/span>&lt;span class="lnt">1717
&lt;/span>&lt;span class="lnt">1718
&lt;/span>&lt;span class="lnt">1719
&lt;/span>&lt;span class="lnt">1720
&lt;/span>&lt;span class="lnt">1721
&lt;/span>&lt;span class="lnt">1722
&lt;/span>&lt;span class="lnt">1723
&lt;/span>&lt;span class="lnt">1724
&lt;/span>&lt;span class="lnt">1725
&lt;/span>&lt;span class="lnt">1726
&lt;/span>&lt;span class="lnt">1727
&lt;/span>&lt;span class="lnt">1728
&lt;/span>&lt;span class="lnt">1729
&lt;/span>&lt;span class="lnt">1730
&lt;/span>&lt;span class="lnt">1731
&lt;/span>&lt;span class="lnt">1732
&lt;/span>&lt;span class="lnt">1733
&lt;/span>&lt;span class="lnt">1734
&lt;/span>&lt;span class="lnt">1735
&lt;/span>&lt;span class="lnt">1736
&lt;/span>&lt;span class="lnt">1737
&lt;/span>&lt;span class="lnt">1738
&lt;/span>&lt;span class="lnt">1739
&lt;/span>&lt;span class="lnt">1740
&lt;/span>&lt;span class="lnt">1741
&lt;/span>&lt;span class="lnt">1742
&lt;/span>&lt;span class="lnt">1743
&lt;/span>&lt;span class="lnt">1744
&lt;/span>&lt;span class="lnt">1745
&lt;/span>&lt;span class="lnt">1746
&lt;/span>&lt;span class="lnt">1747
&lt;/span>&lt;span class="lnt">1748
&lt;/span>&lt;span class="lnt">1749
&lt;/span>&lt;span class="lnt">1750
&lt;/span>&lt;span class="lnt">1751
&lt;/span>&lt;span class="lnt">1752
&lt;/span>&lt;span class="lnt">1753
&lt;/span>&lt;span class="lnt">1754
&lt;/span>&lt;span class="lnt">1755
&lt;/span>&lt;span class="lnt">1756
&lt;/span>&lt;span class="lnt">1757
&lt;/span>&lt;span class="lnt">1758
&lt;/span>&lt;span class="lnt">1759
&lt;/span>&lt;span class="lnt">1760
&lt;/span>&lt;span class="lnt">1761
&lt;/span>&lt;span class="lnt">1762
&lt;/span>&lt;span class="lnt">1763
&lt;/span>&lt;span class="lnt">1764
&lt;/span>&lt;span class="lnt">1765
&lt;/span>&lt;span class="lnt">1766
&lt;/span>&lt;span class="lnt">1767
&lt;/span>&lt;span class="lnt">1768
&lt;/span>&lt;span class="lnt">1769
&lt;/span>&lt;span class="lnt">1770
&lt;/span>&lt;span class="lnt">1771
&lt;/span>&lt;span class="lnt">1772
&lt;/span>&lt;span class="lnt">1773
&lt;/span>&lt;span class="lnt">1774
&lt;/span>&lt;span class="lnt">1775
&lt;/span>&lt;span class="lnt">1776
&lt;/span>&lt;span class="lnt">1777
&lt;/span>&lt;span class="lnt">1778
&lt;/span>&lt;span class="lnt">1779
&lt;/span>&lt;span class="lnt">1780
&lt;/span>&lt;span class="lnt">1781
&lt;/span>&lt;span class="lnt">1782
&lt;/span>&lt;span class="lnt">1783
&lt;/span>&lt;span class="lnt">1784
&lt;/span>&lt;span class="lnt">1785
&lt;/span>&lt;span class="lnt">1786
&lt;/span>&lt;span class="lnt">1787
&lt;/span>&lt;span class="lnt">1788
&lt;/span>&lt;span class="lnt">1789
&lt;/span>&lt;span class="lnt">1790
&lt;/span>&lt;span class="lnt">1791
&lt;/span>&lt;span class="lnt">1792
&lt;/span>&lt;span class="lnt">1793
&lt;/span>&lt;span class="lnt">1794
&lt;/span>&lt;span class="lnt">1795
&lt;/span>&lt;span class="lnt">1796
&lt;/span>&lt;span class="lnt">1797
&lt;/span>&lt;span class="lnt">1798
&lt;/span>&lt;span class="lnt">1799
&lt;/span>&lt;span class="lnt">1800
&lt;/span>&lt;span class="lnt">1801
&lt;/span>&lt;span class="lnt">1802
&lt;/span>&lt;span class="lnt">1803
&lt;/span>&lt;span class="lnt">1804
&lt;/span>&lt;span class="lnt">1805
&lt;/span>&lt;span class="lnt">1806
&lt;/span>&lt;span class="lnt">1807
&lt;/span>&lt;span class="lnt">1808
&lt;/span>&lt;span class="lnt">1809
&lt;/span>&lt;span class="lnt">1810
&lt;/span>&lt;span class="lnt">1811
&lt;/span>&lt;span class="lnt">1812
&lt;/span>&lt;span class="lnt">1813
&lt;/span>&lt;span class="lnt">1814
&lt;/span>&lt;span class="lnt">1815
&lt;/span>&lt;span class="lnt">1816
&lt;/span>&lt;span class="lnt">1817
&lt;/span>&lt;span class="lnt">1818
&lt;/span>&lt;span class="lnt">1819
&lt;/span>&lt;span class="lnt">1820
&lt;/span>&lt;span class="lnt">1821
&lt;/span>&lt;span class="lnt">1822
&lt;/span>&lt;span class="lnt">1823
&lt;/span>&lt;span class="lnt">1824
&lt;/span>&lt;span class="lnt">1825
&lt;/span>&lt;span class="lnt">1826
&lt;/span>&lt;span class="lnt">1827
&lt;/span>&lt;span class="lnt">1828
&lt;/span>&lt;span class="lnt">1829
&lt;/span>&lt;span class="lnt">1830
&lt;/span>&lt;span class="lnt">1831
&lt;/span>&lt;span class="lnt">1832
&lt;/span>&lt;span class="lnt">1833
&lt;/span>&lt;span class="lnt">1834
&lt;/span>&lt;span class="lnt">1835
&lt;/span>&lt;span class="lnt">1836
&lt;/span>&lt;span class="lnt">1837
&lt;/span>&lt;span class="lnt">1838
&lt;/span>&lt;span class="lnt">1839
&lt;/span>&lt;span class="lnt">1840
&lt;/span>&lt;span class="lnt">1841
&lt;/span>&lt;span class="lnt">1842
&lt;/span>&lt;span class="lnt">1843
&lt;/span>&lt;span class="lnt">1844
&lt;/span>&lt;span class="lnt">1845
&lt;/span>&lt;span class="lnt">1846
&lt;/span>&lt;span class="lnt">1847
&lt;/span>&lt;span class="lnt">1848
&lt;/span>&lt;span class="lnt">1849
&lt;/span>&lt;span class="lnt">1850
&lt;/span>&lt;span class="lnt">1851
&lt;/span>&lt;span class="lnt">1852
&lt;/span>&lt;span class="lnt">1853
&lt;/span>&lt;span class="lnt">1854
&lt;/span>&lt;span class="lnt">1855
&lt;/span>&lt;span class="lnt">1856
&lt;/span>&lt;span class="lnt">1857
&lt;/span>&lt;span class="lnt">1858
&lt;/span>&lt;span class="lnt">1859
&lt;/span>&lt;span class="lnt">1860
&lt;/span>&lt;span class="lnt">1861
&lt;/span>&lt;span class="lnt">1862
&lt;/span>&lt;span class="lnt">1863
&lt;/span>&lt;span class="lnt">1864
&lt;/span>&lt;span class="lnt">1865
&lt;/span>&lt;span class="lnt">1866
&lt;/span>&lt;span class="lnt">1867
&lt;/span>&lt;span class="lnt">1868
&lt;/span>&lt;span class="lnt">1869
&lt;/span>&lt;span class="lnt">1870
&lt;/span>&lt;span class="lnt">1871
&lt;/span>&lt;span class="lnt">1872
&lt;/span>&lt;span class="lnt">1873
&lt;/span>&lt;span class="lnt">1874
&lt;/span>&lt;span class="lnt">1875
&lt;/span>&lt;span class="lnt">1876
&lt;/span>&lt;span class="lnt">1877
&lt;/span>&lt;span class="lnt">1878
&lt;/span>&lt;span class="lnt">1879
&lt;/span>&lt;span class="lnt">1880
&lt;/span>&lt;span class="lnt">1881
&lt;/span>&lt;span class="lnt">1882
&lt;/span>&lt;span class="lnt">1883
&lt;/span>&lt;span class="lnt">1884
&lt;/span>&lt;span class="lnt">1885
&lt;/span>&lt;span class="lnt">1886
&lt;/span>&lt;span class="lnt">1887
&lt;/span>&lt;span class="lnt">1888
&lt;/span>&lt;span class="lnt">1889
&lt;/span>&lt;span class="lnt">1890
&lt;/span>&lt;span class="lnt">1891
&lt;/span>&lt;span class="lnt">1892
&lt;/span>&lt;span class="lnt">1893
&lt;/span>&lt;span class="lnt">1894
&lt;/span>&lt;span class="lnt">1895
&lt;/span>&lt;span class="lnt">1896
&lt;/span>&lt;span class="lnt">1897
&lt;/span>&lt;span class="lnt">1898
&lt;/span>&lt;span class="lnt">1899
&lt;/span>&lt;span class="lnt">1900
&lt;/span>&lt;span class="lnt">1901
&lt;/span>&lt;span class="lnt">1902
&lt;/span>&lt;span class="lnt">1903
&lt;/span>&lt;span class="lnt">1904
&lt;/span>&lt;span class="lnt">1905
&lt;/span>&lt;span class="lnt">1906
&lt;/span>&lt;span class="lnt">1907
&lt;/span>&lt;span class="lnt">1908
&lt;/span>&lt;span class="lnt">1909
&lt;/span>&lt;span class="lnt">1910
&lt;/span>&lt;span class="lnt">1911
&lt;/span>&lt;span class="lnt">1912
&lt;/span>&lt;span class="lnt">1913
&lt;/span>&lt;span class="lnt">1914
&lt;/span>&lt;span class="lnt">1915
&lt;/span>&lt;span class="lnt">1916
&lt;/span>&lt;span class="lnt">1917
&lt;/span>&lt;span class="lnt">1918
&lt;/span>&lt;span class="lnt">1919
&lt;/span>&lt;span class="lnt">1920
&lt;/span>&lt;span class="lnt">1921
&lt;/span>&lt;span class="lnt">1922
&lt;/span>&lt;span class="lnt">1923
&lt;/span>&lt;span class="lnt">1924
&lt;/span>&lt;span class="lnt">1925
&lt;/span>&lt;span class="lnt">1926
&lt;/span>&lt;span class="lnt">1927
&lt;/span>&lt;span class="lnt">1928
&lt;/span>&lt;span class="lnt">1929
&lt;/span>&lt;span class="lnt">1930
&lt;/span>&lt;span class="lnt">1931
&lt;/span>&lt;span class="lnt">1932
&lt;/span>&lt;span class="lnt">1933
&lt;/span>&lt;span class="lnt">1934
&lt;/span>&lt;span class="lnt">1935
&lt;/span>&lt;span class="lnt">1936
&lt;/span>&lt;span class="lnt">1937
&lt;/span>&lt;span class="lnt">1938
&lt;/span>&lt;span class="lnt">1939
&lt;/span>&lt;span class="lnt">1940
&lt;/span>&lt;span class="lnt">1941
&lt;/span>&lt;span class="lnt">1942
&lt;/span>&lt;span class="lnt">1943
&lt;/span>&lt;span class="lnt">1944
&lt;/span>&lt;span class="lnt">1945
&lt;/span>&lt;span class="lnt">1946
&lt;/span>&lt;span class="lnt">1947
&lt;/span>&lt;span class="lnt">1948
&lt;/span>&lt;span class="lnt">1949
&lt;/span>&lt;span class="lnt">1950
&lt;/span>&lt;span class="lnt">1951
&lt;/span>&lt;span class="lnt">1952
&lt;/span>&lt;span class="lnt">1953
&lt;/span>&lt;span class="lnt">1954
&lt;/span>&lt;span class="lnt">1955
&lt;/span>&lt;span class="lnt">1956
&lt;/span>&lt;span class="lnt">1957
&lt;/span>&lt;span class="lnt">1958
&lt;/span>&lt;span class="lnt">1959
&lt;/span>&lt;span class="lnt">1960
&lt;/span>&lt;span class="lnt">1961
&lt;/span>&lt;span class="lnt">1962
&lt;/span>&lt;span class="lnt">1963
&lt;/span>&lt;span class="lnt">1964
&lt;/span>&lt;span class="lnt">1965
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ini" data-lang="ini">&lt;span class="line">&lt;span class="cl">&lt;span class="k">[PHP]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; About php.ini ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP&amp;#39;s initialization file, generally called php.ini, is responsible for&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; configuring many of the aspects of PHP&amp;#39;s behavior.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP attempts to find and load this configuration from a number of locations.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The following is a summary of its search order:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; 1. SAPI module specific location.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; 2. The PHPRC environment variable. (As of PHP 5.2.0)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; 4. Current working directory (except CLI)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; 5. The web server&amp;#39;s directory (for SAPI modules), or directory of PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (otherwise in Windows)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; 6. The directory from the --with-config-file-path compile time option, or the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Windows directory (usually C:\windows)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; See the PHP docs for more specific information.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/configuration.file&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The syntax of the file is extremely simple. Whitespace and lines&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; beginning with a semicolon are silently ignored (as you probably guessed).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Section headers (e.g. [Foo]) are also silently ignored, even though&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; they might mean something in the future.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Directives following the section heading [PATH=/www/mysite] only&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; apply to PHP files in the /www/mysite directory. Directives&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; following the section heading [HOST=www.example.com] only apply to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP files served from www.example.com. Directives set in these&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; special sections cannot be overridden by user-defined INI files or&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; at runtime. Currently, [PATH=] and [HOST=] sections only work under&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; CGI/FastCGI.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/ini.sections&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Directives are specified using the following syntax:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; directive = value&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Directive names are *case sensitive* - foo=bar is different from FOO=bar.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Directives are variables used to configure PHP or PHP extensions.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; There is no name validation. If PHP can&amp;#39;t find an expected&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; directive because it is not set or is mistyped, a default value will be used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of the INI constants (On, Off, True, False, Yes, No and None) or an expression&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (e.g. E_ALL &amp;amp; ~E_NOTICE), a quoted string (&amp;#34;bar&amp;#34;), or a reference to a&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; previously set variable or directive (e.g. ${foo})&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Expressions in the INI file are limited to bitwise operators and parentheses:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; | bitwise OR&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; ^ bitwise XOR&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;amp; bitwise AND&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; ~ bitwise NOT&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; ! boolean NOT&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Boolean flags can be turned on using the values 1, On, True or Yes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; They can be turned off using the values 0, Off, False or No.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; An empty string can be denoted by simply not writing anything after the equal&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; sign, or by using the None keyword:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; foo = ; sets foo to an empty string&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; foo = None ; sets foo to an empty string&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; foo = &amp;#34;None&amp;#34; ; sets foo to the string &amp;#39;None&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If you use constants in your value, and these constants belong to a&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; dynamically loaded extension (either a PHP extension or a Zend extension),&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; you may only use these constants *after* the line that loads the extension.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; About this file ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP comes packaged with two INI files. One that is recommended to be used&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; in production environments and one that is recommended to be used in&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; development environments.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; php.ini-production contains settings which hold security, performance and&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; best practices at its core. But please be aware, these settings may break&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; compatibility with older or less security conscience applications. We&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; recommending using the production ini in production and testing environments.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; php.ini-development is very similar to its production variant, except it is&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; much more verbose when it comes to errors. We recommend using the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; development version only in development environments, as errors shown to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; application users can inadvertently leak otherwise secure information.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This is the php.ini-production INI file.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Quick Reference ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The following are all the settings which are different in either the production&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; or development versions of the INIs with respect to PHP&amp;#39;s default behavior.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Please see the actual settings later in the document for more details as to why&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; we recommend these changes in PHP&amp;#39;s behavior.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; display_errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; display_startup_errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; error_reporting&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: E_ALL&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: E_ALL&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: E_ALL &amp;amp; ~E_DEPRECATED &amp;amp; ~E_STRICT&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; log_errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; max_input_time&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: -1 (Unlimited)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 60 (60 seconds)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 60 (60 seconds)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; output_buffering&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 4096&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 4096&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; register_argc_argv&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; request_order&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: None&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: &amp;#34;GP&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: &amp;#34;GP&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; session.gc_divisor&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 100&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 1000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 1000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; session.sid_bits_per_character&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 4&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 5&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 5&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; short_open_tag&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; variables_order&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: &amp;#34;EGPCS&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: &amp;#34;GPCS&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: &amp;#34;GPCS&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; zend.exception_ignore_args&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; zend.exception_string_param_max_len&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 15&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 15&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; php.ini Options ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Name for user-defined php.ini (.htaccess) files. Default is &amp;#34;.user.ini&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;user_ini.filename = &amp;#34;.user.ini&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; To disable this feature set this option to an empty value&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;user_ini.filename =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;user_ini.cache_ttl = 300&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Language Options ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enable the PHP scripting language engine under Apache.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/engine&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">engine&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive determines whether or not PHP will recognize code between&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;lt;? and ?&amp;gt; tags as PHP source which should be processed as such. It is&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; generally recommended that &amp;lt;?php and ?&amp;gt; should be used and that this feature&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; should be disabled, as enabling it may result in issues when generating XML&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; documents, however this remains supported for backward compatibility reasons.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note that this directive does not control the &amp;lt;?= shorthand tag, which can be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; used regardless of this directive.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/short-open-tag&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">short_open_tag&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The number of significant digits displayed in floating point numbers.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/precision&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">precision&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">14&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Output buffering is a mechanism for controlling how much output data&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (excluding headers and cookies) PHP should keep internally before pushing that&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; data to the client. If your application&amp;#39;s output exceeds this setting, PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; will send that data in chunks of roughly the size you specify.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Turning on this setting and managing its maximum buffer size can yield some&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; interesting side-effects depending on your application and web server.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; You may be able to send headers and cookies after you&amp;#39;ve already sent output&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; through print or echo. You also may see performance benefits if your server is&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; emitting less packets due to buffered output versus PHP streaming the output&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; as it gets it. On production servers, 4096 bytes is a good setting for performance&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; reasons.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Output buffering can also be controlled via Output Buffering Control&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; functions.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Possible Values:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; On = Enabled and buffer is unlimited. (Use with caution)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Off = Disabled&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Integer = Enables the buffer and sets its maximum size in bytes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: This directive is hardcoded to Off for the CLI SAPI&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 4096&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 4096&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/output-buffering&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">output_buffering&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">4096&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; You can redirect all of the output of your scripts to a function. For&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; example, if you set output_handler to &amp;#34;mb_output_handler&amp;#34;, character&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; encoding will be transparently converted to the specified encoding.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Setting any output handler automatically turns on output buffering.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: People who wrote portable scripts should not depend on this ini&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; directive. Instead, explicitly set the output handler using ob_start().&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Using this ini directive may cause problems unless you know what script&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is doing.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: You cannot use both &amp;#34;mb_output_handler&amp;#34; with &amp;#34;ob_iconv_handler&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; and you cannot use both &amp;#34;ob_gzhandler&amp;#34; and &amp;#34;zlib.output_compression&amp;#34;.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: output_handler must be empty if this is set &amp;#39;On&amp;#39; !!!!&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Instead you must use zlib.output_handler.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/output-handler&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;output_handler =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; URL rewriter function rewrites URL on the fly by using&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; output buffer. You can set target tags by this configuration.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#34;form&amp;#34; tag is special tag. It will add hidden input tag to pass values.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Refer to session.trans_sid_tags for usage.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: &amp;#34;form=&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: &amp;#34;form=&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: &amp;#34;form=&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;url_rewriter.tags&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; URL rewriter will not rewrite absolute URL nor form by default. To enable&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; absolute URL rewrite, allowed hosts must be defined at RUNTIME.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Refer to session.trans_sid_hosts for more details.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: &amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: &amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: &amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;url_rewriter.hosts&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Transparent output compression using the zlib library&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Valid values for this option are &amp;#39;off&amp;#39;, &amp;#39;on&amp;#39;, or a specific buffer size&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to be used for compression (default is 4KB)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Resulting chunk size may vary due to nature of compression. PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; outputs chunks that are few hundreds bytes each as a result of&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; compression. If you prefer a larger chunk size for better&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; performance, enable output_buffering in addition.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: You need to use zlib.output_handler instead of the standard&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; output_handler, or otherwise the output will be corrupted.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/zlib.output-compression&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">zlib.output_compression&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/zlib.output-compression-level&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;zlib.output_compression_level = -1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; You cannot specify additional output handlers if zlib.output_compression&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is activated here. This setting does the same as output_handler but in&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; a different order.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/zlib.output-handler&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;zlib.output_handler =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Implicit flush tells PHP to tell the output layer to flush itself&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; automatically after every output block. This is equivalent to calling the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP function flush() after each and every call to print() or echo() and each&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; and every HTML block. Turning this option on has serious performance&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; implications and is generally recommended for debugging purposes only.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/implicit-flush&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: This directive is hardcoded to On for the CLI SAPI&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">implicit_flush&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The unserialize callback function will be called (with the undefined class&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; name as parameter), if the unserializer finds an undefined class&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; which should be instantiated. A warning appears if the specified function is&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; not defined, or if the function doesn&amp;#39;t include/implement the missing class.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; So only set this entry, if you really want to implement such a&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; callback-function.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">unserialize_callback_func&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The unserialize_max_depth specifies the default depth limit for unserialized&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; structures. Setting the depth limit too high may result in stack overflows&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; during unserialization. The unserialize_max_depth ini setting can be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; overridden by the max_depth option on individual unserialize() calls.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; A value of 0 disables the depth limit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;unserialize_max_depth = 4096&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; When floats &amp;amp; doubles are serialized, store serialize_precision significant&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; digits after the floating point. The default value ensures that when floats&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; are decoded with unserialize, the data will remain the same.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The value is also used for json_encode when encoding double values.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If -1 is used, then dtoa mode 0 is used which automatically select the best&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; precision.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">serialize_precision&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">-1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; open_basedir, if set, limits all file operations to the defined directory&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; and below. This directive makes most sense if used in a per-directory&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; or per-virtualhost web server configuration file.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: disables the realpath cache&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/open-basedir&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;open_basedir =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive allows you to disable certain functions.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; It receives a comma-delimited list of function names.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/disable-functions&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">disable_functions&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive allows you to disable certain classes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; It receives a comma-delimited list of class names.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/disable-classes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">disable_classes&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Colors for Syntax Highlighting mode. Anything that&amp;#39;s acceptable in&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;lt;span style=&amp;#34;color: ???????&amp;#34;&amp;gt; would work.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/syntax-highlighting&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;highlight.string = #DD0000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;highlight.comment = #FF9900&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;highlight.keyword = #007700&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;highlight.default = #0000BB&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;highlight.html = #000000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If enabled, the request will be allowed to complete even if the user aborts&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the request. Consider enabling it if executing long requests, which may end up&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; being interrupted by the user or a browser timing out. PHP&amp;#39;s default behavior&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is to disable this feature.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/ignore-user-abort&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;ignore_user_abort = On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Determines the size of the realpath cache to be used by PHP. This value should&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; be increased on systems where PHP opens many files to reflect the quantity of&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the file operations performed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: if open_basedir is set, the cache is disabled&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/realpath-cache-size&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;realpath_cache_size = 4096k&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Duration of time, in seconds for which to cache realpath information for a given&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; file or directory. For systems with rarely changing files, consider increasing this&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; value.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/realpath-cache-ttl&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;realpath_cache_ttl = 120&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enables or disables the circular reference collector.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/zend.enable-gc&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">zend.enable_gc&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If enabled, scripts may be written in encodings that are incompatible with&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; encodings. To use this feature, mbstring extension must be enabled.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;zend.multibyte = Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allows to set the default encoding for the scripts. This value will be used&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; unless &amp;#34;declare(encoding=...)&amp;#34; directive appears at the top of the script.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Only affects if zend.multibyte is set.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;zend.script_encoding =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allows to include or exclude arguments from stack traces generated for exceptions.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; In production, it is recommended to turn this setting on to prohibit the output&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of sensitive information in stack traces&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">zend.exception_ignore_args&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allows setting the maximum string length in an argument of a stringified stack trace&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to a value between 0 and 1000000.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This has no effect when zend.exception_ignore_args is enabled.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 15&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 15&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; In production, it is recommended to set this to 0 to reduce the output&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of sensitive information in stack traces.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">zend.exception_string_param_max_len&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Miscellaneous ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Decides whether PHP may expose the fact that it is installed on the server&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (e.g. by adding its signature to the Web server header). It is no security&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; threat in any way, but it makes it possible to determine whether you use PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; on your server or not.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/expose-php&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">expose_php&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Resource Limits ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum execution time of each script, in seconds&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/max-execution-time&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: This directive is hardcoded to 0 for the CLI SAPI&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">max_execution_time&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">30&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum amount of time each script may spend parsing request data. It&amp;#39;s a good&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; idea to limit this time on productions servers in order to eliminate unexpectedly&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; long running scripts.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: This directive is hardcoded to -1 for the CLI SAPI&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: -1 (Unlimited)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 60 (60 seconds)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 60 (60 seconds)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/max-input-time&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">max_input_time&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">60&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum input variable nesting level&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/max-input-nesting-level&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;max_input_nesting_level = 64&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; How many GET/POST/COOKIE input variables may be accepted&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;max_input_vars = 1000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; How many multipart body parts (combined input variable and file uploads) may&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; be accepted.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: -1 (Sum of max_input_vars and max_file_uploads)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;max_multipart_body_parts = 1500&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum amount of memory a script may consume&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/memory-limit&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">memory_limit&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">128M&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Error handling and logging ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive informs PHP of which errors, warnings and notices you would like&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; it to take action for. The recommended way of setting values for this&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; directive is through the use of the error level constants and bitwise&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; operators. The error level constants are below here for convenience as well as&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; some common settings and their meanings.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; By default, PHP is set to take action on all errors, notices and warnings EXCEPT&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; those related to E_NOTICE and E_STRICT, which together cover best practices and&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; recommended coding standards in PHP. For performance reasons, this is the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; recommend error reporting setting. Your production server shouldn&amp;#39;t be wasting&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; resources complaining about best practices and coding standards. That&amp;#39;s what&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; development servers and development settings are for.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: The php.ini-development file has this setting as E_ALL. This&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; means it pretty much reports everything which is exactly what you want during&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; development and early testing.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Error Level Constants:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_ERROR - fatal run-time errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_RECOVERABLE_ERROR - almost fatal run-time errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_WARNING - run-time warnings (non-fatal errors)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_PARSE - compile-time parse errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_NOTICE - run-time notices (these are warnings which often result&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; from a bug in your code, but it&amp;#39;s possible that it was&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; intentional (e.g., using an uninitialized variable and&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; relying on the fact it is automatically initialized to an&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; empty string)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_STRICT - run-time notices, enable to have PHP suggest changes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to your code which will ensure the best interoperability&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; and forward compatibility of your code&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_CORE_ERROR - fatal errors that occur during PHP&amp;#39;s initial startup&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP&amp;#39;s&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; initial startup&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_COMPILE_ERROR - fatal compile-time errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_USER_ERROR - user-generated error message&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_USER_WARNING - user-generated warning message&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_USER_NOTICE - user-generated notice message&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_DEPRECATED - warn about code that will not work in future versions&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_USER_DEPRECATED - user-generated deprecation warnings&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Common Values:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_ALL (Show all errors, warnings and notices including coding standards.)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_ALL &amp;amp; ~E_NOTICE (Show all errors, except for notices)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_ALL &amp;amp; ~E_NOTICE &amp;amp; ~E_STRICT (Show all errors, except for notices and coding standards warnings.)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: E_ALL&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: E_ALL&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: E_ALL &amp;amp; ~E_DEPRECATED &amp;amp; ~E_STRICT&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/error-reporting&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">error_reporting&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">E_ALL &amp;amp; ~E_DEPRECATED &amp;amp; ~E_STRICT&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive controls whether or not and where PHP will output errors,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; notices and warnings too. Error output is very useful during development, but&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; it could be very dangerous in production environments. Depending on the code&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; which is triggering the error, sensitive information could potentially leak&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; out of your application such as database usernames and passwords or worse.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; For production environments, we recommend logging errors rather than&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; sending them to STDOUT.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Possible Values:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Off = Do not display any errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; stderr = Display errors to STDERR (affects only CGI/CLI binaries!)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; On or stdout = Display errors to STDOUT&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/display-errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">display_errors&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The display of errors which occur during PHP&amp;#39;s startup sequence are handled&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; separately from display_errors. We strongly recommend you set this to &amp;#39;off&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; for production servers to avoid leaking configuration details.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/display-startup-errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">display_startup_errors&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Besides displaying errors, PHP can also log errors to locations such as a&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; server-specific log, STDERR, or a location specified by the error_log&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; directive found below. While errors should not be displayed on productions&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; servers they should still be monitored and logging is a great way to do that.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/log-errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">log_errors&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Do not log repeated messages. Repeated errors must occur in same file on same&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; line unless ignore_repeated_source is set true.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/ignore-repeated-errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">ignore_repeated_errors&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Ignore source of message when ignoring repeated messages. When this setting&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is On you will not log errors with repeated messages from different files or&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; source lines.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/ignore-repeated-source&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">ignore_repeated_source&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If this parameter is set to Off, then memory leaks will not be shown (on&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; stdout or in the log). This is only effective in a debug compile, and if&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; error reporting includes E_WARNING in the allowed list&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/report-memleaks&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">report_memleaks&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This setting is off by default.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;report_zend_debug = 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Turn off normal error reporting and emit XML-RPC error XML&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/xmlrpc-errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;xmlrpc_errors = 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; An XML-RPC faultCode&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;xmlrpc_error_number = 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; When PHP displays or logs an error, it has the capability of formatting the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; error message as HTML for easier reading. This directive controls whether&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the error message is formatted as HTML or not.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: This directive is hardcoded to Off for the CLI SAPI&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/html-errors&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;html_errors = On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If html_errors is set to On *and* docref_root is not empty, then PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; produces clickable error messages that direct to a page describing the error&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; or function causing the error in detail.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; You can download a copy of the PHP manual from https://php.net/docs&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; and change docref_root to the base URL of your local copy including the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; leading &amp;#39;/&amp;#39;. You must also specify the file extension being used including&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the dot. PHP&amp;#39;s default behavior is to leave these settings empty, in which&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; case no links to documentation are generated.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Never use this feature for production boxes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/docref-root&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Examples&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;docref_root = &amp;#34;/phpmanual/&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/docref-ext&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;docref_ext = .html&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; String to output before an error message. PHP&amp;#39;s default behavior is to leave&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; this setting blank.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/error-prepend-string&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Example:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;error_prepend_string = &amp;#34;&amp;lt;span style=&amp;#39;color: #ff0000&amp;#39;&amp;gt;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; String to output after an error message. PHP&amp;#39;s default behavior is to leave&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; this setting blank.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/error-append-string&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Example:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;error_append_string = &amp;#34;&amp;lt;/span&amp;gt;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Log errors to specified file. PHP&amp;#39;s default behavior is to leave this value&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; empty.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/error-log&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Example:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;error_log = php_errors.log&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Log errors to syslog (Event Log on Windows).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;error_log = syslog&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The syslog ident is a string which is prepended to every message logged&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to syslog. Only used when error_log is set to syslog.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;syslog.ident = php&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The syslog facility is used to specify what type of program is logging&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the message. Only used when error_log is set to syslog.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;syslog.facility = user&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Set this to disable filtering control characters (the default).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Some loggers only accept NVT-ASCII, others accept anything that&amp;#39;s not&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; control characters. If your logger accepts everything, then no filtering&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is needed at all.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allowed values are:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; ascii (all printable ASCII characters and NL)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; no-ctrl (all characters except control characters)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; all (all characters)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; raw (like &amp;#34;all&amp;#34;, but messages are not split at newlines)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/syslog.filter&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;syslog.filter = ascii&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;windows.show_crt_warning&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default value: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development value: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production value: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Data Handling ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The separator used in PHP generated URLs to separate arguments.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP&amp;#39;s default setting is &amp;#34;&amp;amp;&amp;#34;.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/arg-separator.output&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Example:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;arg_separator.output = &amp;#34;&amp;amp;amp;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; List of separator(s) used by PHP to parse input URLs into variables.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP&amp;#39;s default setting is &amp;#34;&amp;amp;&amp;#34;.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; NOTE: Every character in this directive is considered as separator!&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/arg-separator.input&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Example:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;arg_separator.input = &amp;#34;;&amp;amp;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive determines which super global arrays are registered when PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; starts up. G,P,C,E &amp;amp; S are abbreviations for the following respective super&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; paid for the registration of these arrays and because ENV is not as commonly&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; used as the others, ENV is not recommended on productions servers. You&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; can still get access to the environment variables through getenv() should you&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; need to.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: &amp;#34;EGPCS&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: &amp;#34;GPCS&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: &amp;#34;GPCS&amp;#34;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/variables-order&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">variables_order&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">&amp;#34;GPCS&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive determines which super global data (G,P &amp;amp; C) should be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; registered into the super global array REQUEST. If so, it also determines&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the order in which that data is registered. The values for this directive&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; are specified in the same manner as the variables_order directive,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; EXCEPT one. Leaving this value empty will cause PHP to use the value set&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; in the variables_order directive. It does not mean it will leave the super&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; globals array REQUEST empty.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: None&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: &amp;#34;GP&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: &amp;#34;GP&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/request-order&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">request_order&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">&amp;#34;GP&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive determines whether PHP registers $argv &amp;amp; $argc each time it&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; runs. $argv contains an array of all the arguments passed to PHP when a script&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is invoked. $argc contains an integer representing the number of arguments&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; that were passed when the script was invoked. These arrays are extremely&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; useful when running scripts from the command line. When this directive is&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; enabled, registering these variables consumes CPU cycles and memory each time&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; a script is executed. For performance reasons, this feature should be disabled&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; on production servers.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: This directive is hardcoded to On for the CLI SAPI&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/register-argc-argv&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">register_argc_argv&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; When enabled, the ENV, REQUEST and SERVER variables are created when they&amp;#39;re&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; first used (Just In Time) instead of when the script starts. If these&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; variables are not used within a script, having this directive on will result&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; in a performance gain. The PHP directive register_argc_argv must be disabled&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; for this directive to have any effect.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/auto-globals-jit&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">auto_globals_jit&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Whether PHP will read the POST data.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This option is enabled by default.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Most likely, you won&amp;#39;t want to disable this option globally. It causes $_POST&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; and $_FILES to always be empty; the only way you will be able to read the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; POST data will be through the php://input stream wrapper. This can be useful&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to proxy requests or to process the POST data in a memory efficient fashion.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/enable-post-data-reading&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;enable_post_data_reading = Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum size of POST data that PHP will accept.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Its value may be 0 to disable the limit. It is ignored if POST data reading&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is disabled through enable_post_data_reading.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/post-max-size&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">post_max_size&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">8M&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Automatically add files before PHP document.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/auto-prepend-file&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">auto_prepend_file&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Automatically add files after PHP document.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/auto-append-file&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">auto_append_file&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; By default, PHP will output a media type using the Content-Type header. To&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; disable this, simply set it to be empty.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP&amp;#39;s built-in default media type is set to text/html.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/default-mimetype&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">default_mimetype&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">&amp;#34;text/html&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP&amp;#39;s default character set is set to UTF-8.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/default-charset&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">default_charset&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">&amp;#34;UTF-8&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP internal character encoding is set to empty.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If empty, default_charset is used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/internal-encoding&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;internal_encoding =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP input character encoding is set to empty.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If empty, default_charset is used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/input-encoding&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;input_encoding =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP output character encoding is set to empty.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If empty, default_charset is used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; See also output_buffer.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/output-encoding&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;output_encoding =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Paths and Directories ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; UNIX: &amp;#34;/path1:/path2&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;include_path = &amp;#34;.:/php/includes&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Windows: &amp;#34;\path1;\path2&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;include_path = &amp;#34;.;c:\php\includes&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP&amp;#39;s default setting for include_path is &amp;#34;.;/path/to/php/pear&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/include-path&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The root of the PHP pages, used only if nonempty.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; if you are running php as a CGI under any web server (other than IIS)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; see documentation for security issues. The alternate is to use the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; cgi.force_redirect configuration below&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/doc-root&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">doc_root&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The directory under which PHP opens the script using /~username used only&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; if nonempty.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/user-dir&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">user_dir&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Directory in which the loadable extensions (modules) reside.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/extension-dir&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension_dir = &amp;#34;./&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; On windows:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension_dir = &amp;#34;ext&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Directory where the temporary files should be placed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Defaults to the system default (see sys_get_temp_dir)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;sys_temp_dir = &amp;#34;/tmp&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Whether or not to enable the dl() function. The dl() function does NOT work&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; properly in multithreaded servers, such as IIS or Zeus, and is automatically&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; disabled on them.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/enable-dl&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">enable_dl&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; cgi.force_redirect is necessary to provide security running PHP as a CGI under&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; most web servers. Left undefined, PHP turns this on by default. You can&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; turn it off here AT YOUR OWN RISK&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; **You CAN safely turn this off for IIS, in fact, you MUST.**&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/cgi.force-redirect&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;cgi.force_redirect = 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; if cgi.nph is enabled it will force cgi to always sent Status: 200 with&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; every request. PHP&amp;#39;s default behavior is to disable this feature.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;cgi.nph = 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (iPlanet) web servers, you MAY need to set an environment variable name that PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; will look for to know it is OK to continue execution. Setting this variable MAY&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; cause security issues, KNOW WHAT YOU ARE DOING FIRST.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/cgi.redirect-status-env&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;cgi.redirect_status_env =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP&amp;#39;s&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of zero causes PHP to behave as before. Default is 1. You should fix your scripts&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/cgi.fix-pathinfo&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;cgi.fix_pathinfo=1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of the web tree and people will not be able to circumvent .htaccess security.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;cgi.discard_path=1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; FastCGI under IIS supports the ability to impersonate&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; security tokens of the calling client. This allows IIS to define the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; security context that the request runs under. mod_fastcgi under Apache&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; does not currently support this feature (03/17/2002)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Set to 1 if running under IIS. Default is zero.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/fastcgi.impersonate&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;fastcgi.impersonate = 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Disable logging through FastCGI connection. PHP&amp;#39;s default behavior is to enable&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; this feature.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;fastcgi.logging = 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; cgi.rfc2616_headers configuration option tells PHP what type of headers to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; use when sending HTTP response code. If set to 0, PHP sends Status: header that&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is supported by Apache. When this option is set to 1, PHP will send&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; RFC2616 compliant header.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default is zero.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/cgi.rfc2616-headers&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;cgi.rfc2616_headers = 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #!&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (shebang) at the top of the running script. This line might be needed if the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; script support running both as stand-alone script and via PHP CGI&amp;lt;. PHP in CGI&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; mode skips this line and ignores its content if this directive is turned on.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/cgi.check-shebang-line&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;cgi.check_shebang_line=1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; File Uploads ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Whether to allow HTTP file uploads.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/file-uploads&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">file_uploads&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Temporary directory for HTTP uploaded files (will use system default if not&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; specified).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/upload-tmp-dir&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;upload_tmp_dir =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum allowed size for uploaded files.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/upload-max-filesize&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">upload_max_filesize&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">2M&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum number of files that can be uploaded via a single request&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">max_file_uploads&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">20&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Fopen wrappers ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Whether to allow the treatment of URLs (like http:// or ftp://) as files.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/allow-url-fopen&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">allow_url_fopen&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Whether to allow include/require to open URLs (like https:// or ftp://) as files.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/allow-url-include&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">allow_url_include&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Define the anonymous ftp password (your email address). PHP&amp;#39;s default setting&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; for this is empty.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/from&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;from=&amp;#34;john@doe.com&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Define the User-Agent string. PHP&amp;#39;s default setting for this is empty.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/user-agent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;user_agent=&amp;#34;PHP&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default timeout for socket based streams (seconds)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/default-socket-timeout&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">default_socket_timeout&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">60&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If your scripts have to deal with files from Macintosh systems,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; or you are running on a Mac and need to deal with files from&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; unix or win32 systems, setting this flag will cause PHP to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; automatically detect the EOL character in those files so that&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; fgets() and file() will work regardless of the source of the file.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/auto-detect-line-endings&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;auto_detect_line_endings = Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Dynamic Extensions ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If you wish to have an extension loaded automatically, use the following&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; syntax:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; extension=modulename&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; For example:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; extension=mysqli&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; When the extension library to load is not located in the default extension&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; directory, You may specify an absolute path to the library file:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; extension=/path/to/extension/mysqli.so&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note : The syntax used in previous PHP versions (&amp;#39;extension=&amp;lt;ext&amp;gt;.so&amp;#39; and&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#39;extension=&amp;#39;php_&amp;lt;ext&amp;gt;.dll&amp;#39;) is supported for legacy reasons and may be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; deprecated in a future PHP major version. So, when it is possible, please&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; move to the new (&amp;#39;extension=&amp;lt;ext&amp;gt;) syntax.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Notes for Windows environments :&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - Many DLL files are located in the extensions/ (PHP 4) or ext/ (PHP 5+)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; extension folders as well as the separate PECL DLL download (PHP 5+).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Be sure to appropriately set the extension_dir directive.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=bz2&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The ldap extension must be before curl if OpenSSL 1.0.2 and OpenLDAP is used&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; otherwise it results in segfault when unloading after using SASL.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; See https://github.com/php/php-src/issues/8620 for more info.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=ldap&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=curl&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=ffi&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=ftp&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=fileinfo&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=gd&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=gettext&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=gmp&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=intl&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=imap&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=mbstring&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=exif ; Must be after mbstring as it depends on it&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=mysqli&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=oci8_12c ; Use with Oracle Database 12c Instant Client&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=oci8_19 ; Use with Oracle Database 19 Instant Client&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=odbc&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=openssl&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=pdo_firebird&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=pdo_mysql&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=pdo_oci&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=pdo_odbc&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=pdo_pgsql&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=pdo_sqlite&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=pgsql&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=shmop&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The MIBS data available in the PHP distribution must be installed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; See https://www.php.net/manual/en/snmp.installation.php&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=snmp&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=soap&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=sockets&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=sodium&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=sqlite3&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=tidy&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;extension=xsl&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;zend_extension=opcache&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Module Settings ;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;;;;;;;;;;;;;;;;;;;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[CLI Server]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Whether the CLI web server uses ANSI color coding in its terminal output.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">cli_server.color&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[Date]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Defines the default timezone used by the date functions&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/date.timezone&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;date.timezone =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/date.default-latitude&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;date.default_latitude = 31.7667&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/date.default-longitude&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;date.default_longitude = 35.2333&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/date.sunrise-zenith&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;date.sunrise_zenith = 90.833333&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/date.sunset-zenith&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;date.sunset_zenith = 90.833333&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[filter]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/filter.default&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;filter.default = unsafe_raw&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/filter.default-flags&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;filter.default_flags =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[iconv]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Use of this INI entry is deprecated, use global input_encoding instead.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If empty, default_charset or input_encoding or iconv.input_encoding is used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The precedence is: default_charset &amp;lt; input_encoding &amp;lt; iconv.input_encoding&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;iconv.input_encoding =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Use of this INI entry is deprecated, use global internal_encoding instead.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If empty, default_charset or internal_encoding or iconv.internal_encoding is used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The precedence is: default_charset &amp;lt; internal_encoding &amp;lt; iconv.internal_encoding&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;iconv.internal_encoding =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Use of this INI entry is deprecated, use global output_encoding instead.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If empty, default_charset or output_encoding or iconv.output_encoding is used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The precedence is: default_charset &amp;lt; output_encoding &amp;lt; iconv.output_encoding&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; To use an output encoding conversion, iconv&amp;#39;s output handler must be set&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; otherwise output encoding conversion cannot be performed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;iconv.output_encoding =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[imap]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; rsh/ssh logins are disabled by default. Use this INI entry if you want to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; enable them. Note that the IMAP library does not filter mailbox names before&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; passing them to rsh/ssh command, thus passing untrusted data to this function&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; with rsh/ssh enabled is insecure.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;imap.enable_insecure_rsh=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[intl]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;intl.default_locale =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive allows you to produce PHP errors when some error&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; happens within intl functions. The value is the level of the error produced.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default is 0, which does not produce any errors.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;intl.error_level = E_WARNING&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;intl.use_exceptions = 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[sqlite3]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Directory pointing to SQLite3 extensions&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/sqlite3.extension-dir&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;sqlite3.extension_dir =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; SQLite defensive mode flag (only available from SQLite 3.26+)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; When the defensive flag is enabled, language features that allow ordinary&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; SQL to deliberately corrupt the database file are disabled. This forbids&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; writing directly to the schema, shadow tables (eg. FTS data tables), or&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the sqlite_dbpage virtual table.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://www.sqlite.org/c3ref/c_dbconfig_defensive.html&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (for older SQLite versions, this flag has no use)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;sqlite3.defensive = 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[Pcre]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PCRE library backtracking limit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/pcre.backtrack-limit&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;pcre.backtrack_limit=100000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PCRE library recursion limit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Please note that if you set this value to a high number you may consume all&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the available process stack and eventually crash PHP (due to reaching the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; stack size limit imposed by the Operating System).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/pcre.recursion-limit&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;pcre.recursion_limit=100000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enables or disables JIT compilation of patterns. This requires the PCRE&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; library to be compiled with JIT support.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;pcre.jit=1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[Pdo]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Whether to pool ODBC connections. Can be one of &amp;#34;strict&amp;#34;, &amp;#34;relaxed&amp;#34; or &amp;#34;off&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/pdo-odbc.connection-pooling&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;pdo_odbc.connection_pooling=strict&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[Pdo_mysql]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default socket name for local MySQL connects. If empty, uses the built-in&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; MySQL defaults.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pdo_mysql.default_socket&lt;/span>&lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[Phar]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/phar.readonly&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;phar.readonly = On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/phar.require-hash&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;phar.require_hash = On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;phar.cache_list =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[mail function]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; For Win32 only.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/smtp&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">SMTP&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">localhost&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/smtp-port&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">smtp_port&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">25&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; For Win32 only.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/sendmail-from&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;sendmail_from = me@example.com&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; For Unix only. You may supply arguments as well (default: &amp;#34;sendmail -t -i&amp;#34;).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/sendmail-path&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;sendmail_path =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Force the addition of the specified parameters to be passed as extra parameters&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to the sendmail binary. These parameters will always replace the value of&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the 5th parameter to mail().&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mail.force_extra_parameters =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mail.add_x_header&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The path to a log file that will log all mail() calls. Log entries include&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the full path of the script, line number, To address and headers.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mail.log =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Log mail to syslog (Event Log on Windows).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mail.log = syslog&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[ODBC]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/odbc.default-db&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;odbc.default_db = Not yet implemented&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/odbc.default-user&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;odbc.default_user = Not yet implemented&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/odbc.default-pw&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;odbc.default_pw = Not yet implemented&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Controls the ODBC cursor model.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default: SQL_CURSOR_STATIC (default).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;odbc.default_cursortype&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allow or prevent persistent links.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/odbc.allow-persistent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">odbc.allow_persistent&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Check that a connection is still valid before reuse.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/odbc.check-persistent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">odbc.check_persistent&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum number of persistent links. -1 means no limit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/odbc.max-persistent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">odbc.max_persistent&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">-1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum number of links (persistent + non-persistent). -1 means no limit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/odbc.max-links&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">odbc.max_links&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">-1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Handling of LONG fields. Returns number of bytes to variables. 0 means&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; passthru.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/odbc.defaultlrl&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">odbc.defaultlrl&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">4096&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; See the documentation on odbc_binmode and odbc_longreadlen for an explanation&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of odbc.defaultlrl and odbc.defaultbinmode&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/odbc.defaultbinmode&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">odbc.defaultbinmode&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[MySQLi]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum number of persistent links. -1 means no limit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mysqli.max-persistent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mysqli.max_persistent&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">-1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allow accessing, from PHP&amp;#39;s perspective, local files with LOAD DATA statements&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mysqli.allow_local_infile&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mysqli.allow_local_infile = On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; It allows the user to specify a folder where files that can be sent via LOAD DATA&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; LOCAL can exist. It is ignored if mysqli.allow_local_infile is enabled.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mysqli.local_infile_directory =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allow or prevent persistent links.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mysqli.allow-persistent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mysqli.allow_persistent&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum number of links. -1 means no limit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mysqli.max-links&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mysqli.max_links&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">-1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default port number for mysqli_connect(). If unset, mysqli_connect() will use&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; compile-time value defined MYSQL_PORT (in that order). Win32 will only look&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; at MYSQL_PORT.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mysqli.default-port&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mysqli.default_port&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">3306&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default socket name for local MySQL connects. If empty, uses the built-in&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; MySQL defaults.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mysqli.default-socket&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mysqli.default_socket&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default host for mysqli_connect() (doesn&amp;#39;t apply in safe mode).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mysqli.default-host&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mysqli.default_host&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default user for mysqli_connect() (doesn&amp;#39;t apply in safe mode).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mysqli.default-user&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mysqli.default_user&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default password for mysqli_connect() (doesn&amp;#39;t apply in safe mode).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note that this is generally a *bad* idea to store passwords in this file.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; *Any* user with PHP access can run &amp;#39;echo get_cfg_var(&amp;#34;mysqli.default_pw&amp;#34;)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; and reveal this password! And of course, any users with read access to this&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; file will be able to reveal the password as well.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mysqli.default-pw&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mysqli.default_pw&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allow or prevent reconnect&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mysqli.reconnect&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If this option is enabled, closing a persistent connection will rollback&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; any pending transactions of this connection, before it is put back&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; into the persistent connection pool.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mysqli.rollback_on_cached_plink = Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[mysqlnd]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enable / Disable collection of general statistics by mysqlnd which can be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; used to tune and monitor MySQL operations.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mysqlnd.collect_statistics&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enable / Disable collection of memory usage statistics by mysqlnd which can be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; used to tune and monitor MySQL operations.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">mysqlnd.collect_memory_statistics&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Records communication from all extensions using mysqlnd to the specified log&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; file.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mysqlnd.debug&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mysqlnd.debug =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Defines which queries will be logged.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mysqlnd.log_mask = 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default size of the mysqlnd memory pool, which is used by result sets.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mysqlnd.mempool_default_size = 16000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mysqlnd.net_cmd_buffer_size = 2048&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Size of a pre-allocated buffer used for reading data sent by the server in&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; bytes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mysqlnd.net_read_buffer_size = 32768&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Timeout for network requests in seconds.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mysqlnd.net_read_timeout = 31536000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; SHA-256 Authentication Plugin related. File with the MySQL server public RSA&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; key.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mysqlnd.sha256_server_public_key =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[OCI8]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Connection: Enables privileged connections using external&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; credentials (OCI_SYSOPER, OCI_SYSDBA)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/oci8.privileged-connect&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;oci8.privileged_connect = Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Connection: The maximum number of persistent OCI8 connections per&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; process. Using -1 means no limit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/oci8.max-persistent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;oci8.max_persistent = -1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Connection: The maximum number of seconds a process is allowed to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; maintain an idle persistent connection. Using -1 means idle&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; persistent connections will be maintained forever.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/oci8.persistent-timeout&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;oci8.persistent_timeout = -1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Connection: The number of seconds that must pass before issuing a&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; ping during oci_pconnect() to check the connection validity. When&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; set to 0, each oci_pconnect() will cause a ping. Using -1 disables&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pings completely.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/oci8.ping-interval&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;oci8.ping_interval = 60&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Connection: Set this to a user chosen connection class to be used&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; for all pooled server requests with Oracle 11g Database Resident&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Connection Pooling (DRCP). To use DRCP, this value should be set to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the same string for all web servers running the same application,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the database pool must be configured, and the connection string must&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; specify to use a pooled server.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;oci8.connection_class =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; High Availability: Using On lets PHP receive Fast Application&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Notification (FAN) events generated when a database node fails. The&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; database must also be configured to post FAN events.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;oci8.events = Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Tuning: This option enables statement caching, and specifies how&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; many statements to cache. Using 0 disables statement caching.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/oci8.statement-cache-size&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;oci8.statement_cache_size = 20&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Tuning: Enables statement prefetching and sets the default number of&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; rows that will be fetched automatically after statement execution.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/oci8.default-prefetch&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;oci8.default_prefetch = 100&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Compatibility. Using On means oci_close() will not close&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; oci_connect() and oci_new_connect() connections.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/oci8.old-oci-close-semantics&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;oci8.old_oci_close_semantics = Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[PostgreSQL]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allow or prevent persistent links.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/pgsql.allow-persistent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pgsql.allow_persistent&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Detect broken persistent links always with pg_pconnect().&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Auto reset feature requires a little overheads.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/pgsql.auto-reset-persistent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pgsql.auto_reset_persistent&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum number of persistent links. -1 means no limit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/pgsql.max-persistent&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pgsql.max_persistent&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">-1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Maximum number of links (persistent+non persistent). -1 means no limit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/pgsql.max-links&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pgsql.max_links&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">-1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Ignore PostgreSQL backends Notice message or not.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Notice message logging require a little overheads.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/pgsql.ignore-notice&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pgsql.ignore_notice&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Log PostgreSQL backends Notice message or not.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Unless pgsql.ignore_notice=0, module cannot log notice message.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/pgsql.log-notice&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pgsql.log_notice&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[bcmath]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Number of decimal digits for all bcmath functions.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/bcmath.scale&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">bcmath.scale&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[browscap]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/browscap&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;browscap = extra/browscap.ini&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[Session]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Handler used to store/retrieve data.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.save-handler&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.save_handler&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">files&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Argument passed to save_handler. In the case of files, this is the path&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; where data files are stored. Note: Windows users have to change this&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; variable in order to use PHP&amp;#39;s session functions.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The path can be defined as:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; session.save_path = &amp;#34;N;/path&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; where N is an integer. Instead of storing all the session files in&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; /path, what this will do is use subdirectories N-levels deep, and&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; store the session data in those directories. This is useful if&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; your OS has problems with many files in one directory, and is&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; a more efficient layout for servers that handle many sessions.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; NOTE 1: PHP will not create this directory structure automatically.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; You can use the script in the ext/session dir for that purpose.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; NOTE 2: See the section on garbage collection below if you choose to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; use subdirectories for session storage&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The file storage module creates files using mode 600 by default.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; You can change that by using&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; session.save_path = &amp;#34;N;MODE;/path&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; where MODE is the octal representation of the mode. Note that this&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; does not overwrite the process&amp;#39;s umask.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.save-path&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;session.save_path = &amp;#34;/tmp&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Whether to use strict session mode.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Strict session mode does not accept an uninitialized session ID, and&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; regenerates the session ID if the browser sends an uninitialized session ID.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Strict mode protects applications from session fixation via a session adoption&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; vulnerability. It is disabled by default for maximum compatibility, but&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; enabling it is encouraged.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://wiki.php.net/rfc/strict_sessions&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.use_strict_mode&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Whether to use cookies.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.use-cookies&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.use_cookies&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.cookie-secure&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;session.cookie_secure =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This option forces PHP to fetch and use a cookie for storing and maintaining&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the session id. We encourage this operation as it&amp;#39;s very helpful in combating&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; session hijacking when not specifying and managing your own session id. It is&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; not the be-all and end-all of session hijacking defense, but it&amp;#39;s a good start.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.use-only-cookies&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.use_only_cookies&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Name of the session (used as cookie name).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.name&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.name&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">PHPSESSID&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Initialize session on request startup.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.auto-start&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.auto_start&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Lifetime in seconds of cookie or, if 0, until browser is restarted.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.cookie-lifetime&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.cookie_lifetime&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The path for which the cookie is valid.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.cookie-path&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.cookie_path&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">/&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The domain for which the cookie is valid.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.cookie-domain&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.cookie_domain&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Whether or not to add the httpOnly flag to the cookie, which makes it&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; inaccessible to browser scripting languages such as JavaScript.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.cookie-httponly&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.cookie_httponly&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Add SameSite attribute to cookie to help mitigate Cross-Site Request Forgery (CSRF/XSRF)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Current valid values are &amp;#34;Strict&amp;#34;, &amp;#34;Lax&amp;#34; or &amp;#34;None&amp;#34;. When using &amp;#34;None&amp;#34;,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; make sure to include the quotes, as `none` is interpreted like `false` in ini files.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://tools.ietf.org/html/draft-west-first-party-cookies-07&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.cookie_samesite&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Handler used to serialize data. php is the standard serializer of PHP.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.serialize-handler&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.serialize_handler&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">php&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Defines the probability that the &amp;#39;garbage collection&amp;#39; process is started on every&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; session initialization. The probability is calculated by using gc_probability/gc_divisor,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; e.g. 1/100 means there is a 1% chance that the GC process starts on each request.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.gc-probability&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.gc_probability&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Defines the probability that the &amp;#39;garbage collection&amp;#39; process is started on every&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; session initialization. The probability is calculated by using gc_probability/gc_divisor,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; e.g. 1/100 means there is a 1% chance that the GC process starts on each request.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; For high volume production servers, using a value of 1000 is a more efficient approach.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 100&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 1000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 1000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.gc-divisor&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.gc_divisor&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">1000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; After this number of seconds, stored data will be seen as &amp;#39;garbage&amp;#39; and&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; cleaned up by the garbage collection process.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.gc-maxlifetime&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.gc_maxlifetime&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">1440&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; NOTE: If you are using the subdirectory option for storing session files&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (see session.save_path above), then garbage collection does *not*&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; happen automatically. You will need to do your own garbage&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; collection through a shell script, cron entry, or some other method.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; For example, the following script is the equivalent of setting&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; find /path/to/sessions -cmin +24 -type f | xargs rm&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Check HTTP Referer to invalidate externally stored URLs containing ids.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; HTTP_REFERER has to contain this substring for the session to be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; considered as valid.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.referer-check&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.referer_check&lt;/span> &lt;span class="o">=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Set to {nocache,private,public,} to determine HTTP caching aspects&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; or leave this empty to avoid sending anti-caching headers.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.cache-limiter&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.cache_limiter&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">nocache&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Document expires after n minutes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.cache-expire&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.cache_expire&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">180&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; trans sid support is disabled by default.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Use of trans sid may risk your users&amp;#39; security.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Use this option with caution.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - User may send URL contains active session ID&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to other person via. email/irc/etc.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - URL that contains active session ID may be stored&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; in publicly accessible computer.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - User may access your site with the same session ID&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; always using URL stored in browser&amp;#39;s history or bookmarks.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.use-trans-sid&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.use_trans_sid&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Set session ID character length. This value could be between 22 to 256.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Shorter length than default is supported only for compatibility reason.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Users should use 32 or more chars.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.sid-length&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 32&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 26&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 26&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.sid_length&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">26&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The URL rewriter will look for URLs in a defined set of HTML tags.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;lt;form&amp;gt; is special; if you include them here, the rewriter will&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; add a hidden &amp;lt;input&amp;gt; field with the info which is otherwise appended&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to URLs. &amp;lt;form&amp;gt; tag&amp;#39;s action attribute URL will not be modified&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; unless it is specified.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note that all valid entries require a &amp;#34;=&amp;#34;, even if no value follows.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: &amp;#34;a=href,area=href,frame=src,form=&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: &amp;#34;a=href,area=href,frame=src,form=&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: &amp;#34;a=href,area=href,frame=src,form=&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/url-rewriter.tags&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.trans_sid_tags&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">&amp;#34;a=href,area=href,frame=src,form=&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; URL rewriter does not rewrite absolute URLs by default.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; To enable rewrites for absolute paths, target hosts must be specified&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; at RUNTIME. i.e. use ini_set()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;lt;form&amp;gt; tags is special. PHP will check action attribute&amp;#39;s URL regardless&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of session.trans_sid_tags setting.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If no host is defined, HTTP_HOST will be used for allowed host.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Example value: php.net,www.php.net,wiki.php.net&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Use &amp;#34;,&amp;#34; for multiple hosts. No spaces are allowed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: &amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: &amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: &amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;session.trans_sid_hosts=&amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Define how many bits are stored in each character when converting&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the binary hash data to something readable.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Possible values:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; 4 (4 bits: 0-9, a-f)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; 5 (5 bits: 0-9, a-v)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; 6 (6 bits: 0-9, a-z, A-Z, &amp;#34;-&amp;#34;, &amp;#34;,&amp;#34;)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 4&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 5&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 5&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.hash-bits-per-character&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">session.sid_bits_per_character&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">5&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enable upload progress tracking in $_SESSION&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.upload-progress.enabled&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;session.upload_progress.enabled = On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Cleanup the progress information as soon as all POST data has been read&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (i.e. upload completed).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.upload-progress.cleanup&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;session.upload_progress.cleanup = On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; A prefix used for the upload progress key in $_SESSION&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: &amp;#34;upload_progress_&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: &amp;#34;upload_progress_&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: &amp;#34;upload_progress_&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.upload-progress.prefix&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;session.upload_progress.prefix = &amp;#34;upload_progress_&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The index name (concatenated with the prefix) in $_SESSION&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; containing the upload progress information&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: &amp;#34;PHP_SESSION_UPLOAD_PROGRESS&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: &amp;#34;PHP_SESSION_UPLOAD_PROGRESS&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: &amp;#34;PHP_SESSION_UPLOAD_PROGRESS&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.upload-progress.name&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;session.upload_progress.name = &amp;#34;PHP_SESSION_UPLOAD_PROGRESS&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; How frequently the upload progress should be updated.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Given either in percentages (per-file), or in bytes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: &amp;#34;1%&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: &amp;#34;1%&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: &amp;#34;1%&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.upload-progress.freq&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;session.upload_progress.freq = &amp;#34;1%&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The minimum delay between updates, in seconds&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.upload-progress.min-freq&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;session.upload_progress.min_freq = &amp;#34;1&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Only write session data when session data is changed. Enabled by default.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/session.lazy-write&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;session.lazy_write = On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[Assertion]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Switch whether to compile assertions at all (to have no overhead at run-time)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; -1: Do not compile at all&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; 0: Jump over assertion at run-time&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; 1: Execute assertions&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Development Value: 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Production Value: -1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/zend.assertions&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">zend.assertions&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">-1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Assert(expr); active by default.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/assert.active&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;assert.active = On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Throw an AssertionError on failed assertions&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/assert.exception&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;assert.exception = On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/assert.warning&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;assert.warning = On&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Don&amp;#39;t bail out by default.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/assert.bail&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;assert.bail = Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; User-function to be called if an assertion fails.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/assert.callback&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;assert.callback = 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[COM]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/com.typelib-file&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;com.typelib_file =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; allow Distributed-COM calls&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/com.allow-dcom&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;com.allow_dcom = true&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; autoregister constants of a component&amp;#39;s typelib on com_load()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/com.autoregister-typelib&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;com.autoregister_typelib = true&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; register constants casesensitive&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/com.autoregister-casesensitive&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;com.autoregister_casesensitive = false&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; show warnings on duplicate constant registrations&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/com.autoregister-verbose&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;com.autoregister_verbose = true&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The default character set code-page to use when passing strings to and from COM objects.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default: system ANSI code page&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;com.code_page=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The version of the .NET framework to use. The value of the setting are the first three parts&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of the framework&amp;#39;s version number, separated by dots, and prefixed with &amp;#34;v&amp;#34;, e.g. &amp;#34;v4.0.30319&amp;#34;.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;com.dotnet_version=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[mbstring]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; language for internal character representation.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This affects mb_send_mail() and mbstring.detect_order.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mbstring.language&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mbstring.language = Japanese&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Use of this INI entry is deprecated, use global internal_encoding instead.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; internal/script encoding.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If empty, default_charset or internal_encoding or iconv.internal_encoding is used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The precedence is: default_charset &amp;lt; internal_encoding &amp;lt; iconv.internal_encoding&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mbstring.internal_encoding =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Use of this INI entry is deprecated, use global input_encoding instead.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; http input encoding.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; mbstring.encoding_translation = On is needed to use this setting.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If empty, default_charset or input_encoding or mbstring.input is used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The precedence is: default_charset &amp;lt; input_encoding &amp;lt; mbstring.http_input&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mbstring.http-input&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mbstring.http_input =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Use of this INI entry is deprecated, use global output_encoding instead.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; http output encoding.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; mb_output_handler must be registered as output buffer to function.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If empty, default_charset or output_encoding or mbstring.http_output is used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The precedence is: default_charset &amp;lt; output_encoding &amp;lt; mbstring.http_output&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; To use an output encoding conversion, mbstring&amp;#39;s output handler must be set&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; otherwise output encoding conversion cannot be performed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mbstring.http-output&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mbstring.http_output =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; enable automatic encoding translation according to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; mbstring.internal_encoding setting. Input chars are&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; converted to internal encoding by setting this to On.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Do _not_ use automatic encoding translation for&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; portable libs/applications.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mbstring.encoding-translation&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mbstring.encoding_translation = Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; automatic encoding detection order.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#34;auto&amp;#34; detect order is changed according to mbstring.language&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mbstring.detect-order&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mbstring.detect_order = auto&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; substitute_character used when character cannot be converted&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; one from another&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/mbstring.substitute-character&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mbstring.substitute_character = none&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enable strict encoding detection.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mbstring.strict_detection = Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive specifies the regex pattern of content types for which mb_output_handler()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is activated.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default: mbstring.http_output_conv_mimetypes=^(text/|application/xhtml\+xml)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mbstring.http_output_conv_mimetypes=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive specifies maximum stack depth for mbstring regular expressions. It is similar&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to the pcre.recursion_limit for PCRE.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mbstring.regex_stack_limit=100000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive specifies maximum retry count for mbstring regular expressions. It is similar&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to the pcre.backtrack_limit for PCRE.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;mbstring.regex_retry_limit=1000000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[gd]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Tell the jpeg decode to ignore warnings and try to create&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; a gd image. The warning will then be displayed as notices&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; disabled by default&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/gd.jpeg-ignore-warning&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;gd.jpeg_ignore_warning = 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[exif]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; With mbstring support this will automatically be converted into the encoding&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; given by corresponding encode setting. When empty mbstring.internal_encoding&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is used. For the decode settings you can distinguish between motorola and&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; intel byte order. A decode setting cannot be empty.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/exif.encode-unicode&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;exif.encode_unicode = ISO-8859-15&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/exif.decode-unicode-motorola&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;exif.decode_unicode_motorola = UCS-2BE&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/exif.decode-unicode-intel&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;exif.decode_unicode_intel = UCS-2LE&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/exif.encode-jis&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;exif.encode_jis =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/exif.decode-jis-motorola&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;exif.decode_jis_motorola = JIS&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/exif.decode-jis-intel&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;exif.decode_jis_intel = JIS&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[Tidy]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The path to a default tidy configuration file to use when using tidy&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/tidy.default-config&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;tidy.default_config = /usr/local/lib/php/default.tcfg&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Should tidy clean and repair output automatically?&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; WARNING: Do not use this option if you are generating non-html content&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; such as dynamic images&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/tidy.clean-output&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">tidy.clean_output&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">Off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[soap]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enables or disables WSDL caching feature.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/soap.wsdl-cache-enabled&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">soap.wsdl_cache_enabled&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Sets the directory name where SOAP extension will put cache files.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/soap.wsdl-cache-dir&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">soap.wsdl_cache_dir&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;/tmp&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (time to live) Sets the number of second while cached file will be used&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; instead of original one.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/soap.wsdl-cache-ttl&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">soap.wsdl_cache_ttl&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">86400&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Sets the size of the cache limit. (Max. number of WSDL files to cache)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">soap.wsdl_cache_limit&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">5&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[sysvshm]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; A default size of the shared memory segment&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;sysvshm.init_mem = 10000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[ldap]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Sets the maximum number of open links or -1 for unlimited.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">ldap.max_links&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">-1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[dba]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;dba.default_handler=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[opcache]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Determines if Zend OPCache is enabled&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.enable=1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Determines if Zend OPCache is enabled for the CLI version of PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.enable_cli=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The OPcache shared memory storage size.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.memory_consumption=128&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The amount of memory for interned strings in Mbytes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.interned_strings_buffer=8&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The maximum number of keys (scripts) in the OPcache hash table.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Only numbers between 200 and 1000000 are allowed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.max_accelerated_files=10000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The maximum percentage of &amp;#34;wasted&amp;#34; memory until a restart is scheduled.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.max_wasted_percentage=5&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; When this directive is enabled, the OPcache appends the current working&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; directory to the script key, thus eliminating possible collisions between&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; files with the same name (basename). Disabling the directive improves&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; performance, but may break existing applications.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.use_cwd=1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; When disabled, you must reset the OPcache manually or restart the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; webserver for changes to the filesystem to take effect.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.validate_timestamps=1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; How often (in seconds) to check file timestamps for changes to the shared&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; memory storage allocation. (&amp;#34;1&amp;#34; means validate once per second, but only&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; once per request. &amp;#34;0&amp;#34; means always validate)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.revalidate_freq=2&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enables or disables file search in include_path optimization&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.revalidate_path=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If disabled, all PHPDoc comments are dropped from the code to reduce the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; size of the optimized code.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.save_comments=1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If enabled, compilation warnings (including notices and deprecations) will&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; be recorded and replayed each time a file is included. Otherwise, compilation&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; warnings will only be emitted when the file is first cached.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.record_warnings=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allow file existence override (file_exists, etc.) performance feature.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.enable_file_override=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; A bitmask, where each bit enables or disables the appropriate OPcache&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; passes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.optimization_level=0x7FFFBFFF&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.dups_fix=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The location of the OPcache blacklist file (wildcards allowed).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Each OPcache blacklist file is a text file that holds the names of files&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; that should not be accelerated. The file format is to add each filename&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to a new line. The filename may be a full path or just a file prefix&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (i.e., /var/www/x blacklists all the files and directories in /var/www&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; that start with &amp;#39;x&amp;#39;). Line starting with a ; are ignored (comments).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.blacklist_filename=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allows exclusion of large files from being cached. By default all files&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; are cached.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.max_file_size=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Check the cache checksum each N requests.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The default value of &amp;#34;0&amp;#34; means that the checks are disabled.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.consistency_checks=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; How long to wait (in seconds) for a scheduled restart to begin if the cache&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is not being accessed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.force_restart_timeout=180&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; OPcache error_log file name. Empty string assumes &amp;#34;stderr&amp;#34;.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.error_log=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; All OPcache errors go to the Web server log.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; By default, only fatal errors (level 0) or errors (level 1) are logged.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; You can also enable warnings (level 2), info messages (level 3) or&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; debug messages (level 4).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.log_verbosity_level=1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Preferred Shared Memory back-end. Leave empty and let the system decide.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.preferred_memory_model=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Protect the shared memory from unexpected writing during script execution.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Useful for internal debugging only.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.protect_memory=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Allows calling OPcache API functions only from PHP scripts which path is&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; started from specified string. The default &amp;#34;&amp;#34; means no restriction&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.restrict_api=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Mapping base of shared memory segments (for Windows only). All the PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; processes have to map shared memory into the same address space. This&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; directive allows to manually fix the &amp;#34;Unable to reattach to base address&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; errors.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.mmap_base=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Facilitates multiple OPcache instances per user (for Windows only). All PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; processes with the same cache ID and user share an OPcache instance.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.cache_id=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enables and sets the second level cache directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; It should improve performance when SHM memory is full, at server restart or&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; SHM reset. The default &amp;#34;&amp;#34; disables file based caching.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.file_cache=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enables or disables opcode caching in shared memory.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.file_cache_only=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enables or disables checksum validation when script loaded from file cache.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.file_cache_consistency_checks=1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Implies opcache.file_cache_only=1 for a certain process that failed to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; reattach to the shared memory (for Windows only). Explicitly enabled file&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; cache is required.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.file_cache_fallback=1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Enables or disables copying of PHP code (text segment) into HUGE PAGES.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Under certain circumstances (if only a single global PHP process is&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; started from which all others fork), this can increase performance&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; by a tiny amount because TLB misses are reduced. On the other hand, this&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; delays PHP startup, increases memory usage and degrades performance&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; under memory pressure - use with care.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Requires appropriate OS configuration.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.huge_code_pages=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Validate cached file permissions.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.validate_permission=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Prevent name collisions in chroot&amp;#39;ed environment.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.validate_root=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If specified, it produces opcode dumps for debugging different stages of&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; optimizations.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.opt_debug_level=0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Specifies a PHP script that is going to be compiled and executed at server&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; start-up.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/opcache.preload&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.preload=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Preloading code as root is not allowed for security reasons. This directive&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; facilitates to let the preloading to be run as another user.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; https://php.net/opcache.preload_user&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.preload_user=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Prevents caching files that are less than this number of seconds old. It&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; protects from caching of incompletely updated files. In case all file updates&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; on your site are atomic, you may increase performance by setting it to &amp;#34;0&amp;#34;.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.file_update_protection=2&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Absolute path used to store shared lockfiles (for *nix only).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;opcache.lockfile_path=/tmp&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[curl]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; A default value for the CURLOPT_CAINFO option. This is required to be an&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; absolute path.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;curl.cainfo =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[openssl]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The location of a Certificate Authority (CA) file on the local filesystem&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to use when verifying the identity of SSL/TLS peers. Most users should&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; not specify a value for this directive as PHP will attempt to use the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; OS-managed cert stores in its absence. If specified, this value may still&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; be overridden on a per-stream basis via the &amp;#34;cafile&amp;#34; SSL stream context&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; option.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;openssl.cafile=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If openssl.cafile is not specified or if the CA file is not found, the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; directory pointed to by openssl.capath is searched for a suitable&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; certificate. This value must be a correctly hashed certificate directory.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Most users should not specify a value for this directive as PHP will&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; attempt to use the OS-managed cert stores in its absence. If specified,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; this value may still be overridden on a per-stream basis via the &amp;#34;capath&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; SSL stream context option.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;openssl.capath=&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[ffi]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; FFI API restriction. Possible values:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#34;preload&amp;#34; - enabled in CLI scripts and preloaded files (default)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#34;false&amp;#34; - always disabled&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#34;true&amp;#34; - always enabled&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;ffi.enable=preload&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; List of headers files to preload, wildcard patterns allowed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;ffi.preload=&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>www.conf&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt"> 10
&lt;/span>&lt;span class="lnt"> 11
&lt;/span>&lt;span class="lnt"> 12
&lt;/span>&lt;span class="lnt"> 13
&lt;/span>&lt;span class="lnt"> 14
&lt;/span>&lt;span class="lnt"> 15
&lt;/span>&lt;span class="lnt"> 16
&lt;/span>&lt;span class="lnt"> 17
&lt;/span>&lt;span class="lnt"> 18
&lt;/span>&lt;span class="lnt"> 19
&lt;/span>&lt;span class="lnt"> 20
&lt;/span>&lt;span class="lnt"> 21
&lt;/span>&lt;span class="lnt"> 22
&lt;/span>&lt;span class="lnt"> 23
&lt;/span>&lt;span class="lnt"> 24
&lt;/span>&lt;span class="lnt"> 25
&lt;/span>&lt;span class="lnt"> 26
&lt;/span>&lt;span class="lnt"> 27
&lt;/span>&lt;span class="lnt"> 28
&lt;/span>&lt;span class="lnt"> 29
&lt;/span>&lt;span class="lnt"> 30
&lt;/span>&lt;span class="lnt"> 31
&lt;/span>&lt;span class="lnt"> 32
&lt;/span>&lt;span class="lnt"> 33
&lt;/span>&lt;span class="lnt"> 34
&lt;/span>&lt;span class="lnt"> 35
&lt;/span>&lt;span class="lnt"> 36
&lt;/span>&lt;span class="lnt"> 37
&lt;/span>&lt;span class="lnt"> 38
&lt;/span>&lt;span class="lnt"> 39
&lt;/span>&lt;span class="lnt"> 40
&lt;/span>&lt;span class="lnt"> 41
&lt;/span>&lt;span class="lnt"> 42
&lt;/span>&lt;span class="lnt"> 43
&lt;/span>&lt;span class="lnt"> 44
&lt;/span>&lt;span class="lnt"> 45
&lt;/span>&lt;span class="lnt"> 46
&lt;/span>&lt;span class="lnt"> 47
&lt;/span>&lt;span class="lnt"> 48
&lt;/span>&lt;span class="lnt"> 49
&lt;/span>&lt;span class="lnt"> 50
&lt;/span>&lt;span class="lnt"> 51
&lt;/span>&lt;span class="lnt"> 52
&lt;/span>&lt;span class="lnt"> 53
&lt;/span>&lt;span class="lnt"> 54
&lt;/span>&lt;span class="lnt"> 55
&lt;/span>&lt;span class="lnt"> 56
&lt;/span>&lt;span class="lnt"> 57
&lt;/span>&lt;span class="lnt"> 58
&lt;/span>&lt;span class="lnt"> 59
&lt;/span>&lt;span class="lnt"> 60
&lt;/span>&lt;span class="lnt"> 61
&lt;/span>&lt;span class="lnt"> 62
&lt;/span>&lt;span class="lnt"> 63
&lt;/span>&lt;span class="lnt"> 64
&lt;/span>&lt;span class="lnt"> 65
&lt;/span>&lt;span class="lnt"> 66
&lt;/span>&lt;span class="lnt"> 67
&lt;/span>&lt;span class="lnt"> 68
&lt;/span>&lt;span class="lnt"> 69
&lt;/span>&lt;span class="lnt"> 70
&lt;/span>&lt;span class="lnt"> 71
&lt;/span>&lt;span class="lnt"> 72
&lt;/span>&lt;span class="lnt"> 73
&lt;/span>&lt;span class="lnt"> 74
&lt;/span>&lt;span class="lnt"> 75
&lt;/span>&lt;span class="lnt"> 76
&lt;/span>&lt;span class="lnt"> 77
&lt;/span>&lt;span class="lnt"> 78
&lt;/span>&lt;span class="lnt"> 79
&lt;/span>&lt;span class="lnt"> 80
&lt;/span>&lt;span class="lnt"> 81
&lt;/span>&lt;span class="lnt"> 82
&lt;/span>&lt;span class="lnt"> 83
&lt;/span>&lt;span class="lnt"> 84
&lt;/span>&lt;span class="lnt"> 85
&lt;/span>&lt;span class="lnt"> 86
&lt;/span>&lt;span class="lnt"> 87
&lt;/span>&lt;span class="lnt"> 88
&lt;/span>&lt;span class="lnt"> 89
&lt;/span>&lt;span class="lnt"> 90
&lt;/span>&lt;span class="lnt"> 91
&lt;/span>&lt;span class="lnt"> 92
&lt;/span>&lt;span class="lnt"> 93
&lt;/span>&lt;span class="lnt"> 94
&lt;/span>&lt;span class="lnt"> 95
&lt;/span>&lt;span class="lnt"> 96
&lt;/span>&lt;span class="lnt"> 97
&lt;/span>&lt;span class="lnt"> 98
&lt;/span>&lt;span class="lnt"> 99
&lt;/span>&lt;span class="lnt">100
&lt;/span>&lt;span class="lnt">101
&lt;/span>&lt;span class="lnt">102
&lt;/span>&lt;span class="lnt">103
&lt;/span>&lt;span class="lnt">104
&lt;/span>&lt;span class="lnt">105
&lt;/span>&lt;span class="lnt">106
&lt;/span>&lt;span class="lnt">107
&lt;/span>&lt;span class="lnt">108
&lt;/span>&lt;span class="lnt">109
&lt;/span>&lt;span class="lnt">110
&lt;/span>&lt;span class="lnt">111
&lt;/span>&lt;span class="lnt">112
&lt;/span>&lt;span class="lnt">113
&lt;/span>&lt;span class="lnt">114
&lt;/span>&lt;span class="lnt">115
&lt;/span>&lt;span class="lnt">116
&lt;/span>&lt;span class="lnt">117
&lt;/span>&lt;span class="lnt">118
&lt;/span>&lt;span class="lnt">119
&lt;/span>&lt;span class="lnt">120
&lt;/span>&lt;span class="lnt">121
&lt;/span>&lt;span class="lnt">122
&lt;/span>&lt;span class="lnt">123
&lt;/span>&lt;span class="lnt">124
&lt;/span>&lt;span class="lnt">125
&lt;/span>&lt;span class="lnt">126
&lt;/span>&lt;span class="lnt">127
&lt;/span>&lt;span class="lnt">128
&lt;/span>&lt;span class="lnt">129
&lt;/span>&lt;span class="lnt">130
&lt;/span>&lt;span class="lnt">131
&lt;/span>&lt;span class="lnt">132
&lt;/span>&lt;span class="lnt">133
&lt;/span>&lt;span class="lnt">134
&lt;/span>&lt;span class="lnt">135
&lt;/span>&lt;span class="lnt">136
&lt;/span>&lt;span class="lnt">137
&lt;/span>&lt;span class="lnt">138
&lt;/span>&lt;span class="lnt">139
&lt;/span>&lt;span class="lnt">140
&lt;/span>&lt;span class="lnt">141
&lt;/span>&lt;span class="lnt">142
&lt;/span>&lt;span class="lnt">143
&lt;/span>&lt;span class="lnt">144
&lt;/span>&lt;span class="lnt">145
&lt;/span>&lt;span class="lnt">146
&lt;/span>&lt;span class="lnt">147
&lt;/span>&lt;span class="lnt">148
&lt;/span>&lt;span class="lnt">149
&lt;/span>&lt;span class="lnt">150
&lt;/span>&lt;span class="lnt">151
&lt;/span>&lt;span class="lnt">152
&lt;/span>&lt;span class="lnt">153
&lt;/span>&lt;span class="lnt">154
&lt;/span>&lt;span class="lnt">155
&lt;/span>&lt;span class="lnt">156
&lt;/span>&lt;span class="lnt">157
&lt;/span>&lt;span class="lnt">158
&lt;/span>&lt;span class="lnt">159
&lt;/span>&lt;span class="lnt">160
&lt;/span>&lt;span class="lnt">161
&lt;/span>&lt;span class="lnt">162
&lt;/span>&lt;span class="lnt">163
&lt;/span>&lt;span class="lnt">164
&lt;/span>&lt;span class="lnt">165
&lt;/span>&lt;span class="lnt">166
&lt;/span>&lt;span class="lnt">167
&lt;/span>&lt;span class="lnt">168
&lt;/span>&lt;span class="lnt">169
&lt;/span>&lt;span class="lnt">170
&lt;/span>&lt;span class="lnt">171
&lt;/span>&lt;span class="lnt">172
&lt;/span>&lt;span class="lnt">173
&lt;/span>&lt;span class="lnt">174
&lt;/span>&lt;span class="lnt">175
&lt;/span>&lt;span class="lnt">176
&lt;/span>&lt;span class="lnt">177
&lt;/span>&lt;span class="lnt">178
&lt;/span>&lt;span class="lnt">179
&lt;/span>&lt;span class="lnt">180
&lt;/span>&lt;span class="lnt">181
&lt;/span>&lt;span class="lnt">182
&lt;/span>&lt;span class="lnt">183
&lt;/span>&lt;span class="lnt">184
&lt;/span>&lt;span class="lnt">185
&lt;/span>&lt;span class="lnt">186
&lt;/span>&lt;span class="lnt">187
&lt;/span>&lt;span class="lnt">188
&lt;/span>&lt;span class="lnt">189
&lt;/span>&lt;span class="lnt">190
&lt;/span>&lt;span class="lnt">191
&lt;/span>&lt;span class="lnt">192
&lt;/span>&lt;span class="lnt">193
&lt;/span>&lt;span class="lnt">194
&lt;/span>&lt;span class="lnt">195
&lt;/span>&lt;span class="lnt">196
&lt;/span>&lt;span class="lnt">197
&lt;/span>&lt;span class="lnt">198
&lt;/span>&lt;span class="lnt">199
&lt;/span>&lt;span class="lnt">200
&lt;/span>&lt;span class="lnt">201
&lt;/span>&lt;span class="lnt">202
&lt;/span>&lt;span class="lnt">203
&lt;/span>&lt;span class="lnt">204
&lt;/span>&lt;span class="lnt">205
&lt;/span>&lt;span class="lnt">206
&lt;/span>&lt;span class="lnt">207
&lt;/span>&lt;span class="lnt">208
&lt;/span>&lt;span class="lnt">209
&lt;/span>&lt;span class="lnt">210
&lt;/span>&lt;span class="lnt">211
&lt;/span>&lt;span class="lnt">212
&lt;/span>&lt;span class="lnt">213
&lt;/span>&lt;span class="lnt">214
&lt;/span>&lt;span class="lnt">215
&lt;/span>&lt;span class="lnt">216
&lt;/span>&lt;span class="lnt">217
&lt;/span>&lt;span class="lnt">218
&lt;/span>&lt;span class="lnt">219
&lt;/span>&lt;span class="lnt">220
&lt;/span>&lt;span class="lnt">221
&lt;/span>&lt;span class="lnt">222
&lt;/span>&lt;span class="lnt">223
&lt;/span>&lt;span class="lnt">224
&lt;/span>&lt;span class="lnt">225
&lt;/span>&lt;span class="lnt">226
&lt;/span>&lt;span class="lnt">227
&lt;/span>&lt;span class="lnt">228
&lt;/span>&lt;span class="lnt">229
&lt;/span>&lt;span class="lnt">230
&lt;/span>&lt;span class="lnt">231
&lt;/span>&lt;span class="lnt">232
&lt;/span>&lt;span class="lnt">233
&lt;/span>&lt;span class="lnt">234
&lt;/span>&lt;span class="lnt">235
&lt;/span>&lt;span class="lnt">236
&lt;/span>&lt;span class="lnt">237
&lt;/span>&lt;span class="lnt">238
&lt;/span>&lt;span class="lnt">239
&lt;/span>&lt;span class="lnt">240
&lt;/span>&lt;span class="lnt">241
&lt;/span>&lt;span class="lnt">242
&lt;/span>&lt;span class="lnt">243
&lt;/span>&lt;span class="lnt">244
&lt;/span>&lt;span class="lnt">245
&lt;/span>&lt;span class="lnt">246
&lt;/span>&lt;span class="lnt">247
&lt;/span>&lt;span class="lnt">248
&lt;/span>&lt;span class="lnt">249
&lt;/span>&lt;span class="lnt">250
&lt;/span>&lt;span class="lnt">251
&lt;/span>&lt;span class="lnt">252
&lt;/span>&lt;span class="lnt">253
&lt;/span>&lt;span class="lnt">254
&lt;/span>&lt;span class="lnt">255
&lt;/span>&lt;span class="lnt">256
&lt;/span>&lt;span class="lnt">257
&lt;/span>&lt;span class="lnt">258
&lt;/span>&lt;span class="lnt">259
&lt;/span>&lt;span class="lnt">260
&lt;/span>&lt;span class="lnt">261
&lt;/span>&lt;span class="lnt">262
&lt;/span>&lt;span class="lnt">263
&lt;/span>&lt;span class="lnt">264
&lt;/span>&lt;span class="lnt">265
&lt;/span>&lt;span class="lnt">266
&lt;/span>&lt;span class="lnt">267
&lt;/span>&lt;span class="lnt">268
&lt;/span>&lt;span class="lnt">269
&lt;/span>&lt;span class="lnt">270
&lt;/span>&lt;span class="lnt">271
&lt;/span>&lt;span class="lnt">272
&lt;/span>&lt;span class="lnt">273
&lt;/span>&lt;span class="lnt">274
&lt;/span>&lt;span class="lnt">275
&lt;/span>&lt;span class="lnt">276
&lt;/span>&lt;span class="lnt">277
&lt;/span>&lt;span class="lnt">278
&lt;/span>&lt;span class="lnt">279
&lt;/span>&lt;span class="lnt">280
&lt;/span>&lt;span class="lnt">281
&lt;/span>&lt;span class="lnt">282
&lt;/span>&lt;span class="lnt">283
&lt;/span>&lt;span class="lnt">284
&lt;/span>&lt;span class="lnt">285
&lt;/span>&lt;span class="lnt">286
&lt;/span>&lt;span class="lnt">287
&lt;/span>&lt;span class="lnt">288
&lt;/span>&lt;span class="lnt">289
&lt;/span>&lt;span class="lnt">290
&lt;/span>&lt;span class="lnt">291
&lt;/span>&lt;span class="lnt">292
&lt;/span>&lt;span class="lnt">293
&lt;/span>&lt;span class="lnt">294
&lt;/span>&lt;span class="lnt">295
&lt;/span>&lt;span class="lnt">296
&lt;/span>&lt;span class="lnt">297
&lt;/span>&lt;span class="lnt">298
&lt;/span>&lt;span class="lnt">299
&lt;/span>&lt;span class="lnt">300
&lt;/span>&lt;span class="lnt">301
&lt;/span>&lt;span class="lnt">302
&lt;/span>&lt;span class="lnt">303
&lt;/span>&lt;span class="lnt">304
&lt;/span>&lt;span class="lnt">305
&lt;/span>&lt;span class="lnt">306
&lt;/span>&lt;span class="lnt">307
&lt;/span>&lt;span class="lnt">308
&lt;/span>&lt;span class="lnt">309
&lt;/span>&lt;span class="lnt">310
&lt;/span>&lt;span class="lnt">311
&lt;/span>&lt;span class="lnt">312
&lt;/span>&lt;span class="lnt">313
&lt;/span>&lt;span class="lnt">314
&lt;/span>&lt;span class="lnt">315
&lt;/span>&lt;span class="lnt">316
&lt;/span>&lt;span class="lnt">317
&lt;/span>&lt;span class="lnt">318
&lt;/span>&lt;span class="lnt">319
&lt;/span>&lt;span class="lnt">320
&lt;/span>&lt;span class="lnt">321
&lt;/span>&lt;span class="lnt">322
&lt;/span>&lt;span class="lnt">323
&lt;/span>&lt;span class="lnt">324
&lt;/span>&lt;span class="lnt">325
&lt;/span>&lt;span class="lnt">326
&lt;/span>&lt;span class="lnt">327
&lt;/span>&lt;span class="lnt">328
&lt;/span>&lt;span class="lnt">329
&lt;/span>&lt;span class="lnt">330
&lt;/span>&lt;span class="lnt">331
&lt;/span>&lt;span class="lnt">332
&lt;/span>&lt;span class="lnt">333
&lt;/span>&lt;span class="lnt">334
&lt;/span>&lt;span class="lnt">335
&lt;/span>&lt;span class="lnt">336
&lt;/span>&lt;span class="lnt">337
&lt;/span>&lt;span class="lnt">338
&lt;/span>&lt;span class="lnt">339
&lt;/span>&lt;span class="lnt">340
&lt;/span>&lt;span class="lnt">341
&lt;/span>&lt;span class="lnt">342
&lt;/span>&lt;span class="lnt">343
&lt;/span>&lt;span class="lnt">344
&lt;/span>&lt;span class="lnt">345
&lt;/span>&lt;span class="lnt">346
&lt;/span>&lt;span class="lnt">347
&lt;/span>&lt;span class="lnt">348
&lt;/span>&lt;span class="lnt">349
&lt;/span>&lt;span class="lnt">350
&lt;/span>&lt;span class="lnt">351
&lt;/span>&lt;span class="lnt">352
&lt;/span>&lt;span class="lnt">353
&lt;/span>&lt;span class="lnt">354
&lt;/span>&lt;span class="lnt">355
&lt;/span>&lt;span class="lnt">356
&lt;/span>&lt;span class="lnt">357
&lt;/span>&lt;span class="lnt">358
&lt;/span>&lt;span class="lnt">359
&lt;/span>&lt;span class="lnt">360
&lt;/span>&lt;span class="lnt">361
&lt;/span>&lt;span class="lnt">362
&lt;/span>&lt;span class="lnt">363
&lt;/span>&lt;span class="lnt">364
&lt;/span>&lt;span class="lnt">365
&lt;/span>&lt;span class="lnt">366
&lt;/span>&lt;span class="lnt">367
&lt;/span>&lt;span class="lnt">368
&lt;/span>&lt;span class="lnt">369
&lt;/span>&lt;span class="lnt">370
&lt;/span>&lt;span class="lnt">371
&lt;/span>&lt;span class="lnt">372
&lt;/span>&lt;span class="lnt">373
&lt;/span>&lt;span class="lnt">374
&lt;/span>&lt;span class="lnt">375
&lt;/span>&lt;span class="lnt">376
&lt;/span>&lt;span class="lnt">377
&lt;/span>&lt;span class="lnt">378
&lt;/span>&lt;span class="lnt">379
&lt;/span>&lt;span class="lnt">380
&lt;/span>&lt;span class="lnt">381
&lt;/span>&lt;span class="lnt">382
&lt;/span>&lt;span class="lnt">383
&lt;/span>&lt;span class="lnt">384
&lt;/span>&lt;span class="lnt">385
&lt;/span>&lt;span class="lnt">386
&lt;/span>&lt;span class="lnt">387
&lt;/span>&lt;span class="lnt">388
&lt;/span>&lt;span class="lnt">389
&lt;/span>&lt;span class="lnt">390
&lt;/span>&lt;span class="lnt">391
&lt;/span>&lt;span class="lnt">392
&lt;/span>&lt;span class="lnt">393
&lt;/span>&lt;span class="lnt">394
&lt;/span>&lt;span class="lnt">395
&lt;/span>&lt;span class="lnt">396
&lt;/span>&lt;span class="lnt">397
&lt;/span>&lt;span class="lnt">398
&lt;/span>&lt;span class="lnt">399
&lt;/span>&lt;span class="lnt">400
&lt;/span>&lt;span class="lnt">401
&lt;/span>&lt;span class="lnt">402
&lt;/span>&lt;span class="lnt">403
&lt;/span>&lt;span class="lnt">404
&lt;/span>&lt;span class="lnt">405
&lt;/span>&lt;span class="lnt">406
&lt;/span>&lt;span class="lnt">407
&lt;/span>&lt;span class="lnt">408
&lt;/span>&lt;span class="lnt">409
&lt;/span>&lt;span class="lnt">410
&lt;/span>&lt;span class="lnt">411
&lt;/span>&lt;span class="lnt">412
&lt;/span>&lt;span class="lnt">413
&lt;/span>&lt;span class="lnt">414
&lt;/span>&lt;span class="lnt">415
&lt;/span>&lt;span class="lnt">416
&lt;/span>&lt;span class="lnt">417
&lt;/span>&lt;span class="lnt">418
&lt;/span>&lt;span class="lnt">419
&lt;/span>&lt;span class="lnt">420
&lt;/span>&lt;span class="lnt">421
&lt;/span>&lt;span class="lnt">422
&lt;/span>&lt;span class="lnt">423
&lt;/span>&lt;span class="lnt">424
&lt;/span>&lt;span class="lnt">425
&lt;/span>&lt;span class="lnt">426
&lt;/span>&lt;span class="lnt">427
&lt;/span>&lt;span class="lnt">428
&lt;/span>&lt;span class="lnt">429
&lt;/span>&lt;span class="lnt">430
&lt;/span>&lt;span class="lnt">431
&lt;/span>&lt;span class="lnt">432
&lt;/span>&lt;span class="lnt">433
&lt;/span>&lt;span class="lnt">434
&lt;/span>&lt;span class="lnt">435
&lt;/span>&lt;span class="lnt">436
&lt;/span>&lt;span class="lnt">437
&lt;/span>&lt;span class="lnt">438
&lt;/span>&lt;span class="lnt">439
&lt;/span>&lt;span class="lnt">440
&lt;/span>&lt;span class="lnt">441
&lt;/span>&lt;span class="lnt">442
&lt;/span>&lt;span class="lnt">443
&lt;/span>&lt;span class="lnt">444
&lt;/span>&lt;span class="lnt">445
&lt;/span>&lt;span class="lnt">446
&lt;/span>&lt;span class="lnt">447
&lt;/span>&lt;span class="lnt">448
&lt;/span>&lt;span class="lnt">449
&lt;/span>&lt;span class="lnt">450
&lt;/span>&lt;span class="lnt">451
&lt;/span>&lt;span class="lnt">452
&lt;/span>&lt;span class="lnt">453
&lt;/span>&lt;span class="lnt">454
&lt;/span>&lt;span class="lnt">455
&lt;/span>&lt;span class="lnt">456
&lt;/span>&lt;span class="lnt">457
&lt;/span>&lt;span class="lnt">458
&lt;/span>&lt;span class="lnt">459
&lt;/span>&lt;span class="lnt">460
&lt;/span>&lt;span class="lnt">461
&lt;/span>&lt;span class="lnt">462
&lt;/span>&lt;span class="lnt">463
&lt;/span>&lt;span class="lnt">464
&lt;/span>&lt;span class="lnt">465
&lt;/span>&lt;span class="lnt">466
&lt;/span>&lt;span class="lnt">467
&lt;/span>&lt;span class="lnt">468
&lt;/span>&lt;span class="lnt">469
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ini" data-lang="ini">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Start a new pool named &amp;#39;www&amp;#39;.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the variable $pool can be used in any directive and will be replaced by the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pool name (&amp;#39;www&amp;#39; here)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">[www]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Per pool prefix&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; It only applies on the following directives:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - &amp;#39;access.log&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - &amp;#39;slowlog&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - &amp;#39;listen&amp;#39; (unixsocket)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - &amp;#39;chroot&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - &amp;#39;chdir&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - &amp;#39;php_values&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - &amp;#39;php_admin_values&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; When not set, the global prefix (or NONE) applies instead.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: This directive can also be relative to the global prefix.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: none&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;prefix = /path/to/pools/$pool&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Unix user/group of the child processes. This can be used only if the master&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; process running user is root. It is set after the child process is created.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The user and group can be specified either by their name or by their numeric&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; IDs.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: If the user is root, the executable needs to be started with&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; --allow-to-run-as-root option to work.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Values: The user is set to master process running user by default.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If the group is not set, the user&amp;#39;s group is used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">user&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">www-data&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">group&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">www-data&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The address on which to accept FastCGI requests.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Valid syntaxes are:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#39;ip.add.re.ss:port&amp;#39; - to listen on a TCP socket to a specific IPv4 address on&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; a specific port;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#39;[ip:6:addr:ess]:port&amp;#39; - to listen on a TCP socket to a specific IPv6 address on&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; a specific port;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#39;port&amp;#39; - to listen on a TCP socket to all addresses&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (IPv6 and IPv4-mapped) on a specific port;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#39;/path/to/unix/socket&amp;#39; - to listen on a unix socket.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: This value is mandatory.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">listen&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">127.0.0.1:9000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Set listen(2) backlog.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 511 (-1 on FreeBSD and OpenBSD)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;listen.backlog = 511&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Set permissions for unix socket, if one is used. In Linux, read/write&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; permissions must be set in order to allow connections from a web server. Many&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; BSD-derived systems allow connections regardless of permissions. The owner&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; and group can be specified either by name or by their numeric IDs.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Values: Owner is set to the master process running user. If the group&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; is not set, the owner&amp;#39;s group is used. Mode is set to 0660.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;listen.owner = www-data&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;listen.group = www-data&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;listen.mode = 0660&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; When POSIX Access Control Lists are supported you can set them using&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; these options, value is a comma separated list of user/group names.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; When set, listen.owner and listen.group are ignored&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;listen.acl_users =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;listen.acl_groups =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; must be separated by a comma. If this value is left blank, connections will be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; accepted from any ip address.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: any&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;listen.allowed_clients = 127.0.0.1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Specify the nice(2) priority to apply to the pool processes (only if set)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The value can vary from -19 (highest priority) to 20 (lower priority)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: - It will only work if the FPM master process is launched as root&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - The pool processes will inherit the master process priority&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; unless it specified otherwise&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: no set&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; process.priority = -19&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; or group is different than the master process user. It allows to create process&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; core dump and ptrace the process for the pool user.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: no&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; process.dumpable = yes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Choose how the process manager will control the number of child processes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Possible Values:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; static - a fixed number (pm.max_children) of child processes;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; dynamic - the number of child processes are set dynamically based on the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; following directives. With this process management, there will be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; always at least 1 children.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pm.max_children - the maximum number of children that can&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; be alive at the same time.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pm.start_servers - the number of children created on startup.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pm.min_spare_servers - the minimum number of children in &amp;#39;idle&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; state (waiting to process). If the number&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of &amp;#39;idle&amp;#39; processes is less than this&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; number then some children will be created.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pm.max_spare_servers - the maximum number of children in &amp;#39;idle&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; state (waiting to process). If the number&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of &amp;#39;idle&amp;#39; processes is greater than this&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; number then some children will be killed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pm.max_spawn_rate - the maximum number of rate to spawn child&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; processes at once.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; ondemand - no children are created at startup. Children will be forked when&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; new requests will connect. The following parameter are used:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pm.max_children - the maximum number of children that&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; can be alive at the same time.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pm.process_idle_timeout - The number of seconds after which&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; an idle process will be killed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: This value is mandatory.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pm&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">dynamic&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The number of child processes to be created when pm is set to &amp;#39;static&amp;#39; and the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; maximum number of child processes when pm is set to &amp;#39;dynamic&amp;#39; or &amp;#39;ondemand&amp;#39;.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This value sets the limit on the number of simultaneous requests that will be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; CGI. The below defaults are based on a server without much resources. Don&amp;#39;t&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; forget to tweak pm.* to fit your needs.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Used when pm is set to &amp;#39;static&amp;#39;, &amp;#39;dynamic&amp;#39; or &amp;#39;ondemand&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: This value is mandatory.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pm.max_children&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">5&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The number of child processes created on startup.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Used only when pm is set to &amp;#39;dynamic&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: (min_spare_servers + max_spare_servers) / 2&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pm.start_servers&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">2&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The desired minimum number of idle server processes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Used only when pm is set to &amp;#39;dynamic&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Mandatory when pm is set to &amp;#39;dynamic&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pm.min_spare_servers&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The desired maximum number of idle server processes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Used only when pm is set to &amp;#39;dynamic&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Mandatory when pm is set to &amp;#39;dynamic&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">pm.max_spare_servers&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">3&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The number of rate to spawn child processes at once.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Used only when pm is set to &amp;#39;dynamic&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Mandatory when pm is set to &amp;#39;dynamic&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 32&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;pm.max_spawn_rate = 32&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The number of seconds after which an idle process will be killed.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: Used only when pm is set to &amp;#39;ondemand&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 10s&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;pm.process_idle_timeout = 10s;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The number of requests each child process should execute before respawning.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This can be useful to work around memory leaks in 3rd party libraries. For&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; endless request processing specify &amp;#39;0&amp;#39;. Equivalent to PHP_FCGI_MAX_REQUESTS.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;pm.max_requests = 500&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The URI to view the FPM status page. If this value is not set, no URI will be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; recognized as a status page. It shows the following information:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pool - the name of the pool;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; process manager - static, dynamic or ondemand;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; start time - the date and time FPM has started;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; start since - number of seconds since FPM has started;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; accepted conn - the number of request accepted by the pool;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; listen queue - the number of request in the queue of pending&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; connections (see backlog in listen(2));&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; max listen queue - the maximum number of requests in the queue&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of pending connections since FPM has started;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; listen queue len - the size of the socket queue of pending connections;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; idle processes - the number of idle processes;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; active processes - the number of active processes;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; total processes - the number of idle + active processes;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; max active processes - the maximum number of active processes since FPM&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; has started;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; max children reached - number of times, the process limit has been reached,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; when pm tries to start more children (works only for&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pm &amp;#39;dynamic&amp;#39; and &amp;#39;ondemand&amp;#39;);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Value are updated in real time.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Example output:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pool: www&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; process manager: static&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; start time: 01/Jul/2011:17:53:49 +0200&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; start since: 62636&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; accepted conn: 190460&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; listen queue: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; max listen queue: 1&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; listen queue len: 42&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; idle processes: 4&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; active processes: 11&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; total processes: 15&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; max active processes: 12&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; max children reached: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; By default the status page output is formatted as text/plain. Passing either&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#39;html&amp;#39;, &amp;#39;xml&amp;#39; or &amp;#39;json&amp;#39; in the query string will return the corresponding&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; output syntax. Example:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; http://www.foo.bar/status&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; http://www.foo.bar/status?json&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; http://www.foo.bar/status?html&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; http://www.foo.bar/status?xml&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; By default the status page only outputs short status. Passing &amp;#39;full&amp;#39; in the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; query string will also return status for each pool process.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Example:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; http://www.foo.bar/status?full&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; http://www.foo.bar/status?json&amp;amp;full&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; http://www.foo.bar/status?html&amp;amp;full&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; http://www.foo.bar/status?xml&amp;amp;full&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The Full status returns for each process:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pid - the PID of the process;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; state - the state of the process (Idle, Running, ...);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; start time - the date and time the process has started;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; start since - the number of seconds since the process has started;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; requests - the number of requests the process has served;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; request duration - the duration in µs of the requests;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; request method - the request method (GET, POST, ...);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; request URI - the request URI with the query string;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; content length - the content length of the request (only with POST);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; user - the user (PHP_AUTH_USER) (or &amp;#39;-&amp;#39; if not set);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; script - the main script called (or &amp;#39;-&amp;#39; if not set);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; last request cpu - the %cpu the last request consumed&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; it&amp;#39;s always 0 if the process is not in Idle state&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; because CPU calculation is done when the request&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; processing has terminated;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; last request memory - the max amount of memory the last request consumed&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; it&amp;#39;s always 0 if the process is not in Idle state&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; because memory calculation is done when the request&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; processing has terminated;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; If the process is in Idle state, then informations are related to the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; last request the process has served. Otherwise informations are related to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the current request being served.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Example output:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; ************************&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pid: 31330&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; state: Running&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; start time: 01/Jul/2011:17:53:49 +0200&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; start since: 63087&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; requests: 12808&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; request duration: 1250261&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; request method: GET&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; request URI: /test_mem.php?N=10000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; content length: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; user: -&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; script: /home/fat/web/docs/php/test_mem.php&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; last request cpu: 0.00&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; last request memory: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: There is a real-time FPM status monitoring sample web page available&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; It&amp;#39;s available in: /usr/local/share/php/fpm/status.html&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: The value must start with a leading slash (/). The value can be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; anything, but it may not be a good idea to use the .php extension or it&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; may conflict with a real PHP file.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: not set&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;pm.status_path = /status&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The address on which to accept FastCGI status request. This creates a new&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; invisible pool that can handle requests independently. This is useful&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; if the main pool is busy with long running requests because it is still possible&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; to get the status before finishing the long running requests.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Valid syntaxes are:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#39;ip.add.re.ss:port&amp;#39; - to listen on a TCP socket to a specific IPv4 address on&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; a specific port;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#39;[ip:6:addr:ess]:port&amp;#39; - to listen on a TCP socket to a specific IPv6 address on&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; a specific port;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#39;port&amp;#39; - to listen on a TCP socket to all addresses&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (IPv6 and IPv4-mapped) on a specific port;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; &amp;#39;/path/to/unix/socket&amp;#39; - to listen on a unix socket.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: value of the listen option&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;pm.status_listen = 127.0.0.1:9001&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The ping URI to call the monitoring page of FPM. If this value is not set, no&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; URI will be recognized as a ping page. This could be used to test from outside&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; that FPM is alive and responding, or to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - create a graph of FPM availability (rrd or such);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - remove a server from a group if it is not responding (load balancing);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - trigger alerts for the operating team (24/7).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: The value must start with a leading slash (/). The value can be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; anything, but it may not be a good idea to use the .php extension or it&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; may conflict with a real PHP file.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: not set&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;ping.path = /ping&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This directive may be used to customize the response of a ping request. The&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; response is formatted as text/plain with a 200 response code.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: pong&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;ping.response = pong&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The access log file&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default: not set&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;access.log = log/$pool.access.log&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The access log format.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The following syntax is allowed&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %%: the &amp;#39;%&amp;#39; character&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %C: %CPU used by the request&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; it can accept the following format:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{user}C for user CPU only&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{system}C for system CPU only&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{total}C for user + system CPU (default)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %d: time taken to serve the request&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; it can accept the following format:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{seconds}d (default)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{milliseconds}d&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{milli}d&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{microseconds}d&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{micro}d&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %e: an environment variable (same as $_ENV or $_SERVER)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; it must be associated with embraces to specify the name of the env&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; variable. Some examples:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %f: script filename&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %l: content-length of the request (for POST request only)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %m: request method&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %M: peak of memory allocated by PHP&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; it can accept the following format:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{bytes}M (default)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{kilobytes}M&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{kilo}M&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{megabytes}M&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{mega}M&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %n: pool name&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %o: output header&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; it must be associated with embraces to specify the name of the header:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{Content-Type}o&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{X-Powered-By}o&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - %{Transfert-Encoding}o&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; - ....&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %p: PID of the child that serviced the request&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %P: PID of the parent of the child that serviced the request&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %q: the query string&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %Q: the &amp;#39;?&amp;#39; character if query string exists&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %r: the request URI (without the query string, see %q and %Q)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %R: remote IP address&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %s: status (response code)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %t: server time the request was received&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; it can accept a strftime(3) format:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %d/%b/%Y:%H:%M:%S %z (default)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The strftime(3) format must be encapsulated in a %{&amp;lt;strftime_format&amp;gt;}t tag&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %T: time the log has been written (the request has finished)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; it can accept a strftime(3) format:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %d/%b/%Y:%H:%M:%S %z (default)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The strftime(3) format must be encapsulated in a %{&amp;lt;strftime_format&amp;gt;}t tag&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; %u: remote user&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default: &amp;#34;%R - %u %t \&amp;#34;%m %r\&amp;#34; %s&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;access.format = &amp;#34;%R - %u %t \&amp;#34;%m %r%Q%q\&amp;#34; %s %f %{milli}d %{kilo}M %C%%&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The log file for slow requests&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: not set&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: slowlog is mandatory if request_slowlog_timeout is set&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;slowlog = log/$pool.log.slow&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The timeout for serving a single request after which a PHP backtrace will be&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; dumped to the &amp;#39;slowlog&amp;#39; file. A value of &amp;#39;0s&amp;#39; means &amp;#39;off&amp;#39;.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;request_slowlog_timeout = 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Depth of slow log stack trace.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 20&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;request_slowlog_trace_depth = 20&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The timeout for serving a single request after which the worker process will&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; be killed. This option should be used when the &amp;#39;max_execution_time&amp;#39; ini option&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; does not stop script execution for some reason. A value of &amp;#39;0&amp;#39; means &amp;#39;off&amp;#39;.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;request_terminate_timeout = 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; The timeout set by &amp;#39;request_terminate_timeout&amp;#39; ini option is not engaged after&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; application calls &amp;#39;fastcgi_finish_request&amp;#39; or when application has finished and&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; shutdown functions are being called (registered via register_shutdown_function).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; This option will enable timeout limit to be applied unconditionally&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; even in such cases.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: no&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;request_terminate_timeout_track_finished = no&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Set open file descriptor rlimit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: system defined value&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;rlimit_files = 1024&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Set max core size rlimit.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Possible Values: &amp;#39;unlimited&amp;#39; or an integer greater or equal to 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: system defined value&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;rlimit_core = 0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Chroot to this directory at the start. This value must be defined as an&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; absolute path. When this value is not set, chroot is not used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: you can prefix with &amp;#39;$prefix&amp;#39; to chroot to the pool prefix or one&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; of its subdirectories. If the pool prefix is not set, the global prefix&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; will be used instead.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: chrooting is a great security feature and should be used whenever&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; possible. However, all PHP paths will be relative to the chroot&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (error_log, sessions.save_path, ...).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: not set&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;chroot =&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Chdir to this directory at the start.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: relative path can be used.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: current directory or / when chroot&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;chdir = /var/www&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Redirect worker stdout and stderr into main error log. If not set, stdout and&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; stderr will be redirected to /dev/null according to FastCGI specs.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: on highloaded environment, this can cause some delay in the page&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; process time (several ms).&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: no&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;catch_workers_output = yes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Decorate worker output with prefix and suffix containing information about&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the child that writes to the log and if stdout or stderr is used as well as&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; log level and time. This options is used only if catch_workers_output is yes.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Settings to &amp;#34;no&amp;#34; will output data as written to the stdout or stderr.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default value: yes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;decorate_workers_output = no&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Clear environment in FPM workers&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Prevents arbitrary environment variables from reaching FPM worker processes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; by clearing the environment in workers before env vars specified in this&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; pool configuration are added.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Setting to &amp;#34;no&amp;#34; will make all environment variables available to PHP code&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; via getenv(), $_ENV and $_SERVER.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: yes&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;clear_env = no&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Limits the extensions of the main script FPM will allow to parse. This can&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; prevent configuration mistakes on the web server side. You should only limit&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; FPM to .php extensions to prevent malicious users to use other extensions to&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; execute php code.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: set an empty value to allow all extensions.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: .php&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;security.limit_extensions = .php .php3 .php4 .php5 .php7&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; the current environment.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: clean env&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;env[HOSTNAME] = $HOSTNAME&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;env[PATH] = /usr/local/bin:/usr/bin:/bin&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;env[TMP] = /tmp&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;env[TMPDIR] = /tmp&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;env[TEMP] = /tmp&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Additional php.ini defines, specific to this pool of workers. These settings&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; overwrite the values previously defined in the php.ini. The directives are the&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; same as the PHP SAPI:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; php_value/php_flag - you can set classic ini defines which can&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; be overwritten from PHP call &amp;#39;ini_set&amp;#39;.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; php_admin_value/php_admin_flag - these directives won&amp;#39;t be overwritten by&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; PHP call &amp;#39;ini_set&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Defining &amp;#39;extension&amp;#39; will load the corresponding shared extension from&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; extension_dir. Defining &amp;#39;disable_functions&amp;#39; or &amp;#39;disable_classes&amp;#39; will not&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; overwrite previously defined php.ini values, but will append the new value&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; instead.&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Note: path INI options can be relative and will be expanded with the prefix&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; (pool, global or /usr/local)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; Default Value: nothing is defined by default except the values in php.ini and&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">; specified at startup with the -d argument&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;php_flag[display_errors] = off&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;php_admin_value[error_log] = /var/log/fpm-php.www.log&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;php_admin_flag[log_errors] = on&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">;php_admin_value[memory_limit] = 32M&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>运行命令&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">podman run --name php-fpm --pod nginxpod &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>-v /root/docker/nginx/www:/var/www/html &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>-v /root/docker/php/conf/www.conf:/usr/local/etc/php-fpm.d/www.conf &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>-v /root/docker/php/conf/php.ini:/usr/local/etc/php/php.ini &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>-d php:8.1-fpm
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="nginx部署">nginx部署&lt;/h2>
&lt;p>这里需要配置SSL，我暂时先用自签证书。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">mkdir -p ./conf/cert
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">cd&lt;/span> ./conf/cert
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">openssl genrsa -out server.key &lt;span class="m">2048&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">openssl req -new -key server.key -out server.csr
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">openssl x509 -req -in server.csr -signkey server.key -out server.crt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>在conf目录创建nginx配置文件&lt;/p>
&lt;p>./conf/default.conf&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;span class="lnt">44
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ini" data-lang="ini">&lt;span class="line">&lt;span class="cl">&lt;span class="na">server {&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">listen 80;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">listen [::]:80;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">server_name localhost;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">#access_log /var/log/nginx/host.access.log main;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">root /usr/share/nginx/html;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">location / {&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">root /usr/share/nginx/html;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">index index.html index.htm;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">#error_page 404 /404.html;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># redirect server error pages to the static page /50x.html&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">#&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">error_page 500 502 503 504 /50x.html;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">location&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">/50x.html {
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s"> root /usr/share/nginx/html;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s"> }&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># proxy the PHP scripts to Apache listening on 127.0.0.1:80&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">#&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">#location ~ \.php$ {&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># proxy_pass http://127.0.0.1;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">#}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">location ~ \.php$ {&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">fastcgi_pass php-fpm:9000;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">fastcgi_index index.php;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">include fastcgi_params;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># deny access to .htaccess files, if Apache&amp;#39;s document root&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># concurs with nginx&amp;#39;s one&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">#&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">location ~ /\.ht {&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">deny all;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>./conf/ssl.conf&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;span class="lnt">44
&lt;/span>&lt;span class="lnt">45
&lt;/span>&lt;span class="lnt">46
&lt;/span>&lt;span class="lnt">47
&lt;/span>&lt;span class="lnt">48
&lt;/span>&lt;span class="lnt">49
&lt;/span>&lt;span class="lnt">50
&lt;/span>&lt;span class="lnt">51
&lt;/span>&lt;span class="lnt">52
&lt;/span>&lt;span class="lnt">53
&lt;/span>&lt;span class="lnt">54
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-ini" data-lang="ini">&lt;span class="line">&lt;span class="cl">&lt;span class="na">server {&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">listen 443 ssl default_server;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">listen [::]:443 ssl default_server;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 开启 HTTP/3&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">listen 443 quic reuseport;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">listen [::]:443 quic reuseport;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># 开启 HTTP/2&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">http2 on;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">server_name fatkun2.ddnsfree.com;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">ssl_certificate /etc/nginx/conf.d/cert/server.crt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">ssl_certificate_key /etc/nginx/conf.d/cert/server.key;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">ssl_session_timeout 1d;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">ssl_session_cache shared:SSL:10m;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">ssl_session_tickets off;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">ssl_protocols TLSv1.2 TLSv1.3;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">ssl_prefer_server_ciphers off;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">#access_log /var/log/nginx/host.access.log main;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">root /usr/share/nginx/html;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">location / {&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">root /usr/share/nginx/html;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">index index.html index.htm;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">#error_page 404 /404.html;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># redirect server error pages to the static page /50x.html&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">#&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">error_page 500 502 503 504 /50x.html;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">location&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s">/50x.html {
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s"> root /usr/share/nginx/html;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s"> }
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s"> # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s"> location ~ \.php$ {
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s"> fastcgi_pass php-fpm:9000;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s"> fastcgi_index index.php;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s"> fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s"> include fastcgi_params;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s"> }&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># deny access to .htaccess files, if Apache&amp;#39;s document root&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1"># concurs with nginx&amp;#39;s one&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">#&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">location ~ /\.ht {&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">deny all;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="na">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>启动nginx&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">podman run --name nginx --pod nginxpod &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>-v /root/docker/nginx/conf:/etc/nginx/conf.d &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>-v /root/docker/nginx/www:/usr/share/nginx/html &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>-v /root/docker/nginx/log:/var/log/nginx -d nginx
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h1 id="自动启动">自动启动&lt;/h1>
&lt;p>podman由于没有常驻进程，启动需要依赖systemd，执行命令会生成3个service(container-nginx.service container-php-fpm.service pod-nginxpod.service)文件&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">podman generate systemd --files --name nginxpod
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>把service拷贝到systemd目录&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">cp *.service /etc/systemd/system
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 开启服务&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">systemctl &lt;span class="nb">enable&lt;/span> pod-nginxpod
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category><category domain="https://fatkun.github.io/tags/linux/">Linux</category></item><item><title>去除某直播平台广告</title><link>https://fatkun.github.io/post/2024/crack_dy/</link><guid isPermaLink="true">https://fatkun.github.io/post/2024/crack_dy/</guid><pubDate>Mon, 05 Aug 2024 14:51:54 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="声明">声明&lt;/h1>
&lt;p>仅用于学习用途，不可用作非法用途。&lt;/p>
&lt;h1 id="工具">工具&lt;/h1>
&lt;ul>
&lt;li>jadx&lt;/li>
&lt;li>mt工具箱&lt;/li>
&lt;li>apktool&lt;/li>
&lt;/ul>
&lt;h1 id="分析">分析&lt;/h1>
&lt;p>软件版本：8.0.2&lt;/p>
&lt;p>这个直播平台的广告主要有开屏广告和在后台播放一段时间后，切回应用时会跳出广告。由于其他的广告干扰不大，所以只去掉这两种广告。&lt;/p>
&lt;p>首先用MT工具箱记录Activity，看看有没有启动的Activity。完全关闭应用后，重新打开。发现开屏广告没有新的Activity，不过知道了首页的Activity是什么。&lt;/p>
&lt;p>再来测试切回应用的广告，这时就看到有新的Activity(&lt;code>HotStartSplashActivity&lt;/code>)了。同时在同一个Package里面也有一个 &lt;code>ColdStartSplashAd&lt;/code>，猜测是开屏广告。&lt;/p>
&lt;p>找到Activity后，就找哪里启动这个Activity的。用MT工具看没有加固，直接用jadx分析代码。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">m22715a&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nd">@NotNull&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Context&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">PatchProxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f28598a&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;686f70ac&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">Context&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Void&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">TYPE&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">isSupport&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Intrinsics&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">checkNotNullParameter&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;context&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Intent&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">intent&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Intent&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">&amp;lt;?&amp;gt;&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">HotStartSplashActivity&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">instanceof&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Activity&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">intent&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">addFlags&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">CommonNetImpl&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">FLAG_AUTH&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">try&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">startActivity&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">intent&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">catch&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Exception&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">e7&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">DYInstantLog&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m11921a&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">DYLogFirstTagEnum&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">DY_LOG_Action_ShowHotAD&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;热启动广告activity启动异常：&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">+&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">e7&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getMessage&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>找到调用链路，HotStartSplashAd代码里面&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">a&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">SplashAdInfo&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">splashAdInfo&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">PatchProxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">splashAdInfo&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f28605c&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;7a93ae5a&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">SplashAdInfo&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Void&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">TYPE&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">isSupport&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">HotStartSplashAd&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">hotStartSplashAd&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">HotStartSplashAd&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">f28604d&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">HotStartSplashAd&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mSplashAdInfo&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">SplashAdManager&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getSplashAdInfo&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">splashAdInfo&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getAdBean&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">SplashAdDot&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">f28661z&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m22780g&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">SplashAdPos&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">f28774h&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m22912a&lt;/span>&lt;span class="p">(),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;0&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;1&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">DYInstantLog&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m11925e&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">DYLogFirstTagEnum&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">DY_LOG_Action_ShowHotAD&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;热启动广告数据获取成功&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">HotStartSplashActivity&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">INSTANCE&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m22715a&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>这里在判断不为空的时候，启动Activity。找到代码里，修改也很容易，直接返回就好了。&lt;/p>
&lt;p>找到对应方法的smali代码，插入 &lt;code>return-void&lt;/code>，注意这个是匿名方法，在一个$的文件里面。&lt;/p>
&lt;p>再来分析冷启动的代码&lt;code>ColdStartSplashAd&lt;/code>，这里主要是找有没有一些关键字，AD、广告之类的，最终看到是这里的代码。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Observable&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">Boolean&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">B&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">PatchProxyResult&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">proxy&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">PatchProxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">[&lt;/span>&lt;span class="n">0&lt;/span>&lt;span class="o">]&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f27857l&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;55b00877&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">[&lt;/span>&lt;span class="n">0&lt;/span>&lt;span class="o">]&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Observable&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">proxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">isSupport&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Observable&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">proxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">result&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">f27858m&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">r&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">MADProviderUtils&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">a&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">LaunchAnalyzerConstant&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">f8829f&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">SplashAdDot&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">f27953z&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">C&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">System&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">currentTimeMillis&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">OperationInfoPreload&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">operationInfoPreload&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">OperationInfoPreload&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">f28123d&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">OperationInfo&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">c10&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">operationInfoPreload&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">c&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">DYLogSdk&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">i&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;launcher&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;检查是否有运营图:&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">+&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">c10&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getHasOperation&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">+&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34; 运营图数据加载过？ &amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">+&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">operationInfoPreload&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">b&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">c10&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getHasOperation&lt;/span>&lt;span class="p">())&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">R&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">c10&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">else&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">MonitorLog&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">f29755c&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">b&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">LaunchStageLog&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">NO_LAUNCH_OPERATION&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">D&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">homeObservable&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>不能直接跳过D方法，否则会导致下面的导航栏位置不对。进入D()方法，里面有一个timeout方法，把超时时间改为1毫秒跳过广告。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">D&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">PatchProxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">[&lt;/span>&lt;span class="n">0&lt;/span>&lt;span class="o">]&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f27857l&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;f4df8d85&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">[&lt;/span>&lt;span class="n">0&lt;/span>&lt;span class="o">]&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Void&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">TYPE&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">isSupport&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">long&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">b10&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">AdSdk&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">k&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">?&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">r0&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">b&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">2000L&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">f27858m&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">n&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="na">timeout&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">b10&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">TimeUnit&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">MILLISECONDS&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">observeOn&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">AndroidSchedulers&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mainThread&lt;/span>&lt;span class="p">()).&lt;/span>&lt;span class="na">subscribe&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Action1&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">SplashAdInfo&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">// from class: com.dou**.module.ad.launch.ColdStartSplashAd$observeSplashAdResult$1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="cm">/* renamed from: b, reason: collision with root package name */&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">static&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">PatchRedirect&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f27880b&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">a&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">SplashAdInfo&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">it&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">PatchProxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">it&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f27880b&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;9beacd31&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">SplashAdInfo&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Void&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">TYPE&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">isSupport&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">MonitorLog&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">f29755c&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">b&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">LaunchStageLog&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">LAUNCH_AD_REQUEST_COMPLETE_SHOW_AD&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ColdStartSplashAd&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">coldStartSplashAd&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ColdStartSplashAd&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">this&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Intrinsics&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">checkNotNullExpressionValue&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">it&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;it&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ColdStartSplashAd&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">g&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">coldStartSplashAd&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">it&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-smali" data-lang="smali">&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>if-eqz&lt;span class="w"> &lt;/span>&lt;span class="nb">v0&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nl">:cond_1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>invoke-interface&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="nb">v0&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">Lcom/dou**/sdk/ad/callback/Ad&lt;/span>&lt;span class="kt">I&lt;/span>&lt;span class="err">nit&lt;/span>&lt;span class="kt">C&lt;/span>&lt;span class="err">allback;&lt;/span>&lt;span class="p">-&amp;gt;&lt;/span>&lt;span class="nf">b&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="kt">I&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>move-result&lt;span class="w"> &lt;/span>&lt;span class="nb">v0&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>int-to-long&lt;span class="w"> &lt;/span>&lt;span class="nb">v0&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nb">v0&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>goto&lt;span class="w"> &lt;/span>&lt;span class="nl">:goto_0&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nl">:cond_1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>const-wide/16&lt;span class="w"> &lt;/span>&lt;span class="nb">v0&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mh">0x7d0&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># 这里是原来的超时时间2000毫秒
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c">&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">.line&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nl">:goto_0&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c"># FIX 改这里超时时间！！！改为1毫秒
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c">&lt;/span>&lt;span class="w"> &lt;/span>const-wide/16&lt;span class="w"> &lt;/span>&lt;span class="nb">v0&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mh">0x1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>sget-object&lt;span class="w"> &lt;/span>&lt;span class="nb">v2&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">Lcom/dou**/module/ad/launch/&lt;/span>&lt;span class="kt">C&lt;/span>&lt;span class="err">old&lt;/span>&lt;span class="kt">S&lt;/span>&lt;span class="err">tart&lt;/span>&lt;span class="kt">S&lt;/span>&lt;span class="err">plashAd;&lt;/span>&lt;span class="p">-&amp;gt;&lt;/span>&lt;span class="nv">m&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="err">Lcom/dou**/module/ad/launch/data/&lt;/span>&lt;span class="kt">S&lt;/span>&lt;span class="err">plashAdManager;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>invoke-virtual&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="nb">v2&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">Lcom/dou**/module/ad/launch/data/&lt;/span>&lt;span class="kt">S&lt;/span>&lt;span class="err">plashAdManager;&lt;/span>&lt;span class="p">-&amp;gt;&lt;/span>&lt;span class="nf">n&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="kt">L&lt;/span>rx/&lt;span class="nc">Observable&lt;/span>;&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>move-result-object&lt;span class="w"> &lt;/span>&lt;span class="nb">v2&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="右侧浮动广告">右侧浮动广告&lt;/h2>
&lt;p>右侧浮动广告，代码在&lt;code>com.****.module.player.p092p.adfloatball.AdFloatBallView&lt;/code>里。&lt;/p>
&lt;p>AdFloatBallView类里面有三个匿名类，&lt;code>AdFloatBallView$bindData$1&lt;/code>、&lt;code>AdFloatBallView$bindData$2&lt;/code>、&lt;code>AdFloatBallView$bindData$3&lt;/code>&lt;/p>
&lt;p>搜索bindData可以找到一个方法&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">kf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nd">@org.jetbrains.annotations.NotNull&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">com&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">dou&lt;/span>&lt;span class="o">**&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">sdk&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">ad&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">AdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">r16&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">boolean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">r17&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nd">@org.jetbrains.annotations.Nullable&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">lang&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">Runnable&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">r18&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nd">@org.jetbrains.annotations.Nullable&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">lang&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">Runnable&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">r19&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nd">@org.jetbrains.annotations.NotNull&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">kotlin&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">jvm&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">functions&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">Function0&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">kotlin&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">Unit&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">r20&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="cm">/*
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> L9f:
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> rx.Observable r0 = r15.Ef(r4)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> com.dou**.module.player.p.adfloatball.AdFloatBallView$bindData$1 r1 = new com.dou**.module.player.p.adfloatball.AdFloatBallView$bindData$1
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r1.&amp;lt;init&amp;gt;()
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> rx.Observable r0 = r0.map(r1)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> Lac:
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r12 = r0
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> com.dou**.module.player.p.adfloatball.AdFloatBallView$bindData$2 r13 = new com.dou**.module.player.p.adfloatball.AdFloatBallView$bindData$2
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r0 = r13
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r1 = r15
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r2 = r20
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r5 = r18
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r6 = r19
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r7 = r17
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r8 = r16
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r0.&amp;lt;init&amp;gt;()
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> com.dou**.module.player.p.adfloatball.AdFloatBallView$bindData$3 r0 = new com.dou**.module.player.p.adfloatball.AdFloatBallView$bindData$3
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r0.&amp;lt;init&amp;gt;()
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> rx.Subscription r0 = r12.subscribe(r13, r0)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> r9.bindDataSubscription = r0
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> return
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm"> */&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>另外还有个AdFloatBallView$bindDataForSdkAD&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">wf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nd">@NotNull&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">AdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">adBean&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nd">@NotNull&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">posId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nd">@Nullable&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Runnable&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">exposeRunnable&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nd">@Nullable&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Runnable&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">clickRunnable&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">PatchProxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">adBean&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">posId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">exposeRunnable&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">clickRunnable&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f65676n&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;84fcb75c&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">AdBean&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Runnable&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Runnable&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Void&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">TYPE&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">isSupport&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Intrinsics&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">checkNotNullParameter&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">adBean&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;adBean&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Intrinsics&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">checkNotNullParameter&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">posId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;posId&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">reset&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">setTag&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">adBean&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mpNativeAd&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">==&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mpNativeAd&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">MpNativeAd&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">idleSdkAdContainer&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">MpNativeAd&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">mpNativeAd&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mpNativeAd&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">mpNativeAd&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">mpNativeAd&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">e&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">posId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">clickRunnable&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Function1&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">Integer&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Unit&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">// from class: com.dou**.module.player.p.adfloatball.AdFloatBallView$bindDataForSdkAD$1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">static&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">PatchRedirect&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">patch$Redirect&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="中部横幅广告">中部横幅广告&lt;/h2>
&lt;p>如何找到对应的代码？我是先用autojs分析布局，找出对应控件的id，但是由于id是混淆的，有重复的，只能一个个找，看看在某个layout里面是否都有这些id。但是找到layout好像也没用，在代码中没有找到对应layout。&lt;/p>
&lt;p>之后通过搜索R.id.xxx 找到相关的代码。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">View&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">inflate&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">R&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">layout&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">f264114j0&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">View&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">R&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">id&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">a5n&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Intrinsics&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">checkNotNullExpressionValue&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">findViewById&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;findViewById(R.id.bg_view_for_rambo)&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">ivViewBackground&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">setBackgroundColor&lt;/span>&lt;span class="p">(((&lt;/span>&lt;span class="n">Number&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">com&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="o">*****&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">sdk&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">apkdownload&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">ExtensionsKt&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m123158n&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">RoomUtil&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m60539s&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Integer&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">valueOf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">BaseThemeUtils&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m14626b&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">R&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">attr&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">f258987f9&lt;/span>&lt;span class="p">)),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">0&lt;/span>&lt;span class="p">)).&lt;/span>&lt;span class="na">intValue&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">View&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById2&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">R&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">id&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">erx&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Intrinsics&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">checkNotNullExpressionValue&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">findViewById2&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;findViewById(R.id.iv_game_bg)&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">ivGameBackground&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">DYImageView&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById2&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">View&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById3&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">R&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">id&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">erz&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Intrinsics&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">checkNotNullExpressionValue&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">findViewById3&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;findViewById(R.id.iv_game_icon)&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">ivGameIcon&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">DYImageView&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById3&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">View&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById4&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">R&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">id&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">el2&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Intrinsics&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">checkNotNullExpressionValue&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">findViewById4&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;findViewById(R.id.iv_close)&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ImageView&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">imageView&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">ImageView&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">findViewById4&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>代码在&lt;code>XHCommonPlayerBannerView&lt;/code>和&lt;code>XHCommonPlayerBannerView2&lt;/code>里面，可以在bindData里面拦截。&lt;/p>
&lt;p>以XHCommonPlayerBannerView2举例，在匿名类&lt;code>class XHCommonPlayerBannerView2$bindData$1&lt;/code>里面，在run方法里面拦截&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">class&lt;/span> &lt;span class="nc">XHCommonPlayerBannerView2$bindData$1&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">implements&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Runnable&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="cm">/* renamed from: c */&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">static&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">PatchRedirect&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f76594c&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="cm">/* renamed from: b */&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cm">/* synthetic */&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">XHCommonBannerStyleData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f76596b&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">XHCommonPlayerBannerView2$bindData$1&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">XHCommonBannerStyleData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">xHCommonBannerStyleData&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">data&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">xHCommonBannerStyleData&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nd">@Override&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c1">// java.lang.Runnable&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">run&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">PatchProxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">[&lt;/span>&lt;span class="n">0&lt;/span>&lt;span class="o">]&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f76594c&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;7ca8490d&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">[&lt;/span>&lt;span class="n">0&lt;/span>&lt;span class="o">]&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Void&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">TYPE&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">isSupport&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">XHCommonBannerStyleData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">xHCommonBannerStyleData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">data&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">xHCommonBannerStyleData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">instanceof&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">DefaultStyle&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">XHCommonPlayerBannerView2&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m56696Jc&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">XHCommonPlayerBannerView2&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">DefaultStyle&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">xHCommonBannerStyleData&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Activity&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">m14684a&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">DYActivityUtils&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m14684a&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">XHCommonPlayerBannerView2&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">this&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">m14684a&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ThemeResBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">m75780c&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">RamboSkinProviderUtil&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">INSTANCE&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m75780c&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">m14684a&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kt">int&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">m74739g&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">RamboProviderUtil&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m74739g&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">m14684a&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">XHCommonPlayerBannerView2&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mo56399J7&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">m74739g&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ThemeResBeanKt&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m75790a&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">m74739g&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">m75780c&lt;/span>&lt;span class="p">));&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>如果只是上面拦截，广告不加载了，但是有一个空白的框，找到调用它的上一层方法，从这里拦截。
&lt;code>com.*****.module.player.p106p.animatedad.widget.commonbanner.NewGamePlayerAdPresenter&lt;/code>&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="cm">/* renamed from: n */&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">private&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">m56626n&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Context&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">bizType&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ILandHalfContentProvider&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">iLandHalfContentProvider&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">PatchProxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">bizType&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f76460h&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;ab81d0c2&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">Context&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Void&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">TYPE&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">isSupport&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">RoomUtil&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m60538r&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">RamboXHAnimatedAdCompatNeuron&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ramboXHAnimatedAdCompatNeuron&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">RamboXHAnimatedAdCompatNeuron&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Hand&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m132371l&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">DYActivityUtils&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m14690g&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">RamboXHAnimatedAdCompatNeuron&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">ramboXHAnimatedAdCompatNeuron&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ramboXHAnimatedAdCompatNeuron&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m74770tI&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">m56629q&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">else&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">RoomUtil&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m60535o&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;amp;&amp;amp;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">iLandHalfContentProvider&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">ILandHalfContentProvider&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">DYRouter&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getInstance&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="na">navigationLive&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ILandHalfContentProvider&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">iLandHalfContentProvider&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mo67745c1&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">m56629q&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="na">mo56402j&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">iLandHalfContentProvider&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mo67754n0&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">0L&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">0&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">IXHCommonBannerView&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">m56629q&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">m56629q&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">XHCommonBannerStyleData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">xHCommonBannerStyleData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">XHCommonPlayerBannerView&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">xHCommonPlayerBannerView&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">XHCommonPlayerBannerView&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">m56629q&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">instanceof&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">XHCommonPlayerBannerView&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">?&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">m56629q&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">xHCommonPlayerBannerView&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">xHCommonPlayerBannerView&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">setGifFrequencyController&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">FrequencyControlGif&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mFreq&lt;/span>&lt;span class="p">));&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">xHCommonPlayerBannerView&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">setMp4FrequencyController&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">FrequencyControlMp4&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mFreq&lt;/span>&lt;span class="p">));&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">IAbsAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">iAbsAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mRealGameData&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">iAbsAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">instanceof&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">StarSeaDataBean&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">iAbsAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">instanceof&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">StarSeaDataBean&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">iAbsAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">StarSeaDataBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">starSeaDataBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">StarSeaDataBean&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">iAbsAdBean&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">starSeaDataBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">xHCommonBannerStyleData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">XHCommonBannerStyleKt&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m56671d&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">starSeaDataBean&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">bizType&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">else&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">iAbsAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">instanceof&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">CommonAdBean&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">iAbsAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">instanceof&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">CommonAdBean&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">iAbsAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">CommonAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">commonAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">CommonAdBean&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">iAbsAdBean&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">commonAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">xHCommonBannerStyleData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">XHCommonBannerStyleKt&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m56670c&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">commonAdBean&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">m56629q&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mo56398C8&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">xHCommonBannerStyleData&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="其他广告">其他广告&lt;/h2>
&lt;p>&lt;code>com.*****.module.yuba2.dynamic.hometab.follow.DynamicVideoAdManager&lt;/code>
不知道是什么广告&lt;/p>
&lt;h2 id="通用广告">通用广告&lt;/h2>
&lt;p>&lt;code>com.*****.sdk.ad.AdView&lt;/code>
能够屏蔽首页的一些广告，但会导致部分地方空白。能够屏蔽热议首页广告（不完全）。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">bindAd&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">AdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">adBean&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">IAdView&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">iAdView&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">PatchProxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">adBean&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">patch$Redirect&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;8331d9cb&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">AdBean&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Void&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">TYPE&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">isSupport&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">||&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">iAdView&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mAdView&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">==&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">iAdView&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">b&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">adBean&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">bindAdByJson&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">str&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">IAdView&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">iAdView&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">PatchProxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">str&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">patch$Redirect&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;a5187cea&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Void&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">TYPE&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">isSupport&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">||&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">iAdView&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">mAdView&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">==&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">iAdView&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">b&lt;/span>&lt;span class="p">((&lt;/span>&lt;span class="n">AdBean&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Utils&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">t&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">str&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">AdBean&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">));&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="关播广告">关播广告&lt;/h2>
&lt;p>找到一个类似播放广告视频的类&lt;code>com.*****.sdk.ad.dou**.video.AdVideoPlayerPresenter&lt;/code>，使用frida监控这个类的所有方法，可以看到有一个是从这个类请求的。&lt;code>com.*****.module.player.p.liveclose.rambo.widget.CloseRoomAdViewFullscreen&lt;/code>&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">Bd&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nd">@Nullable&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">AdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">adBean&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">DyAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">dyAdBean&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kt">boolean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">z7&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">PatchProxy&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">proxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">adBean&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f50296r&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;5d1c3069&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Class&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="n">AdBean&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">class&lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Void&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">TYPE&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">isSupport&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">||&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">adBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">==&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">||&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">dyAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">adBean&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getDyAdBean&lt;/span>&lt;span class="p">())&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">==&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">dyAdBean&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">localIsPlayedCompleted&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">DYInstantLog&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">e&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;关播广告&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;已经播放完成了，不再播放&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">currentDyAdBean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">DYInstantLog&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">e&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;关播广告&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;已经有广告数据了，不再重复播放&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">省略&lt;/span>&lt;span class="p">...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>逆向某某鹰文件，破解VIP功能</title><link>https://fatkun.github.io/post/2024/crack_owl/</link><guid isPermaLink="true">https://fatkun.github.io/post/2024/crack_owl/</guid><pubDate>Fri, 19 Jul 2024 14:22:01 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="声明">声明&lt;/h1>
&lt;p>仅用于学习用途，不可用作非法用途。&lt;/p>
&lt;h1 id="软件">软件&lt;/h1>
&lt;ul>
&lt;li>&lt;a href="https://github.com/AndnixSH/APKToolGUI">APKToolGUI&lt;/a>&lt;/li>
&lt;li>jadx&lt;/li>
&lt;li>frida&lt;/li>
&lt;/ul>
&lt;p>我下载的app版本是13.1.1&lt;/p>
&lt;h1 id="分析过程">分析过程&lt;/h1>
&lt;p>这个软件没有加壳，直接用jadx查看源码。代码被混淆了，可以在工具-&amp;gt;反混淆勾选，代码相对容易分析一点。先尝试搜索vip之类的字符串，字符串搜索到一些，但是没看到代码引用。&lt;/p>
&lt;p>只能无目的浏览一下代码，看到包名有些没有混淆，例如 &lt;code>com.****.fileexplorer.purchase&lt;/code>，在里面找到一系列的&lt;code>OWLFILES_MEMBER&lt;/code> 开头的变量，其中有个LEVEL的变量特别在意。&lt;/p>
&lt;p>搜索&lt;code>OWLFILES_MEMBER_LEVEL&lt;/code>找到一处代码，在&lt;code>com/***/fileexplorer/purchase/account/a0&lt;/code>，这段代码看起来是读取这个值，如果没有则返回0。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="cm">/* renamed from: g */&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">static&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">long&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">m6862g&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Context&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Long&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">l10&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f4784b&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">l10&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">l10&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">longValue&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">C5997g&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">c5997g&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">C5997g&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">m6864i&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">f4784b&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Long&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">valueOf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">c5997g&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">m8776c&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;OWLFILES_MEMBER_LEVEL&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">0L&lt;/span>&lt;span class="p">));&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">else&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">f4784b&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">0L&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">f4784b&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">longValue&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>我们可以使用frida hook查看返回值。使用右键“复制为frida片段”，把复制的片段嵌套在&lt;code>Java.perform(function(){代码...}&lt;/code>里。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;span class="lnt">8
&lt;/span>&lt;span class="lnt">9
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-javascript" data-lang="javascript">&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">perform&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kd">function&lt;/span>&lt;span class="p">(){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">AbstractC5530a0&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">use&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;com.*****.fileexplorer.purchase.account.a0&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">AbstractC5530a0&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;g&amp;#34;&lt;/span>&lt;span class="p">].&lt;/span>&lt;span class="nx">implementation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">context&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`AbstractC5530a0.m6862g is called: context=&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">context&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">let&lt;/span> &lt;span class="nx">result&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;g&amp;#34;&lt;/span>&lt;span class="p">](&lt;/span>&lt;span class="nx">context&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sb">`AbstractC5530a0.m6862g result=&lt;/span>&lt;span class="si">${&lt;/span>&lt;span class="nx">result&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="sb">`&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">result&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>frida 具体用法不说了，自己搜索，frida 执行命令&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">frida -U -f com.***.apps.fileexplorerfree -l .&lt;span class="se">\t&lt;/span>.js
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>可以看到值都是0。这里可以把 &lt;code>return result;&lt;/code> 直接改成 &lt;code>return 1;&lt;/code>尝试一下，发现可以使用VIP功能了。&lt;/p>
&lt;h1 id="修改">修改&lt;/h1>
&lt;p>使用APK Tool GUI，拖入APK，点击&lt;code>反编译&lt;/code>。&lt;/p>
&lt;img src="https://fatkun.github.io/img/crack_owl/image-20240719173605333.png" alt="image-20240719173605333" style="zoom:50%;" />
&lt;p>使用vscode打开smali文件，从上面代码看我们要返回一个long类型的数字。我对smali语法不熟，直接问AI还挺方便的。直接在代码开头返回1。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;span class="lnt">8
&lt;/span>&lt;span class="lnt">9
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-smali" data-lang="smali">&lt;span class="line">&lt;span class="cl">&lt;span class="k">.method&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">static&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">g&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kt">L&lt;/span>android/content/&lt;span class="nc">Context&lt;/span>;&lt;span class="p">)&lt;/span>&lt;span class="kt">J&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">.locals&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mi">3&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="err">//&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">添加下面两行&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>const-wide/16&lt;span class="w"> &lt;/span>&lt;span class="nb">v0&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="mh">0x1&lt;/span>&lt;span class="err">L&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>return-wide&lt;span class="w"> &lt;/span>&lt;span class="nb">v0&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="err">//&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="err">省略其他代码&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="k">.end&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">method&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>修改保存后，点击&lt;code>编译&lt;/code> 重新编译成APK文件，编译后会自动签名，就可以把app传到手机上安装了。&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>Android14 https 抓包</title><link>https://fatkun.github.io/post/2024/android14_capture_https/</link><guid isPermaLink="true">https://fatkun.github.io/post/2024/android14_capture_https/</guid><pubDate>Sat, 22 Jun 2024 00:41:10 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="目标">目标&lt;/h1>
&lt;p>使用Android14的设备进行网络抓包。&lt;/p>
&lt;h1 id="前提">前提&lt;/h1>
&lt;p>我的设备是小米6平板，已root。&lt;/p>
&lt;h1 id="操作">操作&lt;/h1>
&lt;p>使用&lt;a href="https://reqable.com/">Reqable&lt;/a>来抓包，这个软件和知名应用HttpCanary是同一个作者，试用了一下还挺方便。&lt;/p>
&lt;p>由于要抓取的是https，所以要安装CA证书，我是抓取手机的APP，Reqable有指引怎么在Android手机安装证书，我用的是Magisk的方式。&lt;/p>
&lt;p>同时在手机上也下载一个客户端，我是使用协同的方式。电脑点击左上角的手机图标&lt;img src="https://fatkun.github.io/img/android14_capture_https/image-20240622004817428.png" alt="image-20240622004817428">，手机扫码后，使用协同的方式。这个时候已经可以抓取部分https的请求了，但是部分提示客户端SSL握手失败。&lt;/p>
&lt;p>&lt;img src="https://fatkun.github.io/img/android14_capture_https/image-20240622005428599.png" alt="image-20240622005428599">&lt;/p>
&lt;p>客户端SSL握手失败的问题，这时要借助LSPosed的模块JustTrustMe，用于跳过证书校验，为了支持Android14，有人&lt;a href="https://github.com/SekiBetu/JustTrustMe/releases/tag/v.3">自己编译了一个版本&lt;/a>。安装后，并且选择你抓包的应用。&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/%E6%8A%93%E5%8C%85/">抓包</category></item><item><title>逆向某电新闻</title><link>https://fatkun.github.io/post/2024/reverse_itouch/</link><guid isPermaLink="true">https://fatkun.github.io/post/2024/reverse_itouch/</guid><pubDate>Fri, 21 Jun 2024 14:22:01 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="声明">声明&lt;/h1>
&lt;p>仅用于学习用途，不可用作非法用途。&lt;/p>
&lt;p>以下操作参考这篇文章 &lt;a href="https://blog.wen2go.site/2022/04/21/20220421/">安卓逆向--某c电新闻x-itouchtv-ca-signature参数分析&lt;/a> 实现。&lt;/p>
&lt;h1 id="操作">操作&lt;/h1>
&lt;h2 id="前提要求">前提要求&lt;/h2>
&lt;ul>
&lt;li>一台root的机器（我使用真机，从刷机包找到boot.img，使用magisk给boot.img打补丁，最后使用fastboot刷人boot_patch.img）&lt;/li>
&lt;/ul>
&lt;h2 id="脱壳静态分析">脱壳静态分析&lt;/h2>
&lt;p>由于apk用了360加固（可以使用&lt;code>PKID&lt;/code>查看），所以得先把代码dump出来。&lt;/p>
&lt;p>安装&lt;code>frida&lt;/code>, &lt;code>objection &lt;/code> 等软件&lt;/p>
&lt;pre tabindex="0">&lt;code>pip3 install frida
pip3 install frida-tools
pip3 install objection
&lt;/code>&lt;/pre>&lt;p>安装ADB工具，确保 &lt;code>adb devices&lt;/code> 能够列出机器，如果没有列出&lt;/p>
&lt;ul>
&lt;li>在电脑管理设备页面检查驱动是否安装了&lt;/li>
&lt;li>在手机检查开发者选项里，USB调试是否已经打开&lt;/li>
&lt;/ul>
&lt;p>原文是用 objection 配合 frida_dexdump 使用，但是我没法使用，可能是 frida_dexdump 已经不更新了。&lt;/p>
&lt;pre tabindex="0">&lt;code>pip3 install frida_dexdump
&lt;/code>&lt;/pre>&lt;p>&lt;a href="https://github.com/frida/frida/releases">下载frida_server&lt;/a>文件放到手机目录下&lt;/p>
&lt;pre tabindex="0">&lt;code>adb push .\frida-server /data/local/tmp
adb shell
&lt;/code>&lt;/pre>&lt;p>进入shell之后&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">su
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">cd&lt;/span> /data/local/tmp
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">chmod +x frida-server
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">./frida-server
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>另外我尝试单独用 frida_dexdump ，能导出dex文件，但是导出的不是我想要的代码&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">frida-hexdump -U -f com.touchtv.touchtv
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>这里找到&lt;a href="https://www.kancloud.cn/ay947528/aypy/2837384">一篇文章&lt;/a>，发现可以导出dex&lt;/p>
&lt;p>脚本地址：https://github.com/r0ysue/frida_dump&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">frida -U --no-pause -f com.touchtv.touchtv -l dump_dex.js
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>执行之后，结果在手机的&lt;code>/data/data/{包名}/files/&lt;/code>目录下&lt;/p>
&lt;p>dump_dex.js 内容如下&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt"> 10
&lt;/span>&lt;span class="lnt"> 11
&lt;/span>&lt;span class="lnt"> 12
&lt;/span>&lt;span class="lnt"> 13
&lt;/span>&lt;span class="lnt"> 14
&lt;/span>&lt;span class="lnt"> 15
&lt;/span>&lt;span class="lnt"> 16
&lt;/span>&lt;span class="lnt"> 17
&lt;/span>&lt;span class="lnt"> 18
&lt;/span>&lt;span class="lnt"> 19
&lt;/span>&lt;span class="lnt"> 20
&lt;/span>&lt;span class="lnt"> 21
&lt;/span>&lt;span class="lnt"> 22
&lt;/span>&lt;span class="lnt"> 23
&lt;/span>&lt;span class="lnt"> 24
&lt;/span>&lt;span class="lnt"> 25
&lt;/span>&lt;span class="lnt"> 26
&lt;/span>&lt;span class="lnt"> 27
&lt;/span>&lt;span class="lnt"> 28
&lt;/span>&lt;span class="lnt"> 29
&lt;/span>&lt;span class="lnt"> 30
&lt;/span>&lt;span class="lnt"> 31
&lt;/span>&lt;span class="lnt"> 32
&lt;/span>&lt;span class="lnt"> 33
&lt;/span>&lt;span class="lnt"> 34
&lt;/span>&lt;span class="lnt"> 35
&lt;/span>&lt;span class="lnt"> 36
&lt;/span>&lt;span class="lnt"> 37
&lt;/span>&lt;span class="lnt"> 38
&lt;/span>&lt;span class="lnt"> 39
&lt;/span>&lt;span class="lnt"> 40
&lt;/span>&lt;span class="lnt"> 41
&lt;/span>&lt;span class="lnt"> 42
&lt;/span>&lt;span class="lnt"> 43
&lt;/span>&lt;span class="lnt"> 44
&lt;/span>&lt;span class="lnt"> 45
&lt;/span>&lt;span class="lnt"> 46
&lt;/span>&lt;span class="lnt"> 47
&lt;/span>&lt;span class="lnt"> 48
&lt;/span>&lt;span class="lnt"> 49
&lt;/span>&lt;span class="lnt"> 50
&lt;/span>&lt;span class="lnt"> 51
&lt;/span>&lt;span class="lnt"> 52
&lt;/span>&lt;span class="lnt"> 53
&lt;/span>&lt;span class="lnt"> 54
&lt;/span>&lt;span class="lnt"> 55
&lt;/span>&lt;span class="lnt"> 56
&lt;/span>&lt;span class="lnt"> 57
&lt;/span>&lt;span class="lnt"> 58
&lt;/span>&lt;span class="lnt"> 59
&lt;/span>&lt;span class="lnt"> 60
&lt;/span>&lt;span class="lnt"> 61
&lt;/span>&lt;span class="lnt"> 62
&lt;/span>&lt;span class="lnt"> 63
&lt;/span>&lt;span class="lnt"> 64
&lt;/span>&lt;span class="lnt"> 65
&lt;/span>&lt;span class="lnt"> 66
&lt;/span>&lt;span class="lnt"> 67
&lt;/span>&lt;span class="lnt"> 68
&lt;/span>&lt;span class="lnt"> 69
&lt;/span>&lt;span class="lnt"> 70
&lt;/span>&lt;span class="lnt"> 71
&lt;/span>&lt;span class="lnt"> 72
&lt;/span>&lt;span class="lnt"> 73
&lt;/span>&lt;span class="lnt"> 74
&lt;/span>&lt;span class="lnt"> 75
&lt;/span>&lt;span class="lnt"> 76
&lt;/span>&lt;span class="lnt"> 77
&lt;/span>&lt;span class="lnt"> 78
&lt;/span>&lt;span class="lnt"> 79
&lt;/span>&lt;span class="lnt"> 80
&lt;/span>&lt;span class="lnt"> 81
&lt;/span>&lt;span class="lnt"> 82
&lt;/span>&lt;span class="lnt"> 83
&lt;/span>&lt;span class="lnt"> 84
&lt;/span>&lt;span class="lnt"> 85
&lt;/span>&lt;span class="lnt"> 86
&lt;/span>&lt;span class="lnt"> 87
&lt;/span>&lt;span class="lnt"> 88
&lt;/span>&lt;span class="lnt"> 89
&lt;/span>&lt;span class="lnt"> 90
&lt;/span>&lt;span class="lnt"> 91
&lt;/span>&lt;span class="lnt"> 92
&lt;/span>&lt;span class="lnt"> 93
&lt;/span>&lt;span class="lnt"> 94
&lt;/span>&lt;span class="lnt"> 95
&lt;/span>&lt;span class="lnt"> 96
&lt;/span>&lt;span class="lnt"> 97
&lt;/span>&lt;span class="lnt"> 98
&lt;/span>&lt;span class="lnt"> 99
&lt;/span>&lt;span class="lnt">100
&lt;/span>&lt;span class="lnt">101
&lt;/span>&lt;span class="lnt">102
&lt;/span>&lt;span class="lnt">103
&lt;/span>&lt;span class="lnt">104
&lt;/span>&lt;span class="lnt">105
&lt;/span>&lt;span class="lnt">106
&lt;/span>&lt;span class="lnt">107
&lt;/span>&lt;span class="lnt">108
&lt;/span>&lt;span class="lnt">109
&lt;/span>&lt;span class="lnt">110
&lt;/span>&lt;span class="lnt">111
&lt;/span>&lt;span class="lnt">112
&lt;/span>&lt;span class="lnt">113
&lt;/span>&lt;span class="lnt">114
&lt;/span>&lt;span class="lnt">115
&lt;/span>&lt;span class="lnt">116
&lt;/span>&lt;span class="lnt">117
&lt;/span>&lt;span class="lnt">118
&lt;/span>&lt;span class="lnt">119
&lt;/span>&lt;span class="lnt">120
&lt;/span>&lt;span class="lnt">121
&lt;/span>&lt;span class="lnt">122
&lt;/span>&lt;span class="lnt">123
&lt;/span>&lt;span class="lnt">124
&lt;/span>&lt;span class="lnt">125
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-javascript" data-lang="javascript">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">get_self_process_name&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">openPtr&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;libc.so&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;open&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">open&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">NativeFunction&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">openPtr&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;int&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;pointer&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;int&amp;#39;&lt;/span>&lt;span class="p">]);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">readPtr&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;libc.so&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;read&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">read&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">NativeFunction&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">readPtr&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;int&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="s2">&amp;#34;int&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;pointer&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;int&amp;#34;&lt;/span>&lt;span class="p">]);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">closePtr&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">getExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;libc.so&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;close&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">close&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">NativeFunction&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">closePtr&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;int&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;int&amp;#39;&lt;/span>&lt;span class="p">]);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">path&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Memory&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">allocUtf8String&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;/proc/self/cmdline&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">fd&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">open&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">fd&lt;/span> &lt;span class="o">!=&lt;/span> &lt;span class="o">-&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">buffer&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Memory&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">alloc&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mh">0x1000&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">result&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">read&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">fd&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">buffer&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mh">0x1000&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">close&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">fd&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">result&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">ptr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">buffer&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">readCString&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">result&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="s2">&amp;#34;-1&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">dump_dex&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">libart&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">findModuleByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;libart.so&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">addr_DefineClass&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">symbols&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">libart&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">enumerateSymbols&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="kd">var&lt;/span> &lt;span class="nx">index&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">index&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="nx">symbols&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">length&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="nx">index&lt;/span>&lt;span class="o">++&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">symbol&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">symbols&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">index&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">symbol_name&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">symbol&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">name&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">//这个DefineClass的函数签名是Android9的
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">//_ZN3art11ClassLinker11DefineClassEPNS_6ThreadEPKcmNS_6HandleINS_6mirror11ClassLoaderEEERKNS_7DexFileERKNS9_8ClassDefE
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">symbol_name&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">indexOf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;ClassLinker&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="mi">0&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">symbol_name&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">indexOf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;DefineClass&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="mi">0&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">symbol_name&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">indexOf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Thread&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="mi">0&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">symbol_name&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">indexOf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;DexFile&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="mi">0&lt;/span> &lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">symbol_name&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">symbol&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">address&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">addr_DefineClass&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">symbol&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">address&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">dex_maps&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">{};&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[DefineClass:]&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">addr_DefineClass&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">addr_DefineClass&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Interceptor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">attach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">addr_DefineClass&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onEnter&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">args&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">dex_file&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">args&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">5&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">//ptr(dex_file).add(Process.pointerSize) is &amp;#34;const uint8_t* const begin_;&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">//ptr(dex_file).add(Process.pointerSize + Process.pointerSize) is &amp;#34;const size_t size_;&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">var&lt;/span> &lt;span class="nx">base&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">ptr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">dex_file&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">pointerSize&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">readPointer&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">size&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">ptr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">dex_file&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">pointerSize&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">Process&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">pointerSize&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">readUInt&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">dex_maps&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">base&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="kc">undefined&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">dex_maps&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="nx">base&lt;/span>&lt;span class="p">]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">size&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">magic&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">ptr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">base&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">readCString&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">magic&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">indexOf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;dex&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">process_name&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">get_self_process_name&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">process_name&lt;/span> &lt;span class="o">!=&lt;/span> &lt;span class="s2">&amp;#34;-1&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">dex_path&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;/data/data/&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">process_name&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s2">&amp;#34;/files/&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">base&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">toString&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">16&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s2">&amp;#34;_&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">size&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">toString&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">16&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="s2">&amp;#34;.dex&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[find dex]:&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">dex_path&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">fd&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">new&lt;/span> &lt;span class="nx">File&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">dex_path&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;wb&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">fd&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="nx">fd&lt;/span> &lt;span class="o">!=&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">dex_buffer&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">ptr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">base&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">readByteArray&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">size&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">fd&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">write&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">dex_buffer&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">fd&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">flush&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">fd&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">close&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[dump dex]:&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">dex_path&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span> &lt;span class="nx">onLeave&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">retval&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">var&lt;/span> &lt;span class="nx">is_hook_libart&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">false&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">hook_dlopen&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Interceptor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">attach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">findExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;dlopen&amp;#34;&lt;/span>&lt;span class="p">),&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onEnter&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">args&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">pathptr&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">args&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">pathptr&lt;/span> &lt;span class="o">!==&lt;/span> &lt;span class="kc">undefined&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="nx">pathptr&lt;/span> &lt;span class="o">!=&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">path&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">ptr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">pathptr&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">readCString&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">//console.log(&amp;#34;dlopen:&amp;#34;, path);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">path&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">indexOf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;libart.so&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">can_hook_libart&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">true&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[dlopen:]&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">path&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onLeave&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">retval&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">can_hook_libart&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="o">!&lt;/span>&lt;span class="nx">is_hook_libart&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">dump_dex&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">is_hook_libart&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">true&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Interceptor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">attach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Module&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">findExportByName&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s2">&amp;#34;android_dlopen_ext&amp;#34;&lt;/span>&lt;span class="p">),&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onEnter&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">args&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">pathptr&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">args&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">pathptr&lt;/span> &lt;span class="o">!==&lt;/span> &lt;span class="kc">undefined&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="nx">pathptr&lt;/span> &lt;span class="o">!=&lt;/span> &lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">path&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">ptr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">pathptr&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="nx">readCString&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">//console.log(&amp;#34;android_dlopen_ext:&amp;#34;, path);
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">path&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">indexOf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;libart.so&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;gt;=&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">can_hook_libart&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">true&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;[android_dlopen_ext:]&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">path&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onLeave&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">retval&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">can_hook_libart&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="o">!&lt;/span>&lt;span class="nx">is_hook_libart&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">dump_dex&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">is_hook_libart&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kc">true&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">setImmediate&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">hook_dlopen&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>可能会有出错，先忽略，先用&lt;code>jadx&lt;/code>分析。&lt;/p>
&lt;p>搜索关键字找到生成header的地方，有多个位置有类似的代码，可以静态分析一下哪个是app调用的。&lt;/p>
&lt;p>&lt;img src="https://fatkun.github.io/img/reverse_itouch/image-20240621145718722.png" alt="image-20240621145718722">&lt;/p>
&lt;p>里面还可以找到是怎么签名的，签名方式不变，还是&lt;code>HMAC&lt;/code>，里面有些内容是base64后的，需要decode。&lt;/p>
&lt;h2 id="动态分析">动态分析&lt;/h2>
&lt;p>由于我已经有了之前别人的php，我这里不需要抓包分析，我只需要分析header信息是什么。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">objection -g com.touchtv.touchtv explore -s &lt;span class="s2">&amp;#34;android sslpinning disable --quiet&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>使用objection hook功能，但是我这里会提示找不到类，可能app新版本禁止了&lt;/p>
&lt;pre tabindex="0">&lt;code>android hooking watch class com.touchtv.internetSDK.network.d
&lt;/code>&lt;/pre>&lt;p>换了一种方式去hook，但我对objection不熟，能用就行&lt;/p>
&lt;p>把以下脚本保存1.js&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-javascript" data-lang="javascript">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">foo&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">clz&lt;/span>&lt;span class="p">){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;--------&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">clz&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">clz&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">v&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">implementation&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="kd">function&lt;/span> &lt;span class="p">(&lt;/span> &lt;span class="nx">url&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">body&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">method&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">extraParams&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">send&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;arg0:&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">url&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">send&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;arg1:&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">body&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">send&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;arg2:&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">method&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">Map&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">use&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;java.util.HashMap&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">map&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">v&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">url&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">body&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">method&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">extraParams&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">res_map&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">cast&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">map&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">Map&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">send&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;map:&amp;#34;&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="nx">res_map&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">toString&lt;/span>&lt;span class="p">())&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">perform&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kd">function&lt;/span>&lt;span class="p">(){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">choose&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;dalvik.system.PathClassLoader&amp;#34;&lt;/span>&lt;span class="p">,{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onMatch&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="kd">function&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">instance&lt;/span>&lt;span class="p">){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">instance&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">ClassFactory&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">factory&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">Java&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">ClassFactory&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">get&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">instance&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">try&lt;/span>&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">myClass&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">factory&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">use&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;com.touchtv.internetSDK.network.d&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">foo&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">myClass&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="s2">&amp;#34;stop&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>&lt;span class="k">catch&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;next&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">e&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">onComplete&lt;/span>&lt;span class="o">:&lt;/span>&lt;span class="kd">function&lt;/span>&lt;span class="p">(){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">log&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Done&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">})&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>在objection里引入这个js（如果要更新js，则需要退出objection重新import）&lt;/p>
&lt;pre tabindex="0">&lt;code>import ./1.js
&lt;/code>&lt;/pre>&lt;p>代码会报错，不过无所谓(对objection不熟)，这段代码是hook &lt;code>com.touchtv.internetSDK.network.d&lt;/code> 的 v 方法，拿到输入参数和输出结果。&lt;/p>
&lt;p>执行完之后，回到手机上，点击APP的页面，然后可以在CMD看到hook的输出。&lt;/p>
&lt;p>&lt;img src="https://fatkun.github.io/img/reverse_itouch/image-20240621151358272.png" alt="image-20240621151358272">&lt;/p>
&lt;p>这样我们就拿到所有header信息了，幸运的是，这里我发现只要拿其中一个header就能够请求成功了。&lt;/p>
&lt;h1 id="参考">参考&lt;/h1>
&lt;p>&lt;a href="https://blog.wen2go.site/2022/04/21/20220421/">安卓逆向--某c电新闻x-itouchtv-ca-signature参数分析&lt;/a>&lt;/p>
&lt;p>&lt;a href="https://www.kancloud.cn/ay947528/aypy/2837384">看雪dump dex&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/%E9%80%86%E5%90%91/">逆向</category></item><item><title>Nacos配置服务源码分析</title><link>https://fatkun.github.io/post/2024/nacos-config/</link><guid isPermaLink="true">https://fatkun.github.io/post/2024/nacos-config/</guid><pubDate>Mon, 15 Jan 2024 20:05:39 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="概要">概要&lt;/h1>
&lt;p>分析的版本为nacos 2.3.0，nacos 2.x版本使用grpc通信，先看主要的proto文件&lt;/p>
&lt;h1 id="grpc通信">GRPC通信&lt;/h1>
&lt;h2 id="获取配置">获取配置&lt;/h2>
&lt;p>先从代码入口入手，nacos源码中有一个Example（com.alibaba.nacos.example.ConfigExample）&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">serverAddr&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;localhost&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;test&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;DEFAULT_GROUP&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="n">Properties&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">properties&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Properties&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="n">properties&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">put&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;serverAddr&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">serverAddr&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1">// 创建一个NacosConfigService&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="n">ConfigService&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">configService&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">NacosFactory&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">createConfigService&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">properties&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1">// 获取配置&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">content&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">configService&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getConfig&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">5000&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="n">System&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">out&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">println&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;[config content] &amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">+&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">content&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1">// 注册回调&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="n">configService&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">addListener&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Listener&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nd">@Override&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">receiveConfigInfo&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">configInfo&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">System&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">out&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">println&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;receive:&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">+&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">configInfo&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nd">@Override&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Executor&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">getExecutor&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">});&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>进入getConfig方法，看看是如何获取配置的&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">private&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">getConfigInner&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">long&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">timeoutMs&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">throws&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">NacosException&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// ...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 从本地获取配置，这个是用于灾备场景的&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">content&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">LocalConfigInfoProcessor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getFailover&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">worker&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getAgentName&lt;/span>&lt;span class="p">(),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// ...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 从服务端获取配置&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigResponse&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">worker&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getServerConfig&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">timeoutMs&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">cr&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">setContent&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getContent&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>调用的是ClientWorker.getServerConfig() -&amp;gt; ConfigRpcTransportClient.queryConfig()&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigResponse&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">queryConfig&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">long&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">readTimeouts&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">boolean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">notify&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">throws&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">NacosException&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 创建一个ConfigQueryRequest的请求&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigQueryRequest&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">request&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigQueryRequest&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">build&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">request&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">putHeader&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">NOTIFY_HEADER&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">valueOf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">notify&lt;/span>&lt;span class="p">));&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">RpcClient&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">rpcClient&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">getOneRunningClient&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 向服务端请求&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigQueryResponse&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">ConfigQueryResponse&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">requestProxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">rpcClient&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">request&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">readTimeouts&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigResponse&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">configResponse&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigResponse&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">isSuccess&lt;/span>&lt;span class="p">())&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 写成文件&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">LocalConfigInfoProcessor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">saveSnapshot&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getName&lt;/span>&lt;span class="p">(),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getContent&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">configResponse&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">setContent&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getContent&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>跟踪代码，ConfigRpcTransportClient.requestProxy() -&amp;gt; rpcClientInner.request() -&amp;gt; GrpcConnection#request()&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Response&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">request&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Request&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">request&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">long&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">timeouts&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">throws&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">NacosException&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 序列化请求&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Payload&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">grpcRequest&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">GrpcUtils&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">convert&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">request&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 调用PB方法&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ListenableFuture&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">Payload&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">requestFuture&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">grpcFutureServiceStub&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">request&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">grpcRequest&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Payload&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">grpcResponse&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">try&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">timeouts&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;lt;=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">0&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">grpcResponse&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">requestFuture&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">get&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">else&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">grpcResponse&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">requestFuture&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">get&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">timeouts&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">TimeUnit&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">MILLISECONDS&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">catch&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Exception&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">e&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">throw&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">NacosException&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">NacosException&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">SERVER_ERROR&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">e&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 反序列化结果&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Response&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">GrpcUtils&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">parse&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">grpcResponse&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>这里涉及到grpc的调用，从proto文件（src/main/proto/nacos_grpc_service.proto）看，主要有两个接口&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-protobuf" data-lang="protobuf">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">message&lt;/span> &lt;span class="nc">Payload&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span> &lt;span class="n">Metadata&lt;/span> &lt;span class="n">metadata&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span> &lt;span class="n">google.protobuf.Any&lt;/span> &lt;span class="n">body&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">3&lt;/span>&lt;span class="p">;&lt;/span> &lt;span class="c1">// 主要的Request对象序列化成这个
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span>&lt;span class="kd">service&lt;/span> &lt;span class="n">Request&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span> &lt;span class="c1">// 注册、获取配置
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">rpc&lt;/span> &lt;span class="n">request&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">Payload&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">returns&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">Payload&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span> &lt;span class="p">}&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span>&lt;span class="kd">service&lt;/span> &lt;span class="n">BiRequestStream&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span> &lt;span class="c1">// stream接口，双向通信，用于接收服务端推送的更新
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="k">rpc&lt;/span> &lt;span class="n">requestBiStream&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">stream&lt;/span> &lt;span class="n">Payload&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="k">returns&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="n">stream&lt;/span> &lt;span class="n">Payload&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="p">{&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span> &lt;span class="p">}&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>客户端的请求是ConfigQueryRequest，对应服务端的代码在com.alibaba.nacos.config.server.remote.ConfigQueryRequestHandler&lt;/p>
&lt;p>// 待填充&lt;/p>
&lt;p>// 服务端这里主要是从磁盘里(直接文件获取或者通过rocksDB)获取内容&lt;/p>
&lt;h2 id="监听配置">监听配置&lt;/h2>
&lt;p>监听采用的回调的思想，当服务端通知的时候，调用回调方法。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;span class="lnt">44
&lt;/span>&lt;span class="lnt">45
&lt;/span>&lt;span class="lnt">46
&lt;/span>&lt;span class="lnt">47
&lt;/span>&lt;span class="lnt">48
&lt;/span>&lt;span class="lnt">49
&lt;/span>&lt;span class="lnt">50
&lt;/span>&lt;span class="lnt">51
&lt;/span>&lt;span class="lnt">52
&lt;/span>&lt;span class="lnt">53
&lt;/span>&lt;span class="lnt">54
&lt;/span>&lt;span class="lnt">55
&lt;/span>&lt;span class="lnt">56
&lt;/span>&lt;span class="lnt">57
&lt;/span>&lt;span class="lnt">58
&lt;/span>&lt;span class="lnt">59
&lt;/span>&lt;span class="lnt">60
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">addListener&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Listener&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listener&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">throws&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">NacosException&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">worker&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">addTenantListeners&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Collections&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">singletonList&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">listener&lt;/span>&lt;span class="p">));&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">addTenantListeners&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">List&lt;/span>&lt;span class="o">&amp;lt;?&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">extends&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">Listener&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listeners&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">throws&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">NacosException&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">blank2defaultGroup&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">agent&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getTenant&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 增加一个CacheData，会存放在ClientWorker.cacheMap里面&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">CacheData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">cache&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">addCacheDataIfAbsent&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">synchronized&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">cache&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">for&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Listener&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listener&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listeners&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 加入到CopyOnWriteArrayList&amp;lt;ManagerListenerWrap&amp;gt; listeners里面&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">cache&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">addListener&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">listener&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">cache&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">setDiscard&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">cache&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">setConsistentWithServer&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 通知&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">agent&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">notifyListenConfig&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kd">private&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">BlockingQueue&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listenExecutebell&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ArrayBlockingQueue&lt;/span>&lt;span class="o">&amp;lt;&amp;gt;&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">1&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">notifyListenConfig&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 放入一个BlockingQueue里面，有一个线程消费这个queue，执行executeConfigListen方法&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">listenExecutebell&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">offer&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">bellItem&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">startInternal&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">executor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">schedule&lt;/span>&lt;span class="p">(()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">-&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">while&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="n">executor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">isShutdown&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;amp;&amp;amp;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="n">executor&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">isTerminated&lt;/span>&lt;span class="p">())&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">try&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">listenExecutebell&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">poll&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">5L&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">TimeUnit&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">SECONDS&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 省略一部分代码...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">executeConfigListen&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">catch&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Throwable&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">e&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 省略一部分代码...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">notifyListenConfig&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">},&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">0L&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">TimeUnit&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">MILLISECONDS&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">executeConfigListen&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 省略一部分代码...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">for&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">CacheData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">cache&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">cacheMap&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">get&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="na">values&lt;/span>&lt;span class="p">())&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// consistentWithServer 在新加入进来时是false，在收到服务端一致时才是true&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">cache&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">isConsistentWithServer&lt;/span>&lt;span class="p">())&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">cache&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">checkListenerMd5&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="n">needAllSync&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">continue&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 省略一部分代码...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 检查数据有没有变化&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kt">boolean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">hasChangedKeys&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">checkListenCache&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">listenCachesMap&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 省略一部分代码...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>和服务端对比MD5，检查配置是否有变更&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">private&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">boolean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">checkListenCache&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Map&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">List&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">CacheData&lt;/span>&lt;span class="o">&amp;gt;&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listenCachesMap&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">//...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">for&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Map&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">Entry&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">List&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">CacheData&lt;/span>&lt;span class="o">&amp;gt;&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">entry&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listenCachesMap&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">entrySet&lt;/span>&lt;span class="p">())&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 按照taskId多线程执行&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 发起RPC请求，批量检查配置是否有变更&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigBatchListenRequest&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">configChangeListenRequest&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">buildConfigRequest&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">listenCaches&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">RpcClient&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">rpcClient&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ensureRpcClient&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">taskId&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigChangeBatchListenResponse&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listenResponse&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">ConfigChangeBatchListenResponse&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">requestProxy&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">rpcClient&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">configChangeListenRequest&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">List&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">ConfigChangeBatchListenResponse&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">ConfigContext&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">changedConfigs&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listenResponse&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getChangedConfigs&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">//handle changed keys,notify listener&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="n">CollectionUtils&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">isEmpty&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">changedConfigs&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">hasChangedKeys&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">set&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">for&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">ConfigChangeBatchListenResponse&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">ConfigContext&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">changeConfig&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">changedConfigs&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">changeKey&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">GroupKey&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getKeyTenant&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">changeConfig&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getDataId&lt;/span>&lt;span class="p">(),&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">changeConfig&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getGroup&lt;/span>&lt;span class="p">(),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">changeConfig&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getTenant&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">changeKeys&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">changeKey&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kt">boolean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">isInitializing&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">cacheMap&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">get&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="na">get&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">changeKey&lt;/span>&lt;span class="p">).&lt;/span>&lt;span class="na">isInitializing&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 获取数据，并且执行用户回调&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">refreshContentAndCheck&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">changeKey&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="n">isInitializing&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">//...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>从服务端获取配置，回调用户方法&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">private&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">refreshContentAndCheck&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">CacheData&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">cacheData&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">boolean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">notify&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">try&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 从服务端获取配置&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigResponse&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">getServerConfig&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">cacheData&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">cacheData&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">cacheData&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">tenant&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">3000L&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">notify&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">cacheData&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">setEncryptedDataKey&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getEncryptedDataKey&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">cacheData&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">setContent&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getContent&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getConfigType&lt;/span>&lt;span class="p">())&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">cacheData&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">setType&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">response&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getConfigType&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// ...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 和listener最后执行的md5比较，如果不一样就调用用户注册的回调方法&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">cacheData&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">checkListenerMd5&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">catch&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Exception&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">e&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// ...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="配置变更推送">配置变更推送&lt;/h2>
&lt;p>再回来看看服务端怎么处理ConfigBatchListenRequest请求，服务端代码在ConfigChangeBatchListenRequestHandler&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigChangeBatchListenResponse&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">handle&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">ConfigBatchListenRequest&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">configChangeListenRequest&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">RequestMeta&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">meta&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">throws&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">NacosException&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">for&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">ConfigBatchListenRequest&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">ConfigListenContext&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listenContext&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">configChangeListenRequest&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getConfigListenContexts&lt;/span>&lt;span class="p">())&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">configChangeListenRequest&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">isListen&lt;/span>&lt;span class="p">())&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 加入监听列表&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">configChangeListenContext&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">addListen&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">groupKey&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">md5&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">connectionId&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kt">boolean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">isUptoDate&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigCacheService&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">isUptodate&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">groupKey&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">md5&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">meta&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getClientIp&lt;/span>&lt;span class="p">(),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tag&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="n">isUptoDate&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">configChangeBatchListenResponse&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">addChangeConfig&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">listenContext&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getDataId&lt;/span>&lt;span class="p">(),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listenContext&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getGroup&lt;/span>&lt;span class="p">(),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listenContext&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getTenant&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">else&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 从监听列表移除&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">configChangeListenContext&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">removeListen&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">groupKey&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">connectionId&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>加入监控列表&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">// com.alibaba.nacos.config.server.remote.ConfigChangeListenContext#addListen&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1">// 维护一个 {connectionId:{groupKey:md5}} 的关系&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kd">private&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ConcurrentHashMap&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">HashMap&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="o">&amp;gt;&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">connectionIdContext&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ConcurrentHashMap&lt;/span>&lt;span class="o">&amp;lt;&amp;gt;&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="c1">// 维护 groupKey-&amp;gt; connection 关系&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kd">private&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ConcurrentHashMap&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">HashSet&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="o">&amp;gt;&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">groupKeyContext&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ConcurrentHashMap&lt;/span>&lt;span class="o">&amp;lt;&amp;gt;&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">synchronized&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">addListen&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">groupKey&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">md5&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">connectionId&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">//...&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>RpcConfigChangeNotifier 是负责推送配置的类，在接收到LocalDataChangeEvent变更之后，触发推送&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">configDataChanged&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">groupKey&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">boolean&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">isBeta&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">List&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">betaIps&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tag&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 获取所有和这个groupKey相关的连接&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Set&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="o">&amp;gt;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listeners&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">configChangeListenContext&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getListeners&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">groupKey&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">CollectionUtils&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">isEmpty&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">listeners&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kt">int&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">notifyClientCount&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">0&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">for&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kd">final&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">client&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">listeners&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Connection&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">connection&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">connectionManager&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getConnection&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">client&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">connection&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">==&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">continue&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ConnectionMeta&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">metaInfo&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">connection&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getMetaInfo&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">clientIp&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">metaInfo&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getClientIp&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">clientTag&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">metaInfo&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getTag&lt;/span>&lt;span class="p">();&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">//tag check&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">StringUtils&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">isNotBlank&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">tag&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">&amp;amp;&amp;amp;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!&lt;/span>&lt;span class="n">tag&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">equals&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">clientTag&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">continue&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigChangeNotifyRequest&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">notifyRequest&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigChangeNotifyRequest&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">build&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">dataId&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">group&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">tenant&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="c1">// 构造RPC推送&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">RpcPushTask&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">rpcPushRetryTask&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">RpcPushTask&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">notifyRequest&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">ConfigCommonConfig&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getInstance&lt;/span>&lt;span class="p">().&lt;/span>&lt;span class="na">getMaxPushRetryTimes&lt;/span>&lt;span class="p">(),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">client&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">clientIp&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">metaInfo&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">getAppName&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">push&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">rpcPushRetryTask&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">connectionManager&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">notifyClientCount&lt;/span>&lt;span class="o">++&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">Loggers&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">REMOTE_PUSH&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">info&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;push [{}] clients, groupKey=[{}]&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">notifyClientCount&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">groupKey&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>这里的grpc推送，从RpcPushTask跟进去，调用rpcPushService.pushWithCallback，GrpcConnection#sendRequestNoAck方法里面通过streamObserver来发送。&lt;/p>
&lt;p>这个streamObserver是在com.alibaba.nacos.core.remote.grpc.GrpcBiStreamRequestAcceptor#requestBiStream调用时，前面看到的grpc方法，客户端在建立双向流后，使用streamObserver给客户端推送请求。&lt;/p>
&lt;h1 id="参考文章">参考文章&lt;/h1>
&lt;p>&lt;a href="https://juejin.cn/column/7207620183308255292">Nacos源码分析&lt;/a>&lt;/p>
&lt;p>&lt;a href="https://juejin.cn/post/6986887722283565069">程序猿阿越 Nacos源码分东西&lt;/a>&lt;/p></description></item><item><title>Touchtv iptv代码备份</title><link>https://fatkun.github.io/post/2023/touchtv_iptv/</link><guid isPermaLink="true">https://fatkun.github.io/post/2023/touchtv_iptv/</guid><pubDate>Sat, 23 Dec 2023 17:37:21 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>代码来自恩山论坛 wjxgzz&lt;/p>
&lt;p>php版本：https://www.right.com.cn/forum/thread-8294817-1-1.html&lt;/p>
&lt;p>nodejs版本：https://www.right.com.cn/forum/thread-8294618-1-1.html&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;span class="lnt">36
&lt;/span>&lt;span class="lnt">37
&lt;/span>&lt;span class="lnt">38
&lt;/span>&lt;span class="lnt">39
&lt;/span>&lt;span class="lnt">40
&lt;/span>&lt;span class="lnt">41
&lt;/span>&lt;span class="lnt">42
&lt;/span>&lt;span class="lnt">43
&lt;/span>&lt;span class="lnt">44
&lt;/span>&lt;span class="lnt">45
&lt;/span>&lt;span class="lnt">46
&lt;/span>&lt;span class="lnt">47
&lt;/span>&lt;span class="lnt">48
&lt;/span>&lt;span class="lnt">49
&lt;/span>&lt;span class="lnt">50
&lt;/span>&lt;span class="lnt">51
&lt;/span>&lt;span class="lnt">52
&lt;/span>&lt;span class="lnt">53
&lt;/span>&lt;span class="lnt">54
&lt;/span>&lt;span class="lnt">55
&lt;/span>&lt;span class="lnt">56
&lt;/span>&lt;span class="lnt">57
&lt;/span>&lt;span class="lnt">58
&lt;/span>&lt;span class="lnt">59
&lt;/span>&lt;span class="lnt">60
&lt;/span>&lt;span class="lnt">61
&lt;/span>&lt;span class="lnt">62
&lt;/span>&lt;span class="lnt">63
&lt;/span>&lt;span class="lnt">64
&lt;/span>&lt;span class="lnt">65
&lt;/span>&lt;span class="lnt">66
&lt;/span>&lt;span class="lnt">67
&lt;/span>&lt;span class="lnt">68
&lt;/span>&lt;span class="lnt">69
&lt;/span>&lt;span class="lnt">70
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-php" data-lang="php">&lt;span class="line">&lt;span class="cl">&lt;span class="o">&amp;lt;?&lt;/span>&lt;span class="nx">php&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">//触电新闻v3
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nv">$pk&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nv">$_GET&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;pk&amp;#39;&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$ts&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">time&lt;/span>&lt;span class="p">()&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="s1">&amp;#39;123&amp;#39;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$pubKey&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALLUiZV6DVmAcJGOsWzftnYxDVpIdTlQynYeTtq5Z1ZzUteINPX24GyeetbYjnIT8pq0IdXGEjjBtngvddR0YaMCAwEAAQ==&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$pubKey&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;-----BEGIN PUBLIC KEY-----&lt;/span>&lt;span class="se">\n&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="nx">wordwrap&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$pubKey&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="mi">64&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="se">\n&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="k">true&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="se">\n&lt;/span>&lt;span class="s2">-----END PUBLIC KEY-----&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$randIMEI&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">substr&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">md5&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">rand&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">10000000&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="mi">99999999&lt;/span>&lt;span class="p">)),&lt;/span>&lt;span class="nx">rand&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">0&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="mi">15&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="mi">16&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">openssl_public_encrypt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;IMEI_&amp;#34;&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="nv">$randIMEI&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nv">$encData&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nv">$pubKey&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$headers&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;X-ITOUCHTV-Ca-Key: 04039368653554864194910691389924&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;referer: https://android.itouchtv.cn/&amp;#34;&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="nv">$randIMEI&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;X-ITOUCHTV-A01: &amp;#34;&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="nx">base64_encode&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$encData&lt;/span>&lt;span class="p">),&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;X-ITOUCHTV-CLIENT: NEWS_APP&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;User-Agent: Mozilla/5.0 (Linux; Android 13.1.2;)&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;X-ITOUCHTV-APP-VERSION: 4.9.2&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;X-ITOUCHTV-Ca-Timestamp: &lt;/span>&lt;span class="si">$ts&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;X-ITOUCHTV-A05: hFiVdSB9XwdEevy3UZlmj2BFW1o8S6MRLQVj1z7hBU4IfPS4tawaISroHYLgA5d1PcI2rIQCAud1nYH19Ks95A==&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="c1">// 44
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="s2">&amp;#34;X-ITOUCHTV-RESOLUTION: 1920,1080&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;X-ITOUCHTV-OSVS: 13.1.2&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$signkey&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;qmiHeB9bKgowHqxRv0prc2cPN2EwXL1HOYu3DPiYCcaYxyxdFIyT5mAfBmr0UKPO&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$bstrURL&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;https://tcdn-api.itouchtv.cn/getParam&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$sign&lt;/span> &lt;span class="o">=&lt;/span>&lt;span class="nx">base64_encode&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">hash_hmac&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;SHA256&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="s2">&amp;#34;GET&lt;/span>&lt;span class="se">\n&lt;/span>&lt;span class="si">$bstrURL\n$ts\n&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nv">$signkey&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="k">true&lt;/span>&lt;span class="p">));&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$headers&lt;/span>&lt;span class="p">[]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;X-ITOUCHTV-Ca-Signature:&lt;/span>&lt;span class="si">$sign&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$ch&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">curl_init&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">curl_setopt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">CURLOPT_URL&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nv">$bstrURL&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">curl_setopt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">CURLOPT_RETURNTRANSFER&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="k">true&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">curl_setopt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">CURLOPT_SSL_VERIFYPEER&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="k">FALSE&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">curl_setopt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">CURLOPT_SSL_VERIFYHOST&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="k">FALSE&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">curl_setopt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">CURLOPT_HTTPHEADER&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nv">$headers&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$data&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">curl_exec&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">curl_close&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$json&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">json_decode&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$data&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$node&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nv">$json&lt;/span>&lt;span class="o">-&amp;gt;&lt;/span>&lt;span class="na">node&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">array_pop&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$headers&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$bstrURL&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;https://api.itouchtv.cn/liveservice/v3/tvChannelList?node=&lt;/span>&lt;span class="si">$node&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$sign&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">base64_encode&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">hash_hmac&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;SHA256&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="s2">&amp;#34;GET&lt;/span>&lt;span class="se">\n&lt;/span>&lt;span class="si">$bstrURL\n$ts\n&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nv">$signkey&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="k">true&lt;/span>&lt;span class="p">));&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$headers&lt;/span>&lt;span class="p">[]&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="s2">&amp;#34;X-ITOUCHTV-Ca-Signature:&lt;/span>&lt;span class="si">$sign&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$ch&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">curl_init&lt;/span>&lt;span class="p">();&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">curl_setopt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">CURLOPT_URL&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nv">$bstrURL&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">curl_setopt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">CURLOPT_RETURNTRANSFER&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="k">true&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">curl_setopt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">CURLOPT_SSL_VERIFYPEER&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="k">FALSE&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">curl_setopt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">CURLOPT_SSL_VERIFYHOST&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="k">FALSE&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">curl_setopt&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">CURLOPT_HTTPHEADER&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nv">$headers&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$data&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">curl_exec&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">//echo $data;exit;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">curl_close&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$ch&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$pk&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="s1">&amp;#39;&amp;#39;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$json&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nx">json_decode&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$data&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">foreach&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nv">$json&lt;/span>&lt;span class="o">-&amp;gt;&lt;/span>&lt;span class="na">tvChannelList&lt;/span> &lt;span class="k">as&lt;/span> &lt;span class="nv">$out&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">echo&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nv">$out&lt;/span>&lt;span class="o">-&amp;gt;&lt;/span>&lt;span class="na">name&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="s1">&amp;#39;,&amp;#39;&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="nv">$out&lt;/span>&lt;span class="o">-&amp;gt;&lt;/span>&lt;span class="na">pk&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="s1">&amp;#39;&amp;lt;br /&amp;gt;&amp;#39;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">else&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">preg_match&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s1">&amp;#39;/pk&amp;#34;:&amp;#39;&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="nv">$pk&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="s1">&amp;#39;,.*?&amp;#34;url&amp;#34;:&amp;#34;(.*?)&amp;#34;/i&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nv">$data&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="nv">$result&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nv">$playURL&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="nv">$result&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">1&lt;/span>&lt;span class="p">];&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">header&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;location:&lt;/span>&lt;span class="si">$playURL&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">?&amp;gt;&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description><category domain="https://fatkun.github.io/categories/vps/">Vps</category><category domain="https://fatkun.github.io/tags/iptv/">Iptv</category></item><item><title>Kafka 面试题</title><link>https://fatkun.github.io/post/2023/kafka/</link><guid isPermaLink="true">https://fatkun.github.io/post/2023/kafka/</guid><pubDate>Wed, 06 Dec 2023 18:05:43 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="概念">概念&lt;/h2>
&lt;ul>
&lt;li>&lt;em>Broker&lt;/em> : 一个 Kafka 节点就是一个 Broker&lt;/li>
&lt;li>&lt;em>Consumer Group&lt;/em>：每个Consumer都属于一个Consumer Group，每条消息只能被Consumer Group中的一个Consumer消费，但可以被多个Consumer Group消费。&lt;/li>
&lt;li>&lt;em>Controller：&lt;/em> Kafka 集群中的其中一个服务器，用来进行Leader election以及各种 Failover 操作。&lt;/li>
&lt;/ul>
&lt;h2 id="使用场景">使用场景&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>日志收集&lt;/strong>&lt;/li>
&lt;li>&lt;strong>消息队列&lt;/strong>（系统解耦，通过消息交互，异步处理）&lt;/li>
&lt;/ul>
&lt;h2 id="kafka-性能高原因">Kafka 性能高原因&lt;/h2>
&lt;ul>
&lt;li>磁盘顺序读写，使用PageCache 缓存&lt;/li>
&lt;li>零拷贝技术（发送使用sendfile，index使用mmap，log不用）&lt;/li>
&lt;li>Kafka支持批量读写和批量压缩，减少了网络传输的延迟和带宽开销。&lt;/li>
&lt;/ul>
&lt;h2 id="kafka-文件高效存储设计原理">Kafka 文件高效存储设计原理&lt;/h2>
&lt;ul>
&lt;li>Kafka把Topic中一个Partition大文件分成多个小文件段&lt;/li>
&lt;li>索引文件稀疏存储，减少索引占用空间&lt;/li>
&lt;li>索引元数据全部映射到 memory，可以避免 Segment 文件的磁盘I/O操作&lt;/li>
&lt;/ul>
&lt;h2 id="kafka-的优缺点">Kafka 的优缺点&lt;/h2>
&lt;p>优点&lt;/p>
&lt;ul>
&lt;li>高性能、高吞吐量、低延迟：Kafka 生产和消费消息的速度都达到每秒10万级&lt;/li>
&lt;li>高可用：所有消息持久化存储到磁盘，并支持数据备份防止数据丢失&lt;/li>
&lt;li>高并发：支持数千个客户端同时读写&lt;/li>
&lt;li>容错性：允许集群中节点失败（若副本数量为n，则允许 n-1 个节点失败）&lt;/li>
&lt;li>高扩展性：Kafka 集群支持热伸缩，无须停机&lt;/li>
&lt;/ul>
&lt;h2 id="kafka-写入过程">Kafka 写入过程&lt;/h2>
&lt;ul>
&lt;li>封装成一个 ProducerRecord 对象，然后序列化&lt;/li>
&lt;li>对消息进行分区处理&lt;/li>
&lt;li>放入生产者的缓存区，多条消息会被封装成一个批次（Batch），默认一个批次的大小是 16KB&lt;/li>
&lt;li>Sender 线程启动以后会从缓存里面去获取可以发送的批次，分批发送&lt;/li>
&lt;/ul>
&lt;h2 id="kafka-读取过程">Kafka 读取过程&lt;/h2>
&lt;ul>
&lt;li>使用pull模式&lt;/li>
&lt;/ul>
&lt;h2 id="负载均衡与故障转移">负载均衡与故障转移&lt;/h2>
&lt;p>&lt;strong>负载均衡&lt;/strong>&lt;/p>
&lt;p>通过选举选出leader，读写分散到不同的partition。&lt;/p>
&lt;p>&lt;strong>故障转移&lt;/strong>&lt;/p>
&lt;p>每台 Kafka 服务器启动后会以会话的形式把自己注册到 Zookeeper 服务器上，如果故障会断连，触发迁移。&lt;/p>
&lt;p>？？？迁移逻辑&lt;/p>
&lt;h2 id="kafka-创建topic后如何将分区放置到不同的-broker-中">Kafka 创建Topic后如何将分区放置到不同的 Broker 中&lt;/h2>
&lt;p>Kafka创建Topic将分区放置到不同的Broker时遵循以下规则：&lt;/p>
&lt;ol>
&lt;li>副本因子不能大于Broker的个数。&lt;/li>
&lt;li>第一个分区（编号为0）的第一个副本放置位置是随机从Broker List中选择的。&lt;/li>
&lt;li>其他分区的第一个副本放置位置相对于第0个分区依次往后移。也就是如果有3个Broker，3个分区，假设第一个分区放在第二个Broker上，那么第二个分区将会放在第三个Broker上；第三个分区将会放在第一个Broker上，更多Broker与更多分区依此类推。剩余的副本相对于第一个副本放置位置其实是由&lt;code>nextReplicaShift&lt;/code>决定的，而这个数也是随机产生的。&lt;/li>
&lt;/ol>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="https://javabetter.cn/interview/kafka-40.html">https://javabetter.cn/interview/kafka-40.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/technology/">Technology</category><category domain="https://fatkun.github.io/tags/queue/">Queue</category><category domain="https://fatkun.github.io/tags/kafka/">Kafka</category></item><item><title>N5095 Jellyfin硬解</title><link>https://fatkun.github.io/post/2023/n5095-jellyfin/</link><guid isPermaLink="true">https://fatkun.github.io/post/2023/n5095-jellyfin/</guid><pubDate>Sat, 24 Jun 2023 00:28:01 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>按照一般教程开启jellyfin硬件加速总是报错：该客户端与媒体不兼容，服务器未发送兼容的媒体格式&lt;/p>
&lt;p>由于N5095是11代的CPU，需要有些特殊配置。&lt;/p>
&lt;p>首先内核要比较新，我是使用OMV，内核是6.1的&lt;/p>
&lt;ol>
&lt;li>在系统上添加所需的i915内核参数以启用加载GUC和HuC固件&lt;/li>
&lt;/ol>
&lt;pre tabindex="0">&lt;code>sudo mkdir -p /etc/modprobe.d
sudo sh -c &amp;#34;echo &amp;#39;options i915 enable_guc=3&amp;#39; &amp;gt;&amp;gt; /etc/modprobe.d/i915.conf&amp;#34;
&lt;/code>&lt;/pre>&lt;ol start="2">
&lt;li>
&lt;p>更新initramfs和grub&lt;/p>
&lt;p>Debian和Ubuntu&lt;/p>
&lt;/li>
&lt;/ol>
&lt;pre tabindex="0">&lt;code>sudo update-initramfs -u &amp;amp;&amp;amp; sudo update-grub
&lt;/code>&lt;/pre>&lt;ol start="3">
&lt;li>重新启动系统并使用以下命令检查GuC和HuC状态，确保输出中没有FAIL或ERROR。&lt;/li>
&lt;/ol>
&lt;pre tabindex="0">&lt;code>sudo reboot
sudo dmesg | grep i915
sudo cat /sys/kernel/debug/dri/0/gt/uc/guc_info
sudo cat /sys/kernel/debug/dri/0/gt/uc/huc_info
&lt;/code>&lt;/pre>&lt;ol start="4">
&lt;li>安装jellyfin&lt;/li>
&lt;/ol>
&lt;pre tabindex="0">&lt;code>---
version: &amp;#34;2.1&amp;#34;
services:
jellyfin:
image: nyanmisaka/jellyfin:latest
container_name: jellyfin
environment:
- PUID=1000
- PGID=100
- TZ=Etc/UTC
#- JELLYFIN_PublishedServerUrl=192.168.0.5 #optional
volumes:
- /mnt/docker/jellyfin2:/config
- /mnt/hgst_8t:/data/hgst_8t
- /mnt/2t:/data/2t
- /mnt/st_4t:/data/st_4t
devices:
- &amp;#34;/dev/dri:/dev/dri&amp;#34;
ports:
- 8096:8096
- 8920:8920 #optional
- 7359:7359/udp #optional
- 1900:1900/udp #optional
restart: unless-stopped
&lt;/code>&lt;/pre>&lt;p>在jellyfin里面，控制台-》播放&lt;/p>
&lt;ul>
&lt;li>硬件加速选择QSV&lt;/li>
&lt;li>勾选 启用低电压模式的 Intel H.264 硬件编码器&lt;/li>
&lt;li>勾选 启用低电压模式的 Intel HEVC 硬件编码器&lt;/li>
&lt;/ul>
&lt;h1 id="参考文档">参考文档&lt;/h1>
&lt;p>&lt;a href="https://www.symphonysun.com/2023/04/08/n5095-n5100-n5105-n6005-j6412%E7%AD%89intel-11%E4%BB%A3jasper-lake%E5%92%8Celkhart-lake%E5%B9%B3%E5%8F%B0cpu%E4%BD%BF%E7%94%A8jellyfin%E5%BC%80%E5%90%AF%E7%A1%AC%E4%BB%B6%E5%8A%A0%E9%80%9F/">N5095, N5100, N5105, N6005, J6412等intel 11代Jasper Lake和Elkhart Lake平台cpu使用jellyfin开启硬件加速&lt;/a>&lt;/p>
&lt;p>&lt;a href="https://post.smzdm.com/p/avxe2p87/">N5095使用经验分享 Step By Step &lt;/a>&lt;/p></description></item><item><title>JMES Path - 提取json内容</title><link>https://fatkun.github.io/post/2022/jmes-path/</link><guid isPermaLink="true">https://fatkun.github.io/post/2022/jmes-path/</guid><pubDate>Tue, 30 Aug 2022 10:38:28 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>JMESPath有很多方法，可以提取json内容&lt;/p>
&lt;p>例如 keys(@) 可以把所有key取出来&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;xx&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{},&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;#34;bb&amp;#34;&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="p">{}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>这个例子的结果是&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-json" data-lang="json">&lt;span class="line">&lt;span class="cl">&lt;span class="p">[&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;xx&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s2">&amp;#34;bb&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h1 id="参考">参考&lt;/h1>
&lt;p>&lt;a href="https://jmespath.org/tutorial.html">https://jmespath.org/tutorial.html&lt;/a>&lt;/p>
&lt;p>&lt;a href="https://jmespath.org/specification.html#functions">https://jmespath.org/specification.html#functions&lt;/a>&lt;/p></description></item><item><title>K8s Informer HasSync</title><link>https://fatkun.github.io/post/2021/k8s-informer-hassync/</link><guid isPermaLink="true">https://fatkun.github.io/post/2021/k8s-informer-hassync/</guid><pubDate>Sun, 18 Apr 2021 17:30:28 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="背景">背景&lt;/h1>
&lt;p>K8S中的informer中HasSynced到底表示什么？&lt;/p>
&lt;h1 id="分析">分析&lt;/h1>
&lt;p>HasSynced的注释是这样写的，如果拿到至少一个列表后返回true。&lt;/p>
&lt;pre tabindex="0">&lt;code>HasSynced returns true if the shared informer&amp;#39;s store has been informed by at least one full LIST of the authoritative state of the informer&amp;#39;s object collection. This is unrelated to &amp;#34;resync&amp;#34;.
&lt;/code>&lt;/pre>&lt;p>一般我们使用informer的时候，会监听一些对象，那HasSynced是否会等待这些做完才返回呢？&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-go" data-lang="go">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">// HasSynced returns true if an Add/Update/Delete/AddIfNotPresent are called first,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">// or an Update called first but the first batch of items inserted by Replace() has been popped
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="kd">func&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">f&lt;/span> &lt;span class="o">*&lt;/span>&lt;span class="nx">DeltaFIFO&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="nf">HasSynced&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="kt">bool&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">f&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">lock&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nf">Lock&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">defer&lt;/span> &lt;span class="nx">f&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">lock&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nf">Unlock&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="nx">f&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">populated&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> &lt;span class="nx">f&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">initialPopulationCount&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="mi">0&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>在func (f *DeltaFIFO) Pop(process PopProcessFunc)的时候负责initialPopulationCount的减少，并且这里有锁，能保证在调用完process(item)才返回。&lt;/p>
&lt;p>但是事件传递有个缓冲池，事件是异步处理。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-go" data-lang="go">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">func&lt;/span> &lt;span class="p">(&lt;/span>&lt;span class="nx">p&lt;/span> &lt;span class="o">*&lt;/span>&lt;span class="nx">processorListener&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="nf">pop&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">defer&lt;/span> &lt;span class="nx">utilruntime&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nf">HandleCrash&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">defer&lt;/span> &lt;span class="nb">close&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">p&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">nextCh&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="c1">// Tell .run() to stop
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">nextCh&lt;/span> &lt;span class="kd">chan&lt;/span>&lt;span class="o">&amp;lt;-&lt;/span> &lt;span class="kd">interface&lt;/span>&lt;span class="p">{}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">var&lt;/span> &lt;span class="nx">notification&lt;/span> &lt;span class="kd">interface&lt;/span>&lt;span class="p">{}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">for&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">select&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">case&lt;/span> &lt;span class="nx">nextCh&lt;/span> &lt;span class="o">&amp;lt;-&lt;/span> &lt;span class="nx">notification&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Notification dispatched
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="kd">var&lt;/span> &lt;span class="nx">ok&lt;/span> &lt;span class="kt">bool&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">notification&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">ok&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="nx">p&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">pendingNotifications&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nf">ReadOne&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">!&lt;/span>&lt;span class="nx">ok&lt;/span> &lt;span class="p">{&lt;/span> &lt;span class="c1">// Nothing to pop
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">nextCh&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="kc">nil&lt;/span> &lt;span class="c1">// Disable this select case
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">case&lt;/span> &lt;span class="nx">notificationToAdd&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">ok&lt;/span> &lt;span class="o">:=&lt;/span> &lt;span class="o">&amp;lt;-&lt;/span>&lt;span class="nx">p&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">addCh&lt;/span>&lt;span class="p">:&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="p">!&lt;/span>&lt;span class="nx">ok&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="nx">notification&lt;/span> &lt;span class="o">==&lt;/span> &lt;span class="kc">nil&lt;/span> &lt;span class="p">{&lt;/span> &lt;span class="c1">// No notification to pop (and pendingNotifications is empty)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="c1">// Optimize the case - skip adding to pendingNotifications
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">notification&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="nx">notificationToAdd&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">nextCh&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="nx">p&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">nextCh&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span> &lt;span class="k">else&lt;/span> &lt;span class="p">{&lt;/span> &lt;span class="c1">// There is already a notification waiting to be dispatched
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">p&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">pendingNotifications&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nf">WriteOne&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">notificationToAdd&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h1 id="结论">结论&lt;/h1>
&lt;p>HasSynced=true时，只能保证store中的数据已经加载第一批，事件处理是异步的，无法保证完成。&lt;/p></description><category domain="https://fatkun.github.io/tags/k8s/">K8s</category></item><item><title>Istio 1.8 主要变化</title><link>https://fatkun.github.io/post/2020/2020-12-27-istio-1.8-release/</link><guid isPermaLink="true">https://fatkun.github.io/post/2020/2020-12-27-istio-1.8-release/</guid><pubDate>Sun, 27 Dec 2020 16:51:11 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="istio18">istio1.8&lt;/h1>
&lt;h2 id="istio的安装和升级">istio的安装和升级&lt;/h2>
&lt;p>原来已经支持istioctl install 和 Istio operator，现在新增helm3的安装方式，当前还处于试验阶段。之前在1.6版本移除，可能是顺应社区的需求，重新加回来。&lt;/p>
&lt;h2 id="多集群">多集群&lt;/h2>
&lt;p>编写新的安装文档，使得多集群安装变得容易。多集群包含单一网络和多网络场景。&lt;/p>
&lt;h2 id="虚拟机支持">虚拟机支持&lt;/h2>
&lt;p>新增&lt;a href="https://istio.io/latest/blog/2020/dns-proxy/">智能DNS&lt;/a>，istio agent会透明拦截DNS请求，实现虚拟机到服务网格访问，不必以非安全方式将其指向集群DNS服务器。&lt;/p>
&lt;h2 id="安全">安全&lt;/h2>
&lt;p>网关证书之前是通过网关直接访问k8s读取，现在由istiod来发送。&lt;/p>
&lt;p>支持外部的CA，需要使用Kubernetes CSR API（k8s版本&amp;gt;=1.18）&lt;/p>
&lt;h2 id="易用性">易用性&lt;/h2>
&lt;p>istioctl bug-report 用于搜集错误报告&lt;/p>
&lt;p>istioctl analyze 可以返回错误所在的行号以及错误信息&lt;/p>
&lt;h2 id="弃用">弃用&lt;/h2>
&lt;p>正式弃用mixed，建议使用Envoy WebAssembly来扩展。&lt;/p>
&lt;h1 id="istio-17">Istio 1.7&lt;/h1>
&lt;h2 id="安全增强">安全增强&lt;/h2>
&lt;p>确认destination规则证书的分发场景下，使用sds来下发证书很有优势（尤其是证书轮转）。现在这个特性用在Egress网关上，提供tls/mtls证书。&lt;/p>
&lt;p>信任域验证除了支持http，现在tcp也可以支持了，并且可以在MeshConfig配置。&lt;/p>
&lt;p>支持使用ECC（椭圆曲线密码学）进行 CA 通信，提高了安全性和效率。&lt;/p>
&lt;h2 id="易用性-1">易用性&lt;/h2>
&lt;p>主要是istioctl工具的增强&lt;/p>
&lt;ul>
&lt;li>analysis 支持
&lt;ul>
&lt;li>对可能不安全的 &lt;code>DestinationRule&lt;/code> 配置发出警告&lt;/li>
&lt;li>对使用废弃的 Mixer 资源发出警告&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>使用ISTIOCONFIG指定istioctl的配置&lt;/li>
&lt;li>使用名字代替端口，例如http表示80端口&lt;/li>
&lt;li>添加 &lt;code>istioctl x uninstall&lt;/code> 用于卸载&lt;/li>
&lt;li>支持多控制平面升级，可以同时部署多个版本，验证新版本&lt;/li>
&lt;/ul>
&lt;h2 id="生产运维改进">生产运维改进&lt;/h2>
&lt;p>在sidecar启动后再启动应用，避免应用启动时拿不到配置。（通过在sidecar配置 lifecycle-postStart 脚本实现）&lt;/p>
&lt;p>Istio Operator 作为最佳安装方式，但目前还不支持金丝雀部署。&lt;/p>
&lt;p>提供了 istio-agent 的指标&lt;/p>
&lt;h2 id="虚拟机安全性">虚拟机安全性&lt;/h2>
&lt;p>支持证书的分发和自动轮转&lt;/p>
&lt;p>istioctl能够验证虚拟机的状态&lt;/p>
&lt;p>增加RPM安装包，简化安装&lt;/p>
&lt;h2 id="其他">其他&lt;/h2>
&lt;p>在这个版本开始要求k8s 1.16以上，主要是因为webhook admissionregistration.io beta1要改为v1版本（在k8s1.16开始支持，在1.19版本移除beta1）&lt;/p>
&lt;p>【alpha】试验支持&lt;a href="https://istio.io/latest/blog/2020/new-deployment-model/">中心化的istio&lt;/a> （Central Istiod）， 把控制面部署在外部的集群，从目标集群获取配置和service。中心集群不获取配置，两个都是远程集群，从其中一个集群读取配置。&lt;/p>
&lt;p>向 Envoy xDSv3 迁移&lt;/p>
&lt;h1 id="istio-16">istio 1.6&lt;/h1>
&lt;p>版本目标是继续简化，在发布标题使用了三个Simplify来强调。&lt;/p>
&lt;h2 id="易用性-2">易用性&lt;/h2>
&lt;p>使用istioctl工具可以提供更好的诊断信息，更简单的安装方式&lt;/p>
&lt;p>支持istio控制面的金丝雀发布，&lt;code>istioctl upgrade&lt;/code>支持原地升级&lt;/p>
&lt;h2 id="可观察性">可观察性&lt;/h2>
&lt;p>增加很多指标以及可配置项。&lt;/p>
&lt;p>[alpha]配置可以开启状态信息，用于判断配置是否分发完成 &lt;a href="https://istio.io/latest/docs/reference/config/config-status/">https://istio.io/latest/docs/reference/config/config-status/&lt;/a>&lt;/p>
&lt;h2 id="虚拟机支持-1">虚拟机支持&lt;/h2>
&lt;p>通过WorkloadEntry更简单的定义VM，这样可以使得VM和Pod在同一级别下。在之前是依赖ServiceEntry指定address的方式支持。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">apiVersion&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">networking.istio.io/v1alpha3&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">kind&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">WorkloadEntry&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">metadata&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">name&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">details-svc&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">serviceAccount&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">details-legacy&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">address&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">vm1.vpc01.corp.net&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">labels&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">app&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">details-legacy&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">instance-id&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">vm1&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="网络改进">网络改进&lt;/h2>
&lt;p>默认启用了Gateway SDS&lt;/p>
&lt;p>添加了对&lt;a href="https://github.com/kubernetes-sigs/service-apis/">Kubernetes Service API的&lt;/a>实验性支持&lt;/p>
&lt;p>支持VirtualService级联方式，可以嵌套配置VirtualService，为了避免单个VS文件太大。&lt;/p>
&lt;p>&lt;img src="https://mmbiz.qpic.cn/mmbiz_png/ia1Z7HH4plnDc8mBxWEvMQXHWbXElwQEpFFWGvAGpibJgVlljtzvORH0iafFTf0ocmUfSkwiaAYBrBaXhfZIf0ibyiag/640?wx_fmt=png" alt="img">&lt;/p>
&lt;h1 id="istio-15">istio 1.5&lt;/h1>
&lt;p>istiod的起源地，istio发现当前部署架构过于复杂，不利于推广，在这个版本开始合并组件。&lt;/p>
&lt;h2 id="可扩展性">可扩展性&lt;/h2>
&lt;p>引入WebAssembly，抛弃Mixer&lt;/p>
&lt;h2 id="易用性-3">易用性&lt;/h2>
&lt;p>提供 istioctl 安装工具，以及IstioOperator API用于运维，还处于alpha状态。&lt;/p>
&lt;p>istioctl 支持一些分析能力&lt;/p>
&lt;h2 id="更安全">更安全&lt;/h2>
&lt;p>简化mtls配置，启动自动mtls。&lt;/p>
&lt;p>授权支持“拒绝”语义&lt;/p>
&lt;p>将nodeagent的功能移入pilot agent，简化部署，不必在证书更改时重启envoy。&lt;/p>
&lt;h2 id="优化">优化&lt;/h2>
&lt;p>优化xds推送，例如有些配置变更不涉及到eds的更新，可以不推送。&lt;a href="https://github.com/istio/istio/pull/18354">详细&lt;/a>&lt;/p>
&lt;h1 id="参考">参考&lt;/h1>
&lt;p>Istio 1.8正式发布 &lt;a href="http://dockone.io/article/43733">http://dockone.io/article/43733&lt;/a>&lt;/p>
&lt;p>Istio 1.8——用户至上的选择 &lt;a href="https://jimmysong.io/blog/istio-18-release/">https://jimmysong.io/blog/istio-18-release/&lt;/a>&lt;/p>
&lt;p>Istio 1.7 发布——进击的追风少年 &lt;a href="https://www.servicemesher.com/blog/istio-1-7-explanation/">https://www.servicemesher.com/blog/istio-1-7-explanation/&lt;/a>&lt;/p>
&lt;p>Istio v1.6深度解读：Simplify（有深入分析） &lt;a href="https://www.ershicimi.com/p/291c62cff3608af7681b2821b05da3ac">https://www.ershicimi.com/p/291c62cff3608af7681b2821b05da3ac&lt;/a>&lt;/p>
&lt;p>迈向极简主义 - Istio 1.6 发布 &lt;a href="https://www.servicemesher.com/blog/istio-1.6-explain/">https://www.servicemesher.com/blog/istio-1.6-explain/&lt;/a>&lt;/p>
&lt;p>拥抱变化 —— Istio 1.5 新特性解读 &lt;a href="https://www.servicemesher.com/blog/istio-1-5-explanation/">https://www.servicemesher.com/blog/istio-1-5-explanation/&lt;/a>&lt;/p></description></item><item><title>Go Json Marshal字段不输出</title><link>https://fatkun.github.io/post/2020/go-json-marshal/</link><guid isPermaLink="true">https://fatkun.github.io/post/2020/go-json-marshal/</guid><pubDate>Fri, 30 Oct 2020 14:15:06 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="问题">问题&lt;/h2>
&lt;p>json.Marshal默认不输出非导出的字段&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-go" data-lang="go">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">type&lt;/span> &lt;span class="nx">Test&lt;/span> &lt;span class="kd">struct&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Total&lt;/span> &lt;span class="kt">int&lt;/span> &lt;span class="s">`json:&amp;#34;total&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">item&lt;/span> &lt;span class="kt">string&lt;/span> &lt;span class="s">`json:&amp;#34;item&amp;#34;`&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">func&lt;/span> &lt;span class="nf">main&lt;/span>&lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">resp&lt;/span> &lt;span class="o">:=&lt;/span> &lt;span class="nx">Test&lt;/span>&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">Total&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="mi">1&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">item&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="s">&amp;#34;aa&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">body&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nx">err&lt;/span> &lt;span class="o">:=&lt;/span> &lt;span class="nx">json&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nf">Marshal&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">resp&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">fmt&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nf">Printf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;body=%v, err=%v \n&amp;#34;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="nb">string&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="nx">body&lt;/span>&lt;span class="p">),&lt;/span> &lt;span class="nx">err&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="c1">// 输出 body={&amp;#34;total&amp;#34;:1}, err=&amp;lt;nil&amp;gt;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h2 id="解决方式">解决方式&lt;/h2>
&lt;p>把字段改成大写字母开头&lt;/p></description><category domain="https://fatkun.github.io/categories/go/">Go</category><category domain="https://fatkun.github.io/tags/go-json/">Go Json</category></item><item><title>mac使用/home目录</title><link>https://fatkun.github.io/2020/07/mac-use-home-dir.html</link><guid isPermaLink="true">https://fatkun.github.io/2020/07/mac-use-home-dir.html</guid><pubDate>Sun, 05 Jul 2020 16:29:21 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>编辑/etc/auto_master文件，把/home那一行注释掉&lt;br>
重新挂载sudo automount -vc&lt;/p>
&lt;p>来源：&lt;a href="https://stackoverflow.com/questions/1362703/how-can-i-use-the-home-directory-on-mac-os-x/25558272#25558272">https://stackoverflow.com/questions/1362703/how-can-i-use-the-home-directory-on-mac-os-x/25558272#25558272&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>从CustomResourceDefinition生成k8s java模型代码</title><link>https://fatkun.github.io/2019/10/generate-java-codes-from-customresourcedefinition.html</link><guid isPermaLink="true">https://fatkun.github.io/2019/10/generate-java-codes-from-customresourcedefinition.html</guid><pubDate>Sat, 26 Oct 2019 10:41:26 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="目标">目标&lt;/h2>
&lt;p>已经有了go版本的模型定义，需要生成java版本
看了下官方介绍的文档 &lt;a href="https://github.com/kubernetes-client/java/blob/master/docs/generate-model-from-third-party-resources.md" rel="noopener" target="_blank">generate-model-from-third-party-resources.md&lt;/a> 感觉不会太难，照着尝试一下。&lt;/p>
&lt;h2 id="开始干活">开始干活&lt;/h2>
&lt;p>首先看到要k8s 1.15以上的版本，我只有1.14，只好使用minikube重新装了1.16的版本，具体安装不细说了。&lt;br>
然后把CRD apply进集群里面，注意CRD得带有openAPIV3Schema的validation（我的是kubebuilder生成的）&lt;br>
执行这个命令生成swagger json文件&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">kubectl get --raw&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;/openapi/v2&amp;#34;&lt;/span> &amp;gt; /tmp/swagger
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>然后执行这个命令生成代码&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">docker run -i --rm dockerhub.azk8s.cn/yue9944882/java-model-gen &amp;lt; /tmp/swagger &lt;span class="p">|&lt;/span> tar -xzf - -C /tmp/
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>这里我添加了dockerhub.azk8s.cn镜像加速，这个镜像应该是别人构建好的，如果想自己构建，要用首页介绍的项目kubernetes-client/gen ，里面还会用到maven下载也是比较慢的，可以加一下mirrors
我写了个简单的Dockerfile&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-Dockerfile" data-lang="Dockerfile">&lt;span class="line">&lt;span class="cl">&lt;span class="k">FROM&lt;/span>&lt;span class="s"> dockerhub.azk8s.cn/yue9944882/java-model-gen&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="err">&lt;/span>&lt;span class="k">COPY&lt;/span> ./settings.xml /usr/share/maven/conf/settings.xml&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>把settings.xml放到同一个目录，内容大概这样，可以加更多一些mirror&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-xml" data-lang="xml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">&amp;lt;settings&lt;/span> &lt;span class="na">xmlns=&lt;/span>&lt;span class="s">&amp;#34;http://maven.apache.org/SETTINGS/1.0.0&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">xmlns:xsi=&lt;/span>&lt;span class="s">&amp;#34;http://www.w3.org/2001/XMLSchema-instance&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">xsi:schemaLocation=&lt;/span>&lt;span class="s">&amp;#34;http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd&amp;#34;&lt;/span>&lt;span class="nt">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nt">&amp;lt;mirrors&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nt">&amp;lt;mirror&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;id&amp;gt;&lt;/span>aliyun-central&lt;span class="nt">&amp;lt;/id&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;mirrorOf&amp;gt;&lt;/span>*&lt;span class="nt">&amp;lt;/mirrorOf&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;name&amp;gt;&lt;/span>aliyun central&lt;span class="nt">&amp;lt;/name&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nt">&amp;lt;url&amp;gt;&lt;/span>https://maven.aliyun.com/repository/central&lt;span class="nt">&amp;lt;/url&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nt">&amp;lt;/mirror&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nt">&amp;lt;/mirrors&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nt">&amp;lt;/settings&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>执行完成后，生成的文件在/tmp/java里面，找一下自己要的文件在哪里。？？？文件呢？为什么只有个*List文件？？
试了下文档给出的CRD文件，确实可以生成，但为什么我的不行？&lt;br>
试了执行一下explain, 发现字段没有显示出来。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">kubectl explain my_crd_name --recursive
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>最终使用排除法的方式，对比例子和我crd的差异，找出了这里的差异&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">spec&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">preserveUnknownFields&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">false&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># 需要添加这个，这个值默认为true&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">validation&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">openAPIV3Schema&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">type&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="l">object&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="c"># 这里也要&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>修改后使用 kubectl explain 可以正确识别字段&lt;/p></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/client-java/">Client-Java</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category><category domain="https://fatkun.github.io/tags/kubenetes/">Kubenetes</category><category domain="https://fatkun.github.io/tags/open-api/">Open Api</category></item><item><title>使用java kubenetes client replaceClusterCustomObject报错Bad Request</title><link>https://fatkun.github.io/2019/09/java-kubenetes-client-replaceclustercustomobject-throw-bad-request.html</link><guid isPermaLink="true">https://fatkun.github.io/2019/09/java-kubenetes-client-replaceclustercustomobject-throw-bad-request.html</guid><pubDate>Wed, 18 Sep 2019 02:18:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="报错">报错&lt;/h2>
&lt;p>报错Bad Request只是显式的错误，在ApiException里面有个resp返回的内容，在里面可以看到实际的错误，报错如下
couldn’t get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct&lt;/p>
&lt;h2 id="原因">原因&lt;/h2>
&lt;p>我在replaceClusterCustomObject最后一个参数里填了字符串（通过gson.toJson(obj)来返回），实际上不能传递字符串，直接传obj就好了，或者传bytes，就是不要传字符串。。&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">RequestBody&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">serialize&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">Object&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">obj&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">contentType&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">throws&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ApiException&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">obj&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">instanceof&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">byte&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">RequestBody&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">create&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">MediaType&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">parse&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">contentType&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kt">byte&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">)((&lt;/span>&lt;span class="kt">byte&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="n">obj&lt;/span>&lt;span class="p">));&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">else&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">obj&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">instanceof&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">File&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">RequestBody&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">create&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">MediaType&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">parse&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">contentType&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">File&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="n">obj&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">else&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">isJsonMime&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">contentType&lt;/span>&lt;span class="p">))&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">content&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">obj&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">!=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">content&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">this&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">json&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">serialize&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">obj&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">else&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">content&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">null&lt;/span>&lt;span class="p">;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">return&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">RequestBody&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">create&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">MediaType&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">parse&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">contentType&lt;/span>&lt;span class="p">),&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">content&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">else&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="k">throw&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">new&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">ApiException&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;Content type \&amp;#34;&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">+&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">contentType&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">+&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;\&amp;#34; is not supported&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/categories/go/">Go</category><category domain="https://fatkun.github.io/tags/client/">Client</category><category domain="https://fatkun.github.io/tags/java/">JAVA</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category><category domain="https://fatkun.github.io/tags/kubenetes/">Kubenetes</category></item><item><title>K8s Endpoint无IP定位错误方法</title><link>https://fatkun.github.io/2019/08/k8s-endpoint-not-contain-ip.html</link><guid isPermaLink="true">https://fatkun.github.io/2019/08/k8s-endpoint-not-contain-ip.html</guid><pubDate>Mon, 26 Aug 2019 02:57:21 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="可能的原因">可能的原因&lt;/h2>
&lt;ul>
&lt;li>确认selector是否正确&lt;/li>
&lt;li>确认pod里面配置的containerPort以及service里面的配置的port能对应上&lt;/li>
&lt;li>确认pod是否ready了，不能只看get pod看到的1/1，还要看一下-o yaml的输出结果&lt;/li>
&lt;/ul></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/endpoint/">Endpoint</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category><category domain="https://fatkun.github.io/tags/service/">Service</category></item><item><title>minikube生成内置证书的kubeconfig</title><link>https://fatkun.github.io/2019/08/minikube-embed-certs.html</link><guid isPermaLink="true">https://fatkun.github.io/2019/08/minikube-embed-certs.html</guid><pubDate>Mon, 12 Aug 2019 06:20:20 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>minikube默认生成的证书都是文件路径，如果要在其他地方使用不方便，需要把证书内置。
如果还没启动minikube，可以看下 &lt;a href="https://github.com/kubernetes/minikube/issues/3064" rel="noopener" target="_blank">&lt;a href="https://github.com/kubernetes/minikube/issues/3064">https://github.com/kubernetes/minikube/issues/3064&lt;/a>&lt;/a>
如果已经生成了，执行以下命令可以把证书内置。&lt;/p>
&lt;pre escaped="true" lang="bash">kubectl config set-credentials minikube --embed-certs --client-certificate=${HOME}/.minikube/client.crt --client-key=${HOME}/.minikube/client.key
kubectl config set-cluster minikube --embed-certs --certificate-authority=${HOME}/.minikube/ca.crt&lt;/pre></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category><category domain="https://fatkun.github.io/tags/minikube/">Minikube</category></item><item><title>golang for 循环指针的坑</title><link>https://fatkun.github.io/2019/08/golang-for-pointer-error.html</link><guid isPermaLink="true">https://fatkun.github.io/2019/08/golang-for-pointer-error.html</guid><pubDate>Thu, 01 Aug 2019 06:09:46 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>原文：&lt;a href="https://www.jianshu.com/p/dbd81a7c2bcb">https://www.jianshu.com/p/dbd81a7c2bcb&lt;/a>&lt;/p>
&lt;pre lang="other" escaped="true">package main
import (
"log"
"time"
)
type student struct {
Name string
Age int
}
func main() {
m := make([]*student, 3)
stus := []student{
student{Name: "sa", Age: 10},
student{Name: "sb", Age: 11},
student{Name: "sc", Age: 12},
}
log.Println("################ 错误做法 ##################")
for k, stu := range stus {
m[k] = &amp;stu
}
for _, s := range m {
log.Println(s.Name, s.Age)
}
log.Println("################ 正确做法 ##################")
for k, _ := range stus {
m[k] = &amp;stus[k]
}
for _, s := range m {
log.Println(s.Name, s.Age)
}
time.Sleep(2 * time.Second)
}&lt;/pre>
&lt;p>输出如下：&lt;/p>
&lt;pre lang="other" escaped="true">2018/12/12 12:24:19 ################ 错误做法 ##################
2018/12/12 12:24:19 sc 12
2018/12/12 12:24:19 sc 12
2018/12/12 12:24:19 sc 12
2018/12/12 12:24:19 ################ 正确做法 ##################
2018/12/12 12:24:19 sa 10
2018/12/12 12:24:19 sb 11
2018/12/12 12:24:19 sc 12
&lt;/pre>
&lt;p>for k, stu := range stus 变量stu 的地址并不会随着遍历而改变，所以&amp;amp;stu 对应的值始终为stus的最后的元素&lt;/p></description><category domain="https://fatkun.github.io/categories/go/">Go</category></item><item><title>kvm虚拟机virsh常用命令</title><link>https://fatkun.github.io/2019/05/kvm%E8%99%9A%E6%8B%9F%E6%9C%BAvirsh%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4.html</link><guid isPermaLink="true">https://fatkun.github.io/2019/05/kvm%E8%99%9A%E6%8B%9F%E6%9C%BAvirsh%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4.html</guid><pubDate>Wed, 29 May 2019 02:26:43 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;pre lang="bash" escaped="true"># 列出所有虚拟机
virsh --connect qemu:///system list --all
# 停掉虚拟机
virsh --connect qemu:///system shutdown kvm-1
# 删除虚拟机
virsh --connect qemu:///system undefine kvm-1
&lt;/pre>
&lt;p> 
更多命令见：&lt;a href="https://www.centos.bz/2017/07/kvm-virsh-manage-command/">https://www.centos.bz/2017/07/kvm-virsh-manage-command/&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>knative serving 0.6 版本变更</title><link>https://fatkun.github.io/2019/05/knative-serving-0-6-change.html</link><guid isPermaLink="true">https://fatkun.github.io/2019/05/knative-serving-0-6-change.html</guid><pubDate>Sun, 19 May 2019 13:47:33 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;div class="header___O32EY"> &lt;div class="title___3ntsK"> &lt;p> 翻译了一下0.6的版本变更 &lt;/p>
&lt;h1 id="article-title"> 概要 &lt;/h1> &lt;/div>&lt;/div>
&lt;div class="content___2v1LS"> &lt;div class="yuque-doc-content" data-df="lake"> &lt;div class="lake-engine-view"> &lt;h3 id="Nr256"> 新API模型 &lt;/h3>
&lt;p> 我们已经通过了knative serving “v1beta1” API模型&lt;a href="https://docs.google.com/presentation/d/10wuLMFXyol731WKuO5x7lalWrH0A6YVHa4exIERQaQ8/edit#slide=id.p" target="_blank" rel="noopener noreferrer">提议&lt;/a>，这些改变会使得kubernetes用户更容易使用Serving资源，解锁了在knative Service中使用Route，并且可以自己指定Revision名称，开启了GitOps场景。我们争取在接下来几个发布中完成。 &lt;/p>
&lt;p> 在这次发布中，我们移植新的API定义到v1alpha1 API，作为转换到v1beta1（又称lemonade）的第一步。以下不兼容的变更会在0.7+版本实施： &lt;/p>
&lt;ul> &lt;li> Service和Configuration不再支持内嵌Build。 &lt;/li>
&lt;li> Service不支持 manual 模式。 &lt;/li> &lt;/ul>
&lt;p> 你可以通过knative/docs的&lt;a href="https://github.com/knative/docs/blob/master/docs/serving/samples/README.md" target="_blank" rel="noopener noreferrer">例子&lt;/a>来了解新API接口，我们会继续支持大多数v1alpha1的接口直到我们停用它。 &lt;/p>
&lt;h3 id="imY1F"> 彻底改变缩容到零 &lt;/h3>
&lt;p> 我们从根本上改变了缩容到零的机制，新的架构通过Serving资源模型较少的改动，获得职责上更好的分离，并且解决了一些长期存在的问题（一些在这次版本发布，一些将来发布）。看下面内容了解更多。 &lt;/p>
&lt;h3 id="5EeUA"> &lt;a href="https://github.com/knative/docs/blob/204c5b959a269d5c804ff18ec50bbbcefe5b63ca/docs/serving/using-auto-tls.md" target="_blank" rel="noopener noreferrer">自动证书&lt;/a>（alpha，可选） &lt;/h3>
&lt;p> 我们添加了自动证书集成！默认的实现基于 &lt;a href="https://github.com/jetstack/cert-manager" target="_blank" rel="noopener noreferrer">cert-manager&lt;/a> 来提供证书（例如通过Let’s Encrypt），但和Istio插件化类似，你也可以替换cert-manager为其他证书提供系统。当前证书针对每个路由提供，但泛域名将在未来版本支持。这个功能依赖Istio 1.1，并且需要显式的开启。 &lt;/p>
&lt;h3 id="7PdgO"> 控制器解耦 &lt;/h3>
&lt;p> 我们已经开始将Knative中的“可插拔”控制器拆分为它们自己的控制器进程，以便希望替换Knative子系统的人能够更容易地删除绑定的默认实现。例如，要安装Knative Serving但不包含Istio: &lt;/p>
&lt;div id="z7BA2" contenteditable="false" data-card-type="block" data-lake-card="codeblock" data-card-value="data:%7B%22mode%22%3A%22plain%22%2C%22code%22%3A%22kubectl%20apply%20-f%20serving.yaml%20%5C%5C%5Cn%20%20-l%20networking.knative.dev%2Fingress-provider!%3Distio%22%2C%22id%22%3A%22z7BA2%22%7D"> &lt;div data-card-element="body"> &lt;div data-card-element="center"> &lt;div class="lake-codeblock lake-codeblock-plain"> &lt;div class="lake-codeblock-content"> &lt;div class="CodeMirror"> &lt;pre class="cm-s-default">kubectl apply -f serving.yaml \
-l networking.knative.dev/ingress-provider!=istio&lt;/pre> &lt;/div> &lt;/div> &lt;/div> &lt;/div> &lt;/div> &lt;/div>
&lt;p> 注意，由于kubectl不能理解Istio对象的yaml（尽管他们已经被label选择器过滤掉了），我们会看到一些错误。可以安全的忽略找不到 &amp;#8220;networking.istio.io/v1alpha3&amp;#8221; 的 &amp;#8220;Gateway&amp;#8221; 资源。 &lt;/p>
&lt;p> 你也可以用以下命令忽略基于cert-manager实现的自动证书（Auto-TLS）控制器： &lt;/p>
&lt;div id="hc2om" contenteditable="false" data-card-type="block" data-lake-card="codeblock" data-card-value="data:%7B%22mode%22%3A%22plain%22%2C%22code%22%3A%22kubectl%20apply%20-f%20serving.yaml%20%5C%5C%5Cn%20%20-l%20networking.knative.dev%2Fcertificate-provider!%3Dcert-manager%22%2C%22id%22%3A%22hc2om%22%7D"> &lt;div data-card-element="body"> &lt;div data-card-element="center"> &lt;div class="lake-codeblock lake-codeblock-plain"> &lt;div class="lake-codeblock-content"> &lt;div class="CodeMirror"> &lt;pre class="cm-s-default">kubectl apply -f serving.yaml \
-l networking.knative.dev/certificate-provider!=cert-manager&lt;/pre> &lt;/div> &lt;/div> &lt;/div> &lt;/div> &lt;/div> &lt;/div>
&lt;h2 id="gNVUb"> 扩缩容 &lt;/h2>
&lt;p> 把Knative PodAutoscaler（又称KPA） /scale 子资源移出来，变成一个PodScalable 通用类型（“duck type”）。这样可以利用informer缓存，并且扩展的字段可以让ServerlessService（又称SKS）利用PodSpec在未来版本优化。 &lt;/p>
&lt;p> （具体修改见&lt;a href="https://github.com/knative/serving/pull/3889" target="_blank" rel="noopener noreferrer">#3889&lt;/a> ，题外话，之前每次调解都需要使用scale client连接API server读取/scale子资源，用不上缓存） &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> 我们现在确保在Revision缩容到零前，“activator”组件已经接管流量（又称正向切换[positive hand-off], &lt;a href="https://github.com/knative/serving/issues/2949" target="_blank" rel="noopener noreferrer">#2949&lt;/a>）。这个改动开启了Revision能够管理激活。 &lt;/p>
&lt;p> (实现这个是为了解决缩容到0之前，要等待30秒，这个值是个经验值，主要是等待istio切换路由。但我们也不清楚30秒是否足够，还是说可以缩短。目前这个实现是在activator和queue proxy都加一个响应探测的接口，当需要缩容到零时，由pa发起请求探测检查确认是否路由到activator了。但目前的实现还不是完美的，由于istio有很多sidecar，更新路由需要时间，我们只能确定某个sidecar配置更新了) &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> 新的注解 &lt;code>autoscaling.knative.dev/window&lt;/code>, &lt;code>autoscaling.knative.dev/panicWindowPercentage&lt;/code>, and &lt;code>autoscaling.knative.dev/panicThresholdPercentage&lt;/code> 允许用户自定义 KPA 类型的扩缩容敏感性。(&lt;a href="https://github.com/knative/serving/pull/3103" target="_blank" rel="noopener noreferrer">#3103&lt;/a>) &lt;/p>
&lt;p> （译者注：增加配置时间窗口、panic的一些参数） &lt;/p>
&lt;p> 添加activator的链路耗时（tracing）获取更详细的数据，并且可以持续的测量性能数据（&lt;a href="https://github.com/knative/serving/pull/2726" target="_blank" rel="noopener noreferrer">#2726&lt;/a>）。这个解决了&lt;a href="https://github.com/knative/serving/issues/1276" target="_blank" rel="noopener noreferrer">#1276&lt;/a> 并且允许我们去定位性能问题，例如冷启动。 &lt;/p>
&lt;p> 缩短默认transports的空闲超时时间，解决了使用Istio 1.1 lean安装，缩容到零的问题(&lt;a href="https://github.com/knative/serving/issues/3987" target="_blank" rel="noopener noreferrer">#3987&lt;/a>)。原因是当endpoints变更时，通过k8s的service没有断开连接。 &lt;/p>
&lt;p> 解决一个阻止缩容到零的问题 (&lt;a href="https://github.com/knative/serving/pull/3688" target="_blank" rel="noopener noreferrer">#3688&lt;/a>)，解决方法，把enable-scale-to-zero配置加入KPA调解计算中。如果minScaler注解没有设或者设为0，并且enable-scale-to-zero设为false，保留最少一个pod。 &lt;/p>
&lt;p> 修复autoscaler重启时，做出轻率的决定（&lt;a href="https://github.com/knative/serving/pull/3771" target="_blank" rel="noopener noreferrer">#3771&lt;/a>）（在没有指标时不扩缩容）。 &lt;/p>
&lt;h2 id="XaWtj"> 核心API &lt;/h2>
&lt;p> 我们已经批准了v1beta的API定义！如上所述，我们要开始在接下来的几个里程碑实现v1beta1.这次里程碑把v1beta1 API接口作为v1alpha1的子集。 &lt;/p>
&lt;p> 我们改变了执行校验的方式，基于在支持的字段使用“fieldmask”。我们现在会给每个Kubernetes对象创建一个副本（仅限于我们需要的字段），并和原来的对象比较，这样确保我们在Kubernetes API发展中仔细考虑使用哪些资源字段(&lt;a href="https://github.com/knative/serving/issues/3424" target="_blank" rel="noopener noreferrer">#3424&lt;/a>, &lt;a href="https://github.com/knative/serving/pull/3779" target="_blank" rel="noopener noreferrer">#3779&lt;/a>)&lt;strong>。&lt;/strong> 在这基础上，清理了内部API的校验 (&lt;a href="https://github.com/knative/serving/issues/3789" target="_blank" rel="noopener noreferrer">#3789&lt;/a>, &lt;a href="https://github.com/knative/serving/pull/3911" target="_blank" rel="noopener noreferrer">#3911&lt;/a>)。 &lt;/p>
&lt;p> status.domain已经过时，使用status.url 来替换 (&lt;a href="https://github.com/knative/serving/pull/3970" target="_blank" rel="noopener noreferrer">#3970&lt;/a>) 。使用 &lt;code>apis.URL&lt;/code> 类型作为URL status 字段，解决issue &amp;#8220;无法获取服务 URL&amp;#8221; (&lt;a href="https://github.com/knative/serving/issues/1590" target="_blank" rel="noopener noreferrer">#1590&lt;/a>)。 &lt;/p>
&lt;p> 添加可以通过configmap设置默认的cpu、内存request和limit值。并且删除了之前默认的CPU limit，这样可以回退到k8s的默认值，除了由operator特别指定的。(&lt;a href="https://github.com/knative/serving/issues/3550" target="_blank" rel="noopener noreferrer">#3550&lt;/a>, &lt;a href="https://github.com/knative/serving/pull/3912" target="_blank" rel="noopener noreferrer">#3912&lt;/a>) &lt;/p>
&lt;p> 去掉configurationMetadataGeneration label的使用 (&lt;a href="https://github.com/knative/serving/pull/4012" target="_blank" rel="noopener noreferrer">#4012&lt;/a>) ，并完成了我们转向CRD 子资源的最后一个改动(&lt;a href="https://github.com/knative/serving/issues/643" target="_blank" rel="noopener noreferrer">#643&lt;/a>)。 &lt;/p>
&lt;h2 id="y2Y9b"> 网络 &lt;/h2>
&lt;p> 彻底改变了我们缩容到零的方式！这个开启了Revision管理自己启动的语义。需要缩容到零时实现了正向切换，并且增加了autoscaling控制器的同步周期，保持和其他控制器一致。 &lt;/p>
&lt;p> 添加自动配置TLS证书。 &lt;/p>
&lt;p> 停止发布Istio yaml文件。重新分发istio不是我们的本意，并且之前的版本暴露我们的改动-优化了Istio yamls。用户应该请教Istio或者厂商指定的文档来如何获得一个支持knative的Istio版本。 &lt;/p>
&lt;p> 我们已经开始在Service或者Route的子路由中采取扁平命名方案。老的URL目前还可以使用，但新的URL会出现在 &lt;code>status.traffic[*].url&lt;/code> 字段里。 &lt;/p>
&lt;p> 支持安装Istio 1.1 (&lt;a href="https://github.com/knative/serving/issues/3515" target="_blank" rel="noopener noreferrer">#3515&lt;/a>, &lt;a href="https://github.com/knative/serving/pull/3353" target="_blank" rel="noopener noreferrer">#3353&lt;/a>) &lt;/p>
&lt;p> 解决在开启Istio mTLS时，readiness 探测的问题(&lt;a href="https://github.com/knative/serving/pull/4017" target="_blank" rel="noopener noreferrer">#4017&lt;/a>) &lt;/p>
&lt;h2 id="yZHfT"> 监控 &lt;/h2>
&lt;p> Activator也把请求日志记录下来(&lt;a href="https://github.com/knative/serving/issues/3781" target="_blank" rel="noopener noreferrer">#3781&lt;/a>) &lt;/p>
&lt;h2 id="dLxaX"> 测试和发布 &lt;/h2>
&lt;ul> &lt;li> label serving.knative.dev/release: devel需要有发布名字或者数字来替代devel，暴露TAG来填充 &lt;/li>
&lt;li> 总是用istio的HEAD版本来做升级测试，解决在升级降级knative测试遇到的错误 &lt;/li>
&lt;li> 添加额外一致性测试（9个新增的测试），改进现有的一致性测试和v1beta1的覆盖率。 &lt;/li> &lt;/ul>
&lt;h2> 参考内容 &lt;/h2>
&lt;p> 内容翻译自knative/serving release node &lt;a href="https://github.com/knative/serving/releases/tag/v0.6.0">https://github.com/knative/serving/releases/tag/v0.6.0&lt;/a> &lt;/p> &lt;/div> &lt;/div>&lt;/div></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/knative/">Knative</category></item><item><title>minikube在宿主机请求集群IP</title><link>https://fatkun.github.io/2019/02/minikube%E5%9C%A8%E5%AE%BF%E4%B8%BB%E6%9C%BA%E8%AF%B7%E6%B1%82%E9%9B%86%E7%BE%A4ip.html</link><guid isPermaLink="true">https://fatkun.github.io/2019/02/minikube%E5%9C%A8%E5%AE%BF%E4%B8%BB%E6%9C%BA%E8%AF%B7%E6%B1%82%E9%9B%86%E7%BE%A4ip.html</guid><pubDate>Mon, 18 Feb 2019 03:34:47 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>添加路由进行请求
sudo ip route add 172.17.0.0/16 via $(minikube ip)&lt;/p>
&lt;h2 id="来源">来源&lt;/h2>
&lt;p>&lt;a href="https://stackoverflow.com/questions/42268814/routing-an-internal-kubernetes-ip-address-to-the-host-system">https://stackoverflow.com/questions/42268814/routing-an-internal-kubernetes-ip-address-to-the-host-system&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category><category domain="https://fatkun.github.io/tags/minikube/">Minikube</category></item><item><title>【记录】为Kubernetes集群添加用户</title><link>https://fatkun.github.io/2019/02/kubernetes-add-user.html</link><guid isPermaLink="true">https://fatkun.github.io/2019/02/kubernetes-add-user.html</guid><pubDate>Sun, 17 Feb 2019 09:47:39 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>具体按照这篇文章配置 &lt;a href="https://zhuanlan.zhihu.com/p/43237959">https://zhuanlan.zhihu.com/p/43237959&lt;/a>  ，本文用于记录命令
minikube的证书在/var/lib/minikube/certs 目录下，或者/var/lib/localkube/certs，可以通过查询进程kube-controller-manager，查看它的参数cluster-signing-cert-file是什么。&lt;br>
在.minikube目录里面的ca.crt和ca.key也是一样的。&lt;/p>
&lt;pre lang="bash" escaped="true">mkdir /var/lib/minikube/certs/tmp/
cd /var/lib/minikube/certs/tmp/
# 首先需要为此用户创建一个私钥
openssl genrsa -out knative.key 2048
# 接着用此私钥创建一个csr(证书签名请求)文件，其中我们需要在subject里带上用户信息(CN为用户名，O为用户组)
openssl req -new -key knative.key -out knative.csr -subj "/CN=knative/O=MGM"
# 通过集群的CA证书和之前创建的csr文件，来为用户颁发证书
openssl x509 -req -in knative.csr -CA ../ca.crt -CAkey ../ca.key -CAcreateserial -out knative.crt -days 365
&lt;/pre>
&lt;p>生成kubeconfig，具体见 &lt;a href="https://jimmysong.io/kubernetes-handbook/guide/kubectl-user-authentication-authorization.html">jimmysong 的文章&lt;/a>。&lt;/p>
&lt;pre lang="bash" escaped="true"># KUBE_APISERVER 可以进一个容器里面看环境变量
# 如果是用虚拟机启动，执行minikube ip 拿到minikube的ip，加上端口8443。'https://192.168.39.23:8443'，这个地址也可以从.kube/config里的server配置得到
# 设置集群参数
export KUBE_APISERVER="https://10.96.0.1:443"
kubectl config set-cluster kubernetes \
--certificate-authority=../ca.crt \
--embed-certs=true \
--server=${KUBE_APISERVER} \
--kubeconfig=knative.kubeconfig
# 设置客户端认证参数
kubectl config set-credentials knative \
--client-certificate=./knative.crt \
--client-key=./knative.key \
--embed-certs=true \
--kubeconfig=knative.kubeconfig
# 设置上下文参数
kubectl config set-context kubernetes \
--cluster=kubernetes \
--user=knative \
--namespace=default \
--kubeconfig=knative.kubeconfig
# 设置默认上下文
kubectl config use-context kubernetes --kubeconfig=knative.kubeconfig
&lt;/pre>
&lt;p>绑定namespace管理员权限&lt;/p>
&lt;pre lang="bash" escaped="true">kubectl create rolebinding knative-admin-binding --clusterrole=admin --user=knative --namespace=knative-serving&lt;/pre>
&lt;p>使用账号访问&lt;/p>
&lt;pre lang="bash" escaped="true">kubectl --kubeconfig=knative.kubeconfig -n knative-serving get po&lt;/pre>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="https://jimmysong.io/kubernetes-handbook/guide/kubectl-user-authentication-authorization.html">https://jimmysong.io/kubernetes-handbook/guide/kubectl-user-authentication-authorization.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category></item><item><title>查看k8s中某台机器gpu分配</title><link>https://fatkun.github.io/2018/12/%E6%9F%A5%E7%9C%8Bk8s%E4%B8%AD%E6%9F%90%E5%8F%B0%E6%9C%BA%E5%99%A8gpu%E5%88%86%E9%85%8D.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/12/%E6%9F%A5%E7%9C%8Bk8s%E4%B8%AD%E6%9F%90%E5%8F%B0%E6%9C%BA%E5%99%A8gpu%E5%88%86%E9%85%8D.html</guid><pubDate>Thu, 20 Dec 2018 01:57:13 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>分配的任务会记录在这个文件 /var/lib/kubelet/device-plugins/kubelet_internal_checkpoint
里面有个POD_UID，可以在日志里面找，找到对应的pod名称&lt;/p></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/device-plugin/">Device Plugin</category><category domain="https://fatkun.github.io/tags/gpu/">Gpu</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category></item><item><title>Failed to initialize NVML: Unknown Error</title><link>https://fatkun.github.io/2018/11/failed-to-initialize-nvml-unknown-error.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/11/failed-to-initialize-nvml-unknown-error.html</guid><pubDate>Wed, 14 Nov 2018 13:11:20 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在k8s启动的pod内执行nvidia-smi，报错Failed to initialize NVML: Unknown Error，但直接用docker run –rm nvidia/cuda:9.0-base nvidia-smi 却不会报错。
找到这里的文章提示 &lt;a href="https://www.hwchiu.com/gpu-gke.html">https://www.hwchiu.com/gpu-gke.html&lt;/a> 可以用strace来查看系统调用，
能看到有这句
open(“/dev/nvidiactl”, O_RDWR) = -1 EPERM (Operation not permitted)&lt;br>
open(“/dev/nvidiactl”, O_RDONLY) = -1 EPERM (Operation not permitted)
没有权限去读取/dev/nvidiactl，按上面文章提示，加上&lt;/p>
&lt;pre>&lt;span class="line"> securityContext:&lt;/span>
&lt;span class="line"> privileged: true&lt;/span>
但加上&lt;span class="line">privileged会导致/dev下所有显卡暴露，不能加特权。&lt;/span>
最终发现是/etc/systemd/system/kubelet.service 加了--feature-gates CPUManager=true ，具体原因不明为什么有影响。
&lt;/pre></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/gpu/">Gpu</category></item><item><title>k8s 拉取私有仓库失败</title><link>https://fatkun.github.io/2018/09/k8s-errimagepull.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/09/k8s-errimagepull.html</guid><pubDate>Thu, 27 Sep 2018 08:59:02 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>k8s 报错拉取镜像失败 Error response from daemon: pull access denied for istio/citadel, repository does not exist or may require ‘docker login’
 
docker login后，把配置拷贝到以下目录的其中一个。如果是${HOME}/.docker/config.json看说明是要额外设环境变量给kubelet的，可以试试放在/var/lib/kubelet/config.json
 
Docker stores keys for private registries in the $HOME/.dockercfg or $HOME/.docker/config.json file. If you put the same file in the search paths list below, kubelet uses it as the credential provider when pulling images.&lt;/p>
&lt;pre lang="html" escaped="true">{--root-dir:-/var/lib/kubelet}/config.json
{cwd of kubelet}/config.json
${HOME}/.docker/config.json
/.docker/config.json
{--root-dir:-/var/lib/kubelet}/.dockercfg
{cwd of kubelet}/.dockercfg
${HOME}/.dockercfg
/.dockercfg
Note: You may have to set HOME=/root explicitly in your environment file for kubelet.&lt;/pre>
&lt;p>&lt;a href="https://kubernetes.io/docs/concepts/containers/images/">https://kubernetes.io/docs/concepts/containers/images/&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category></item><item><title>knative分析 – controller</title><link>https://fatkun.github.io/2018/08/knative-controller.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/08/knative-controller.html</guid><pubDate>Mon, 06 Aug 2018 12:06:37 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>由于service名称重复，这里会用knative service 和 k8s service区分两者。&lt;/p>
&lt;h1 id="总体流程">总体流程&lt;/h1>
&lt;p>用户创建knative service后，会创建出route和configuration。&lt;br>
然后根据configuration创建revision，根据revision创建deployment启动业务pod。&lt;br>
根据route创建k8s service和istio VirtualService，负责流量如何转发。&lt;/p>
&lt;div data-type="image" data-src="https://github.com/knative/serving/raw/master/docs/spec/images/object_model.png"> &lt;img src="https://github.com/knative/serving/raw/master/docs/spec/images/object_model.png" />&lt;/div>
# controller代码分析 {#controller代码分析}
&lt;h2 id="knative-service-controller">knative service controller&lt;/h2>
&lt;p>监听（knative service，configuration，route）&lt;/p>
&lt;ul>
&lt;li>如果没有Configuration，则会创建一个。如果已存在，会比较然后判断是否需要更新。&lt;/li>
&lt;li>如果没有Route，则会创建一个，如果已存在，比较判断是否需要更新。&lt;/li>
&lt;/ul>
&lt;h2 id="configuration-controller">Configuration controller&lt;/h2>
&lt;p>监听（configuration, revision）&lt;/p>
&lt;ul>
&lt;li>检查是否创建了Revision(Revision名字由 config.Name 和 config.Spec.Generation构成)，如果没有创建则创建一个。
&lt;ul>
&lt;li>如果有config.Spec.Build，会同时创建Build和Revision&lt;/li>
&lt;li>如果存在，则更新状态&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h2 id="revision-controller">Revision controller&lt;/h2>
&lt;p>监听(revision，build，endpoint, deployment, configMap)&lt;/p>
&lt;ul>
&lt;li>如果需要build，检查build的状态&lt;/li>
&lt;li>如果没有build或者build完成后
&lt;ul>
&lt;li>reconcileDeployment, 判断rev.Spec.ServingState状态
&lt;ul>
&lt;li>v1alpha1.RevisionServingStateActive, v1alpha1.RevisionServingStateReserve 活跃或保留状态
&lt;ul>
&lt;li>如果不存在，创建deployment（如果是Reserve状态，把副本设为0）&lt;/li>
&lt;li>如果存在，检查更新deployment&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>v1alpha1.RevisionServingStateRetired 退休状态
&lt;ul>
&lt;li>如果存在，删除deployment&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>reconcileService， 创建或更新k8s service(名称例子：autoscale-go-00000-service)&lt;/li>
&lt;li>reconcileFluentdConfigMap，配置fluentd的configmap&lt;/li>
&lt;li>reconcileAutoscalerDeployment，创建或更新Autoscaler 的deployment&lt;/li>
&lt;li>reconcileAutoscalerService，创建Autoscaler的k8s service&lt;/li>
&lt;li>reconcileVPA，创建或删除VPA&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h2 id="route-controller">Route controller&lt;/h2>
&lt;p>监听（route，Configuration）&lt;/p>
&lt;ul>
&lt;li>reconcilePlaceholderService, 创建同名的k8s service或更新k8s service的ClusterIP&lt;/li>
&lt;li>configureTraffic，尝试根据RouteSpec分配流量，如果找不到目标（例如没有ready状态的Revision，或者状态是Revision）,则不会分配流量。如果流量分配配置好了，会把RouteStatus更新为AllTrafficAssigned = True, 否则设为 False，并在原因里面写明缺少的目标。
&lt;ul>
&lt;li>如果TrafficTarget.RevisionName不为空，判断target是否ready了
&lt;ul>
&lt;li>如果target ready了，创建或更新Istio VirtualService
&lt;ul>
&lt;li>判断target是否active，如果POD还没启动，会添加部分流量到activator里&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>如果TrafficTarget.ConfigurationName不为空，则会从conf里面拿到LatestReadyRevisionName，然后按RevisionName不为空的流程配置
 &lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;pre># istio VirtualService 例子
spec:
gateways:
- knative-shared-gateway.knative-serving.svc.cluster.local
- mesh
hosts:
- '*.helloworld-python.default.example.com'
- helloworld-python.default.example.com
- helloworld-python.default.svc.cluster.local
http:
- appendHeaders:
Knative-Serving-Namespace: default
Knative-Serving-Revision: helloworld-python-00000
x-envoy-upstream-rq-timeout-ms: "0"
match:
- authority:
exact: helloworld-python.default.example.com
- authority:
exact: helloworld-python.default.svc.cluster.local
route:
- destination:
host: activator-service.knative-serving.svc.cluster.local
port:
number: 80
weight: 100
timeout: 60s&lt;/pre></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category><category domain="https://fatkun.github.io/tags/knative/">Knative</category></item><item><title>knative分析 – activator</title><link>https://fatkun.github.io/2018/08/knative-activator.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/08/knative-activator.html</guid><pubDate>Mon, 06 Aug 2018 12:04:51 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="qxxgwm" data-type="h"> 当scale到0时，是怎样唤醒业务容器的？&lt;/h1>
&lt;p data-type="p"> activator就是负责做这个事情的组件。activator做两件事情，一个是负责把pod启动起来，另外一个是把启动中的请求转发给pod。&lt;/p>
&lt;p data-type="p"> &lt;p data-type="p"> 请求是怎么转发到activator的？ &lt;/p>
&lt;p data-type="p"> 当业务pod scale到0的时候，会更新istio VirtualServer，把流量按权重分配给activator。在pod启动ready之后，流量权重又直接指向业务pod，所有revision都ready的情况下，activator不会分配到流量。 &lt;/p>
&lt;p data-type="p"> &lt;p data-type="p"> 唤醒pod是通过更新 revision.Spec.ServingState = v1alpha1.RevisionServingStateActive 状态实现的，controller会根据状态，创建出业务pod和autoscaler。 &lt;/p>
&lt;p data-type="p"> 这里要解决的一个问题是在pod没启动之前，可能会有很多个请求，这里做了限制每个revision只会触发一次。 &lt;/p>
&lt;p data-type="p"> 还有个问题是在pod没ready前，把请求阻塞。 &lt;/p>
&lt;p data-type="p"> activator本身是个HTTP服务，在POD启动的期间，当pod ready之后，会把请求转发到到pod里（通过FQDN域名） &lt;/p>
&lt;div data-type="p"> &lt;/div>
&lt;div data-type="p"> &lt;/div>
&lt;div data-type="p"> &lt;/div>
&lt;h1 id="1b60dl" data-type="h"> 流量转发 &lt;/h1>
&lt;div data-type="p"> &lt;/div>
&lt;div data-type="p"> 以下内容主要来自：&lt;a class="bi-link" href="https://github.com/knative/serving/blob/master/pkg/activator/README.md" target="_blank" rel="noopener">https://github.com/knative/serving/blob/master/pkg/activator/README.md&lt;/a> &lt;/div>
&lt;div data-type="p"> &lt;/div>
&lt;div data-type="p"> 这个图感觉没更新，目前没有看到有用ingress来路由，而是由istio ingress gateway来路由。 &lt;/div>
&lt;div data-type="p"> &lt;/div>
&lt;div data-type="p"> &lt;div data-type="image" data-display="block" data-align="left" data-src="https://cdn.nlark.com/lark/0/2018/png/2023/1533027397839-996997db-e966-4428-a41a-e9dbe232f825.png" data-width="782"> &lt;img src="https://cdn.nlark.com/lark/0/2018/png/2023/1533027397839-996997db-e966-4428-a41a-e9dbe232f825.png" width="782" /> &lt;/div> &lt;/div>
&lt;div data-type="p"> &lt;/div>
&lt;h2 id="q03mkb" data-type="h"> Istio Route Rules Configurations &lt;/h2>
&lt;div data-type="p"> &lt;span data-type="ranges">Knative Serving 使用istio route rules来控制流量（根据Route对象指定的比例分配），如果某个revision因为不活跃变为Reserve状态，会把部分流量转向activator。&lt;/span> &lt;/div>
&lt;div data-type="p"> 下面分三种情况 &lt;/div>
&lt;h3 id="ifipty" data-type="h"> All revisions are active &lt;/h3>
&lt;div data-type="p"> &lt;span data-type="ranges">如果所有revision都是活跃的，activator 不会收到任何流量。&lt;/span> &lt;/div>
&lt;div data-type="p"> &lt;/div>
&lt;div data-type="p"> &lt;div data-type="image" data-display="block" data-align="left" data-src="https://cdn.nlark.com/lark/0/2018/png/2023/1533030224312-c79a3bec-15a4-4d04-bceb-29fa13019e95.png" data-width="528"> &lt;img src="https://cdn.nlark.com/lark/0/2018/png/2023/1533030224312-c79a3bec-15a4-4d04-bceb-29fa13019e95.png" width="528" /> &lt;/div> &lt;/div>
&lt;h3 id="18kegg" data-type="h"> One revision is in Reserve state &lt;/h3>
&lt;div data-type="p"> 如果一个revision是Reserve状态，则会把原本给revision b的流量转发给activator，activator收到请求后，会启动revision b，revision b ready后会把流量导入revision b。后续的流量直接到revision b。 &lt;/div>
&lt;div data-type="p"> &lt;/div>
&lt;div data-type="p"> &lt;div data-type="image" data-display="block" data-align="left" data-src="https://cdn.nlark.com/lark/0/2018/png/2023/1533030284503-bf5220e4-1ce4-47ab-8c81-5bac26f9f3d8.png" data-width="697"> &lt;img src="https://cdn.nlark.com/lark/0/2018/png/2023/1533030284503-bf5220e4-1ce4-47ab-8c81-5bac26f9f3d8.png" width="697" /> &lt;/div> &lt;/div>
&lt;div data-type="p"> &lt;/div>
&lt;h3 id="lqnnql" data-type="h"> Multiple revisions are in Reserve state &lt;/h3>
&lt;div data-type="p"> 如果有两个或两个以上revision是Reserve状态，所有到reserve状态的流量转向activator &lt;/div></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category><category domain="https://fatkun.github.io/tags/knative/">Knative</category></item><item><title>knative分析 – autoscaler</title><link>https://fatkun.github.io/2018/08/knative-autoscaler.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/08/knative-autoscaler.html</guid><pubDate>Mon, 06 Aug 2018 12:00:42 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;div data-type="p"> 文档说目前的实现只是为了快速实现，后期还会修改。&lt;/div>
&lt;div data-type="p">&lt;/div>
&lt;h2 id="pistun" data-type="h"> knative是如何做伸缩容的？&lt;/h2>
&lt;p data-type="p"> 处理伸缩容问题，首先要解决的问题是根据什么指标判断伸缩容？cpu、内存、请求数？这里knative使用的是请求数。&lt;/p>
&lt;p data-type="p"> 其次是伸缩多少的问题。&lt;/p>
&lt;p data-type="p"> knative的伸缩是依赖修改deployment的replicate数实现的。&lt;/p>
&lt;div data-type="p">&lt;/div>
## 如何采集请求数？
&lt;p data-type="p"> 启动revision的pod时，也会启动一个autoscaler（一个knative revision只启动一个autoscaler），autoscaler自己本身也会scale到0，用于接收请求数统计和处理伸缩容。&lt;/p>
&lt;p data-type="p"> 业务pod中，会注入queue-proxy sidecard，用于接收请求，在这里会统计并发数，每秒向autoscaler汇报，接收到的请求会转发给业务container。&lt;/p>
&lt;p data-type="p"> 注：单租户模式下一个revision启动一个autoscaler，多租户共用一个autoscaler&lt;/p>
&lt;div data-type="p">&lt;/div>
&lt;h2 id="5nvoev" data-type="h"> 计算需要pod的个数？&lt;/h2>
&lt;p data-type="p"> autoscaler接收到并发统计的时候，会根据算法计算需要的pod个数。&lt;/p>
&lt;p data-type="p"> 算法中有两种模式，分别是panic和stable模式，一个是短时间，一个是长时间，为了解决短时间内请求突增的场景，需要快速扩容。&lt;/p>
&lt;p data-type="p"> &lt;a class="bi-link" href="https://github.com/knative/docs/blob/master/serving/samples/autoscale-go/README.md#algorithm" target="_blank" rel="noopener">文档中描述&lt;/a>&lt;span data-type="ranges">的算法是，默认的target concurency是1，如果一个revision 35QPS，每个请求花费0.25秒，Knative Serving 觉得需要 9 个 pod。 &lt;/span>&lt;/p>
ceil(35 * .25) = ceil(8.75) = 9
&lt;div data-type="p">&lt;/div>
&lt;h4 id="xsewfu" data-type="h"> Stable Mode（稳定模式）&lt;/h4>
&lt;p data-type="p"> &lt;span data-type="ranges">在稳定模式下，Autoscaler 根据每个pod期望的并发来调整Deployment的副本个数。根据每个pod在60秒窗口内的平均并发来计算，而不是根据现有副本个数计算，因为pod的数量增加和pod变为可服务和提供指标数据有一定时间间隔。&lt;/span>&lt;/p>
&lt;div data-type="p">&lt;/div>
&lt;h4 id="gysqiy" data-type="h"> Panic Mode （恐慌模式）&lt;/h4>
&lt;p data-type="p"> &lt;span data-type="ranges">Panic时间窗口默认是6秒，如果在6秒内达到2倍期望的并发，则转换到恐慌模式下。在恐慌模式下，Autoscaler根据这6秒的时间窗口计算，这样更能及时的响应突发的流量请求。每2秒调整Deployment的副本数达到想要的pod个数（或者最大10倍当前pod的数量），为了避免pod数量频繁变动，在恐慌模式下只能增加，不会减少。60秒后会恢复回稳定模式。&lt;/span>&lt;/p>
&lt;div data-type="p">&lt;/div>
&lt;h1 id="6dz5gx" data-type="h"> &lt;span data-type="ranges">autoscaler 单租户图&lt;/span>&lt;/h1>
&lt;pre lang="other" escaped="true">+---------------------+
| ROUTE |
| |
| +-------------+ |
| | Istio Route |---------------+
| +-------------+ | |
| | | |
+---------|-----------+ |
| |
| |
| inactive | active
| route | route
| |
| |
| +------|------------------------------------+
V watch | V |
+-----------+ first | +- ----+ create +------------+ |
| Activator |-------------&amp;gt;| Pods |&amp;lt;----------| Deployment | |
+-----------+ | +------+ +------------+ |
| | | ^ |
| activate | | | resize |
+---------------&amp;gt;| | | |
| | metrics +---------------+ |
| +--------------&amp;gt;| Single-tenant | |
| | Autoscaler | |
| +---------------+ |
| REVISION |
+-------------------------------------------+&lt;/pre>
&lt;h1 id="dq5srw" data-type="h"> 模式&lt;/h1>
&lt;pre lang="other" escaped="true">const (
  // 每个pod实例同时只处理一个请求
RevisionRequestConcurrencyModelSingle RevisionRequestConcurrencyModelType = "Single"
// 每个pod实例同时处理多个请求
RevisionRequestConcurrencyModelMulti RevisionRequestConcurrencyModelType = "Multi"
)&lt;/pre>
&lt;h1 id="grc3yo" data-type="h"> 配置&lt;/h1>
&lt;div data-type="p"> &lt;pre lang="other" escaped="true">apiVersion: v1
kind: ConfigMap
metadata:
name: config-autoscaler
namespace: knative-serving
data:
# Static parameters:
&lt;h1 id="期望每个pod并发请求数">期望每个pod并发请求数&lt;/h1>
&lt;p>multi-concurrency-target: &amp;quot;1.0&amp;quot;&lt;/p>
&lt;h1 id="如果是单个并发值要接近10">如果是单个并发，值要接近1.0&lt;/h1>
&lt;p>single-concurrency-target: &amp;quot;0.9&amp;quot;&lt;/p>
&lt;h1 id="stable窗口时间计算平均并发会用到如果进入panic模式后经过stable窗口时间也会恢复stable">stable窗口时间，计算平均并发会用到。如果进入panic模式后，经过stable窗口时间也会恢复stable&lt;/h1>
&lt;p>stable-window: &amp;quot;60s&amp;quot;&lt;/p>
&lt;h1 id="如果平均并发在panic窗口时间内达到2倍目标并发autoscaler进入panic模式">如果平均并发在panic窗口时间内达到2倍目标并发，autoscaler进入panic模式。&lt;/h1>
&lt;h1 id="在panic模式下自动伸缩按在panic窗口时间的平均并发来操作">在panic模式下，自动伸缩按在panic窗口时间的平均并发来操作。&lt;/h1>
&lt;p>panic-window: &amp;quot;6s&amp;quot;&lt;/p>
&lt;h1 id="最大增长比例每次调整会根据并发计算增长比例最大增长不超过这个值">最大增长比例，每次调整会根据并发计算增长比例，最大增长不超过这个值&lt;/h1>
&lt;p>max-scale-up-rate: &amp;quot;10&amp;quot;&lt;/p>
&lt;h1 id="计算并发值的参数每一段时间得到最大并发作为一个bucket最后汇报的时候">计算并发值的参数，每一段时间得到最大并发，作为一个bucket，最后汇报的时候，&lt;/h1>
&lt;h1 id="平均并发--各个bucket最大并发之和--总bucket数汇报间隔是1秒hard-coded">平均并发 = 各个bucket最大并发之和 / 总bucket数，汇报间隔是1秒（hard coded）&lt;/h1>
&lt;p>concurrency-quantum-of-time: &amp;quot;100ms&amp;quot;&lt;/p>
&lt;h1 id="是否开启缩容到0">是否开启缩容到0&lt;/h1>
&lt;p>enable-scale-to-zero: &amp;quot;true&amp;quot;&lt;/p>
&lt;h1 id="实验性开启垂直扩容">实验性：开启垂直扩容&lt;/h1>
&lt;h1 id="requires-a-vpa-installation-eg-third_partyvpainstall-vpash">Requires a VPA installation (e.g. ./third_party/vpa/install-vpa.sh)&lt;/h1>
&lt;p>enable-vertical-pod-autoscaling: &amp;quot;false&amp;quot;&lt;/p>
&lt;h1 id="如果开启了enable-vertical-pod-autoscaling这个值就会替代multi-concurrency-target">如果开启了enable-vertical-pod-autoscaling，这个值就会替代multi-concurrency-target，&lt;/h1>
&lt;h1 id="如果成熟了后期会变成默认值">如果成熟了后期会变成默认值&lt;/h1>
&lt;p>vpa-multi-concurrency-target: &amp;quot;10.0&amp;quot;&lt;/p>
&lt;h1 id="多长时间调整一次">多长时间调整一次&lt;/h1>
&lt;p>tick-interval: &amp;quot;2s&amp;quot;&lt;/p>
&lt;h1 id="dynamic-parameters-take-effect-when-config-map-is-updated">Dynamic parameters (take effect when config map is updated):&lt;/h1>
&lt;h1 id="空闲多长时间缩容到0">空闲多长时间缩容到0&lt;/h1>
&lt;p>scale-to-zero-threshold: &amp;quot;5m&amp;quot;&lt;/pre>&lt;/div>&lt;/p>
&lt;h1 id="nbe3dr" data-type="h"> 参考&lt;/h1>
&lt;div data-type="p"> &lt;a class="bi-link" href="https://github.com/knative/serving/blob/master/docs/scaling/DEVELOPMENT.md" target="_blank" rel="noopener">https://github.com/knative/serving/blob/master/docs/scaling/DEVELOPMENT.md&lt;/a> Autoscaling&lt;/div></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category><category domain="https://fatkun.github.io/tags/knative/">Knative</category></item><item><title>使用MultipleOutputs报File already exists错误</title><link>https://fatkun.github.io/2018/08/use-multipleoutputs-file-already-exists.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/08/use-multipleoutputs-file-already-exists.html</guid><pubDate>Sat, 04 Aug 2018 04:21:53 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在reduce任务看到第一个任务因为某些原因失败了，但后续的任务都一起失败，后续的任务报File already exists错误。
原因是MultipleOutputs.write的时候可以指定输出的别名或者绝对路径，如果写的是绝对路径，目录会马上生效，MR的output commit机制会失效（先输出到临时目录，然后最后移动回正式目录）。当任务第一次失败后，第二次重试还是存在着那个文件会报错退出。
MR会在任务失败的时候清理输出，但仅限于taskAttemptPath，不会清理其他产生的文件。&lt;/p>
&lt;pre lang="java" escaped="true">@Private
public void abortTask(TaskAttemptContext context, Path taskAttemptPath) throws IOException {
if (hasOutputPath()) {
context.progress();
if(taskAttemptPath == null) {
taskAttemptPath = getTaskAttemptPath(context);
}
FileSystem fs = taskAttemptPath.getFileSystem(context.getConfiguration());
if(!fs.delete(taskAttemptPath, true)) {
LOG.warn("Could not delete "+taskAttemptPath);
}
} else {
LOG.warn("Output Path is null in abortTask()");
}
}&lt;/pre>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>想办法在第二次跑之前清理文件。最终输出的文件名是用户指定路径+数字，那个数字不太好从哪里获取到，另外如果开了推测执行，推测执行的任务也会失败。
解决的方法还是不要用绝对路径输出，按key输出文件，最后如果需要分开目录的时候再在client那边把文件移动过去。
 &lt;/p>
&lt;h2 id="相关issue">相关issue&lt;/h2>
&lt;p>这个issue只是指出如果用绝对路径，output committing的机制会失效，加了个警告注释&lt;br>
&lt;a href="https://issues.apache.org/jira/browse/MAPREDUCE-6357">https://issues.apache.org/jira/browse/MAPREDUCE-6357&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category></item><item><title>在容器外访问k8s apiserver</title><link>https://fatkun.github.io/2018/07/%E5%9C%A8%E5%AE%B9%E5%99%A8%E5%A4%96%E8%AE%BF%E9%97%AEk8s-apiserver.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/07/%E5%9C%A8%E5%AE%B9%E5%99%A8%E5%A4%96%E8%AE%BF%E9%97%AEk8s-apiserver.html</guid><pubDate>Fri, 20 Jul 2018 01:59:16 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>使用 &lt;code class="language-shell" data-lang="shell">kubectl proxy --port=8080 &amp;amp;&lt;/code>
或者使用token&lt;/p>
&lt;pre lang="bash" escaped="true">$ APISERVER=$(kubectl config view --minify | grep server | cut -f 2- -d ":" | tr -d " ")
$ TOKEN=$(kubectl describe secret $(kubectl get secrets | grep ^default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d " ")
$ curl $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
{
"kind": "APIVersions",
"versions": [
"v1"
],
"serverAddressByClientCIDRs": [
{
"clientCIDR": "0.0.0.0/0",
"serverAddress": "10.0.1.149:443"
}
]
}&lt;/pre>
&lt;p> 
具体见文档
&lt;a href="https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#without-kubectl-proxy-post-v13x">https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#without-kubectl-proxy-post-v13x&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category></item><item><title>hdfs acl 授权</title><link>https://fatkun.github.io/2018/06/hdfs-acl-%E6%8E%88%E6%9D%83.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/06/hdfs-acl-%E6%8E%88%E6%9D%83.html</guid><pubDate>Fri, 15 Jun 2018 03:35:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>hdfs dfs -setfacl -m default:user:user1111:rwx /tmp/xxx
hdfs dfs -setfacl -m user:user1111:rwx /tmp/xxx
 &lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/acl/">Acl</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>cuDNN下载链接</title><link>https://fatkun.github.io/2018/06/cudnn%E4%B8%8B%E8%BD%BD%E9%93%BE%E6%8E%A5.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/06/cudnn%E4%B8%8B%E8%BD%BD%E9%93%BE%E6%8E%A5.html</guid><pubDate>Sun, 10 Jun 2018 11:00:04 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p class="title"> cuDNN需要注册才能下载，实际上可以从nvidia的gitlab上找到下载地址&lt;/p>
&amp;nbsp;
https://gitlab.com/nvidia/cuda/tree/centos7/9.0
&amp;nbsp;
比如这个地址：http://developer.download.nvidia.com/compute/redist/cudnn/v7.1.4/cudnn-9.0-linux-x64-v7.1.tgz</description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>linux系统镜像</title><link>https://fatkun.github.io/2018/05/linux%E7%B3%BB%E7%BB%9F%E9%95%9C%E5%83%8F.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/05/linux%E7%B3%BB%E7%BB%9F%E9%95%9C%E5%83%8F.html</guid><pubDate>Tue, 08 May 2018 07:19:58 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>debian&lt;/p>
&lt;pre lang="bash" escaped="true">sed -i "s#deb.debian.org#mirrors.aliyun.com#g" /etc/apt/sources.list
sed -i "s#security.debian.org#mirrors.aliyun.com#g" /etc/apt/sources.list&lt;/pre>
&lt;p>ubuntu&lt;/p>
&lt;pre lang="bash" escaped="true">sed -i "s#archive.ubuntu.com#mirrors.aliyun.com#g" /etc/apt/sources.list
sed -i "s#security.ubuntu.com#mirrors.aliyun.com#g" /etc/apt/sources.list
&lt;/pre>
&lt;p>alpline&lt;/p>
&lt;pre escaped="true" lang="html">sed -i "s#dl-cdn.alpinelinux.org#mirrors.aliyun.com#g" /etc/apk/repositories&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/linux/">Linux</category></item><item><title>k8s安装zookeeper</title><link>https://fatkun.github.io/2018/04/k8s-install-zookeeper.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/04/k8s-install-zookeeper.html</guid><pubDate>Mon, 30 Apr 2018 09:53:32 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>使用命令安装，里面使用了gcr的镜像换一下
kubectl create -f \&lt;br>
&lt;a href="https://raw.githubusercontent.com/kubernetes/contrib/master/statefulsets/zookeeper/zookeeper.yaml">https://raw.githubusercontent.com/kubernetes/contrib/master/statefulsets/zookeeper/zookeeper.yaml&lt;/a>
但装完之后，使用zkCli.sh 无法连接，检查配置，发现server配置的hostname不能互相连接，需要使用全域名访问
修改zkGenConfig.sh文件，重新打包&lt;/p>
&lt;pre escaped="true" lang="bash">HOST_DOMAIN=`hostname -a`
function print_servers() {
for (( i=1; i&amp;lt;=$ZK_REPLICAS; i++ ))
do
echo "server.$i=$NAME-$((i-1)).${HOST_DOMAIN#*.}:$ZK_SERVER_PORT:$ZK_ELECTION_PORT"
done
}
&lt;/pre>
&lt;pre escaped="true" lang="bash">FROM xxxxxxxxxxxxx/google_samples/k8szk:v3
COPY zkGenConfig.sh /opt/zookeeper/bin/
RUN chmod +x /usr/bin/zkGenConfig.sh
&lt;/pre></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/k8s/">K8s</category></item><item><title>This is a hidden post.</title><link>https://fatkun.github.io/post/test/hidden-post/</link><guid isPermaLink="true">https://fatkun.github.io/post/test/hidden-post/</guid><pubDate>Thu, 08 Mar 2018 17:40:19 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>This post is hidden from the home page.&lt;/p>
&lt;p>But you can see it in archives, rss or other pages.&lt;/p></description></item><item><title>docker pull 访问registry过程</title><link>https://fatkun.github.io/2018/01/docker-pull.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/01/docker-pull.html</guid><pubDate>Sun, 28 Jan 2018 03:01:28 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>执行 docker pull daocloud.io/busybox 之后
 &lt;/p>
&lt;table> &lt;tr> &lt;td style="width: 16px;"> 步骤 &lt;/td>
&lt;td> 请求 &lt;/td>
&lt;td style="width: 1113px;"> 返回 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 16px;"> 1 &lt;/td>
&lt;td style="width: 1113px;"> GET https://daocloud.io/v2/ HTTP/1.1 &lt;/td>
&lt;td style="width: 1113px;"> HTTP/1.1 401 Unauthorized&lt;br /> Server: nginx/1.11.13&lt;br /> Date: Sun, 28 Jan 2018 02:35:17 GMT&lt;br /> Content-Type: application/json; charset=utf-8&lt;br /> Content-Length: 87&lt;br /> Connection: close&lt;br /> Docker-Distribution-Api-Version: registry/2.0&lt;br /> Www-Authenticate: Bearer realm=&amp;#8221;https://daohub-auth.daocloud.io/auth&amp;#8221;,service=&amp;#8221;daocloud.io&amp;#8221;&lt;br /> X-Content-Type-Options: nosniff{&amp;#8220;errors&amp;#8221;:[{&amp;#8220;code&amp;#8221;:&amp;#8221;UNAUTHORIZED&amp;#8221;,&amp;#8221;message&amp;#8221;:&amp;#8221;authentication required&amp;#8221;,&amp;#8221;detail&amp;#8221;:null}]} &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 16px;"> 2 &lt;/td>
&lt;td style="width: 1113px;"> GET https://daohub-auth.daocloud.io/auth?scope=repository%3Abusybox%3Apull&amp;service=daocloud.io HTTP/1.1 &lt;/td>
&lt;td style="width: 1113px;"> HTTP/1.1 200 OK&lt;br /> Server: nginx/1.11.6&lt;br /> Date: Sun, 28 Jan 2018 02:35:17 GMT&lt;br /> Content-Type: application/json&lt;br /> Content-Length: 570&lt;br /> Connection: close&lt;br /> X-Qequest-Time: 0.025{&amp;#8220;token&amp;#8221;:&amp;#8221;eyJ0eXAiOiJKV1QiL省略_J0Mzfs&amp;#8221;} &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 16px;"> 3 &lt;/td>
&lt;td style="width: 1113px;"> GET https://daocloud.io/v2/busybox/manifests/latest HTTP/1.1&lt;/p>
&lt;pre>&lt;code> &amp;lt;p&amp;gt; Authorization: Bearer eyJ0eXAiOiJKV1QiL省略_J0Mzfs&amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 1113px;&amp;quot;&amp;gt; HTTP/1.1 200 OK&amp;lt;br /&amp;gt; Server: nginx/1.11.13&amp;lt;br /&amp;gt; Date: Sun, 28 Jan 2018 02:35:18 GMT&amp;lt;br /&amp;gt; Content-Type: application/vnd.docker.distribution.manifest.v2+json&amp;lt;br /&amp;gt; Content-Length: 527&amp;lt;br /&amp;gt; Connection: close&amp;lt;br /&amp;gt; Docker-Content-Digest: sha256:4cee1979ba0bf7db9fc5d28fb7b798ca69ae95a47c5fecf46327720df4ff352d&amp;lt;br /&amp;gt; Docker-Distribution-Api-Version: registry/2.0&amp;lt;br /&amp;gt; Etag: &amp;amp;#8220;sha256:4cee1979ba0bf7db9fc5d28fb7b798ca69ae95a47c5fecf46327720df4ff352d&amp;amp;#8221;&amp;lt;br /&amp;gt; X-Content-Type-Options: nosniff{&amp;lt;br /&amp;gt; &amp;amp;#8220;schemaVersion&amp;amp;#8221;: 2,&amp;lt;br /&amp;gt; &amp;amp;#8220;mediaType&amp;amp;#8221;: &amp;amp;#8220;application/vnd.docker.distribution.manifest.v2+json&amp;amp;#8221;,&amp;lt;br /&amp;gt; &amp;amp;#8220;config&amp;amp;#8221;: {&amp;lt;br /&amp;gt; &amp;amp;#8220;mediaType&amp;amp;#8221;: &amp;amp;#8220;application/vnd.docker.container.image.v1+json&amp;amp;#8221;,&amp;lt;br /&amp;gt; &amp;amp;#8220;size&amp;amp;#8221;: 1497,&amp;lt;br /&amp;gt; &amp;amp;#8220;digest&amp;amp;#8221;: &amp;amp;#8220;sha256:5b0d59026729b68570d99bc4f3f7c31a2e4f2a5736435641565d93e7c25bd2c3&amp;amp;#8221;&amp;lt;br /&amp;gt; },&amp;lt;br /&amp;gt; &amp;amp;#8220;layers&amp;amp;#8221;: [&amp;lt;br /&amp;gt; {&amp;lt;br /&amp;gt; &amp;amp;#8220;mediaType&amp;amp;#8221;: &amp;amp;#8220;application/vnd.docker.image.rootfs.diff.tar.gzip&amp;amp;#8221;,&amp;lt;br /&amp;gt; &amp;amp;#8220;size&amp;amp;#8221;: 723070,&amp;lt;br /&amp;gt; &amp;amp;#8220;digest&amp;amp;#8221;: &amp;amp;#8220;sha256:57310166fe88e0dc63a80ca5c219283a932db0f3969712e2f8a86ada143bf566&amp;amp;#8221;&amp;lt;br /&amp;gt; }&amp;lt;br /&amp;gt; ]&amp;lt;br /&amp;gt; } &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;width: 16px;&amp;quot;&amp;gt; 4 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 1113px;&amp;quot;&amp;gt; GET https://daocloud.io/v2/busybox/blobs/&amp;lt;br /&amp;gt; sha256:5b0d59026729b68570d99bc4f3f7c31a2e4f2a5736435641565d93e7c25bd2c3 HTTP/1.1&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; Authorization: Bearer eyJ省略&amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 1113px;&amp;quot;&amp;gt; HTTP/1.1 307 Temporary Redirect&amp;lt;br /&amp;gt; Server: nginx/1.11.13&amp;lt;br /&amp;gt; Date: Sun, 28 Jan 2018 02:35:18 GMT&amp;lt;br /&amp;gt; Content-Type: application/octet-stream&amp;lt;br /&amp;gt; Content-Length: 311&amp;lt;br /&amp;gt; Connection: close&amp;lt;br /&amp;gt; Docker-Distribution-Api-Version: registry/2.0&amp;lt;br /&amp;gt; Location: http://daohub.ufile.ucloud.com.cn/docker/registry/v2/blobs/&amp;lt;br /&amp;gt; sha256/5b/5b0d59026729b68570d99bc4f3f7c31a2e4f2a5736435641565d93e7c25bd2c3/data?Expires=1517107218&amp;amp;Signature=Q72RCd%省略%3D&amp;amp;UCloudPublicKey=mhEYuIyt6tZwLlE省略Blg%2Bc&amp;lt;br /&amp;gt; X-Content-Type-Options: nosniff&amp;amp;nbsp; &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;width: 16px;&amp;quot;&amp;gt; 5 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 1113px;&amp;quot;&amp;gt; GET http://daohub.ufile.ucloud.com.cn/docker/registry/v2/blobs/&amp;lt;br /&amp;gt; sha256/5b/5b0d59026729b68570d99bc4f3f7c31a2e4f2a5736435641565d93e7c25bd2c3/data?Expires=1517107218&amp;amp;Signature=Q72RCd%省略%3D&amp;amp;UCloudPublicKey=mhEYuIyt6tZwLlE省略Blg%2Bc HTTP/1.1 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 1113px;&amp;quot;&amp;gt; 返回具体文件内容 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&amp;lt;/tbody&amp;gt; &amp;lt;/table&amp;gt;&lt;/code>&lt;/pre></description><category domain="https://fatkun.github.io/categories/docker/">Docker</category><category domain="https://fatkun.github.io/tags/docker/">Docker</category><category domain="https://fatkun.github.io/tags/registry/">Registry</category></item><item><title>在win10启动minikube</title><link>https://fatkun.github.io/2018/01/%E5%9C%A8win10%E5%90%AF%E5%8A%A8minikube.html</link><guid isPermaLink="true">https://fatkun.github.io/2018/01/%E5%9C%A8win10%E5%90%AF%E5%8A%A8minikube.html</guid><pubDate>Sat, 13 Jan 2018 13:18:34 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;blockquote class="wp-embedded-content" data-secret="1bUZi1A9eJ"> &lt;p> &lt;a href="https://blogs.msdn.microsoft.com/wasimbloch/2017/01/23/setting-up-kubernetes-on-windows10-laptop-with-minikube/">Setting up Kubernetes on Windows10 Laptop with Minikube&lt;/a> &lt;/p>&lt;/blockquote>
&lt;p>如果建虚拟交换机提示权限失败，使用管理员权限开启hyper-v。如果提示一般性拒绝，试一下把其他的虚拟网卡都卸载掉。
一定要指定虚拟网卡&lt;/p>
&lt;pre lang="bash" escaped="true">minikube.exe start --kubernetes-version="v1.8.0" --vm-driver="hyperv" --memory=1024 --hyperv-virtual-switch="myvnet" --v=7 --alsologtostderr&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/docker/">Docker</category></item><item><title>在docker里无法用jinfo</title><link>https://fatkun.github.io/2017/12/%E5%9C%A8docker%E9%87%8C%E6%97%A0%E6%B3%95%E7%94%A8jinfo.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/12/%E5%9C%A8docker%E9%87%8C%E6%97%A0%E6%B3%95%E7%94%A8jinfo.html</guid><pubDate>Sun, 31 Dec 2017 13:23:10 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在命令里加参数&lt;/p>
&lt;pre lang="bash" escaped="true">docker run --cap-add=SYS_PTRACE alpine sh -c 'apk add -U strace &amp;&amp; strace echo'&lt;/pre>
&lt;p>或者在compose里某个service里面加&lt;/p>
&lt;pre lang="bash" escaped="true">cap_add:
  - SYS_PTRACE&lt;/pre>
&lt;p> 
&lt;a href="https://jarekprzygodzki.wordpress.com/2016/12/19/jvm-in-docker-and-ptrace_attach/">JVM in Docker and PTRACE_ATTACH&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/docker/">Docker</category></item><item><title>cloudera manager在下载日志返回502 BAD_GATEWAY错误</title><link>https://fatkun.github.io/2017/12/cloudera-manager%E5%9C%A8%E4%B8%8B%E8%BD%BD%E6%97%A5%E5%BF%97%E8%BF%94%E5%9B%9E502-bad_gateway%E9%94%99%E8%AF%AF.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/12/cloudera-manager%E5%9C%A8%E4%B8%8B%E8%BD%BD%E6%97%A5%E5%BF%97%E8%BF%94%E5%9B%9E502-bad_gateway%E9%94%99%E8%AF%AF.html</guid><pubDate>Tue, 26 Dec 2017 10:00:52 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>下载日志是通过status_server.py的download_log方法进行的
/usr/lib64/cmf/agent/build/env/lib/python2.6/site-packages/cmf-5.13.1-py2.6.egg/cmf/status_server.py
如果日志目录包含以下开头就禁止下载&lt;/p>
&lt;pre escaped="true" lang="python"># Simple blacklist of path prefixes that are not reasonable for log locations
path_blacklist = [ "/boot/", "/etc/", "/usr/", "/lib/", "/lib64/", "/home/",
"/root/", "/sys/", "/proc/", "/dev/", "/bin/", "/sbin/" ]
fd = self._validate_and_open(new_log_file_path,
restrict_to_parent_path=False,
path_blacklist=path_blacklist)&lt;/pre></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/cloudera/">Cloudera</category></item><item><title>使用docker部署hadoop hdfs</title><link>https://fatkun.github.io/2017/12/deploy-hadoop-hdfs-use-docker.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/12/deploy-hadoop-hdfs-use-docker.html</guid><pubDate>Sun, 24 Dec 2017 10:15:12 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>先创建一个网络&lt;/p>
&lt;pre escaped="true" lang="bash">docker network create hadoop&lt;/pre>
&lt;p>把本机新建一个目录hadoop，以下xml保存为docker-compose.yml&lt;/p>
&lt;pre escaped="true" lang="yml">version: "3"
services:
namenode:
image: uhopper/hadoop-namenode
hostname: namenode1
container_name: namenode1
# 要和networks保持一致，这样能够自动发现其他机器（如datanode1.hadoop）
domainname: hadoop
ports:
- "50070:50070"
volumes:
- ./nn:/hadoop/dfs/name
environment:
- HDFS_CONF_dfs_replication=1
- CLUSTER_NAME=ns1
datanode1:
image: uhopper/hadoop-datanode
hostname: datanode1
container_name: datanode1
domainname: hadoop
volumes:
- ./dn1:/hadoop/dfs/data
environment:
- HDFS_CONF_dfs_replication=1
- CLUSTER_NAME=ns1
- CORE_CONF_fs_defaultFS=hdfs://namenode1:8020
networks:
default:
# 使用外部网络（如果不加这个，启动时会自动创建一个${目录名}_${name}的网络）
external:
name: hadoop
&lt;/pre>
&lt;p>使用docker-compose up -d 启动，可以访问 http://127.0.0.1:50070 查看namenode页面
另外可以进入container里面&lt;/p>
&lt;pre escaped="true" lang="bash">docker exec -it namenode1 bash&lt;/pre>
&lt;p>尝试执行一下hdfs dfs -put /etc/issue /
如果报错&lt;/p>
&lt;pre escaped="true" lang="java">17/12/24 08:39:15 WARN hdfs.DFSClient: DataStreamer Exception
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Net.java:101)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:622)
at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:192)
at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:531)
at org.apache.hadoop.hdfs.DFSOutputStream.createSocketForPipeline(DFSOutputStream.java:1537)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.createBlockOutputStream(DFSOutputStream.java:1313)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.nextBlockOutputStream(DFSOutputStream.java:1266)
at org.apache.hadoop.hdfs.DFSOutputStream$DataStreamer.run(DFSOutputStream.java:449)&lt;/pre>
&lt;p>请检查网络配置是否正确，ping datanode1.hadoop 是否返回IP&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/docker/">Docker</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category></item><item><title>docker常用命令</title><link>https://fatkun.github.io/2017/12/docker-command.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/12/docker-command.html</guid><pubDate>Sun, 24 Dec 2017 07:50:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;pre escaped="true" lang="bash"># 指定子网
docker network create --subnet=172.18.0.0/16 hadoop
# attach进container里面，i参数表示交互，t参数表示tty
docker exec -i -t &amp;lt;CONTAINER_ID&amp;gt; bash&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/docker/">Docker</category></item><item><title>hbase备份文章</title><link>https://fatkun.github.io/2017/12/hbase%E5%A4%87%E4%BB%BD%E6%96%87%E7%AB%A0.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/12/hbase%E5%A4%87%E4%BB%BD%E6%96%87%E7%AB%A0.html</guid><pubDate>Fri, 08 Dec 2017 08:32:10 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> &lt;/p>
&lt;p class="csdn_top"> HBase备份之ExportSnapshot或CopyTable&lt;/p>
&lt;http://blog.csdn.net/iam333/article/details/38538073></description><category domain="https://fatkun.github.io/categories/hbase/">Hbase</category></item><item><title>hg to git fastexport 中文乱码问题</title><link>https://fatkun.github.io/2017/11/hg-to-git-fastexport-%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/11/hg-to-git-fastexport-%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98.html</guid><pubDate>Tue, 28 Nov 2017 07:20:49 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>使用-fe指定编码
sh d:/workspace/fast-export/hg-fast-export.sh -r ../ssp-dev –force -fe gbk&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>HIVE-13936 Hive windowing function 导致 reduce OOM</title><link>https://fatkun.github.io/2017/11/hive-windowing-function-lead-reduce-oom.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/11/hive-windowing-function-lead-reduce-oom.html</guid><pubDate>Thu, 09 Nov 2017 06:10:06 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这个是row_number &lt;a href="https://issues.apache.org/jira/browse/HIVE-13936">https://issues.apache.org/jira/browse/HIVE-13936&lt;/a>
&lt;a href="http://grokbase.com/t/hive/user/148m45m9ge/help-needed-out-of-memory-with-windowing-functions">http://grokbase.com/t/hive/user/148m45m9ge/help-needed-out-of-memory-with-windowing-functions&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/bug/">Bug</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category></item><item><title>HIVE-11315 hive大语句编译缓慢</title><link>https://fatkun.github.io/2017/11/hive-11315-hive%E5%A4%A7%E8%AF%AD%E5%8F%A5%E7%BC%96%E8%AF%91%E7%BC%93%E6%85%A2.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/11/hive-11315-hive%E5%A4%A7%E8%AF%AD%E5%8F%A5%E7%BC%96%E8%AF%91%E7%BC%93%E6%85%A2.html</guid><pubDate>Fri, 03 Nov 2017 08:54:11 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;a href="https://issues.apache.org/jira/browse/HIVE-11315">https://issues.apache.org/jira/browse/HIVE-11315&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category></item><item><title>php curl ssl错误</title><link>https://fatkun.github.io/2017/10/php-curl-ssl%E9%94%99%E8%AF%AF.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/10/php-curl-ssl%E9%94%99%E8%AF%AF.html</guid><pubDate>Fri, 20 Oct 2017 07:10:07 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>可以使用 echo curl_error($ch); 打印错误信息
如果是 SSL certificate problem, verify that the CA cert is OK 这种错误
在php.ini搜索curl.cainfo，改成这个值&lt;br>
curl.cainfo=”/etc/ssl/certs/ca-bundle.crt”
&lt;a href="https://stackoverflow.com/questions/8227909/curl-exec-always-returns-false">https://stackoverflow.com/questions/8227909/curl-exec-always-returns-false&lt;/a>&lt;br>
&lt;a href="https://stackoverflow.com/questions/6400300/https-and-ssl3-get-server-certificatecertificate-verify-failed-ca-is-ok">https://stackoverflow.com/questions/6400300/https-and-ssl3-get-server-certificatecertificate-verify-failed-ca-is-ok&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/curl/">Curl</category><category domain="https://fatkun.github.io/tags/php/">Php</category><category domain="https://fatkun.github.io/tags/ssl/">SSL</category></item><item><title>java数据库事务写的不错的一篇文章</title><link>https://fatkun.github.io/2017/09/java%E6%95%B0%E6%8D%AE%E5%BA%93%E4%BA%8B%E5%8A%A1%E5%86%99%E7%9A%84%E4%B8%8D%E9%94%99%E7%9A%84%E4%B8%80%E7%AF%87%E6%96%87%E7%AB%A0.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/09/java%E6%95%B0%E6%8D%AE%E5%BA%93%E4%BA%8B%E5%8A%A1%E5%86%99%E7%9A%84%E4%B8%8D%E9%94%99%E7%9A%84%E4%B8%80%E7%AF%87%E6%96%87%E7%AB%A0.html</guid><pubDate>Sun, 10 Sep 2017 06:59:38 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> &lt;/p>
&lt;p class="postTitle"> &lt;a id="cb_post_title_url" class="postTitle2" href="http://www.cnblogs.com/davenkin/archive/2013/02/16/java-tranaction-1.html">Java事务之一——Java事务的基本问题&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category></item><item><title>安装cloudera manger（中科大反向代理）</title><link>https://fatkun.github.io/2017/09/%E5%AE%89%E8%A3%85cloudera-manger.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/09/%E5%AE%89%E8%A3%85cloudera-manger.html</guid><pubDate>Sun, 03 Sep 2017 07:02:09 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>从文档&lt;a href="https://www.cloudera.com/documentation/enterprise/release-notes/topics/cm_vd.html#cmvd_topic_1">Cloudera Manager Version and Download Information&lt;/a> 找到下载地址，按系统版本下载
国外的下载地址很慢，使用中科大做的反向代理访问，下面是centos6的cm地址
wget -r -np -k ‘https://cloudera.proxy.ustclug.org/cm5/redhat/6/x86_64/cm/5.12.1/’&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/cloudera/">Cloudera</category><category domain="https://fatkun.github.io/tags/cloudera-manger/">Cloudera Manger</category><category domain="https://fatkun.github.io/tags/mirror/">Mirror</category><category domain="https://fatkun.github.io/tags/%E9%95%9C%E5%83%8F/">镜像</category></item><item><title>构建cloudera自定义parcels</title><link>https://fatkun.github.io/2017/08/create-cloudera-local-parcels.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/08/create-cloudera-local-parcels.html</guid><pubDate>Mon, 28 Aug 2017 10:15:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>构建命令：&lt;/p>
&lt;pre lang="bash" escaped="true">tar zcvf GPLEXTRAS-5.0.0-gplextras5b2.p0.32-el6.parcel GPLEXTRAS-5.0.0-gplextras5b2.p0.32/ --owner=root --group=root&lt;/pre>
&lt;p>把文件都放到一个http可访问的目录下，然后在“Parcel 设置”里面配置URL
目录结构&lt;/p>
&lt;pre lang="bash" escaped="true">-rw-r--r-- 1 kpi kpi 15509175 Jul 19 15:34 CUSTOM-5.4.0-1.cdh5.4.0.p2.5-el6.parcel
-rw-rw-r-- 1 kpi kpi 41 Jul 19 15:41 CUSTOM-5.4.0-1.cdh5.4.0.p2.5-el6.parcel.sha1
-rw-r--r-- 1 kpi kpi 500 Jul 19 15:52 manifest.json&lt;/pre>
&lt;p>manifest.json 文件如下，里面的hash值要对应上，components里面随便填，不要和原来的冲突&lt;/p>
&lt;pre lang="js" escaped="true">{
"lastUpdated": 14993731500000,
"parcels": [
{
"parcelName": "CUSTOM-5.4.0-1.cdh5.4.0.p2.5-el6.parcel",
"components": [
{
"pkg_version": "2.5+cdh5.4.0+0",
"name": "hadoop-custom",
"version": "2.5+cdh5.4.0+0"
}
],
"conflicts": "CDH (&amp;lt;&amp;lt; 5.4.0), CDH (&amp;gt;&amp;gt; 5.12.0.)",
"hash": "fba901a470aedc7f0e83248a989f7dcd04b5dafb"
}
]
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/cloudera/">Cloudera</category><category domain="https://fatkun.github.io/tags/parcel/">Parcel</category></item><item><title>在centos7编译安装python2.6</title><link>https://fatkun.github.io/2017/08/%E5%9C%A8centos7%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85python2-6.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/08/%E5%9C%A8centos7%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85python2-6.html</guid><pubDate>Tue, 22 Aug 2017 06:40:07 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>遇到一些库安装不上，可以忽略掉，具体见网址 http://blog.useasp.net/archive/2014/05/07/compile-and-install-python-2-dot-7-dot-6-on-centos.aspx
 &lt;/p>
&lt;div class="line number1 index0 alt2"> &lt;code class="bash plain">Python build finished, but the necessary bits to build these modules were not found:&lt;/code>&lt;/div>
&lt;div class="line number2 index1 alt1"> &lt;code class="bash spaces">   &lt;/code>&lt;code class="bash plain">_bsddb             _sqlite3           _ssl&lt;/code>&lt;/div>
&lt;div class="line number3 index2 alt2"> &lt;code class="bash spaces">   &lt;/code>&lt;code class="bash plain">_tkinter           bsddb185           bz2&lt;/code>&lt;/div>
&lt;div class="line number4 index3 alt1"> &lt;code class="bash spaces">   &lt;/code>&lt;code class="bash plain">dbm                gdbm               readline&lt;/code>&lt;/div>
&lt;div class="line number5 index4 alt2"> &lt;code class="bash spaces">   &lt;/code>&lt;code class="bash plain">sunaudiodev&lt;/code>&lt;/div>
&lt;div class="line number6 index5 alt1"> &lt;code class="bash plain">To &lt;/code>&lt;code class="bash functions">find&lt;/code> &lt;code class="bash plain">the necessary bits, &lt;/code>&lt;code class="bash functions">look&lt;/code> &lt;code class="bash keyword">in&lt;/code> &lt;code class="bash plain">setup.py &lt;/code>&lt;code class="bash keyword">in&lt;/code> &lt;code class="bash plain">detect_modules() &lt;/code>&lt;code class="bash keyword">for&lt;/code> &lt;code class="bash plain">the module's name.&lt;/code>&lt;/div>
&amp;nbsp;
&lt;table class="table table-bordered"> &lt;tr> &lt;td> 模块 &lt;/td>
&lt;td> 依赖 &lt;/td>
&lt;td> 说明 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> _bsddb &lt;/td>
&lt;td> bsddb &lt;/td>
&lt;td> Interface to Berkeley DB library。Berkeley数据库的接口 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> _curses &lt;/td>
&lt;td> ncurses &lt;/td>
&lt;td> Terminal handling for character-cell displays。 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> _curses_panel &lt;/td>
&lt;td> ncurses &lt;/td>
&lt;td> A panel stack extension for curses。 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> _sqlite3 &lt;/td>
&lt;td> sqlite &lt;/td>
&lt;td> DB-API 2.0 interface for SQLite databases。SqlLite，CentOS可以安装sqlite-devel &lt;/td> &lt;/tr>
&lt;tr> &lt;td> _ssl &lt;/td>
&lt;td> openssl-devel.i686 &lt;/td>
&lt;td> TLS/SSL wrapper for socket objects。 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> _tkinter &lt;/td>
&lt;td> N/A &lt;/td>
&lt;td> a thin object-oriented layer on top of Tcl/Tk。如果不使用桌面程序可以忽略TKinter &lt;/td> &lt;/tr>
&lt;tr> &lt;td> bsddb185 &lt;/td>
&lt;td> old bsddb module &lt;/td>
&lt;td> 老的bsddb模块，可忽略。 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> bz2 &lt;/td>
&lt;td> bzip2-devel.i686 &lt;/td>
&lt;td> Compression compatible with bzip2。bzip2-devel &lt;/td> &lt;/tr>
&lt;tr> &lt;td> dbm &lt;/td>
&lt;td> bsddb &lt;/td>
&lt;td> Simple “database” interface。 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> dl &lt;/td>
&lt;td> N/A &lt;/td>
&lt;td> Call C functions in shared objects.Python2.6开始，已经弃用。 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> gdbm &lt;/td>
&lt;td> gdbm-devel.i686 &lt;/td>
&lt;td> GNU’s reinterpretation of dbm &lt;/td> &lt;/tr>
&lt;tr> &lt;td> imageop &lt;/td>
&lt;td> N/A &lt;/td>
&lt;td> Manipulate raw image data。已经弃用。 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> readline &lt;/td>
&lt;td> readline-devel &lt;/td>
&lt;td> GNU readline interface &lt;/td> &lt;/tr>
&lt;tr> &lt;td> sunaudiodev &lt;/td>
&lt;td> N/A &lt;/td>
&lt;td> Access to Sun audio hardware。这个是针对Sun平台的，CentOS下可以忽略 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> zlib &lt;/td>
&lt;td> Zlib &lt;/td>
&lt;td> Compression compatible with gzip &lt;/td> &lt;/tr>&lt;/table></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/%E8%BF%90%E7%BB%B4/">运维</category></item><item><title>在用户目录安装python lib</title><link>https://fatkun.github.io/2017/08/%E5%9C%A8%E7%94%A8%E6%88%B7%E7%9B%AE%E5%BD%95%E5%AE%89%E8%A3%85python-lib.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/08/%E5%9C%A8%E7%94%A8%E6%88%B7%E7%9B%AE%E5%BD%95%E5%AE%89%E8%A3%85python-lib.html</guid><pubDate>Wed, 16 Aug 2017 09:46:03 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> &lt;/p>
&lt;pre lang="bash" escaped="true">wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
pip install --user xxxxxx&lt;/pre></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/pip/">Pip</category><category domain="https://fatkun.github.io/tags/python/">Python</category></item><item><title>hue cdh5.4.0 编辑器补丁</title><link>https://fatkun.github.io/2017/08/hue-cdh5-4-0-%E7%BC%96%E8%BE%91%E5%99%A8%E8%A1%A5%E4%B8%81.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/08/hue-cdh5-4-0-%E7%BC%96%E8%BE%91%E5%99%A8%E8%A1%A5%E4%B8%81.html</guid><pubDate>Tue, 15 Aug 2017 06:13:46 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> 
更新文件
/opt/cloudera/parcels/CDH/lib/hue/build/static/oozie/js/workflow-editor.ko.js
/opt/cloudera/parcels/CDH/lib/hue/build/static/oozie/js/workflow-editor.ko.xxxxxxxx.js
 &lt;/p>
&lt;h2 id="hue在centos7使用">HUE在CENTOS7使用&lt;/h2>
&lt;p>编译安装python2.6&lt;/p>
&lt;ol>
&lt;li>可能要把旧版本的/usr/lib64/libpython2.6.so.1.0 放进来？&lt;/li>
&lt;li>报mysql找不到so文件，/usr/lib64/mysql里面做链接，在HUE加上环境变量LD_LIBRARY_PATH=/usr/lib64/mysql/&lt;/li>
&lt;li>LXML报错， 移除 /opt/cloudera/parcels/CDH/lib/hue/build/env/lib/python2.6/site-packages/lxml*  重新安装lxm&lt;/li>
&lt;/ol>
&lt;ul>
&lt;li>装lxml的时候也会报错，安装以下包&lt;/li>
&lt;li>libxml2&lt;/li>
&lt;li>libxml2-dev&lt;/li>
&lt;li>libxslt&lt;/li>
&lt;li>libxslt-dev
 &lt;/li>
&lt;/ul></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hue/">Hue</category></item><item><title>安装Ubuntu提示can’t open /dev/sr0:No medium found</title><link>https://fatkun.github.io/2017/08/%E5%AE%89%E8%A3%85ubuntu%E6%8F%90%E7%A4%BAcant-open-devsr0no-medium-found.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/08/%E5%AE%89%E8%A3%85ubuntu%E6%8F%90%E7%A4%BAcant-open-devsr0no-medium-found.html</guid><pubDate>Fri, 04 Aug 2017 17:44:19 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>从U盘启动进入到有LOGO的界面，按F6，然后把U盘拔掉重新插入。
&lt;a href="http://www.linuxdiyf.com/linux/22270.html">http://www.linuxdiyf.com/linux/22270.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>hadoop参数</title><link>https://fatkun.github.io/2017/07/hadoop-config.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/07/hadoop-config.html</guid><pubDate>Fri, 28 Jul 2017 03:06:10 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="yarn">YARN&lt;/h2>
&lt;table> &lt;tr> &lt;td style="width: 575px;"> 参数 &lt;/td>
&lt;td style="width: 72px;"> 默认值 &lt;/td>
&lt;td style="width: 10px;"> 值 &lt;/td>
&lt;td style="width: 477px;"> 备注 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;"> yarn.nodemanager.container-metrics.enable &lt;/td>
&lt;td style="width: 72px;"> &lt;/td>
&lt;td style="width: 10px;"> false &lt;/td>
&lt;td style="width: 477px;"> 关闭，避免nodemanager内存OOM，http://hackershell.cn/?p=993 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;"> yarn.resourcemanager.recovery.enabled &lt;/td>
&lt;td style="width: 72px;"> &lt;/td>
&lt;td style="width: 10px;"> true &lt;/td>
&lt;td style="width: 477px;"> 启用 ResourceManager Recovery &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;"> yarn.scheduler.fair.continuous-scheduling-enabled &lt;/td>
&lt;td style="width: 72px;"> &lt;/td>
&lt;td style="width: 10px;"> true &lt;/td>
&lt;td style="width: 477px;"> 启用 Fair Scheduler 持续调度 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;"> mapreduce.reduce.shuffle.memory.limit.percent &lt;/td>
&lt;td style="width: 72px;"> &lt;/td>
&lt;td style="width: 10px;"> 0.5 &lt;/td>
&lt;td style="width: 477px;"> &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;"> yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentage &lt;/td>
&lt;td style="width: 72px;"> &lt;/td>
&lt;td style="width: 10px;"> 0.95 &lt;/td>
&lt;td style="width: 477px;"> &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;"> mapreduce.task.userlog.limit.kb &lt;/td>
&lt;td style="width: 72px;"> &lt;/td>
&lt;td style="width: 10px;"> 102400 &lt;/td>
&lt;td style="width: 477px;">  限制container输出的日志不要太大，设置为100MB，注意要设置log.backups，不然会使用内存 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;"> yarn.app.mapreduce.task.container.log.backups &lt;/td>
&lt;td style="width: 72px;"> &lt;/td>
&lt;td style="width: 10px;">  1 &lt;/td>
&lt;td style="width: 477px;">  备份文件个数 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;">  yarn.scheduler.fair.max.assign &lt;/td>
&lt;td style="width: 72px;">  -1 &lt;/td>
&lt;td style="width: 10px;"> 10 &lt;/td>
&lt;td style="width: 477px;">  在rm配置，一次分配中，每台机器最大分配任务数 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;"> &lt;/td>
&lt;td style="width: 72px;"> &lt;/td>
&lt;td style="width: 10px;"> &lt;/td>
&lt;td style="width: 477px;"> &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;"> &lt;/td>
&lt;td style="width: 72px;"> &lt;/td>
&lt;td style="width: 10px;"> &lt;/td>
&lt;td style="width: 477px;"> &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;"> &lt;/td>
&lt;td style="width: 72px;"> &lt;/td>
&lt;td style="width: 10px;"> &lt;/td>
&lt;td style="width: 477px;"> &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 575px;"> &lt;/td>
&lt;td style="width: 72px;"> &lt;/td>
&lt;td style="width: 10px;"> &lt;/td>
&lt;td style="width: 477px;"> &lt;/td> &lt;/tr>&lt;/table>
&lt;div class="property-name" data-bind="visible: propertyName, text: propertyName">&lt;/div>
&lt;h2 class="property-name" data-bind="visible: propertyName, text: propertyName"> HDFS&lt;/h2>
&lt;table> &lt;tr> &lt;td style="width: 104px;"> 参数 &lt;/td>
&lt;td style="width: 104px;"> 默认值 &lt;/td>
&lt;td style="width: 58px;"> 值 &lt;/td>
&lt;td style="width: 611px;"> 配置位置 &lt;/td>
&lt;td style="width: 611px;"> 备注 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 104px;"> fs.du.interval &lt;/td>
&lt;td style="width: 104px;"> &lt;/td>
&lt;td style="width: 58px;"> 1200000 &lt;/td>
&lt;td style="width: 611px;"> &lt;/td>
&lt;td style="width: 611px;"> 磁盘du间隔，du对磁盘IO影响比较大 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 104px;"> dfs.blockreport.initialDelay &lt;/td>
&lt;td style="width: 104px;"> &lt;/td>
&lt;td style="width: 58px;"> 180 &lt;/td>
&lt;td style="width: 611px;"> &lt;/td>
&lt;td style="width: 611px;"> 延迟blockreport，避免重启时集中汇报 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 104px;"> dfs.block.scanner.cursor.save.interval.ms &lt;/td>
&lt;td style="width: 104px;"> &lt;/td>
&lt;td style="width: 58px;">  默认10分钟 &lt;/td>
&lt;td style="width: 611px;"> &lt;/td>
&lt;td style="width: 611px;">  10分钟保存一次scan cursor &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 104px;"> dfs.block.scanner.volume.bytes.per.second &lt;/td>
&lt;td style="width: 104px;"> &lt;/td>
&lt;td style="width: 58px;">  4194304 &lt;/td>
&lt;td style="width: 611px;"> &lt;/td>
&lt;td style="width: 611px;">  默认值1MB，磁盘扫描的限速，要注意看看扫描一个磁盘会不会太慢，但设的太高也会影响IO &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 104px;"> dfs.datanode.scan.period.hours &lt;/td>
&lt;td style="width: 104px;"> &lt;/td>
&lt;td style="width: 58px;">  3weeks &lt;/td>
&lt;td style="width: 611px;"> &lt;/td>
&lt;td style="width: 611px;"> 常规 磁盘扫描间隔 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 104px;"> dfs.namenode.checkpoint.txns &lt;/td>
&lt;td style="width: 104px;"> &lt;/td>
&lt;td style="width: 58px;">  10000000 &lt;/td>
&lt;td style="width: 611px;">  namenode hdfs-site.xml &lt;/td>
&lt;td style="width: 611px;">  设置大一些，避免频繁的checkpoint传输 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="width: 104px;"> &lt;del>hadoop.user.group.static.mapping.overrides&lt;/del> &lt;/td>
&lt;td style="width: 104px;"> &lt;del>dr.who=;&lt;/del> &lt;/td>
&lt;td style="width: 58px;"> &lt;del>dr.who=;yarn=yarn,hadoop,supergroup;&lt;/del>&lt;/p>
&lt;pre>&lt;code> &amp;lt;p&amp;gt; &amp;lt;del&amp;gt;mapred:mapred,hadoop,supergroup&amp;lt;/del&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt; &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt; &amp;lt;del&amp;gt;覆盖组权限，需要配置在core-site.xml里面，需要重启namenode&amp;lt;/del&amp;gt; &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;width: 104px;&amp;quot;&amp;gt; dfs.namenode.posix.acl.inheritance.enabled &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 104px;&amp;quot;&amp;gt;  false &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 58px;&amp;quot;&amp;gt; true &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt; &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt;  在namenode hdfs-site.xml配置，在打上HDFS-6962补丁后，ACL mask权限能够继承 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;width: 104px;&amp;quot;&amp;gt; dfs.datanode.balance.max.concurrent.moves &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 104px;&amp;quot;&amp;gt; 5 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 58px;&amp;quot;&amp;gt; 50 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt; &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt; 平衡的线程数，用于提高平衡效率（需要在DataNode和Balance的hdfs-site配置，需要重启DataNode） &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;width: 104px;&amp;quot;&amp;gt; dfs.datanode.balance.bandwidthPerSec &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 104px;&amp;quot;&amp;gt; 10MB &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 58px;&amp;quot;&amp;gt; 30MB &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt; &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt; 平衡的速度 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;width: 104px;&amp;quot;&amp;gt; ha.failover-controller.new-active.rpc-timeout.ms &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 104px;&amp;quot;&amp;gt; 60000 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 58px;&amp;quot;&amp;gt; 300000 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt; 全局的core-site.xml里面配置（客户端和failover controller都会用到） &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt; failover controller在转换active等待的时间，在hdfs failover controller里面配置，如果时间不够会在failover controller里面看到超时错误日志。&amp;lt;a href=&amp;quot;https://issues.apache.org/jira/browse/HDFS-11254&amp;quot;&amp;gt;HDFS-11254&amp;lt;/a&amp;gt; 在replay editlog的时候也会很慢。&amp;lt;br /&amp;gt; 注意要先重启备机的controller，否则重启active controller，namenode会切换。 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;width: 104px;&amp;quot;&amp;gt; dfs.image.transfer.bandwidthPerSec &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 104px;&amp;quot;&amp;gt; &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 58px;&amp;quot;&amp;gt; 41943040 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt; namenode hdfs-site.xml &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 611px;&amp;quot;&amp;gt; image传输限速，占用所有带宽会影响namenode rpc请求，重启active namenode才生效 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&amp;lt;/tbody&amp;gt; &amp;lt;/table&amp;gt;
&amp;lt;p&amp;gt; &amp;amp;nbsp; &amp;lt;/p&amp;gt;
&amp;lt;h2&amp;gt; HIVE &amp;lt;/h2&amp;gt;
&amp;lt;table style=&amp;quot;width: 1113px;&amp;quot;&amp;gt; &amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;width: 105px;&amp;quot;&amp;gt; 参数 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 101px;&amp;quot;&amp;gt; 默认值 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 159px;&amp;quot;&amp;gt; 建议值 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 921px;&amp;quot;&amp;gt; 备注 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;width: 105px;&amp;quot;&amp;gt; hive.metastore.failure.retries &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 101px;&amp;quot;&amp;gt; 1 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 159px;&amp;quot;&amp;gt; 3 &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 921px;&amp;quot;&amp;gt; metastore中途失败重试的次数，某个版本之前默认值是1，后面变为3 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;width: 105px;&amp;quot;&amp;gt; hive.metastore.try.direct.sql &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 101px;&amp;quot;&amp;gt; false &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 159px;&amp;quot;&amp;gt; &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 921px;&amp;quot;&amp;gt; Hive Metastore 是否应尝试使用直接 SQL 查询，而不是针对一定读取路径使用 DataNucleus。这样在获取许多分区时可以使 Metastore 性能得到数量级的提升。打开这个开关要确保打了补丁HIVE-15551，否则有内存泄露 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;width: 105px;&amp;quot;&amp;gt; &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 101px;&amp;quot;&amp;gt; &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 159px;&amp;quot;&amp;gt; &amp;lt;/td&amp;gt;
&amp;lt;td style=&amp;quot;width: 921px;&amp;quot;&amp;gt; &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt; &amp;lt;/table&amp;gt;
&amp;lt;h2&amp;gt; HBASE &amp;lt;/h2&amp;gt;
&amp;lt;p&amp;gt; https://github.com/mattshma/bigdata/blob/master/hbase/docs/hbase_rpc.md &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; hbase.ipc.server.listen.queue.size   默认值 128 &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; hbase.ipc.server.read.threadpool.size 默认值 10 &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; hbase.regionserver.handler.count &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; hbase.regionserver.metahandler.count &amp;lt;/p&amp;gt;&lt;/code>&lt;/pre></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category></item><item><title>HDFS文件的健康检查</title><link>https://fatkun.github.io/2017/07/hdfs-health-check.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/07/hdfs-health-check.html</guid><pubDate>Sun, 16 Jul 2017 13:35:45 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>文章来源：&lt;a href="https://blog.cloudera.com/blog/2016/12/hdfs-datanode-scanners-and-disk-checker-explained/">HDFS DataNode Scanners and Disk Checker Explained&lt;/a>
以下只简单翻译部分文字，详情看英文原文。&lt;/p>
&lt;h2 id="简单的概念">简单的概念&lt;/h2>
&lt;p>一个文件包含多个block，一个block有一个或多个副本。
block存储在每台机器的磁盘上，并且包含个blk_xxx.meta信息，meta中包含crc校验信息等。&lt;/p>
&lt;h2 id="这篇文章为了解答以下问题">这篇文章为了解答以下问题&lt;/h2>
&lt;p>datanode什么时候检查blocks？
datanode怎么保证内存（in-memory）中的metadata和本地磁盘保持一致？
如果发生block读失败，是因为磁盘错误吗？有可能是其他间歇性的错误（例如网络中断）？&lt;/p>
&lt;h2 id="block-scanner--volume-scanner">Block Scanner &amp;amp; Volume Scanner&lt;/h2>
&lt;p>每个datanode有一个block scanner，一个block scanner包含有多个volume scanner，每个volume scanner扫描一个磁盘。这里是多线程的。volume scanner需要读取全部磁盘的数据，验证每一个block，我们称这个为常规扫描（&lt;em>regular scans&lt;/em>）。因为要真实读取数据，这是一个重IO的操作，这里会有个限速器。
除了常规扫描外，volume scanner还维护了一份suspicious blocks（怀疑有问题的blocks列表），它是在出现读写错误的时候（不管是来自于client或者datanode），并且不是网络错误，加进这个列表里面。volume scanner会优先检查这些文件，并且为了避免重复检查，这里也有些优化。
这里还有个block cursor来保存扫描进度，重启datanode也可以接着上次干活。
有两个参数
dfs.block.scanner.volume.bytes.per.second  每秒最多扫描的字节数
dfs.datanode.scan.period.hours 每次扫描间隔多长时间，如果扫描提前完成了，就等。如果超过时间都没完成，就一直做完。&lt;/p>
&lt;h2 id="directory-scanners">Directory Scanners&lt;/h2>
&lt;p>用来检查datanode内存的元数据和磁盘实际存储的是不是一致，主要检查文件在不在，meta信息在不在，文件大小和内存中的是不是一样。
这块没有仔细看，后面再认真看下。
如果发现文件大小不一样，会认为是corrupted block，汇报给namenode。&lt;/p>
&lt;h2 id="disk-checker">Disk Checker&lt;/h2>
&lt;p>主要检查目录在不在，能不能建子目录，location路径是不是目录，目录有没有read、write、execute权限。&lt;/p>
&lt;h2 id="坏块corrupted-block处理">坏块（corrupted block）处理&lt;/h2>
&lt;p>corrupted block会汇报给namenode，namenode调用namesystem.reportBadBlocks处理，会把block标记为corrupt，如果副本数满足一定条件，会把那个副本删掉。
存活的副本数低于要求的副本数时，会触发副本复制。&lt;/p>
&lt;h2 id="再来看看我们集群">再来看看我们集群&lt;/h2>
&lt;p>发现我们用的cdh5.4.0版本，dfs.datanode.scan.period.hours的默认值是0，Block Scanner被关闭了。
下面是打开的补丁，另外对于磁盘检查这块后面的版本也有很多补丁。
&lt;a href="https://issues.apache.org/jira/browse/HDFS-8681">https://issues.apache.org/jira/browse/HDFS-8681&lt;/a> BlockScanner is incorrectly disabled by default
 &lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>hdfs磁盘检查相关文章</title><link>https://fatkun.github.io/2017/07/hdfs%E7%A3%81%E7%9B%98%E6%A3%80%E6%9F%A5%E7%9B%B8%E5%85%B3%E6%96%87%E7%AB%A0.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/07/hdfs%E7%A3%81%E7%9B%98%E6%A3%80%E6%9F%A5%E7%9B%B8%E5%85%B3%E6%96%87%E7%AB%A0.html</guid><pubDate>Sun, 16 Jul 2017 02:23:20 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 id="span-classlink_titlea-hrefhttpblogcsdnnetandroidlushangderenarticledetails53232234datanode启动优化改进磁盘检测并行化aspan">&lt;span class="link_title">&lt;a href="http://blog.csdn.net/androidlushangderen/article/details/53232234">DataNode启动优化改进：磁盘检测并行化&lt;/a>&lt;/span>&lt;/h1>
&lt;p>&lt;a href="https://issues.apache.org/jira/browse/HDFS-8845">https://issues.apache.org/jira/browse/HDFS-8845&lt;/a> 检查时不遍历所有子目录
 
&lt;a href="https://issues.apache.org/jira/browse/HDFS-8850">https://issues.apache.org/jira/browse/HDFS-8850&lt;/a> VolumeScanner可能会抛nullpoint exception
&lt;a href="https://issues.apache.org/jira/browse/HDFS-7916">https://issues.apache.org/jira/browse/HDFS-7916&lt;/a> 汇报坏块给standby namenode时一直出错&lt;/p>
&lt;blockquote data-secret="viXrAX6OoI" class="wp-embedded-content"> &lt;p> &lt;a href="https://blog.cloudera.com/blog/2016/12/hdfs-datanode-scanners-and-disk-checker-explained/">HDFS DataNode Scanners and Disk Checker Explained&lt;/a> &lt;/p>&lt;/blockquote></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>[BUG]HIVE-9613 left join会导致数据错位</title><link>https://fatkun.github.io/2017/07/bughive-9613-left-join%E4%BC%9A%E5%AF%BC%E8%87%B4%E6%95%B0%E6%8D%AE%E9%94%99%E4%BD%8D.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/07/bughive-9613-left-join%E4%BC%9A%E5%AF%BC%E8%87%B4%E6%95%B0%E6%8D%AE%E9%94%99%E4%BD%8D.html</guid><pubDate>Fri, 07 Jul 2017 10:32:00 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;table class="confluenceTable"> &lt;tr> &lt;th class="confluenceTh"> category &lt;/th>
&lt;th class="confluenceTh"> city &lt;/th>
&lt;th class="confluenceTh"> rank &lt;/th>
&lt;th class="confluenceTh"> src_category_en &lt;/th>
&lt;th class="confluenceTh"> src_city_name_en &lt;/th> &lt;/tr>
&lt;tr> &lt;td class="confluenceTd"> jinrongfuwu &lt;/td>
&lt;td class="confluenceTd"> shanghai &lt;/td>
&lt;td class="confluenceTd"> 1 &lt;/td>
&lt;td class="confluenceTd"> danbaobaoxiantouzi &lt;/td>
&lt;td class="confluenceTd"> sh &lt;/td> &lt;/tr>
&lt;tr> &lt;td class="confluenceTd"> ktvjiuba &lt;/td>
&lt;td class="confluenceTd"> shanghai &lt;/td>
&lt;td class="confluenceTd"> 2 &lt;/td>
&lt;td class="confluenceTd"> zpwentiyingshi &lt;/td>
&lt;td class="confluenceTd"> sh &lt;/td> &lt;/tr>&lt;/table>
but int hive0.14,the results in the column **src\_category\_en** is wrong,and is just the **city** contents:
&lt;table class="confluenceTable"> &lt;tr> &lt;th class="confluenceTh"> category &lt;/th>
&lt;th class="confluenceTh"> city &lt;/th>
&lt;th class="confluenceTh"> rank &lt;/th>
&lt;th class="confluenceTh"> src_category_en &lt;/th>
&lt;th class="confluenceTh"> src_city_name_en &lt;/th> &lt;/tr>
&lt;tr> &lt;td class="confluenceTd"> jinrongfuwu &lt;/td>
&lt;td class="confluenceTd"> shanghai &lt;/td>
&lt;td class="confluenceTd"> 1 &lt;/td>
&lt;td class="confluenceTd"> shanghai &lt;/td>
&lt;td class="confluenceTd"> sh &lt;/td> &lt;/tr>
&lt;tr> &lt;td class="confluenceTd"> ktvjiuba &lt;/td>
&lt;td class="confluenceTd"> shanghai &lt;/td>
&lt;td class="confluenceTd"> 2 &lt;/td>
&lt;td class="confluenceTd"> shanghai &lt;/td>
&lt;td class="confluenceTd"> sh &lt;/td> &lt;/tr>&lt;/table></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/bug/">Bug</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category></item><item><title>Hive遇到问题汇总</title><link>https://fatkun.github.io/2017/06/hive%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98%E6%B1%87%E6%80%BB.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/06/hive%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98%E6%B1%87%E6%80%BB.html</guid><pubDate>Fri, 16 Jun 2017 05:39:56 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="新增两个字段但查出来的值为null">新增两个字段，但查出来的值为null。&lt;/h2>
&lt;p>分区有自己的字段信息，检查分区的字段信息是否和表的不一致。 desc table_name parttion (pt=’2016-01-01′);
 &lt;/p>
&lt;h2 id="sum之后的结果变小">SUM之后的结果变小&lt;/h2>
&lt;p>sum一个表的结果，和直接sum子查询返回的结果不一致。
检查发现是表使用了bigint字段，sum之后返回的数值是科学计数法，再转回bigint的时候会出错，返回null值。从而漏掉统计部分数据
 &lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/%E6%80%BB%E7%BB%93/">总结</category></item><item><title>JDK Native Memory Tracking</title><link>https://fatkun.github.io/2017/06/jdk-native-memory-tracking.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/06/jdk-native-memory-tracking.html</guid><pubDate>Mon, 12 Jun 2017 07:42:07 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>command line option: -XX:NativeMemoryTracking=summary or -XX:NativeMemoryTracking=detail
jcmd ${PID} VM.native_memory summary
&lt;a href="https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr007.html">https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr007.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/jdk/">Jdk</category></item><item><title>Hive On Tez cloudera5.4</title><link>https://fatkun.github.io/2017/05/hive-on-tez-cloudera5-4.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/05/hive-on-tez-cloudera5-4.html</guid><pubDate>Mon, 01 May 2017 10:52:17 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="配置">配置&lt;/h2>
&lt;p>tez-site.xml&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;configuration&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;tez.lib.uris&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;${fs.defaultFS}/apps/tez-0.8.5/,${fs.defaultFS}/apps/tez-0.8.5/lib/&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;tez.use.cluster.hadoop-libs&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;true&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;tez.runtime.compress&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;true&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;tez.runtime.compress.codec&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;org.apache.hadoop.io.compress.SnappyCodec&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;/configuration&amp;gt;
&lt;/pre>
&lt;h2 id="调优参数">调优参数&lt;/h2>
&lt;p>tez.grouping.min-size 分片最小限制&lt;/p>
&lt;h2 id="报错处理">报错处理&lt;/h2>
&lt;p>找不到lzo&lt;/p>
&lt;pre lang="bash" escaped="true">Caused by: java.lang.ClassNotFoundException: Class com.hadoop.compression.lzo.LzoCodec not found
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2018)
at org.apache.hadoop.io.compress.CompressionCodecFactory.getCodecClasses(CompressionCodecFactory.java:128)
... 23 more&lt;/pre>
&lt;p>LZO包没加载到，我是把lzo.jar放入tez的lib里面，但是这样会导致不能用到native库，暂时没找到解决方法。
找不到org.apache.hadoop.hive.ql.exec.tez.HiveSplitGenerator&lt;/p>
&lt;pre escaped="true" lang="bash">Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.exec.tez.HiveSplitGenerator&lt;/pre>
&lt;p>同样的解决方法，把hive-exec.jar放进去&lt;/p>
&lt;pre escaped="true" lang="bash">errorMessage=Shuffle Runner Failed:org.apache.tez.runtime.library.common.shuffle.orderedgrouped.Shuffle$ShuffleError: Error while doing final merge
at org.apache.tez.runtime.library.common.shuffle.orderedgrouped.Shuffle$RunShuffleCallable.callInternal(Shuffle.java:320)
at org.apache.tez.runtime.library.common.shuffle.orderedgrouped.Shuffle$RunShuffleCallable.callInternal(Shuffle.java:285)
at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Not a valid ifile header
at org.apache.tez.runtime.library.common.sort.impl.IFile$Reader.verifyHeaderMagic(IFile.java:837)
at org.apache.tez.runtime.library.common.sort.impl.IFile$Reader.isCompressedFlagEnabled(IFile.java:844)
at org.apache.tez.runtime.library.common.sort.impl.IFile$Reader.&amp;lt;init&amp;gt;(IFile.java:547)
at org.apache.tez.runtime.library.common.sort.impl.TezMerger$DiskSegment.init(TezMerger.java:407)
at org.apache.tez.runtime.library.common.sort.impl.TezMerger$MergeQueue.merge(TezMerger.java:753)
at org.apache.tez.runtime.library.common.sort.impl.TezMerger.merge(TezMerger.java:192)
at org.apache.tez.runtime.library.common.shuffle.orderedgrouped.MergeManager.finalMerge(MergeManager.java:1203)
at org.apache.tez.runtime.library.common.shuffle.orderedgrouped.MergeManager.close(MergeManager.java:583)
at org.apache.tez.runtime.library.common.shuffle.orderedgrouped.Shuffle$RunShuffleCallable.callInternal(Shuffle.java:316)&lt;/pre>
&lt;p>我是重新指定了一下压缩算法（tez.runtime.compress.codec），不知道为什么。压缩关掉也可以。&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;tez.runtime.compress&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;true&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;tez.runtime.compress.codec&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;org.apache.hadoop.io.compress.SnappyCodec&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre>
&lt;h2 id="写的不错的文章">写的不错的文章&lt;/h2>
&lt;p>&lt;a href="http://www.leocook.org/2016/05/09/Tez%E7%B3%BB%E5%88%97%E7%AC%AC%E4%BA%8C%E7%AF%87-hive_on_tez/" target="_blank">Tez系列第二篇 Hive_on_tez&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/tez/">Tez</category></item><item><title>jobhistory关注的issue</title><link>https://fatkun.github.io/2017/04/jobhistory%E5%85%B3%E6%B3%A8%E7%9A%84issue.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/04/jobhistory%E5%85%B3%E6%B3%A8%E7%9A%84issue.html</guid><pubDate>Mon, 10 Apr 2017 07:30:14 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>JobHistory cache issue&lt;br>
&lt;a href="https://issues.apache.org/jira/browse/MAPREDUCE-6436">https://issues.apache.org/jira/browse/MAPREDUCE-6436&lt;/a>&lt;br>
可能导致打印的日志太多影响性能
Job history server scans can become blocked on a single, slow entry&lt;br>
&lt;a href="https://issues.apache.org/jira/browse/MAPREDUCE-6797">https://issues.apache.org/jira/browse/MAPREDUCE-6797&lt;/a>
High contention on scanning of user directory under immediate_done in Job History Server&lt;br>
&lt;a href="https://issues.apache.org/jira/browse/MAPREDUCE-6684">https://issues.apache.org/jira/browse/MAPREDUCE-6684&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/jobhistory/">Jobhistory</category></item><item><title>kafka关注的issue</title><link>https://fatkun.github.io/2017/03/kafka%E5%85%B3%E6%B3%A8%E7%9A%84issue.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/03/kafka%E5%85%B3%E6%B3%A8%E7%9A%84issue.html</guid><pubDate>Mon, 27 Mar 2017 10:17:36 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>BrokerChangeListener computes inconsistent live/dead broker list&lt;br>
&lt;a href="https://issues.apache.org/jira/browse/KAFKA-3085">https://issues.apache.org/jira/browse/KAFKA-3085&lt;/a>
BrokerChangeListener missed broker id path ephemeral node deletion event.&lt;br>
&lt;a href="https://issues.apache.org/jira/browse/KAFKA-2448">https://issues.apache.org/jira/browse/KAFKA-2448&lt;/a>
Controller could miss a broker state change&lt;br>
&lt;a href="https://issues.apache.org/jira/browse/KAFKA-1120">https://issues.apache.org/jira/browse/KAFKA-1120&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/kafka/">Kafka</category></item><item><title>在reduce InMemoryMapOutput OOM</title><link>https://fatkun.github.io/2017/03/reduce-inmemorymapoutput-oom.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/03/reduce-inmemorymapoutput-oom.html</guid><pubDate>Wed, 15 Mar 2017 07:54:22 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;pre escaped="true" lang="other">2017-03-14 15:41:52,724 WARN [main] org.apache.hadoop.mapred.YarnChild: Exception running child : org.apache.hadoop.mapreduce.task.reduce.Shuffle$ShuffleError: error in shuffle in fetcher#1
at org.apache.hadoop.mapreduce.task.reduce.Shuffle.run(Shuffle.java:134)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:376)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1693)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
Caused by: java.lang.OutOfMemoryError: Java heap space
at org.apache.hadoop.io.BoundedByteArrayOutputStream.&amp;lt;init&amp;gt;(BoundedByteArrayOutputStream.java:56)
at org.apache.hadoop.io.BoundedByteArrayOutputStream.&amp;lt;init&amp;gt;(BoundedByteArrayOutputStream.java:46)
at org.apache.hadoop.mapreduce.task.reduce.InMemoryMapOutput.&amp;lt;init&amp;gt;(InMemoryMapOutput.java:63)
at org.apache.hadoop.mapreduce.task.reduce.MergeManagerImpl.unconditionalReserve(MergeManagerImpl.java:305)
at org.apache.hadoop.mapreduce.task.reduce.MergeManagerImpl.reserve(MergeManagerImpl.java:295)
at org.apache.hadoop.mapreduce.task.reduce.Fetcher.copyMapOutput(Fetcher.java:514)
at org.apache.hadoop.mapreduce.task.reduce.Fetcher.copyFromHost(Fetcher.java:336)
at org.apache.hadoop.mapreduce.task.reduce.Fetcher.run(Fetcher.java:193)&lt;/pre>
&lt;p>调整这个参数 ( mapreduce.reduce.shuffle.input.percent )，默认值为0.7，改为0.5
相关的参数 mapreduce.reduce.shuffle.memory.limit.percent 一个单一的shuffle的最大内存使用限制&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category></item><item><title>hadoop job -kill 和 yarn application -kill 区别</title><link>https://fatkun.github.io/2017/01/hadoop-job-kill-and-yarn-application-kill-diff.html</link><guid isPermaLink="true">https://fatkun.github.io/2017/01/hadoop-job-kill-and-yarn-application-kill-diff.html</guid><pubDate>Fri, 06 Jan 2017 10:49:51 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>hadoop job -kill 调用的是CLI.java里面的job.killJob(); 这里会分几种情况，如果是能查询到状态是RUNNING的话，是直接向AppMaster发送kill请求的。&lt;br>
YARNRunner.java&lt;/p>
&lt;pre escaped="true" lang="java">@Override
public void killJob(JobID arg0) throws IOException, InterruptedException {
/* check if the status is not running, if not send kill to RM */
JobStatus status = clientCache.getClient(arg0).getJobStatus(arg0);
ApplicationId appId = TypeConverter.toYarn(arg0).getAppId();
// get status from RM and return
if (status == null) {
killUnFinishedApplication(appId);
return;
}
if (status.getState() != JobStatus.State.RUNNING) {
killApplication(appId);
return;
}
try {
/* send a kill to the AM */
clientCache.getClient(arg0).killJob(arg0);
long currentTimeMillis = System.currentTimeMillis();
long timeKillIssued = currentTimeMillis;
while ((currentTimeMillis &amp;lt; timeKillIssued + 10000L)
&amp;&amp; !isJobInTerminalState(status)) {
try {
Thread.sleep(1000L);
} catch (InterruptedException ie) {
/** interrupted, just break */
break;
}
currentTimeMillis = System.currentTimeMillis();
status = clientCache.getClient(arg0).getJobStatus(arg0);
if (status == null) {
killUnFinishedApplication(appId);
return;
}
}
} catch(IOException io) {
LOG.debug("Error when checking for application status", io);
}
if (status != null &amp;&amp; !isJobInTerminalState(status)) {
killApplication(appId);
}
}&lt;/pre>
&lt;p>MRClientService.java&lt;/p>
&lt;pre escaped="true" lang="java">@SuppressWarnings("unchecked")
@Override
public KillJobResponse killJob(KillJobRequest request)
throws IOException {
JobId jobId = request.getJobId();
UserGroupInformation callerUGI = UserGroupInformation.getCurrentUser();
String message = "Kill job " + jobId + " received from " + callerUGI
+ " at " + Server.getRemoteAddress();
LOG.info(message);
verifyAndGetJob(jobId, JobACL.MODIFY_JOB);
appContext.getEventHandler().handle(
new JobDiagnosticsUpdateEvent(jobId, message));
appContext.getEventHandler().handle(
new JobEvent(jobId, JobEventType.JOB_KILL));
KillJobResponse response =
recordFactory.newRecordInstance(KillJobResponse.class);
return response;
}&lt;/pre>
&lt;p>yarn application -kill 使用的是ApplicationCLI.java，是向RM发送kill请求&lt;/p>
&lt;pre escaped="true" lang="java">/**
* Kills the application with the application id as appId
*
* @param applicationId
* @throws YarnException
* @throws IOException
*/
private void killApplication(String applicationId) throws YarnException,
IOException {
ApplicationId appId = ConverterUtils.toApplicationId(applicationId);
ApplicationReport appReport = null;
try {
appReport = client.getApplicationReport(appId);
} catch (ApplicationNotFoundException e) {
sysout.println("Application with id '" + applicationId +
"' doesn't exist in RM.");
throw e;
}
if (appReport.getYarnApplicationState() == YarnApplicationState.FINISHED
|| appReport.getYarnApplicationState() == YarnApplicationState.KILLED
|| appReport.getYarnApplicationState() == YarnApplicationState.FAILED) {
sysout.println("Application " + applicationId + " has already finished ");
} else {
sysout.println("Killing application " + applicationId);
client.killApplication(appId);
}
}&lt;/pre>
&lt;p>YarnClientImpl.java&lt;/p>
&lt;pre escaped="true" lang="java">@Override
public void killApplication(ApplicationId applicationId)
throws YarnException, IOException {
KillApplicationRequest request =
Records.newRecord(KillApplicationRequest.class);
request.setApplicationId(applicationId);
try {
int pollCount = 0;
long startTime = System.currentTimeMillis();
while (true) {
KillApplicationResponse response =
rmClient.forceKillApplication(request);
if (response.getIsKillCompleted()) {
LOG.info("Killed application " + applicationId);
break;
}
long elapsedMillis = System.currentTimeMillis() - startTime;
if (enforceAsyncAPITimeout() &amp;&amp;
elapsedMillis &amp;gt;= this.asyncApiPollTimeoutMillis) {
throw new YarnException("Timed out while waiting for application " +
applicationId + " to be killed.");
}
if (++pollCount % 10 == 0) {
LOG.info("Waiting for application " + applicationId + " to be killed.");
}
Thread.sleep(asyncApiPollIntervalMillis);
}
} catch (InterruptedException e) {
LOG.error("Interrupted while waiting for application " + applicationId
+ " to be killed.");
}
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category></item><item><title>HDFS-6962 hdfs acl mask继承无效</title><link>https://fatkun.github.io/2016/11/hdfs-6962-hdfs-acl-mask%E7%BB%A7%E6%89%BF%E6%97%A0%E6%95%88.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/11/hdfs-6962-hdfs-acl-mask%E7%BB%A7%E6%89%BF%E6%97%A0%E6%95%88.html</guid><pubDate>Mon, 21 Nov 2016 10:50:03 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>ACL inheritance conflicts with umaskmode&lt;br>
&lt;a href="https://issues.apache.org/jira/browse/HDFS-6962">https://issues.apache.org/jira/browse/HDFS-6962&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/bug/">Bug</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>hive merge小文件</title><link>https://fatkun.github.io/2016/11/hive-merge%E5%B0%8F%E6%96%87%E4%BB%B6.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/11/hive-merge%E5%B0%8F%E6%96%87%E4%BB%B6.html</guid><pubDate>Mon, 21 Nov 2016 10:47:17 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>2.输出合并&lt;br>
set hive.merge.mapfiles = true #在Map-only的任务结束时合并小文件（默认开启）
set hive.merge.mapredfiles = true #在Map-Reduce的任务结束时合并小文件&lt;br>
set hive.merge.size.per.task = 256*1000*1000 #合并文件的大小&lt;br>
set hive.merge.smallfiles.avgsize=16000000 #当输出文件的平均大小小于该值时，启动一个独立的map-reduce任务进行文件merge
见：&lt;a href="http://blog.csdn.net/yfkiss/article/details/8590486">http://blog.csdn.net/yfkiss/article/details/8590486&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category></item><item><title>parquet-hive列裁剪和谓词下推</title><link>https://fatkun.github.io/2016/11/parquet-hive-projection-and-push-down.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/11/parquet-hive-projection-and-push-down.html</guid><pubDate>Sun, 20 Nov 2016 13:36:21 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>一直好奇parquet和hive是怎样做列裁剪（跳过某些列）的，今天跟踪了一下代码。
parquet和hive交接的代码已经在合并在hive里面了，直接看hive的代码&lt;/p>
&lt;pre>input format在：org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat&lt;/pre>
&lt;h2 id="数据准备">数据准备&lt;/h2>
&lt;pre lang="sql" escaped="true">CREATE TABLE parquet (x INT, y STRING) STORED AS PARQUET;
CREATE TABLE parquet2 (x INT, y STRING) STORED AS PARQUET;
CREATE TABLE test (x INT, y STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '`';
-- 手工构造数据进test表
INSERT OVERWRITE TABLE parquet SELECT x,y FROM test;
INSERT OVERWRITE TABLE parquet2 SELECT x,y FROM test;&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="测试语句">测试语句&lt;/h2>
&lt;pre escaped="true" lang="bash">SET mapred.job.tracker=local;
SET hive.exec.mode.local.auto=true;
SET fs.defaultFS=file:///;
-- 避免转成mapjoin
SET hive.auto.convert.join=false;
select a.x, b.y from parquet a left join parquet2 b on (a.x = b.x);&lt;/pre>
&lt;h2 id="代码分析">代码分析&lt;/h2>
&lt;p>maptask读取数据的时候，需要先获取一个reader&lt;br>
MapTask(job.getInputFormat().getRecordReader)-&amp;gt; CombineHiveInputFormat.getRecordReader -&amp;gt; HiveInputFormat.pushFilters&lt;/p>
&lt;pre escaped="true" lang="java">public static void pushFilters(JobConf jobConf, TableScanOperator tableScan) {
// construct column name list and types for reference by filter push down
Utilities.setColumnNameList(jobConf, tableScan); // 在conf里设置columns
Utilities.setColumnTypeList(jobConf, tableScan); // 在conf里设置columns.types
}&lt;/pre>
&lt;p>从this.mrwork.getPathToAliases里面拿到table alias，然后再从this.mrwork.getAliasToWork拿到TableScanOperator，&lt;br>
ts.getNeededColumnIDs(), ts.getNeededColumns() 可以拿个这个表扫描需要的字段。&lt;/p>
&lt;pre escaped="true" lang="java">protected void pushProjectionsAndFilters(JobConf jobConf, Class inputFormatClass,
String splitPath, String splitPathWithNoSchema, boolean nonNative) {
if (this.mrwork == null) {
init(job);
}
if(this.mrwork.getPathToAliases() == null) {
return;
}
ArrayList&amp;lt;String&amp;gt; aliases = new ArrayList&amp;lt;String&amp;gt;();
Iterator&amp;lt;Entry&amp;lt;String, ArrayList&amp;lt;String&amp;gt;&amp;gt;&amp;gt; iterator = this.mrwork
.getPathToAliases().entrySet().iterator();
while (iterator.hasNext()) {
Entry&amp;lt;String, ArrayList&amp;lt;String&amp;gt;&amp;gt; entry = iterator.next();
String key = entry.getKey();
boolean match;
if (nonNative) {
// For non-native tables, we need to do an exact match to avoid
// HIVE-1903. (The table location contains no files, and the string
// representation of its path does not have a trailing slash.)
match =
splitPath.equals(key) || splitPathWithNoSchema.equals(key);
} else {
// But for native tables, we need to do a prefix match for
// subdirectories. (Unlike non-native tables, prefix mixups don't seem
// to be a potential problem here since we are always dealing with the
// path to something deeper than the table location.)
match =
splitPath.startsWith(key) || splitPathWithNoSchema.startsWith(key);
}
if (match) {
ArrayList&amp;lt;String&amp;gt; list = entry.getValue();
for (String val : list) {
aliases.add(val);
}
}
}
for (String alias : aliases) {
Operator&amp;lt;? extends OperatorDesc&amp;gt; op = this.mrwork.getAliasToWork().get(
alias);
if (op instanceof TableScanOperator) {
TableScanOperator ts = (TableScanOperator) op;
// push down projections.
ColumnProjectionUtils.appendReadColumns(
jobConf, ts.getNeededColumnIDs(), ts.getNeededColumns());
// push down filters
pushFilters(jobConf, ts);
}
}
}&lt;/pre>
&lt;p>注意这个方法:ColumnProjectionUtils.appendReadColumns，收集这个数据用到的字段。存储到的参数是&lt;br>
hive.io.file.readcolumn.ids 记录需要获取的字段ID&lt;br>
hive.io.file.readcolumn.names 记录需要获取的字段名称
在ParquetRecordReaderWrapper.getSplit里也有一个&lt;br>
jobConf = projectionPusher.pushProjectionsAndFilters(conf, finalPath.getParent());
感觉和上面的HiveInputFormat的功能重叠，代码基本一样，可能为了兼容旧版本？不过重复添加也没有影响。
使用这个字段是在DataWritableReadSupport.init里面，从final String columns = configuration.get(IOConstants.COLUMNS);拿出所有字段，然后构造一个schema，然后结合上面的hive.io.file.readcolumn.ids，从而构造出新的schema
过滤条件的下放也是类似的情况。&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/parquet/">Parquet</category></item><item><title>parquet编码定义</title><link>https://fatkun.github.io/2016/11/parquet-encoding-definitions.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/11/parquet-encoding-definitions.html</guid><pubDate>Sun, 13 Nov 2016 12:29:49 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>主要是翻译https://github.com/Parquet/parquet-format/blob/master/Encodings.md内容，没有完整翻译，有些地方没有理解，可能有理解错的地方。&lt;/p>
&lt;h2 id="plain-plain--0">Plain: (PLAIN = 0)&lt;/h2>
&lt;p>如果没有更高效的编码方式就采用这种方式存储
BOOLEAN: Bit Packed, LSB first&lt;br>
INT32: 4 bytes 小端存储&lt;br>
INT64: 8 bytes 小端存储&lt;br>
INT96: 12 bytes 小端存储&lt;br>
FLOAT: 4 bytes IEEE 小端存储&lt;br>
DOUBLE: 8 bytes IEEE 小端存储&lt;br>
BYTE_ARRAY: 4 bytes 小端存储字符数组长度，接着是字符字节&lt;br>
FIXED_LEN_BYTE_ARRAY: 纯字符字节（这个应该是固定长度的字符）
使用小端存储是因为存储快（未确认，见整型编码调研）&lt;/p>
&lt;h2 id="dictionary-encoding-plain_dictionary--2-字典编码已过时官方文档没更新使用rle_dictionary代替">Dictionary Encoding (PLAIN_DICTIONARY = 2) 字典编码（已过时，官方文档没更新，使用RLE_DICTIONARY代替）&lt;/h2>
&lt;p>对列的内容构建一个字典，字典会存储在每一个column chunk的dictionary page,内容页都存储为int类型使用RLE/Bit-Packing Hybrid（变长长度编码/Bit-Packing混合）编码&lt;br>
如果字典太大，不管是因为大小还是排重值过多，这种编码会退化为plain编码。&lt;br>
Dictionary page会在每个column chunk的开头，接着是data page。
Dictionary page 格式：使用plain编码存储，按字典的顺序&lt;br>
Data page 格式：使用1bytes存储位宽（bit width），最大位宽32bit。接着是使用RLE/Bit packed来存储指向数据的ID。&lt;br>
字典编码举例：构造字典AAA(1) BBB(2),那存储AAABBBAAA就变成：字典内容加上121&lt;/p>
&lt;h2 id="run-length-encoding--bit-packing-hybrid-rle--3-变长长度编码bit-packing混合">Run Length Encoding / Bit-Packing Hybrid (RLE = 3)  变长长度编码/Bit-Packing混合&lt;/h2>
&lt;p>场景：用于存储重复的数据
存储格式&lt;/p>
&lt;blockquote>
&lt;p>rle-bit-packed-hybrid: &lt;length> &lt;encoded-data>&lt;br>
length := &lt;encoded-data> 的长度，用4bytes小端存储&lt;br>
encoded-data := &lt;run>*&lt;br>
run := &lt;bit-packed-run> | &lt;rle-run>&lt;br>
bit-packed-run := &lt;bit-packed-header> &lt;bit-packed-values>&lt;br>
bit-packed-header := varint-encode(&lt;bit-pack-count> &amp;lt;&amp;lt; 1 | 1) //左移一位，最后一位补1，用来区分RLE，varint-encode搜索vlq编码&lt;br>
// bit-pack 总是每次压缩8个值，所以只用存储除以8&lt;br>
bit-pack-count := (number of values in this run) / 8&lt;br>
bit-packed-values := *see 1 below*&lt;br>
rle-run := &lt;rle-header> &lt;repeated-value>&lt;br>
rle-header := varint-encode( (number of times repeated) &amp;lt;&amp;lt; 1) // 重复的次数&lt;br>
repeated-value := value that is repeated, using a fixed-width of round-up-to-next-byte(bit-width) // 重复的内容，round-up-to-next-byte没看懂
以 0 至 7 这八个数字为例子&lt;/p>
&lt;/blockquote>
&lt;pre lang="other" escaped="true">dec value: 0 1 2 3 4 5 6 7
bit value: 000 001 010 011 100 101 110 111
bit label: ABC DEF GHI JKL MNO PQR STU VWX
编码后
bit value: 10001000 11000110 11111010
bit label: HIDEFABC RMNOJKLG VWXSTUPQ&lt;/pre>
&lt;p> 
和下面的Bit-packed (Deprecated)存储顺序不一样，这个是从least significant to most significant（从低位到高位）存储，但是值的位顺序不变&lt;br>
注意看bit label
为什么用这种顺序？看起来是像对小端硬件的优化。&lt;/p>
&lt;blockquote>
&lt;p>The reason for this packing order is to have fewer word-boundaries on little-endian hardware when deserializing more than one byte at at time. This is because 4 bytes can be read into a 32 bit register (or 8 bytes into a 64 bit register) and values can be unpacked just by shifting and ORing with a mask. (to make this optimization work on a big-endian machine, you would have to use the ordering used in the deprecated bit-packing encoding)
varint-encode() is ULEB-128 encoding, 搜索vlq编码
 &lt;/p>
&lt;/blockquote>
&lt;h2 id="bit-packed-deprecated-bit_packed--4">Bit-packed (Deprecated) (BIT_PACKED = 4)&lt;/h2>
&lt;p>已被Run Length Encoding / Bit-Packing Hybrid代替&lt;br>
举例说明，假如要存储0,1,2,3,4,5,6,7这8个数字，用plain的方式来存储是4bytes一个数字，总共 4 * 8 * 8 = 256位。现在采用位编码来存储上面的值，上面最大的数字7用位来表示是：00000000 00000000 00000000 00000111，它的有效位是111，只要用3bit就能存储所有比它小的值，8个数字共占用空间3*8=24bit。&lt;/p>
&lt;pre>dec value: 0 1 2 3 4 5 6 7
bit value: 000 001 010 011 100 101 110 111
bit label: ABC DEF GHI JKL MNO PQR STU VWX
bit value: 00000101 00111001 01110111
bit label: ABCDEFGH IJKLMNOP QRSTUVWX&lt;/pre>
&lt;p>bit label是用来标识上面的每一位的具体位置。&lt;/p>
&lt;h2 id="delta-encoding-delta_binary_packed--5差分编码">Delta Encoding (DELTA_BINARY_PACKED = 5)差分编码&lt;/h2>
&lt;p>支持类型: INT32, INT64
Delta Encoding由header+blocks of delta encoded values构成。每个block里面有多个miniblock，每一个miniblock有不同的bit width来压缩（binary packed）。 When there are not enough values to encode a full block we pad with zeros (added to the frame of reference)
header如下：
&lt;code>&amp;lt;block size in values&amp;gt; &amp;lt;number of miniblocks in a block&amp;gt; &amp;lt;total value count&amp;gt; &amp;lt;first value&amp;gt;&amp;lt;br /&amp;gt; &lt;/code>&lt;/p>
&lt;ul>
&lt;li>block size：一个乘以128用VLQ int存储的值（不清楚这个值怎么算）&lt;/li>
&lt;li>the miniblock count per block：miniblock的个数，用block size除以它可以算出每个block大小。一个乘以32用VLQ int存储的值&lt;/li>
&lt;li>total value count：VLQ int存储&lt;/li>
&lt;li>first value：zigzag VLQ int存储
每一个block包含
&lt;min delta> &lt;list of bitwidths of miniblocks> &lt;miniblocks>&lt;/li>
&lt;li>min delta：最小的差值（VLQ int），计算最小的差值是为了bit packing的时候都是正数&lt;/li>
&lt;li>bitwidth of each block用1 byte存储&lt;/li>
&lt;li>miniblocks：是一组根据前面指定bit width的bit packed 数字
有多个block是因为可以有多个基准值&lt;/li>
&lt;/ul>
&lt;h3 id="如何计算">如何计算？&lt;/h3>
&lt;ol>
&lt;li>计算相邻的差值&lt;/li>
&lt;li>使用zigzag VLQ int编码第一个值&lt;/li>
&lt;li>每一个block里计算参照值(frame of reference)（最小的那个差异值），这个保证每个差量都是正数&lt;/li>
&lt;li>使用VLQ int编码参照值，然后接着的是bit packed 的差异量(每一个减去参考值)
如果这个block只有一个值，第2,3步省略&lt;/li>
&lt;/ol>
&lt;h4 id="例子1">例子1&lt;/h4>
&lt;p>1, 2, 3, 4, 5
第1步后，计算每个数字和前一个数字的差值
1, 1, 1, 1
最小的差异值是1，第二步后
0, 0, 0, 0
最终编码的数据为：
header: 8 (block size), 1 (miniblock count), 5 (value count), 1 (first value)
block 1 (minimum delta), 0 (bitwidth), (no data needed for bitwidth 0)&lt;/p>
&lt;h4 id="例子2">例子2&lt;/h4>
&lt;p>7, 5, 3, 1, 2, 3, 4, 5，差异值为
-2, -2, -2, 1, 1, 1, 1
最小差异值为-2，每个差异值减去这个值后
0, 0, 0, 3, 3, 3, 3
最终编码的数据为：
header: 8 (block size), 1 (miniblock count), 8 (value count), 7 (first value)
block: 0 (minimum delta), 2 (bitwidth), 000000111111b (0,0,0,3,3,3 packed on 2 bits)
（这里不理解为什么minimum delta是0，block size也不清楚为什么是8）&lt;/p>
&lt;h3 id="特性">特性&lt;/h3>
&lt;p>有点像&lt;a href="https://github.com/Parquet/parquet-format/blob/master/Encodings.md#RLE">RLE/bit-packing&lt;/a>，但是&lt;a href="https://github.com/Parquet/parquet-format/blob/master/Encodings.md#RLE">RLE/bit-packing&lt;/a>在一个page里面使用单一的bit width。差分算法使用多个minblocks，可以有不同的bit width，对数值大小变化没那么敏感。如果在一段数据里面都是同一个值，这种算法只需要存储header就行了，不用存储数据（见例子1），这也是一种RLE编码。
 &lt;/p>
&lt;h2 id="delta-length-byte-array-delta_length_byte_array--6">Delta-length byte array: (DELTA_LENGTH_BYTE_ARRAY = 6)&lt;/h2>
&lt;p>支持类型: BYTE_ARRAY
这个编码比PLAIN的byte array好
存储方式，使用差分编码（DELTA_BINARY_PACKED）的方式来存储每个字符串的长度，接着就是每个字符串拼接起来。
这样做的好处是节省了记录长度的空间，以及对压缩好一些（不用在数据中间插入字符长度）
例子：
“Hello”, “World”, “Foobar”, “ABCDEF” -》DeltaEncoding(5, 5, 6, 6) “HelloWorldFoobarABCDEF”&lt;/p>
&lt;h2 id="delta-strings-delta_byte_array--7">Delta Strings: (DELTA_BYTE_ARRAY = 7)&lt;/h2>
&lt;p>支持类型: BYTE_ARRAY，适用于字符较多相似的字符数组
使用incremental encoding(&lt;a href="http://en.wikipedia.org/wiki/Incremental_encoding">http://en.wikipedia.org/wiki/Incremental_encoding&lt;/a>)编码，用DELTA_BINARY_PACKED编码来存储prefix lengths（前缀的长度），然后跟着用DELTA_LENGTH_BYTE_ARRAY编码的字节数组
例子：
“cat” “catlog” “abc” “abd” “add”
使用incremental encoding，前面是prefix lengths，表示和前一个字符串相同的字符串有多少
“0 cat”   “3 log”  “0 abc”  “2 d” “1dd”
最终存储
DELTA_BINARY_PACKED(0, 3, 0, 2, 1) DeltaEncoding(3, 3, 3, 1, 2) “catlogabcddd”
 &lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="https://github.com/Parquet/parquet-format/blob/master/Encodings.md">https://github.com/Parquet/parquet-format/blob/master/Encodings.md&lt;/a>&lt;br>
&lt;a href="https://github.com/apache/parquet-format">https://github.com/apache/parquet-format&lt;/a>
深入分析Parquet列式存储格式 &lt;a href="http://www.infoq.com/cn/articles/in-depth-analysis-of-parquet-column-storage-format">http://www.infoq.com/cn/articles/in-depth-analysis-of-parquet-column-storage-format&lt;/a>&lt;br>
整型编码调研 &lt;a href="https://github.com/sjtufighter/----Data---Storage--/blob/master/encodingDetails.md">https://github.com/sjtufighter/—-Data—Storage–/blob/master/encodingDetails.md&lt;/a>&lt;br>
VLQ(Variable-length quantity) 编码规则 &lt;a href="http://blog.allenm.me/2012/12/base64-vlq-encoding/">http://blog.allenm.me/2012/12/base64-vlq-encoding/&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category><category domain="https://fatkun.github.io/tags/parquet/">Parquet</category><category domain="https://fatkun.github.io/tags/%E6%96%87%E4%BB%B6%E6%A0%BC%E5%BC%8F/">文件格式</category></item><item><title>HIVE-10815 随机选择HiveMetaStoreClient</title><link>https://fatkun.github.io/2016/10/hive-10815-%E9%9A%8F%E6%9C%BA%E9%80%89%E6%8B%A9hivemetastoreclient.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/10/hive-10815-%E9%9A%8F%E6%9C%BA%E9%80%89%E6%8B%A9hivemetastoreclient.html</guid><pubDate>Sat, 22 Oct 2016 03:04:03 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;a href="https://issues.apache.org/jira/browse/HIVE-10815">https://issues.apache.org/jira/browse/HIVE-10815&lt;/a>
 
目前cdh5.4.0版本的hive第一次连接的时候，固定是使用第一个，只有连接失败后，才随机选择。&lt;/p>
&lt;pre>HiveMetaStoreClient.java&lt;/pre>
&lt;pre lang="java" escaped="true">// user wants file store based configuration
if (conf.getVar(HiveConf.ConfVars.METASTOREURIS) != null) {
String metastoreUrisString[] = conf.getVar(
HiveConf.ConfVars.METASTOREURIS).split(",");
metastoreUris = new URI[metastoreUrisString.length];
try {
int i = 0;
for (String s : metastoreUrisString) {
URI tmpUri = new URI(s);
if (tmpUri.getScheme() == null) {
throw new IllegalArgumentException("URI: " + s
+ " does not have a scheme");
}
metastoreUris[i++] = tmpUri;
}
} catch (IllegalArgumentException e) {
throw (e);
} catch (Exception e) {
MetaStoreUtils.logAndThrowMetaException(e);
}
} else {
LOG.error("NOT getting uris from conf");
throw new MetaException("MetaStoreURIs not found in conf file");
}&lt;/pre>
&lt;p> &lt;br>
在重连的时候，随机把后面的交换到第一个&lt;/p>
&lt;pre escaped="true" lang="java">private void promoteRandomMetaStoreURI() {
if (metastoreUris.length &amp;lt;= 1) {
return;
}
Random rng = new Random();
int index = rng.nextInt(metastoreUris.length - 1) + 1;
URI tmp = metastoreUris[0];
metastoreUris[0] = metastoreUris[index];
metastoreUris[index] = tmp;
}&lt;/pre>
&lt;p>HIVE-10815让metastore初始化的时候先打乱顺序&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/improve/">Improve</category></item><item><title>impala断开连接后释放session</title><link>https://fatkun.github.io/2016/10/impala%E6%96%AD%E5%BC%80%E8%BF%9E%E6%8E%A5%E5%90%8E%E9%87%8A%E6%94%BEsession.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/10/impala%E6%96%AD%E5%BC%80%E8%BF%9E%E6%8E%A5%E5%90%8E%E9%87%8A%E6%94%BEsession.html</guid><pubDate>Mon, 17 Oct 2016 02:38:58 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>代码在这里
&lt;a href="https://github.com/cloudera/Impala/blob/cdh5-2.2.0_5.4.0/be/src/service/impala-server.cc">https://github.com/cloudera/Impala/blob/cdh5-2.2.0_5.4.0/be/src/service/impala-server.cc&lt;/a>
 
如果不想断开清除session,直接return&lt;/p>
&lt;pre lang="csharp" escaped="true">void ImpalaServer::ConnectionEnd(
const ThriftServer::ConnectionContext&amp; connection_context) {
return;
unique_lock&amp;lt;mutex&amp;gt; l(connection_to_sessions_map_lock_);
ConnectionToSessionMap::iterator it =
connection_to_sessions_map_.find(connection_context.connection_id);
// Not every connection must have an associated session
if (it == connection_to_sessions_map_.end()) return;
LOG(INFO) &amp;lt;&amp;lt; "Connection from client " &amp;lt;&amp;lt; connection_context.network_address
&amp;lt;&amp;lt; " closed, closing " &amp;lt;&amp;lt; it-&amp;gt;second.size() &amp;lt;&amp;lt; " associated session(s)";
BOOST_FOREACH(const TUniqueId&amp; session_id, it-&amp;gt;second) {
Status status = CloseSessionInternal(session_id, true);
if (!status.ok()) {
LOG(WARNING) &amp;lt;&amp;lt; "Error closing session " &amp;lt;&amp;lt; session_id &amp;lt;&amp;lt; ": "
&amp;lt;&amp;lt; status.GetDetail();
}
}
connection_to_sessions_map_.erase(it);
}&lt;/pre>
&lt;p> &lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/impala/">Impala</category></item><item><title>HIVE-10956 HS2 leaks HMS connections</title><link>https://fatkun.github.io/2016/09/hive-10956-hs2-leaks-hms-connections.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/09/hive-10956-hs2-leaks-hms-connections.html</guid><pubDate>Thu, 08 Sep 2016 03:27:16 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;a href="https://issues.apache.org/jira/browse/HIVE-10956">https://issues.apache.org/jira/browse/HIVE-10956&lt;/a>
HMS链接泄露
 
&lt;a href="https://issues.apache.org/jira/browse/HIVE-13002">https://issues.apache.org/jira/browse/HIVE-13002&lt;/a>
 
HIVE-11934&lt;br>
Transaction lock retry logic results in infinite loop&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category></item><item><title>使用powermock</title><link>https://fatkun.github.io/2016/08/powermock.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/08/powermock.html</guid><pubDate>Wed, 17 Aug 2016 06:10:27 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在pom.xml加入&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;org.easymock&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;easymock&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;3.3.1&amp;lt;/version&amp;gt;
&amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;org.powermock&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;powermock-module-junit4&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;1.6.5&amp;lt;/version&amp;gt;
&amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;org.powermock&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;powermock-api-easymock&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;1.6.5&amp;lt;/version&amp;gt;
&amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;&lt;/pre>
&lt;p>如果报错，有可能项目中包含有低版本的javassist&lt;/p>
&lt;pre escaped="true" lang="java">java.lang.NoSuchMethodError: javassist.CtMethod.hasAnnotation(Ljava/lang/Class;)Z&lt;/pre>
&lt;p>尝试加入新版本的javassist，注意classpath的优先级是否正确&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;dependency&amp;gt;
&amp;lt;groupId&amp;gt;org.javassist&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;javassist&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;3.19.0-GA&amp;lt;/version&amp;gt;
&amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;
&amp;lt;/dependency&amp;gt;&lt;/pre>
&lt;p>使用文档可以看官网：https://github.com/jayway/powermock&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category></item><item><title>获取linux用户和组映射脚本</title><link>https://fatkun.github.io/2016/08/get-user-group-mapping.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/08/get-user-group-mapping.html</guid><pubDate>Mon, 08 Aug 2016 03:02:55 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>记录一下
python代码&lt;/p>
&lt;pre escaped="true" lang="python">#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import sys
p = os.popen('id %s' % sys.argv[1])
s = p.read()
# s = 'uid=486(yarn) gid=484(yarn) groups=484(yarn),493(hadoop),513(supergroup)'
user = re.findall("uid=\d+\((.*?)\)", s)[0]
s = s.split("groups=")[1]
match = re.findall("\((.*?)\)", s)
groups = []
for group in match:
groups.append(group)
print user + "=" + ",".join(sorted(groups))&lt;/pre>
&lt;p>shell脚本&lt;/p>
&lt;pre escaped="true" lang="bash">for user in $(cat /etc/passwd|gawk -F':' '{print $1}'); do
python ./f.py $user
done&lt;/pre></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/categories/linux/">Linux</category></item><item><title>hadoop组映射从配置文件读取</title><link>https://fatkun.github.io/2016/07/hadoop-group-mapping-from-file.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/07/hadoop-group-mapping-from-file.html</guid><pubDate>Sun, 31 Jul 2016 10:41:41 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>hadoop实现类似linux系统的文件权限，需要知道某个用户是属于哪个组。系统默认是使用ShellBasedUnixGroupsMapping 类来获取某个用户属于哪个组，实际是调用id命令来获取用户组信息。为了方便管理，也可以自己实现这个类，通过读取文件的方式来获得组信息。只要实现org.apache.hadoop.security.GroupMappingServiceProvider接口即可，具体可以参考ShellBasedUnixGroupsMapping的实现。
 &lt;/p>
&lt;h2 id="代码">代码&lt;/h2>
&lt;pre escaped="true" lang="java">package cn.uc.hadoop.security;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.security.GroupMappingServiceProvider;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
/**
* Created by fatkun on 2016/7/31.
*/
public class FileBasedUnixGroupsMapping implements GroupMappingServiceProvider {
private ConcurrentHashMap&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt; groups = null;
private static final Log LOG = LogFactory.getLog(FileBasedUnixGroupsMapping.class);
private String confFilePath = "/home/cloudera/var/group/groups.txt";
// 格式： user1=group1,group2
public void setConfFilePath(String confFilePath) {
this.confFilePath = confFilePath;
}
private synchronized void loadConf(boolean refresh) {
if (refresh || groups == null) {
ConcurrentHashMap&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt; tmpGroups = new ConcurrentHashMap&amp;lt;&amp;gt;();
try {
BufferedReader reader = new BufferedReader(new FileReader(confFilePath));
String line = null;
while ((line = reader.readLine()) != null) {
line = line.trim();
if (line.startsWith("#")) continue;
String[] ugArray = line.split("=");
if (ugArray.length == 2) {
String user = ugArray[0].trim();
List&amp;lt;String&amp;gt; groupList = new ArrayList&amp;lt;&amp;gt;();
Set&amp;lt;String&amp;gt; groupSet = new HashSet&amp;lt;String&amp;gt;();
groupSet.add(user);
for (String group : ugArray[1].split(",")) {
groupSet.add(group.trim());
}
groupList.addAll(groupSet);
LOG.info("add user=" + user + " groups=" + groupList);
tmpGroups.put(user, groupList);
}
}
reader.close();
} catch (IOException e) {
LOG.error("LOAD GROUP MAPPING ERROR", e);
}
groups = tmpGroups;
}
}
@Override
public List&amp;lt;String&amp;gt; getGroups(String user) {
if (groups == null) {
loadConf(false);
}
List&amp;lt;String&amp;gt; groupList = groups.get(user);
// 如果找不到组配置，返回一个和用户名一样的组名称
if (groupList == null) {
groupList = new ArrayList&amp;lt;&amp;gt;();
groupList.add(user);
LOG.error("CAN'T NOT FIND GROUPS FOR USER " + user);
}
return groupList;
}
@Override
public void cacheGroupsRefresh() {
loadConf(true);
}
@Override
public void cacheGroupsAdd(List&amp;lt;String&amp;gt; groups) throws IOException {
// does nothing in this provider of user to groups mapping
}
public static void main(String[] args) throws IOException {
FileBasedUnixGroupsMapping f = new FileBasedUnixGroupsMapping();
f.setConfFilePath("d:/tmp/groups.txt");
System.out.println(f.getGroups("impala"));
}
}&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="在cloudera如何使用">在cloudera如何使用&lt;/h2>
&lt;p>在namenode的配置“hdfs-site.xml 的 NameNode 高级配置代码段”加入以下配置，注意不要改“服务级别的hadoop.security.group.mapping”，我们只打算改掉namenode获取组映射的方式&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;hadoop.security.group.mapping&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;cn.uc.hadoop.security.FileBasedUnixGroupsMapping&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre>
&lt;p>在 “NameNode 环境高级配置代码段（安全阀）”加入（把jar加入namenode的classpath里面）&lt;/p>
&lt;pre escaped="true" lang="bash">HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/home/cloudera/var/group/hadoopgroup.jar&lt;/pre>
&lt;p>生成groups.txt见 &lt;a href="http://fatkun.com/2016/08/get-user-group-mapping.html" target="_blank">&lt;a href="http://fatkun.com/2016/08/get-user-group-mapping.html">http://fatkun.com/2016/08/get-user-group-mapping.html&lt;/a>&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category><category domain="https://fatkun.github.io/tags/namenode/">Namenode</category></item><item><title>迁移Hadoop NameNode</title><link>https://fatkun.github.io/2016/07/migrate-hadoop-namenode.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/07/migrate-hadoop-namenode.html</guid><pubDate>Fri, 22 Jul 2016 09:55:06 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;div id="wmd-preview-section-16098" class="wmd-preview-section preview-content"> 版本：hadoop cdh5.4&lt;/p>
&lt;h2 id="迁移hadoop-namenode"> 传输文件 &lt;/h2>&lt;/div>
&lt;div id="wmd-preview-section-9638" class="wmd-preview-section preview-content"> &lt;pre class="prettyprint">&lt;code class=" hljs 1c">接收方 nc -l &amp;lt;span class="hljs-number">19999&amp;lt;/span> &amp;lt;span class="hljs-string">| tar zxvf -&amp;lt;/span>
发送方 tar czvf - ./current &amp;lt;span class="hljs-string">| nc serverip 19999&amp;lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;div id="wmd-preview-section-9639" class="wmd-preview-section preview-content"> &lt;h3 id="迁移方案"> 迁移方案 &lt;/h3>
&lt;p> 采用修改/etc/hosts的方式，把原hostname指向新的IP，新机器更改hostname &lt;/p>&lt;/div>
&lt;div id="wmd-preview-section-9640" class="wmd-preview-section preview-content"> &lt;h3 id="迁移前准备"> 迁移前准备 &lt;/h3>
&lt;ul> &lt;li> 迁移旧namenode机器上的其他服务，只保留HDFS Failover Controller、HDFS JournalNode、HDFS NameNode、ZooKeeper（如有） &lt;/li>
&lt;li> 在hdfs配置中找出元数据存放目录(dfs.name.dir)：/home/cloudera/var/dfs/nn &lt;/li>
&lt;li> 在新NameNode机器建立好用户和组（否则权限不正确） &lt;/li>
&lt;li> 如果要迁移Hive Metastore，要注意mysql-connector.jar是否部署好（放在 /usr/share/java/mysql-connector-java.jar） &lt;/li>
&lt;li> 更改/etc/hosts准备 &lt;/li>
&lt;li> 在新机器部署cloudera &lt;/li> &lt;/ul>&lt;/div>
&lt;div id="wmd-preview-section-9641" class="wmd-preview-section preview-content"> &lt;h3 id="开始迁移"> 开始迁移 &lt;/h3>&lt;/div>
&lt;div id="wmd-preview-section-9642" class="wmd-preview-section preview-content"> &lt;h4 id="1备份元数据"> 1.备份元数据 &lt;/h4>
&lt;ul> &lt;li> 让备机NameNode进入安全模式 &lt;/li>
&lt;li> 保存Namespace &lt;/li>
&lt;li> 进入元数据目录，新建目录，备份fsimage_*（最新的一份）、fsimage_*.md5、seen_txid、VERSION、edits_* &lt;/li>
&lt;li> 把元数据传到新机器 &lt;/li> &lt;/ul>&lt;/div>
&lt;div id="wmd-preview-section-9643" class="wmd-preview-section preview-content"> &lt;pre class="prettyprint">&lt;code class=" hljs vala">&amp;lt;span class="hljs-preprocessor"># 在新机器执行&amp;lt;/span>
mkdir -p /home/cloudera/&amp;lt;span class="hljs-keyword">var&amp;lt;/span>/dfs/nn/current
chown -R hdfs:hdfs /home/cloudera/&amp;lt;span class="hljs-keyword">var&amp;lt;/span>/dfs
&lt;p>&amp;lt;span class=&amp;quot;hljs-preprocessor&amp;quot;&amp;gt;# 传输文件（要注意nc的版本）&amp;lt;/span&amp;gt;
&amp;lt;span class=&amp;quot;hljs-preprocessor&amp;quot;&amp;gt;#接收方 &amp;lt;/span&amp;gt;
nc -l &amp;lt;span class=&amp;quot;hljs-number&amp;quot;&amp;gt;19999&amp;lt;/span&amp;gt; | tar zxvf -
&amp;lt;span class=&amp;quot;hljs-preprocessor&amp;quot;&amp;gt;#传送方&amp;lt;/span&amp;gt;
tar czvf - ./fsimage_0000000000006460983* seen_txid &amp;lt;span class=&amp;quot;hljs-constant&amp;quot;&amp;gt; VERSION &amp;lt;/span&amp;gt;edits_* | nc serverip &amp;lt;span class=&amp;quot;hljs-number&amp;quot;&amp;gt;19999&amp;lt;/span&amp;gt; &lt;/code>&lt;/pre>&lt;/div>&lt;/p>
&lt;div id="wmd-preview-section-13170" class="wmd-preview-section preview-content"> &lt;h4 id="2停止namenode备机服务"> 2.停止NameNode备机服务 &lt;/h4>
&lt;ul> &lt;li> 把这台机器的所有服务停止，并且删除掉（停止前记录一下上面有哪些服务） &lt;/li>
&lt;li> 停止两个HDFS Failover Controller &lt;/li>
&lt;li> 停止旧机器的agent /etc/init.d/cloudera-scm-agent stop &lt;/li>
&lt;li> 从主机中删除旧机器 &lt;/li> &lt;/ul>&lt;/div>
&lt;div id="wmd-preview-section-12219" class="wmd-preview-section preview-content"> &lt;h4 id="3修改ip和hostname"> 3.修改IP和Hostname &lt;/h4>
&lt;ul> &lt;li> 修改所有机器的旧hostname指向新IP &lt;/li>
&lt;li> 修改旧机器的hostname为其他名称（可以不操作） &lt;/li>
&lt;li> 修改新机器的hostname为旧机器hostname，注意/etc/hosts里面本机的原有hostname/IP注释掉 &lt;/li>
&lt;li> 重启新机器的cloudera agent：/etc/init.d/cloudera-scm-agent restart &lt;/li>
&lt;li> 重启完成检查主机名称是否变更 &lt;/li>
&lt;li> 重启agent后要重新部署CDH &lt;/li> &lt;/ul>&lt;/div>
&lt;div id="wmd-preview-section-16054" class="wmd-preview-section preview-content"> &lt;h4 id="4重新添加回服务"> 4.重新添加回服务 &lt;/h4>
&lt;ul> &lt;li> 添加ZooKeeper &lt;/li>
&lt;li> 添加Hive Metastore &lt;/li>
&lt;li> 添加NameNode、JournalNode、Failover Controller，需要改nameservice，先启动NameNode &lt;/li>
&lt;li> 等namenode汇报完块后 &lt;/li> &lt;/ul>&lt;/div>
&lt;div id="wmd-preview-section-17102" class="wmd-preview-section preview-content"> &lt;h4 id="5重启"> 5.重启 &lt;/h4>
&lt;ul> &lt;li> 重启zookeeper（全部重启） &lt;/li>
&lt;li> 重启hbase &lt;/li>
&lt;li> 重启impala &lt;/li>
&lt;li> 重启nodemanager、history server &lt;/li>
&lt;li> 重启spark &lt;/li>
&lt;li> 重启所有用了hdfs常驻型的程序 &lt;/li> &lt;/ul>
&lt;p> 等新机器NameNode正常后，切换为主NameNode &lt;/p>&lt;/div>
&lt;div id="wmd-preview-section-9648" class="wmd-preview-section preview-content"> &lt;h3 id="错误处理"> 错误处理 &lt;/h3>
&lt;p> &lt;code>namenode (osg13-vm05) 在其主机上不具备自动故障转移所必需的 Failover Controller。&lt;/code>&lt;br /> 没有添加Failover Controller，添加一个 &lt;/p>&lt;/div>
&lt;div id="wmd-preview-section-13874" class="wmd-preview-section preview-content"> &lt;h3 id="检查"> 检查 &lt;/h3>
&lt;p> hdfs：hdfs dfs -ls /tmp&lt;br /> hive：show tables;&lt;br /> &lt;strong>&lt;em>impala&lt;/em>&lt;/strong>&lt;br /> show tables; desc xxx; select&lt;br /> &lt;strong>&lt;em>hbase&lt;/em>&lt;/strong> &lt;/p>&lt;/div>
&lt;div id="wmd-preview-section-13911" class="wmd-preview-section preview-content"> &lt;pre class="prettyprint">&lt;code class=" hljs php">hbase shell
&amp;lt;span class="hljs-keyword">list&amp;lt;/span>
desc &amp;lt;span class="hljs-string">"gjtt_uid"&amp;lt;/span>
scan &amp;lt;span class="hljs-string">'gjtt_uid'&amp;lt;/span>,{LIMIT =&amp;gt;&amp;lt;span class="hljs-number">2&amp;lt;/span>}&lt;/code>&lt;/pre>
&lt;p> &lt;strong>&lt;em>hadoop&lt;/em>&lt;/strong> &lt;/p>&lt;/div>
&lt;div id="wmd-preview-section-13534" class="wmd-preview-section preview-content"> &lt;pre class="prettyprint">&lt;code class=" hljs lasso">hadoop jar /home/cloudera/parcels/CDH/lib/hadoop&amp;lt;span class="hljs-attribute">-mapreduce&amp;lt;/span>/hadoop&amp;lt;span class="hljs-attribute">-mapreduce&amp;lt;/span>&amp;lt;span class="hljs-attribute">-examples&amp;lt;/span>&amp;lt;span class="hljs-built_in">.&amp;lt;/span>jar pi &amp;lt;span class="hljs-number">1&amp;lt;/span> &amp;lt;span class="hljs-number">10&amp;lt;/span>&lt;/code>&lt;/pre>
&lt;p> &lt;strong>&lt;em>spark&lt;/em>&lt;/strong>&lt;br /> spark-shell &lt;/p>&lt;/div>
&lt;div id="wmd-preview-section-38061" class="wmd-preview-section preview-content"> &lt;pre class="prettyprint">&lt;code class=" hljs avrasm">val input = sc&amp;lt;span class="hljs-preprocessor">.textFile&amp;lt;/span>(&amp;lt;span class="hljs-string">"/tmp/issue"&amp;lt;/span>)
input&amp;lt;span class="hljs-preprocessor">.flatMap&amp;lt;/span>(_&amp;lt;span class="hljs-preprocessor">.split&amp;lt;/span>(&amp;lt;span class="hljs-string">" "&amp;lt;/span>))&amp;lt;span class="hljs-preprocessor">.map&amp;lt;/span>((_, &amp;lt;span class="hljs-number">1&amp;lt;/span>))&amp;lt;span class="hljs-preprocessor">.reduceByKey&amp;lt;/span>(_ + _)&amp;lt;span class="hljs-preprocessor">.foreach&amp;lt;/span>(println)&lt;/code>&lt;/pre>&lt;/div>
&lt;div id="wmd-preview-section-39422" class="wmd-preview-section preview-content"> &lt;h3 id="回滚"> 回滚 &lt;/h3>
&lt;p> 把hosts改回去，namenode切换回去 &lt;/p>&lt;/div>
&lt;div id="wmd-preview-section-43963" class="wmd-preview-section preview-content"> &lt;h3 id="做不到不影响服务的原因"> 做不到不影响服务的原因 &lt;/h3>
&lt;p> 一开始以为是java缓存了host/IP，但测试之后发现java只缓存30秒。&lt;br /> 原因是DfsClient在建立rpcProxy对象的时候，已经把namenode两台机器的host解析出来，并且放在ConnectionId里，这个对象会一直使用。&lt;br /> 补丁&lt;a href="https://issues.apache.org/jira/browse/HADOOP-7472">HADOOP-7472&lt;/a> 只解决了在没有HA的场景，不过也让datanode可以不用重启。&lt;br /> 在HA场景下，恰好让上面的补丁失效了。&lt;br /> 在社区找了一下新的ISSUE &lt;a href="https://issues.apache.org/jira/browse/HADOOP-12125">https://issues.apache.org/jira/browse/HADOOP-12125&lt;/a> ，但可能不是重要的问题，也没人提交补丁。因为涉及比较基础的类，影响比较大，也不打算修改，采取重启的方式。&lt;br /> 也尝试了一些奇怪的方法，但是没有很好的解决问题，还是选择重启服务。 &lt;/p>&lt;/div></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category></item><item><title>hadoop磁盘写入选择策略</title><link>https://fatkun.github.io/2016/07/hadoop-volume-choosing-policy.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/07/hadoop-volume-choosing-policy.html</guid><pubDate>Thu, 14 Jul 2016 10:27:36 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>hadoop写入时，默认磁盘选择是轮询的方式。可以改用按空间大小来分配，避免某个磁盘特别满。
参数 ：dfs.datanode.fsdataset.volume.choosing.policy&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;dfs.datanode.fsdataset.volume.choosing.policy&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;org.apache.hadoop.hdfs.server.datanode.fsdataset.AvailableSpaceVolumeChoosingPolicy&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre>
&lt;p>详细见：&lt;br>
&lt;a href="http://blog.csdn.net/bigdatahappy/article/details/39992075">hadoop2.0的datanode多目录数据副本存放策略&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>hadoop更换namenode注意事项</title><link>https://fatkun.github.io/2016/05/hadoop%E6%9B%B4%E6%8D%A2namenode%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/05/hadoop%E6%9B%B4%E6%8D%A2namenode%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9.html</guid><pubDate>Wed, 25 May 2016 09:56:00 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;ol>
&lt;li>所有机器hosts都要加上新namenode&lt;/li>
&lt;li>新namenode要建立好以前的用户和组&lt;/li>
&lt;li>zookeeper中HA的信息可以删除，然后重建zookeeper HA&lt;/li>
&lt;li>把namenode image备份，把image和edit log传到新机器&lt;/li>
&lt;li>需要删除一个namenode和failover controler，然后重新建&lt;/li>
&lt;li>重启所有业务（包含用到hdfs的所有程序）&lt;/li>
&lt;li>重新部署所有配置&lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category></item><item><title>[HADOOP-11238]hdfs namenode getGroups延迟</title><link>https://fatkun.github.io/2016/05/hadoop-11238.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/05/hadoop-11238.html</guid><pubDate>Sun, 15 May 2016 02:29:06 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在namenode日志看到如下错误&lt;/p>
&lt;pre escaped="true" lang="html">2016-05-11 01:00:26,360 WARN org.apache.hadoop.security.Groups: Potential performance problem: getGroups(user=xxx) took 5046 milliseconds&lt;/pre>
&lt;p>这个方法是hadoop为了获取某个用户是哪个组。&lt;/p>
&lt;h2 id="分析补丁">分析补丁&lt;/h2>
&lt;p>补丁：&lt;a href="https://issues.apache.org/jira/browse/HADOOP-11238">https://issues.apache.org/jira/browse/HADOOP-11238&lt;/a>&lt;br>
先贴出修改前的源代码&lt;/p>
&lt;pre escaped="true" lang="java">public List&amp;lt;String&amp;gt; getGroups(String user) throws IOException {
// No need to lookup for groups of static users
List&amp;lt;String&amp;gt; staticMapping = staticUserToGroupsMap.get(user);
if (staticMapping != null) {
return staticMapping;
}
// Return cached value if available
CachedGroups groups = userToGroupsMap.get(user);
long startMs = timer.monotonicNow();
if (!hasExpired(groups, startMs)) {
if(LOG.isDebugEnabled()) {
LOG.debug("Returning cached groups for '" + user + "'");
}
if (groups.getGroups().isEmpty()) {
// Even with enabling negative cache, getGroups() has the same behavior
// that throws IOException if the groups for the user is empty.
throw new IOException("No groups found for user " + user);
}
return groups.getGroups();
}
// Create and cache user's groups
List&amp;lt;String&amp;gt; groupList = impl.getGroups(user);
long endMs = timer.monotonicNow();
long deltaMs = endMs - startMs ;
UserGroupInformation.metrics.addGetGroups(deltaMs);
if (deltaMs &amp;gt; warningDeltaMs) {
LOG.warn("Potential performance problem: getGroups(user=" + user +") " +
"took " + deltaMs + " milliseconds.");
}
groups = new CachedGroups(groupList, endMs);
if (groups.getGroups().isEmpty()) {
if (isNegativeCacheEnabled()) {
userToGroupsMap.put(user, groups);
}
throw new IOException("No groups found for user " + user);
}
userToGroupsMap.put(user, groups);
if(LOG.isDebugEnabled()) {
LOG.debug("Returning fetched groups for '" + user + "'");
}
return groups.getGroups();
}&lt;/pre>
&lt;p>导致缓慢的原因是，当缓存超过时间失效时，同时有多个线程调用impl.getGroups(user)方法，我们默认是使用org.apache.hadoop.security.ShellBasedUnixGroupsMapping的实现，这个实际是调用系统命令id来获取用户组信息。多线程调用时，可能会同时启动几十个进程，导致返回缓慢。
我之前想到的修改方法是使用线程同步的方式，避免多个线程同时更新cache。搜索一下issue果然有人实现了，但那个是很久就提交了，没实现NegativeCache，所以官方合并是我上面给出来的补丁。
HADOOP-11238实现的方案是使用&lt;a href="http://ifeve.com/google-guava-cachesexplained/">Google Guava&lt;/a>第三方库来缓存。不了解具体实现，看注释同样实现了多线程请求时，如果在缓存中不存在，也只有一个线程加载，其他线程等待这个线程加载完成。如果在缓存中存在，直接返回缓存内容，如果缓存超时，刷新数据过程中，其他线程仍然获取旧数据，不会等待这个刷新。&lt;br>
NegativeCache是为了缓存空组（某个用户不属于任何组）的情况，超时时间和cache不一样，所以额外加了个变量。&lt;/p>
&lt;h2 id="相关参数">相关参数&lt;/h2>
&lt;p>hadoop.security.group.mapping&lt;br>
可选值有&lt;br>
org.apache.hadoop.security.ShellBasedUnixGroupsMapping 直接调用系统命令id&lt;br>
org.apache.hadoop.security.JniBasedUnixGroupsMapping 使用jni调用hadoop自己实现获取组的c++程序&lt;br>
org.apache.hadoop.security.JniBasedUnixGroupsNetgroupMappingWithFallback 使用jni调用，如果加载c++程序失败，改用ShellBase的方式&lt;br>
org.apache.hadoop.security.LdapGroupsMapping 使用ldap方式获取
也可以自己实现一个方法，可以通过读取文件的方式来获取组和用户的映射&lt;/p>
&lt;h2 id="踩坑">踩坑&lt;/h2>
&lt;p>cloudera manager里面的hadoop.security.group.mapping配置是在“服务范围”内的，也就是对客户端和服务端都会生效。设置为jni的方式后，客户端可能会加载不到native lib导致任务失败。&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>DataNode启动流程源码分析</title><link>https://fatkun.github.io/2016/05/datanode-start.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/05/datanode-start.html</guid><pubDate>Mon, 02 May 2016 09:28:42 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="背景">背景&lt;/h2>
&lt;p>最近打算要重启DataNode，之前有试过重启过程中导致业务任务失败的情况。所以想了解DataNode什么时候才算启动完成，以及能否检测DataNode是否已经准备好了。&lt;br>
本文分析的源码版本是hadoop cdh5.4.0&lt;/p>
&lt;h2 id="源码分析">源码分析&lt;/h2>
&lt;p>从Datanode.java main方法开始&lt;/p>
&lt;pre lang="java" escaped="true">public static void main(String args[]) {
if (DFSUtil.parseHelpArgument(args, DataNode.USAGE, System.out, true)) {
System.exit(0);
}
secureMain(args, null);
}&lt;/pre>
&lt;p>进入secureMain方法，这里调用了createDataNode方法&lt;/p>
&lt;pre lang="java" escaped="true">public static DataNode createDataNode(String args[], Configuration conf,
SecureResources resources) throws IOException {
// 实例化datanode
DataNode dn = instantiateDataNode(args, conf, resources);
if (dn != null) {
// 启动BPOfferService、dataXceiverServer、ipcServer等
dn.runDatanodeDaemon();
}
return dn;
}&lt;/pre>
&lt;pre lang="java" escaped="true">public static DataNode instantiateDataNode(String args [], Configuration conf,
SecureResources resources) throws IOException {
if (conf == null)
conf = new HdfsConfiguration();
if (args != null) {
// parse generic hadoop options
GenericOptionsParser hParser = new GenericOptionsParser(conf, args);
args = hParser.getRemainingArgs();
}
if (!parseArguments(args, conf)) {
printUsage(System.err);
return null;
}
// 获取实际的存储路径（根据配置dfs.datanode.data.dir）
Collection&amp;lt;StorageLocation&amp;gt; dataLocations = getStorageLocations(conf);
UserGroupInformation.setConfiguration(conf);
SecurityUtil.login(conf, DFS_DATANODE_KEYTAB_FILE_KEY,
DFS_DATANODE_KERBEROS_PRINCIPAL_KEY);
return makeInstance(dataLocations, conf, resources);
}&lt;/pre>
&lt;pre lang="java" escaped="true">static DataNode makeInstance(Collection&amp;lt;StorageLocation&amp;gt; dataDirs,
Configuration conf, SecureResources resources) throws IOException {
LocalFileSystem localFS = FileSystem.getLocal(conf);
FsPermission permission = new FsPermission(
conf.get(DFS_DATANODE_DATA_DIR_PERMISSION_KEY,
DFS_DATANODE_DATA_DIR_PERMISSION_DEFAULT));
// DataNode磁盘检查类，检查目录权限以及是否能够创建目录
DataNodeDiskChecker dataNodeDiskChecker =
new DataNodeDiskChecker(permission);
// 找出能够正常读写的路径
List&amp;lt;StorageLocation&amp;gt; locations =
checkStorageLocations(dataDirs, localFS, dataNodeDiskChecker);
DefaultMetricsSystem.initialize("DataNode");
assert locations.size() &amp;gt; 0 : "number of data directories should be &amp;gt; 0";
return new DataNode(conf, locations, resources);
}&lt;/pre>
&lt;p>进入DataNode构造方法，主要看startDataNode(conf, dataDirs, resources)方法&lt;/p>
&lt;pre lang="java" escaped="true">void startDataNode(Configuration conf,
List&amp;lt;StorageLocation&amp;gt; dataDirs,
SecureResources resources
) throws IOException {
// settings global for all BPs in the Data Node
this.secureResources = resources;
synchronized (this) {
this.dataDirs = dataDirs;
}
this.conf = conf;
this.dnConf = new DNConf(conf);
checkSecureConfig(dnConf, conf, resources);
this.spanReceiverHost = SpanReceiverHost.getInstance(conf);
if (dnConf.maxLockedMemory &amp;gt; 0) {
if (!NativeIO.POSIX.getCacheManipulator().verifyCanMlock()) {
throw new RuntimeException(String.format(
"Cannot start datanode because the configured max locked memory" +
" size (%s) is greater than zero and native code is not available.",
DFS_DATANODE_MAX_LOCKED_MEMORY_KEY));
}
if (Path.WINDOWS) {
NativeIO.Windows.extendWorkingSetSize(dnConf.maxLockedMemory);
} else {
long ulimit = NativeIO.POSIX.getCacheManipulator().getMemlockLimit();
if (dnConf.maxLockedMemory &amp;gt; ulimit) {
throw new RuntimeException(String.format(
"Cannot start datanode because the configured max locked memory" +
" size (%s) of %d bytes is more than the datanode's available" +
" RLIMIT_MEMLOCK ulimit of %d bytes.",
DFS_DATANODE_MAX_LOCKED_MEMORY_KEY,
dnConf.maxLockedMemory,
ulimit));
}
}
}
LOG.info("Starting DataNode with maxLockedMemory = " +
dnConf.maxLockedMemory);
storage = new DataStorage();
// global DN settings
registerMXBean();
// 初始化xceiverServer一些对象
initDataXceiver(conf);
// 启动http web hdfs
startInfoServer(conf);
pauseMonitor = new JvmPauseMonitor(conf);
pauseMonitor.start();
// BlockPoolTokenSecretManager is required to create ipc server.
this.blockPoolTokenSecretManager = new BlockPoolTokenSecretManager();
// Login is done by now. Set the DN user name.
dnUserName = UserGroupInformation.getCurrentUser().getShortUserName();
LOG.info("dnUserName = " + dnUserName);
LOG.info("supergroup = " + supergroup);
// 初始化ipc服务
initIpcServer(conf);
metrics = DataNodeMetrics.create(conf, getDisplayName());
metrics.getJvmMetrics().setPauseMonitor(pauseMonitor);
// 重要，构造BlockPoolManager
blockPoolManager = new BlockPoolManager(this);
blockPoolManager.refreshNamenodes(conf);
// Create the ReadaheadPool from the DataNode context so we can
// exit without having to explicitly shutdown its thread pool.
readaheadPool = ReadaheadPool.getInstance();
saslClient = new SaslDataTransferClient(dnConf.conf,
dnConf.saslPropsResolver, dnConf.trustedChannelResolver);
saslServer = new SaslDataTransferServer(dnConf, blockPoolTokenSecretManager);
}&lt;/pre>
&lt;p>在blockPoolManager.refreshNamenodes里面调用了doRefreshNamenodes()方法&lt;/p>
&lt;pre lang="java" escaped="true">private void doRefreshNamenodes(
Map&amp;lt;String, Map&amp;lt;String, InetSocketAddress&amp;gt;&amp;gt; addrMap) throws IOException {
assert Thread.holdsLock(refreshNamenodesLock);
Set&amp;lt;String&amp;gt; toRefresh = Sets.newLinkedHashSet();
Set&amp;lt;String&amp;gt; toAdd = Sets.newLinkedHashSet();
Set&amp;lt;String&amp;gt; toRemove;
synchronized (this) {
// Step 1. For each of the new nameservices, figure out whether
// it's an update of the set of NNs for an existing NS,
// or an entirely new nameservice.
for (String nameserviceId : addrMap.keySet()) {
if (bpByNameserviceId.containsKey(nameserviceId)) {
toRefresh.add(nameserviceId);
} else {
toAdd.add(nameserviceId);
}
}
// Step 2. Any nameservices we currently have but are no longer present
// need to be removed.
toRemove = Sets.newHashSet(Sets.difference(
bpByNameserviceId.keySet(), addrMap.keySet()));
assert toRefresh.size() + toAdd.size() ==
addrMap.size() :
"toAdd: " + Joiner.on(",").useForNull("&amp;lt;default&amp;gt;").join(toAdd) +
" toRemove: " + Joiner.on(",").useForNull("&amp;lt;default&amp;gt;").join(toRemove) +
" toRefresh: " + Joiner.on(",").useForNull("&amp;lt;default&amp;gt;").join(toRefresh);
// 由于是重启，所以都是在toAdd里面
// Step 3. Start new nameservices
if (!toAdd.isEmpty()) {
LOG.info("Starting BPOfferServices for nameservices: " +
Joiner.on(",").useForNull("&amp;lt;default&amp;gt;").join(toAdd));
// 这里遍历的是nameServices，如果用了hdfs federation就会有多个
for (String nsToAdd : toAdd) {
ArrayList&amp;lt;InetSocketAddress&amp;gt; addrs =
Lists.newArrayList(addrMap.get(nsToAdd).values());
// 创建BPOfferService
BPOfferService bpos = createBPOS(addrs);
// 加入bpByNameserviceId里面，下次再执行这个方法的话，就是加入toRefresh里面了
bpByNameserviceId.put(nsToAdd, bpos);
offerServices.add(bpos);
}
}
// 启动所有offerServices的BPOfferService
startAll();
}&lt;/pre>
&lt;p>关注一下createBPOS方法，里面会包含多个BPServiceActor，存储在 BPOfferService.bpServices 变量内&lt;/p>
&lt;pre lang="java" escaped="true">protected BPOfferService createBPOS(List&amp;lt;InetSocketAddress&amp;gt; nnAddrs) {
return new BPOfferService(nnAddrs, dn);
}
BPOfferService(List&amp;lt;InetSocketAddress&amp;gt; nnAddrs, DataNode dn) {
Preconditions.checkArgument(!nnAddrs.isEmpty(),
"Must pass at least one NN.");
this.dn = dn;
// 如果有standby和active两个namenode，就会创建两个BPServiceActor
for (InetSocketAddress addr : nnAddrs) {
this.bpServices.add(new BPServiceActor(addr, this));
}
}&lt;/pre>
&lt;p>上面的startAll()把所有的BPOfferService都启动了，实际是调用下面的BPServiceActor.start()，BPServiceActor的作用在这文件的最上面注释写着：1.和namenode预注册，2.和namenode注册，3.周期性发送心跳到namenode，4.处理来自于namenode的命令。继续看这个类的run()方法&lt;/p>
&lt;pre lang="java" escaped="true">public void run() {
LOG.info(this + " starting to offer service");
try {
while (true) {
// init stuff
try {
// 向namenode注册以及初始化blockPool
// setup storage
connectToNNAndHandshake();
break;
} catch (IOException ioe) {
// Initial handshake, storage recovery or registration failed
runningState = RunningState.INIT_FAILED;
if (shouldRetryInit()) {
// Retry until all namenode's of BPOS failed initialization
LOG.error("Initialization failed for " + this + " "
+ ioe.getLocalizedMessage());
sleepAndLogInterrupts(5000, "initializing");
} else {
runningState = RunningState.FAILED;
LOG.fatal("Initialization failed for " + this + ". Exiting. ", ioe);
return;
}
}
}
runningState = RunningState.RUNNING;
while (shouldRun()) {
try {
// 更新当前那个是active actor，发送blockReport给namenode等
offerService();
} catch (Exception ex) {
LOG.error("Exception in BPOfferService for " + this, ex);
sleepAndLogInterrupts(5000, "offering service");
}
}
runningState = RunningState.EXITED;
} catch (Throwable ex) {
LOG.warn("Unexpected exception in block pool " + this, ex);
runningState = RunningState.FAILED;
} finally {
LOG.warn("Ending block pool service for: " + this);
cleanUp();
}
}&lt;/pre>
&lt;p>关注connectToNNAndHandshake()方法，这里初始化了blockPool&lt;/p>
&lt;pre lang="java" escaped="true">private void connectToNNAndHandshake() throws IOException {
// get NN proxy
bpNamenode = dn.connectToNN(nnAddr);
// 从namenode获取一些版本等信息用于校验
// First phase of the handshake with NN - get the namespace
// info.
NamespaceInfo nsInfo = retrieveNamespaceInfo();
// Verify that this matches the other NN in this HA pair.
// This also initializes our block pool in the DN if we are
// the first NN connection for this BP.
bpos.verifyAndSetNamespaceInfo(nsInfo);
// 向namenode注册，并且设定了一下blockReport的时间（当前时间 - (blockReportInterval - delay)），默认是马上
// Second phase of the handshake with the NN.
register();
}&lt;/pre>
&lt;p>在verifyAndSetNamespaceInfo()方法里，主要看dn.initBlockPool(this);&lt;/p>
&lt;pre lang="java" escaped="true">void initBlockPool(BPOfferService bpos) throws IOException {
NamespaceInfo nsInfo = bpos.getNamespaceInfo();
if (nsInfo == null) {
throw new IOException("NamespaceInfo not found: Block pool " + bpos
+ " should have retrieved namespace info before initBlockPool.");
}
setClusterId(nsInfo.clusterID, nsInfo.getBlockPoolID());
// 把BlockPoolId和BPOfferService关联起来，存放在bpByBlockPoolId
// Register the new block pool with the BP manager.
blockPoolManager.addBlockPool(bpos);
// 初始化data变量，创建出FsDatasetImpl
// In the case that this is the first block pool to connect, initialize
// the dataset, block scanners, etc.
initStorage(nsInfo);
// 去掉坏了的磁盘
// Exclude failed disks before initializing the block pools to avoid startup
// failures.
checkDiskError();
// 开启DirectoryScanner，定期运行，用于处理内存中的对象和实际存储文件的差异
initDirectoryScanner(conf);
// 添加blockPool
data.addBlockPool(nsInfo.getBlockPoolID(), conf);
blockScanner.enableBlockPoolId(bpos.getBlockPoolId());
}&lt;/pre>
&lt;p>这里面关注的是data.addBlockPool方法&lt;/p>
&lt;pre lang="java" escaped="true">public void addBlockPool(String bpid, Configuration conf)
throws IOException {
LOG.info("Adding block pool " + bpid);
synchronized(this) {
// 创建BlockPoolSlice对象，加入bpSlices变量内
volumes.addBlockPool(bpid, conf);
// 初始化ReplicaMap对象（ReplicaMap：Maintains the replica map）
volumeMap.initBlockPool(bpid);
}
// 获取所有磁盘的副本map
volumes.getAllVolumesMap(bpid, volumeMap, ramDiskReplicaTracker);
}&lt;/pre>
&lt;p>volumes.addBlockPool方法里，是创建BlockPoolSlice。BlockPoolSlice的介绍是说这是BlockPool存储在一个磁盘的一部分，里面主要是记录一些目录，还有使用大小等。注意这个有个计算磁盘使用大小非常耗时，这里使用了缓存，每600秒更新一次，在datanode退出的时候会写把数值写到文件里。&lt;/p>
&lt;pre lang="java" escaped="true">void addBlockPool(final String bpid, final Configuration conf) throws IOException {
long totalStartTime = Time.monotonicNow();
final List&amp;lt;IOException&amp;gt; exceptions = Collections.synchronizedList(
new ArrayList&amp;lt;IOException&amp;gt;());
List&amp;lt;Thread&amp;gt; blockPoolAddingThreads = new ArrayList&amp;lt;Thread&amp;gt;();
for (final FsVolumeImpl v : volumes.get()) {
Thread t = new Thread() {
public void run() {
try (FsVolumeReference ref = v.obtainReference()) {
FsDatasetImpl.LOG.info("Scanning block pool " + bpid +
" on volume " + v + "...");
long startTime = Time.monotonicNow();
// 创建BlockPoolSlice
v.addBlockPool(bpid, conf);
long timeTaken = Time.monotonicNow() - startTime;
FsDatasetImpl.LOG.info("Time taken to scan block pool " + bpid +
" on " + v + ": " + timeTaken + "ms");
} catch (ClosedChannelException e) {
// ignore.
} catch (IOException ioe) {
FsDatasetImpl.LOG.info("Caught exception while scanning " + v +
". Will throw later.", ioe);
exceptions.add(ioe);
}
}
};&lt;/pre>
&lt;p>volumes.getAllVolumesMap()方法，实际是调用每一个BlockPoolSlice.getVolumeMap()，我们当前版本在这里没有cache，因为要遍历目录，所以这里的操作比较耗时。添加cache具体见&lt;a href="https://issues.apache.org/jira/browse/HDFS-7928">HDFS-7928&lt;/a>补丁。&lt;/p>
&lt;pre lang="java" escaped="true">void getVolumeMap(ReplicaMap volumeMap,
final RamDiskReplicaTracker lazyWriteReplicaMap)
throws IOException {
// Recover lazy persist replicas, they will be added to the volumeMap
// when we scan the finalized directory.
if (lazypersistDir.exists()) {
int numRecovered = moveLazyPersistReplicasToFinalized(lazypersistDir);
FsDatasetImpl.LOG.info(
"Recovered " + numRecovered + " replicas from " + lazypersistDir);
}
// 遍历底下所有目录，构造副本map
// add finalized replicas
addToReplicasMap(volumeMap, finalizedDir, lazyWriteReplicaMap, true);
// add rbw replicas
addToReplicasMap(volumeMap, rbwDir, lazyWriteReplicaMap, false);
}&lt;/pre>
&lt;p>回到最上面，执行完bpos.verifyAndSetNamespaceInfo(nsInfo);后，执行register()方法，向namenode注册。执行完后，再往上就是调用offerService()，发送心跳，blockMap等。&lt;/p>
&lt;h2 id="结论">结论&lt;/h2>
&lt;p>namenode启动过程中会有多个线程，http和rpc的端口会先启动，但是这个时候还是不能提供服务的。当前版本主要耗时在构建volumeMap上，需要遍历磁盘目录。&lt;br>
初始化完volumeMap会向namenode注册，注册成功后会在日志打印successfully registered with NN（有两条，active和standby namenode）&lt;br>
之后datanode向namenode汇报块信息，发送完成后在日志打印Successfully sent block report（同样有两条）&lt;br>
只有在blockReport完成后才算真的启动完成。
在重启的过程中，如果时间不算太长，在namenode中还没有判定这个datanode为dead node，里面的block map信息还保留着，所以在完成磁盘扫描 volumeMap 之后也算完成了。&lt;/p>
&lt;h2 id="其他">其他&lt;/h2>
&lt;p>代码比较多，限于个人能力，可能理解也有误，如果发现错误以后再更新。&lt;br>
&lt;del>同时也没找出可编程的方法来判断datanode是否启动完成，除非修改datanode代码自己加标志位。&lt;/del>
update(2017-07-18)：判断datanode是否启动完成核心在判断两次blockreport是否完成（分别向active和standby namenode发送），所以可以通过访问datanode jmx地址http://xxx:50075/jmx,检查参数”BlockReportsNumOps” : 大于等于2来判断。
 &lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://huashuizhuhui.iteye.com/blog/1869512">第七章：小朱笔记hadoop之源码分析-hdfs分析 第五节：Datanode 分析&lt;/a> 版本差异比较大&lt;br>
&lt;a href="http://blog.csdn.net/androidlushangderen/article/details/50500136">记一次DataNode慢启动问题&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/datanode/">Datanode</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>HDFS-8824 平衡数据的时候不移动小文件</title><link>https://fatkun.github.io/2016/05/hdfs-8824.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/05/hdfs-8824.html</guid><pubDate>Sun, 01 May 2016 02:08:22 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Do not use small blocks for balancing the cluster
&lt;a href="https://issues.apache.org/jira/browse/HDFS-8824">https://issues.apache.org/jira/browse/HDFS-8824&lt;/a>
 
 
Allow Balancer to run faster
&lt;a href="https://issues.apache.org/jira/browse/HDFS-8818">https://issues.apache.org/jira/browse/HDFS-8818&lt;/a>
 
平衡设置的文章：https://community.hortonworks.com/articles/43849/hdfs-balancer-2-configurations-cli-options.html
 
线程不够会导致平衡卡死，评论说这样改参数可以绕过
By setting dfs.balancer.moverThreads to a value big than dfs.datanode.balance.max.concurrent.moves * &lt;numberOfDatanodes> also works.
&lt;a href="https://issues.apache.org/jira/browse/HDFS-11377">https://issues.apache.org/jira/browse/HDFS-11377&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>hdfs complete file 超时</title><link>https://fatkun.github.io/2016/04/hdfs-complete-file-timeout.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/04/hdfs-complete-file-timeout.html</guid><pubDate>Mon, 25 Apr 2016 02:48:00 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>修改一下超时次数，具体代码在 DFSOutputStream.java&lt;/p>
&lt;pre escaped="true" lang="java">private void completeFile(ExtendedBlock last) throws IOException {
long localstart = Time.now();
long localTimeout = 400;
boolean fileComplete = false;
int retries = dfsClient.getConf().nBlockWriteLocateFollowingRetry;
while (!fileComplete) {
fileComplete =
dfsClient.namenode.complete(src, dfsClient.clientName, last, fileId);
if (!fileComplete) {
final int hdfsTimeout = dfsClient.getHdfsTimeout();
if (!dfsClient.clientRunning &amp;brvbar;&amp;brvbar;
(hdfsTimeout &amp;gt; 0 &amp;&amp; localstart + hdfsTimeout &amp;lt; Time.now())) {
String msg = "Unable to close file because dfsclient " +
" was unable to contact the HDFS servers." +
" clientRunning " + dfsClient.clientRunning +
" hdfsTimeout " + hdfsTimeout;
DFSClient.LOG.info(msg);
throw new IOException(msg);
}
try {
if (retries == 0) {
throw new IOException("Unable to close file because the last block"
+ " does not have enough number of replicas.");
}
retries--;
Thread.sleep(localTimeout);
localTimeout *= 2;
if (Time.now() - localstart &amp;gt; 5000) {
DFSClient.LOG.info("Could not complete " + src + " retrying...");
}
} catch (InterruptedException ie) {
DFSClient.LOG.warn("Caught exception ", ie);
}
}
}
}
&lt;/pre>
&lt;pre lang="xml" escaped="true">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;dfs.client.block.write.locateFollowingBlock.retries&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;10&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>hdfs启动相关文章</title><link>https://fatkun.github.io/2016/04/hdfs-start.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/04/hdfs-start.html</guid><pubDate>Sun, 24 Apr 2016 08:13:38 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;a href="http://blog.csdn.net/androidlushangderen/article/details/50500136">记一次DataNode慢启动问题&lt;/a> ：启动过程中，datanode为了获取used size，如果超过时间，可能会执行DU。
 &lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>hadoop检查目录健康状态</title><link>https://fatkun.github.io/2016/04/hadoop-check-disk-error.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/04/hadoop-check-disk-error.html</guid><pubDate>Sun, 10 Apr 2016 08:38:39 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>DiskChecker负责检查目录是否有建目录和判断权限。&lt;/p>
&lt;h2 id="datanode">datanode&lt;/h2>
&lt;p>BlockPoolSlice.checkDirs()&lt;br>
DataNode.checkDiskError()&lt;/p>
&lt;h2 id="nodemanager">nodeManager&lt;/h2>
&lt;p>LocalDirsHandlerService.checkDirs()&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category></item><item><title>hbase shell创建表命令</title><link>https://fatkun.github.io/2016/01/hbase-shell%E5%88%9B%E5%BB%BA%E8%A1%A8%E5%91%BD%E4%BB%A4.html</link><guid isPermaLink="true">https://fatkun.github.io/2016/01/hbase-shell%E5%88%9B%E5%BB%BA%E8%A1%A8%E5%91%BD%E4%BB%A4.html</guid><pubDate>Wed, 20 Jan 2016 10:43:55 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;pre lang="bash" escaped="true">create 'ucbrowser_imei2', {NAME=&amp;gt;'date', VERSIONS=&amp;gt;5}
disable 'test_imei'
drop 'test_imei'
# 预先指定分区
create 'ucbrowser_utdid', 'date', { VERSIONS =&amp;gt; '5', DATA_BLOCK_ENCODING =&amp;gt; 'PREFIX', COMPRESSION =&amp;gt; 'SNAPPY', SPLITS=&amp;gt;['03ufUX/IWscQABV+EwvaHDOo']}
# 预先分区（200个region）
hbase org.apache.hadoop.hbase.util.RegionSplitter -c 200 -f "date" "ucbrowser_imei2" "HexStringSplit"
# 修改版本
alter 'test_imei', {NAME =&amp;gt; 'date', VERSIONS =&amp;gt; 5 }
# 查看表描述
describe "test_imei"
&lt;/pre>
&lt;h2 id="snapshot">snapshot&lt;/h2>
&lt;pre lang="bash" escaped="true"># 在原集群执行
snapshot 'ucbrowser_utdid', 'ucbrowser_utdid_20171208'
# 导出镜像
hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot ucbrowser_utdid_20171208 -copy-to hdfs://10.xx.xx.xx:8020/hbase
# 检查目标集群的文件权限是否正确
hdfs dfs chown -R hbase:hbase /hbase/archive
# 在目标集群恢复
disable 'ucbrowser_utdid'
restore_snapshot 'ucbrowser_utdid_20171208'
# 查看镜像
list_snapshots
&lt;/pre>
&lt;p> &lt;/p>
&lt;p class="csdn_top"> HBase备份之ExportSnapshot或CopyTable&lt;/p>
&lt;http://blog.csdn.net/iam333/article/details/38538073></description><category domain="https://fatkun.github.io/categories/hbase/">Hbase</category><category domain="https://fatkun.github.io/tags/hbase/">Hbase</category><category domain="https://fatkun.github.io/tags/shell/">Shell</category></item><item><title>Container killed by the ApplicationMaster, Exit code is 143</title><link>https://fatkun.github.io/2015/12/container-killed-by-the-applicationmaster.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/12/container-killed-by-the-applicationmaster.html</guid><pubDate>Wed, 30 Dec 2015 13:14:03 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>之前发现在map任务里面经常看到Container killed by the ApplicationMaster，挺奇怪，不过任务最终是成功的，就没怎么管。不过最近测试集群跑的任务报143错误，还是重新看一下这个问题。
分析版本：hadoop cdh5.4&lt;/p>
&lt;h2 id="错误日志">错误日志&lt;/h2>
&lt;pre lang="other" escaped="true">2015-12-30 17:31:09,994 INFO [AsyncDispatcher event handler] org.apache.hadoop.mapreduce.v2.app.job.impl.TaskAttemptImpl: attempt_1451360650431_0228_m_000000_0 TaskAttempt Transitioned from RUNNING to SUCCESS_CONTAINER_CLEANUP
2015-12-30 17:31:09,995 INFO [ContainerLauncher #1] org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherImpl: Processing the event EventType: CONTAINER_REMOTE_CLEANUP for container container_1451360650431_0228_01_000002 taskAttempt attempt_1451360650431_0228_m_000000_0
2015-12-30 17:31:09,995 INFO [ContainerLauncher #1] org.apache.hadoop.mapreduce.v2.app.launcher.ContainerLauncherImpl: KILLING attempt_1451360650431_0228_m_000000_0
2015-12-30 17:31:09,995 INFO [ContainerLauncher #1] org.apache.hadoop.yarn.client.api.impl.ContainerManagementProtocolProxy: Opening proxy : uaerouter2-vm02:8041
2015-12-30 17:31:10,012 INFO [AsyncDispatcher event handler] org.apache.hadoop.mapreduce.v2.app.job.impl.TaskAttemptImpl: attempt_1451360650431_0228_m_000000_0 TaskAttempt Transitioned from SUCCESS_CONTAINER_CLEANUP to SUCCEEDED
2015-12-30 17:31:10,020 INFO [AsyncDispatcher event handler] org.apache.hadoop.mapreduce.v2.app.job.impl.TaskImpl: Task succeeded with attempt attempt_1451360650431_0228_m_000000_0
2015-12-30 17:31:10,021 INFO [AsyncDispatcher event handler] org.apache.hadoop.mapreduce.v2.app.job.impl.TaskImpl: task_1451360650431_0228_m_000000 Task Transitioned from RUNNING to SUCCEEDED
2015-12-30 17:31:10,023 INFO [AsyncDispatcher event handler] org.apache.hadoop.mapreduce.v2.app.job.impl.JobImpl: Num completed Tasks: 1
2015-12-30 17:31:10,895 INFO [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: Before Scheduling: PendingReds:1 ScheduledMaps:0 ScheduledReds:0 AssignedMaps:1 AssignedReds:0 CompletedMaps:1 CompletedReds:0 ContAlloc:1 ContRel:0 HostLocal:1 RackLocal:0
2015-12-30 17:31:10,898 INFO [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: Recalculating schedule, headroom=&amp;lt;memory:14336, vCores:14&amp;gt;
2015-12-30 17:31:10,898 INFO [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: Reduce slow start threshold reached. Scheduling reduces.
2015-12-30 17:31:10,898 INFO [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: All maps assigned. Ramping up all remaining reduces:1
2015-12-30 17:31:10,898 INFO [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: After Scheduling: PendingReds:0 ScheduledMaps:0 ScheduledReds:1 AssignedMaps:1 AssignedReds:0 CompletedMaps:1 CompletedReds:0 ContAlloc:1 ContRel:0 HostLocal:1 RackLocal:0
2015-12-30 17:31:11,906 INFO [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerRequestor: getResources() for application_1451360650431_0228: ask=1 release= 0 newContainers=0 finishedContainers=1 resourcelimit=&amp;lt;memory:15360, vCores:15&amp;gt; knownNMs=2
2015-12-30 17:31:11,906 INFO [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: Received completed container container_1451360650431_0228_01_000002
2015-12-30 17:31:11,907 INFO [RMCommunicator Allocator] org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator: After Scheduling: PendingReds:0 ScheduledMaps:0 ScheduledReds:1 AssignedMaps:0 AssignedReds:0 CompletedMaps:1 CompletedReds:0 ContAlloc:1 ContRel:0 HostLocal:1 RackLocal:0
2015-12-30 17:31:11,908 INFO [AsyncDispatcher event handler] org.apache.hadoop.mapreduce.v2.app.job.impl.TaskAttemptImpl: Diagnostics report from attempt_1451360650431_0228_m_000000_0: Container killed by the ApplicationMaster.
Container killed on request. Exit code is 143
Container exited with a non-zero exit code 143
&lt;/pre>
&lt;p>分析一下错误日志&lt;/p>
&lt;ol>
&lt;li>其中一个mapper任务完成，发送事件TaskAttemptEventType.TA_DONE&lt;/li>
&lt;li>执行CleanupContainerTransition，取消taskAttemptListener监听，发送事件 ContainerLauncher.EventType.CONTAINER_REMOTE_CLEANUP给containerLauncher&lt;/li>
&lt;li>containerLauncher执行kill命令，但判断container状态还没完成，让container kill掉&lt;/li>
&lt;li>container还没有退出，被强制kill掉，所以有一个143的错误&lt;/li>
&lt;li>TaskAttempt状态由RUNNING 转为 SUCCESS_CONTAINER_CLEANUP&lt;/li>
&lt;li>kill了之后发送事件TaskAttemptEventType.TA_CONTAINER_CLEANED&lt;/li>
&lt;li>TaskAttempt状态由SUCCESS_CONTAINER_CLEANUP转为SUCCEEDED
这里会有143的错误的原因是没等到container退出，就发起命令kill掉它了。简单的改法是等待几秒后再去kill它，但是到底要等几秒，每个都要等几秒拖慢了集群。还是看大神是怎么改的。&lt;/li>
&lt;/ol>
&lt;h2 id="分析补丁">分析补丁&lt;/h2>
&lt;p>找到 &lt;a href="https://issues.apache.org/jira/browse/MAPREDUCE-5465" target="_blank">MAPREDUCE-5465&lt;/a> 这个补丁。
在这个补丁里，在RUNNING -&amp;gt; SUCCESS_CONTAINER_CLEANUP 状态转换中，插入了一个状态 SUCCESS_FINISHING_CONTAINER （成功的场景，失败有另一个状态）。引入这个状态就是为了等container自己退出。&lt;/p>
&lt;ol>
&lt;li>其中一个mapper任务完成，发送事件TaskAttemptEventType.TA_DONE&lt;/li>
&lt;li>向TaskAttemptFinishingMonitor注册(这个类用来避免container一直不退出，之后说)，尽管container这时还没退出，还是发送TaskEventType.T_ATTEMPT_SUCCEEDED事件&lt;/li>
&lt;li>状态由RUNNING 转为 SUCCESS_FINISHING_CONTAINER&lt;/li>
&lt;li>等待container退出（依赖nodemanager发现container退出，汇报给RM，然后再传给AM）&lt;/li>
&lt;li>AM知道container退出后，检查退出状态，如果是被终止的，就发送TaskAttemptEventType.TA_KILL，否则发送TaskAttemptEventType.TA_CONTAINER_COMPLETED&lt;/li>
&lt;li>如果事件是TA_KILL，状态则会变成SUCCESS_CONTAINER_CLEANUP或者KILL_CONTAINER_CLEANUP。SUCCESS_CONTAINER_CLEANUP可以再转换为SUCCESSED&lt;/li>
&lt;li>如果事件是TA_CONTAINER_COMPLETED，状态就变成SUCCESSED了
另外还会收到事件TA_CONTAINER_CLEANED，有条件才会发这个事件的，看注释，好像是等价于TA_CONTAINER_COMPLETED（好烦）
向TaskAttemptFinishingMonitor注册是这里设定了一个定时器，如果超过时间container都还没有退出，这个Monitor就会发起TA_TIMED_OUT的操作了，会把状态由 SUCCESS_FINISHING_CONTAINER 转为 SUCCESS_CONTAINER_CLEANUP，通过kill的方式清理。
同样，这里还会对失败的taskattempt也做同样的处理，会有对应的状态。&lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/143/">143</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/issue/">Issue</category></item><item><title>PandoraBox路由多线多拨</title><link>https://fatkun.github.io/2015/12/pandorabox-mwan.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/12/pandorabox-mwan.html</guid><pubDate>Sat, 12 Dec 2015 13:12:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="划分vlan">划分VLAN&lt;/h2>
&lt;p>在网络-&amp;gt;交换机里面，添加一个VLAN，看一下第二个vlan是怎么配置的，WAN的接口是在哪一个，然后自己插入lan接口，照着加一个。
第三个vlan：端口1为不关联，CPU为关联，其他为关
第一个vlan：端口1改成关
在网络-&amp;gt;接口里面，添加一个新接口wan2。配置物理网卡为vlan eth0.3，配置拨号信息。配置两个WAN的网络跃点为不同的值
教程：http://www.right.com.cn/forum/thread-147109-1-1.html&lt;/p>
&lt;h2 id="配置mwan">配置MWAN&lt;/h2>
&lt;p>添加两个interface wan和刚才加的wan2&lt;br>
添加成员分别配置两个网卡&lt;br>
修改策略，选择两个成员&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/mwan/">MWAN</category><category domain="https://fatkun.github.io/tags/%E5%A4%9A%E7%BA%BF%E5%A4%9A%E6%8B%A8/">多线多拨</category><category domain="https://fatkun.github.io/tags/%E8%B7%AF%E7%94%B1/">路由</category></item><item><title>hdfs exceeds the limit of concurrent xcievers</title><link>https://fatkun.github.io/2015/11/hdfs-exceeds-the-limit-of-concurrent-xcievers.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/11/hdfs-exceeds-the-limit-of-concurrent-xcievers.html</guid><pubDate>Mon, 23 Nov 2015 11:53:49 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>版本: hadoop cdh5.4
datanode jstack，很多这样的线程&lt;/p>
&lt;pre lang="bash" escaped="true">"DataXceiver for client unix:/var/run/hdfs-sockets/dn [Waiting for operation #1]" daemon prio=10 tid=0x00007ffc42de9000 nid=0x68f8 waiting on condition [0x00007ffacbd1d000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for &amp;lt;0x00000007a5d3d568&amp;gt; (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at org.apache.hadoop.net.unix.DomainSocketWatcher.add(DomainSocketWatcher.java:316)
at org.apache.hadoop.hdfs.server.datanode.ShortCircuitRegistry.createNewMemorySegment(ShortCircuitRegistry.java:322)
at org.apache.hadoop.hdfs.server.datanode.DataXceiver.requestShortCircuitShm(DataXceiver.java:418)
at org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.opRequestShortCircuitShm(Receiver.java:214)
at org.apache.hadoop.hdfs.protocol.datatransfer.Receiver.processOp(Receiver.java:95)
at org.apache.hadoop.hdfs.server.datanode.DataXceiver.run(DataXceiver.java:241)
at java.lang.Thread.run(Thread.java:745)&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="相关issue">相关issue&lt;/h2>
&lt;p>[HADOOP-11333] – Fix deadlock in DomainSocketWatcher when the notification pipe is full&lt;br>
[HADOOP-10404] – Some accesses to DomainSocketWatcher#closed are not protected by lock
&lt;a href="https://issues.apache.org/jira/browse/HADOOP-11604">https://issues.apache.org/jira/browse/HADOOP-11604&lt;/a>&lt;br>
&lt;a href="https://issues.apache.org/jira/browse/HADOOP-11802">https://issues.apache.org/jira/browse/HADOOP-11802&lt;/a>&lt;br>
&lt;a href="https://issues.apache.org/jira/browse/HDFS-8429">https://issues.apache.org/jira/browse/HDFS-8429&lt;/a>
 &lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>hadoop cdh5.4 windows 开发环境</title><link>https://fatkun.github.io/2015/11/hadoop-cdh5-4-windows-%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/11/hadoop-cdh5-4-windows-%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83.html</guid><pubDate>Sun, 15 Nov 2015 03:45:27 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;ol>
&lt;li>下载hadoop编译好的包&lt;/li>
&lt;li>安装cygwin&lt;/li>
&lt;li>下载hadoop.dll和winutils.exe (我是自己编译的，在网上找了一个，不知道能否通用http://www.aboutyun.com/thread-8178-1-1.html)&lt;/li>
&lt;li>配置环境变量HADOOP_HOME&lt;/li>
&lt;li>配置环境变量PATH，增加%HADOOP_HOME%/bin
 
报错处理&lt;/li>
&lt;/ol>
&lt;blockquote>
&lt;pre class="code-java">java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.access0(Ljava/lang/&lt;span class="code-object">String&lt;/span>;I)Z&lt;/pre>
&lt;/blockquote>
&lt;p>没有安装cygwin&lt;/p>
&lt;blockquote>
&lt;p>找不到winutils.exe
上网下载或者自己编译，自己编译好麻烦。。。要安装windows sdk。如果你确实准备好了winutils.exe还是报错，看看是不是显示null\bin\winutils.exe，这样的话是你的环境变量HADOOP_HOME没生效。&lt;/p>
&lt;/blockquote></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category></item><item><title>Mismatched address stored in ZK for NameNode</title><link>https://fatkun.github.io/2015/10/mismatched-address-stored-in-zk-for-namenode.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/10/mismatched-address-stored-in-zk-for-namenode.html</guid><pubDate>Wed, 28 Oct 2015 08:28:52 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>我在namenode配置dfs.namenode.servicerpc-address端口后，Failover Controller 报错
java.lang.RuntimeException: Mismatched address stored in ZK for NameNode at kpixxx/xx.xx.xx.xx:88&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;ol>
&lt;li>停止Failover Controller&lt;/li>
&lt;li>通过zookeeper删除 /hadoop-ha&lt;/li>
&lt;li>通过cloudera manager 初始化zookeeper的HA&lt;/li>
&lt;li>重新启动Failover Controller
 &lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>路由器FQ配置</title><link>https://fatkun.github.io/2015/09/%E8%B7%AF%E7%94%B1%E5%99%A8fq%E9%85%8D%E7%BD%AE.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/09/%E8%B7%AF%E7%94%B1%E5%99%A8fq%E9%85%8D%E7%BD%AE.html</guid><pubDate>Sun, 20 Sep 2015 15:44:13 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>记录一下主要步骤
使用ss-redir和iptable转发流量
ss-redir主要用于nat透明代理，注意&lt;strong>不要使用ss-local&lt;/strong>的端口，那个是用来socks5端口。&lt;/p>
&lt;pre lang="bash" escaped="true">#端口默认是1081
/usr/bin/ss-redir -c $CONFIG -b 0.0.0.0 -f $SERVICE_PID_FILE&lt;/pre>
&lt;p>默认是china 路由走本地，其他的流量走代理。这个是通过界面ipset实现的。
 
手工配置IPSET（需要加入/etc/rc.local里）&lt;/p>
&lt;pre lang="java" escaped="true">ipset -N gfwlist iphash
iptables -t nat -A PREROUTING -p tcp -m set --match-set gfwlist dst -j REDIRECT --to-port 1081&lt;/pre>
&lt;p>配置dnsmasq
在/etc/dnsmasq.conf加入以下配置，/etc/init.d/dnsmasq restart  重启生效&lt;/p>
&lt;div id="crayon-55fb4e7f3a3b2044619224-1" class="crayon-line"> &lt;span class="crayon-p">#使用不受污染干扰的DNS解析该域名 可以将此IP改为自己使用的DNS服务器&lt;/span>&lt;/div>
&lt;div id="crayon-55fb4e7f3a3b2044619224-2" class="crayon-line crayon-striped-line"> &lt;span class="crayon-v">server&lt;/span>&lt;span class="crayon-o">=&lt;/span>&lt;span class="crayon-o">/&lt;/span>&lt;span class="crayon-v">google&lt;/span>&lt;span class="crayon-sy">.&lt;/span>&lt;span class="crayon-v">com&lt;/span>&lt;span class="crayon-o">/&lt;/span>&lt;span class="crayon-cn">127.0.0.1&lt;/span>&lt;span class="crayon-p">#5353&lt;/span>&lt;/div>
&lt;div id="crayon-55fb4e7f3a3b2044619224-3" class="crayon-line"> &lt;span class="crayon-p">#将解析出来的IP保存到名为gfwlist的ipset表中&lt;/span>&lt;/div>
&lt;div id="crayon-55fb4e7f3a3b2044619224-4" class="crayon-line crayon-striped-line"> &lt;span class="crayon-v">ipset&lt;/span>&lt;span class="crayon-o">=&lt;/span>&lt;span class="crayon-o">/&lt;/span>&lt;span class="crayon-v">google&lt;/span>&lt;span class="crayon-sy">.&lt;/span>&lt;span class="crayon-v">com&lt;/span>&lt;span class="crayon-o">/&lt;/span>&lt;span class="crayon-v">gfwlist&lt;/span>&lt;/div>
## 参考
&lt;p>&lt;a href="https://gist.github.com/wen-long/8644243">https://gist.github.com/wen-long/8644243&lt;/a>&lt;/p>
&lt;blockquote data-secret="a7Azzpg5rX" class="wp-embedded-content"> &lt;p> &lt;a href="https://cokebar.info/archives/962">Shadowsocks + GfwList 实现 OpenWRT 路由器自动翻墙&lt;/a> &lt;/p>&lt;/blockquote></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/newifi/">Newifi</category><category domain="https://fatkun.github.io/tags/openwrt/">Openwrt</category></item><item><title>编译hive cdh5.4.0</title><link>https://fatkun.github.io/2015/07/compile-hive-cdh5-4-0.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/07/compile-hive-cdh5-4-0.html</guid><pubDate>Thu, 23 Jul 2015 03:17:06 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>编译命令&lt;/p>
&lt;pre escaped="true" lang="html">mvn clean install -Phadoop-2,dist -DskipTests&lt;/pre>
&lt;p>&lt;a href="https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-BuildingHivefromSource">https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-BuildingHivefromSource&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>hive1.1.0查询和旧版本不一致问题分析</title><link>https://fatkun.github.io/2015/06/hive-join-failed.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/06/hive-join-failed.html</guid><pubDate>Sun, 28 Jun 2015 07:08:22 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;div> &lt;h2> 背景 &lt;/h2>&lt;/div>
在查询以下语句的时候结果不正确，无法&lt;span lang="EN-US">join tab1.tm=tab2.hour&lt;/span>。如果存在以下类似的语句，有子查询的&lt;span lang="EN-US">group by&lt;/span>，外层有&lt;span lang="EN-US">join&lt;/span>语句，返回的结果不正确，无法&lt;span lang="EN-US">join&lt;/span>成功。
&lt;pre lang="sql" escaped="true">select tab1.ip, tab1.tm, tab2.hour
from (
    select c.ip,c.lkid, c.hour,min(s.hour) as tm from Tclick_iphone c join Tsndata_iphone s
    on c.ip=s.ip group by c.ip,c.lkid,c.hour
) tab1 join Tsndata_iphone tab2
on tab1.ip=tab2.ip and tab1.tm=tab2.hour;&lt;/pre>
&lt;div>&lt;/div>
&lt;div> &lt;h2> 分析 &lt;/h2>&lt;/div>
首先是构造可重复测试语句，减少所需要查询的数据，然后尝试替换其中的语句，检查语句是否正常。缩小错误范围。
测试中发现如果把子查询替换为表，能够正常查询。另外在随机测试的过程中，发现这样的语句也可以成功。
&lt;pre lang="sql" escaped="true">select tab1.ip, tab1.tm, tab2.hour
from (
    select c.ip,c.lkid, min(s.hour) as tm from Tclick_iphone c join Tsndata_iphone s
    on c.ip=s.ip group by c.ip,c.lkid,c.hour
) tab1 join Tsndata_iphone tab2
on tab1.ip=tab2.ip and tab1.tm=tab2.hour;&lt;/pre>
&lt;div>&lt;/div>
### 单步调试&lt;span lang="EN-US">1&lt;/span>
&lt;p>反复单步调试对比错误、正确语句，发现第二步的输入和正确的语句不一样。
这是字节数组，还有个解析这个字节数组的描述信息（多少个字段，各个字段的类型） ，正确语句输入的内容为：
&lt;span lang="EN-US">[3, 14, 49, 50, 49, 46, 50, 51, 54, 46, 49, 54, 52, 46, 50, 56, -114, 11, -82, 0, 0, 0, 0, 0, 0, 0, 0, 0]&lt;/span>
描述信息有两个字段
错误的语句输入内容为：
&lt;span lang="EN-US">[15, 14, 49, 50, 49, 46, 50, 51, 54, 46, 49, 54, 52, 46, 50, 56, 4, 119, 105, 102, 105, -114, 10, -84, -114, 11, -82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]&lt;/span>
描述信息有两个字段
这个字节第一位是判断符号，判断是否是&lt;span lang="EN-US">null&lt;/span>，后面的字符如果是&lt;span lang="EN-US">string&lt;/span>，第一位是字符长度。如果是数字，会有类似这样的&lt;span lang="EN-US">bytes [-114, 10, -84]&lt;/span>
从这里看出输入的内容不一致，但字段描述信息却一样。那错误可能发生在输入的内容不正确或者字段描述解析不正确。&lt;/p>
&lt;h3 id="单步调试span-langen-us2-8211-span输入内容字段描述从哪里来">单步调试&lt;span lang="EN-US">2 – &lt;/span>输入内容、字段描述从哪里来&lt;/h3>
&lt;p>从&lt;span lang="EN-US">explain&lt;/span>知道第二步的输入来源于子查询的输出，也就是子查询的&lt;span lang="EN-US">reduce&lt;/span>输出。单步调试发现字段描述是在编译语句阶段已经确定好，每个&lt;span lang="EN-US">Operator&lt;/span>已经确定了输出的字段数和类型。
另外在对比&lt;span lang="EN-US">explain&lt;/span>中，发现正确的语句比错误的语句多了个&lt;span lang="EN-US">SELECT Operator&lt;/span>（列裁剪）。&lt;/p>
&lt;h3 id="单步调试span-langen-us3-8211-span为什么错误语句少了span-langen-usselect-operatorspan">单步调试&lt;span lang="EN-US">3 – &lt;/span>为什么错误语句少了&lt;span lang="EN-US">SELECT Operator&lt;/span>？&lt;/h3>
&lt;p>范围缩小到语句的语法编译。
发现代码中会打印一些日志出来，可以修改&lt;span lang="EN-US">hive&lt;/span>的&lt;span lang="EN-US">log4j&lt;/span>文件改为&lt;span lang="EN-US">debug&lt;/span>模式，发现语句优化的过程中把&lt;span lang="EN-US">SELECT Operator&lt;/span>去掉了。
优化前&lt;/p>
&lt;div> &lt;pre>&lt;code>&amp;lt;span lang="EN-US">TS[0]-FIL[2]-RS[3]-JOIN[6]-SEL[7]-GBY[8]-RS[9]-GBY[10]-SEL[11]-FIL[13]-RS[14]-JOIN[17]-SEL[18]-FS[19]&amp;lt;/span>&lt;/code>&lt;/pre>
&lt;pre>&lt;code>&amp;lt;span lang="EN-US">ppd.PredicatePushDown: After PPD&amp;lt;/span>&lt;/code>&lt;/pre>
&lt;pre>&lt;code>&amp;lt;span lang="EN-US">TS[0]-FIL[21]-RS[3]-JOIN[6]-SEL[7]-GBY[8]-RS[9]-GBY[10]-FIL[20]-SEL[11]-RS[14]-JOIN[17]-SEL[18]-FS[19]&amp;lt;/span>&lt;/code>&lt;/pre>&lt;/div>
优化后
&lt;div> &lt;pre>&lt;code>&amp;lt;span lang="EN-US">TS[0]-FIL[21]-RS[3]-JOIN[6]-GBY[8]-RS[9]-GBY[10]-FIL[20]-RS[14]-JOIN[17]-SEL[18]-FS[19]&amp;lt;/span>&lt;/code>&lt;/pre>&lt;/div>
可以看到在&lt;span lang="EN-US">GBY[10]-FIL[20]-SEL[11]-RS[14]&lt;/span>中，&lt;span lang="EN-US">SEL[11]&lt;/span>被去掉了。
单步调试语句的优化过程，由于优化步骤有&lt;span lang="EN-US">21&lt;/span>个，使用二分法检查到底是运行到哪一个优化器把&lt;span lang="EN-US">SEL&lt;/span>去掉了。
最终发现是 &lt;span lang="EN-US">IdentityProjectRemover &lt;/span>优化器。
这个优化器的功能是根据前后输入输出，去掉不必要的&lt;span lang="EN-US">SELECT Operator&lt;/span>。检查到这里，没有继续往下查了，还有一些为什么&lt;span lang="EN-US">FIL[20] row schema&lt;/span>为什么是两个字段，但实际输出内容却不是的问题。
### 搜索
&lt;p>使用关键词&lt;span lang="EN-US">IdentityProjectRemover&lt;/span>搜索源代码，看看这个代码最新版本有没有修改过。搜索发现一些&lt;span lang="EN-US">issue&lt;/span>，找到了关闭这个优化器的参数。&lt;code>&amp;lt;span lang=&amp;quot;EN-US&amp;quot;&amp;gt;hive.optimize.remove.identity.project=false&amp;lt;/span&amp;gt;&lt;/code>，另外发现在&lt;span lang="EN-US">hive1.2.0&lt;/span>版本，增加了另一个参数，间接默认关闭了这个优化。
另外发现这个&lt;span lang="EN-US">issue&lt;/span>和我们这次的错误类似，应该是同一个问题&lt;span lang="EN-US"> &lt;a href="https://issues.apache.org/jira/browse/HIVE-10996" target="_blank">HIVE-10996&lt;/a> &lt;/span>。这个&lt;span lang="EN-US">issue&lt;/span>里面有说明更详细的错误原因，见&lt;span lang="EN-US">&lt;a href="https://issues.apache.org/jira/browse/HIVE-10996?focusedCommentId=14592859&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14592859" target="_blank">&lt;span lang="EN-US">&lt;span lang="EN-US">评论&lt;/span>&lt;/span>&lt;/a>&lt;/span>
这个&lt;span lang="EN-US">issue&lt;/span>已经有补丁，但目前还没有合并到主干。它的解决的方法是在&lt;span lang="EN-US">GBY-FIL-SEL&lt;/span>中插入一个&lt;span lang="EN-US">SEL&lt;/span>，变成&lt;span lang="EN-US">GBY-SEL-FIL-SEL&lt;/span>&lt;/p>
&lt;div> &lt;h2> 当前解决方案 &lt;/h2>&lt;/div>
设置参数 &lt;span lang="EN-US">hive.optimize.remove.identity.project=false &lt;/span>关闭这个优化器
这个优化是从&lt;span lang="EN-US">1.1.0&lt;/span>版本引入（我们当前使用的版本）
&lt;div> &lt;h2> 技巧 &lt;/h2>&lt;/div>
刚开始&lt;span lang="EN-US">debug&lt;/span>的时候很慢，而且越用越慢，后来发现限制&lt;span lang="EN-US">hive&lt;/span>客户端使用内存有一定效果。可能&lt;span lang="EN-US">debug&lt;/span>时需要&lt;span lang="EN-US">dump&lt;/span>内存。
使用 &lt;span lang="EN-US">hive &amp;#8211;debug &lt;/span>可以远程&lt;span lang="EN-US">debug&lt;/span>
使用 &lt;span lang="EN-US">hive &amp;#8211;hiveconf hive.root.logger=DEBUG,console &lt;/span>可以临时打印日志</description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category></item><item><title>在Windows上编译hadoop cdh5.4</title><link>https://fatkun.github.io/2015/05/compile-hadoop-cdh5-4-on-windows.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/05/compile-hadoop-cdh5-4-on-windows.html</guid><pubDate>Sun, 17 May 2015 14:07:27 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 data-anchor-id="tbvu"> 我的环境&lt;/h2>
系统:win8.1 ， maven3.1, eclipse 4.4
hadoop cdh5.4对应apache的源码是hadoop 2.6
&lt;h2 id="准备条件" data-anchor-id="tbvu"> 准备条件&lt;/h2>
&lt;p data-anchor-id="3iwr"> 安装以下软件，见源码src/BUILDING.txt里的要求&lt;br /> jdk1.7&lt;br /> &lt;a href="https://github.com/google/protobuf/releases" target="_blank">protoc.exe 2.5&lt;/a>&lt;br /> cygwin&lt;br /> maven3&lt;br /> cygwin&lt;br /> &lt;a href="http://www.cmake.org/download/" target="_blank">cmake&lt;/a> （注意要单独安装，不要使用cygwin里面的，否则在编译hadoop-hdfs会有cmake错误）&lt;br /> &lt;a href="http://www.microsoft.com/en-us/download/details.aspx?id=8279" target="_blank">Windows SDK&lt;/a> 或者 Visual Studio 2010 Professional（我用的是Windows SDK）&lt;/p>
&lt;p data-anchor-id="zlh3"> 配置环境变量JAVA_HOME等，把下载的protoc.exe放入c:\windows&lt;/p>
&lt;div class="md-section-divider">&lt;/div>
&lt;h2 id="下载源码" data-anchor-id="qaxk"> 下载源码&lt;/h2>
&lt;p data-anchor-id="06vn"> 略&lt;/p>
&lt;div class="md-section-divider">&lt;/div>
&lt;h2 id="编译" data-anchor-id="q8u0"> 编译&lt;/h2>
&lt;p data-anchor-id="gjw9"> 使用&amp;#8221;Windows SDK 7.1 Command Prompt&amp;#8221;进入命令行&lt;/p>
&lt;pre data-anchor-id="lkay">&lt;code>mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse
mvn package -Pdist,native-win -DskipTests -Dtar
&lt;/code>&lt;/pre>
&lt;div class="md-section-divider">&lt;/div>
&lt;h2 id="导入eclipse" data-anchor-id="d3aa"> 导入eclipse&lt;/h2>
&lt;p data-anchor-id="kvt9"> 为了使得Eclipse中安装的Maven插件，同windows中安装的那个相同，需要让eclipse中的maven重新定位一下，点击Window -> Preference -> Maven -> Installation -> Add进行设置&lt;/p>
&lt;p data-anchor-id="t8hn"> 使用import -> Existing Projects into Workspace方式导入&lt;/p>
&lt;div class="md-section-divider">&lt;/div>
&lt;h2 id="错误处理" data-anchor-id="c7my"> 错误处理&lt;/h2>
&lt;div class="md-section-divider">&lt;/div>
&lt;h3 id="报错-request-to-merge-when-filtering-is-not-identical" data-anchor-id="b4hd"> 报错 Request to merge when &amp;#8216;filtering&amp;#8217; is not identical&lt;/h3>
&lt;pre data-anchor-id="ehns">&lt;code>Failed to execute goal org.apache.maven.plugins:maven-eclipse-plugin:2.8:eclipse (default-cli) on project hadoop-yarn-common: Request to merge when 'filtering' is not identical. Original=resource src/main/resources: output=target/classes, include=[], exclude=[yarn-version-info.properties|**/*.java], test=false, filtering=false, merging with=resource src/main/resources: output=target/classes, include=[yarn-version-info.properties], exclude=[**/*.java], test=false, filtering=true -&amp;gt; [Help 1]
&lt;/code>&lt;/pre>
&lt;p data-anchor-id="5bwd"> 改用mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse 编译&lt;/p>
&lt;p data-anchor-id="wkn5"> 或者修改hadoop-2.6.0-cdh5.4.0\src\hadoop-common-project\hadoop-common\pom.xml文件，加入&lt;/p>
&lt;pre lang="xml" escaped="true">&amp;lt;build&amp;gt;
...
&amp;lt;plugins&amp;gt;
...
&amp;lt;plugin&amp;gt;
&amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
&amp;lt;artifactId&amp;gt;maven-eclipse-plugin&amp;lt;/artifactId&amp;gt;
&amp;lt;version&amp;gt;2.6&amp;lt;/version&amp;gt;
&amp;lt;/plugin&amp;gt;
&amp;lt;/plugins&amp;gt;
&amp;lt;/build&amp;gt;&lt;/pre>
&lt;p data-anchor-id="1j1h"> &lt;a href="http://stackoverflow.com/questions/1397903/setting-project-for-eclipse-using-maven" target="_blank">来源&lt;/a>&lt;/p>
&lt;div class="md-section-divider">&lt;/div>
&lt;h3 id="报错-echorequestproto-cannot-be-resolved" data-anchor-id="9l7i"> 报错 EchoRequestProto cannot be resolved&lt;/h3>
&lt;p data-anchor-id="zdyo"> 在根src目录下执行一次 mvn install -DskipTests&lt;br /> 你会看到最终这个是在hadoop-common*test.jar包里面的，应该是由hadoop-common-project\hadoop-common\src\test\proto编译出来的&lt;/p>
&lt;div class="md-section-divider">&lt;/div>
&lt;h3 id="报错-avrorecord-cannot-be-resolved" data-anchor-id="6ar4"> 报错 AvroRecord cannot be resolved&lt;/h3>
&lt;p data-anchor-id="e2eo"> 把hadoop-common*test.jar加入bulid path，或者下载下载avro-tools-x.x.x.jar，进入源码根目录下的“hadoop-common-project\hadoop-common\src\test\avro”执行命令，java -jar &lt;所在目录>/avro-tools-1.7.7.jar compile schema avroRecord.avsc ..\java&lt;/p>
&lt;div class="md-section-divider">&lt;/div>
&lt;h3 id="报错-applicationattemptstartdatapbimpl-cannot-be-resolved" data-anchor-id="9lul"> 报错 ApplicationAttemptStartDataPBImpl cannot be resolved&lt;/h3>
&lt;p data-anchor-id="4389"> 这个是因为解压的时候失败了，导致文件丢失。还有一个文件是ApplicationAttemptStartDataPBImpl，目录在hadoop-2.6.0-cdh5.4.0\src\hadoop-yarn-project\hadoop-yarn\hadoop-yarn-server\hadoop-yarn-server-applicationhistoryservice\src\main\java\org\apache\hadoop\yarn\server\applicationhistoryservice\records\impl\pb&lt;br /> 在Windows下文件名目录不能长于260个字符，想办法把目录缩短一些，然后把文件拷贝回来。&lt;/p>
&lt;div class="md-section-divider">&lt;/div>
&lt;h3 id="导入eclipse后maven-jdktools报错" data-anchor-id="sgxm"> 导入eclipse后maven jdk.tools报错&lt;/h3>
&lt;p data-anchor-id="q01y"> 修改hadoop-annotations/pom.xml，找到jdk.tools，把“&lt;span id="MathJax-Element-153-Frame" class="MathJax">&lt;span id="MathJax-Span-3953" class="math">&lt;span id="MathJax-Span-3954" class="mrow">&lt;span id="MathJax-Span-3955" class="texatom">&lt;span id="MathJax-Span-3956" class="mrow">&lt;span id="MathJax-Span-3957" class="mi">j&lt;/span>&lt;span id="MathJax-Span-3958" class="mi">a&lt;/span>&lt;span id="MathJax-Span-3959" class="mi">v&lt;/span>&lt;span id="MathJax-Span-3960" class="mi">a&lt;/span>&lt;span id="MathJax-Span-3961" class="mo">.&lt;/span>&lt;span id="MathJax-Span-3962" class="mi">h&lt;/span>&lt;span id="MathJax-Span-3963" class="mi">o&lt;/span>&lt;span id="MathJax-Span-3964" class="mi">m&lt;/span>&lt;span id="MathJax-Span-3965" class="mi">e&lt;/span>&lt;/span>&lt;/span>&lt;span id="MathJax-Span-3966" class="mo">.&lt;/span>&lt;span id="MathJax-Span-3967" class="mo">.&lt;/span>&lt;span id="MathJax-Span-3968" class="texatom">&lt;span id="MathJax-Span-3969" class="mrow">&lt;span id="MathJax-Span-3970" class="mo">/&lt;/span>&lt;/span>&lt;/span>&lt;span id="MathJax-Span-3971" class="mo">”&lt;/span>&lt;span id="MathJax-Span-3972" class="texatom">&lt;span id="MathJax-Span-3973" class="mrow">&lt;span id="MathJax-Span-3974" class="mo">改&lt;/span>&lt;/span>&lt;/span>&lt;span id="MathJax-Span-3975" class="texatom">&lt;span id="MathJax-Span-3976" class="mrow">&lt;span id="MathJax-Span-3977" class="mo">为&lt;/span>&lt;/span>&lt;/span>&lt;span id="MathJax-Span-3978" class="mo">“&lt;/span>&lt;/span>&lt;/span>&lt;/span>{JAVA_HOME}/”,也就是jdk下面的tools.jar路径&lt;/p>
&lt;div class="md-section-divider">&lt;/div>
&lt;h3 id="提示maven-resource-plugin版本低于24错误" data-anchor-id="ewgx"> 提示maven-resource-plugin版本低于2.4错误&lt;/h3>
&lt;p data-anchor-id="q6jc"> 修改pom.xml文件，把版本改为2.4，忘记是哪个pom了&lt;/p>
&lt;div class="md-section-divider">&lt;/div>
&lt;h3 id="maven报错lifecycle错误" data-anchor-id="8cui"> maven报错lifecycle错误&lt;/h3>
&lt;p data-anchor-id="k7ww"> 在eclipse配置maven，把这些错误忽略掉。&lt;/p>
&lt;div class="md-section-divider">&lt;/div>
&lt;h3 id="其他还有一些bulid-path的报错" data-anchor-id="rqtq"> 其他还有一些bulid path的报错&lt;/h3>
&lt;p data-anchor-id="6wgc"> 看着错误处理吧&lt;/p>
&lt;div class="md-section-divider">&lt;/div>
&lt;h2 id="参考" data-anchor-id="vxyq"> 参考&lt;/h2>
&lt;p data-anchor-id="4rxn"> &lt;a href="https://wiki.apache.org/hadoop/Hadoop2OnWindows" target="_blank">https://wiki.apache.org/hadoop/Hadoop2OnWindows&lt;/a>&lt;br /> &lt;a href="http://blog.csdn.net/oneinmore/article/details/44984419" target="_blank">将Hadoop 2.6.0源码导入到Eclipse&lt;/a>&lt;br /> &lt;a href="http://www.srccodes.com/p/article/38/build-install-configure-run-apache-hadoop-2.2.0-microsoft-windows-os" target="_blank">Build, Install, Configure and Run Apache Hadoop 2.2.0 in Microsoft Windows OS&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/5.4/">5.4</category><category domain="https://fatkun.github.io/tags/cdh/">Cdh</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/%E7%BC%96%E8%AF%91/">编译</category></item><item><title>解决“已在此计算机上检测到Microsoft Visual C++ 2010 Redistributable的更新版本”</title><link>https://fatkun.github.io/2015/05/microsoft-visual-c-2010-redistributable.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/05/microsoft-visual-c-2010-redistributable.html</guid><pubDate>Sun, 17 May 2015 08:55:41 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>安装Windows SDK for win7时失败，查看错误日志发现是安装vcredist_x64.exe时出错，原因是已经安装了Microsoft Visual C++ 2010 Redistributable新版本，再装旧版本会失败。
安装vcredist_x64.exe提示 “&lt;span class="ask-title ">已在此计算机上检测到Microsoft Visual C++ 2010 Redistributable的更新版本&lt;/span>” 错误。&lt;/p>
&lt;h2 id="解决">解决&lt;/h2>
&lt;p>尝试卸载Microsoft Visual C++ 2010 Redistributable，如果还不行删除注册表 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0&lt;/p>
&lt;h2 id="来源">来源&lt;/h2>
&lt;p>&lt;a href="http://blogs.msdn.com/b/vsnetsetup/archive/2014/07/17/installation-failing-with-a-newer-version-of-microsoft-visual-c-2010-redistributable-has-been-detected-on-this-machine.aspx">http://blogs.msdn.com/b/vsnetsetup/archive/2014/07/17/installation-failing-with-a-newer-version-of-microsoft-visual-c-2010-redistributable-has-been-detected-on-this-machine.aspx&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>cloudera manager添加hive时报错找不到jdbc driver</title><link>https://fatkun.github.io/2015/05/cloudera-manage-jdbc-driver-cannot-be-found.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/05/cloudera-manage-jdbc-driver-cannot-be-found.html</guid><pubDate>Thu, 07 May 2015 03:19:57 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>cm 4.7&lt;/p>
&lt;h2 id="报错">报错&lt;/h2>
&lt;p>JDBC driver cannot be found. Unable to find the JDBC database jar on host&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>把包放入这个目录，注意文件名要保持一致  /usr/share/java/mysql-&lt;wbr />connector-java.jar&lt;/p>
&lt;h2 id="来源">来源&lt;/h2>
&lt;p>&lt;a href="https://groups.google.com/a/cloudera.org/forum/#!topic/cdh-user/OpXSfmzsnuo">https://groups.google.com/a/cloudera.org/forum/#!topic/cdh-user/OpXSfmzsnuo&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/cloudera-manager/">Cloudera Manager</category><category domain="https://fatkun.github.io/tags/cm/">Cm</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category></item><item><title>namenode standby checkponit时间过长导致的问题</title><link>https://fatkun.github.io/2015/05/namenode-standby-checkponit.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/05/namenode-standby-checkponit.html</guid><pubDate>Sun, 03 May 2015 13:30:28 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>我们当前使用的版本是cdh-4.2.1，standby namenode默认每小时生成一个editlog文件，由于操作很多，这个保存时间超过了1分钟。这里面使用了一些读写锁，导致阻塞了其他的一些请求。&lt;/p>
&lt;h2 id="hdfs-ha的实现">HDFS HA的实现&lt;/h2>
&lt;p>要理解整个过程，先来看看是如何实现hdfs ha的，我自己不懂，只能看其他大神的文章了。
&lt;a href="http://www.infoq.com/cn/articles/hadoop-2-0-namenode-ha-federation-practice-zh">Hadoop 2.0 NameNode HA和Federation实践&lt;/a>
&lt;a href="http://yanbohappy.sinaapp.com/?p=50">Hadoop目前的HA(High Availability)机制分析和源代码研究(1)&lt;/a>
&lt;a href="http://yanbohappy.sinaapp.com/?p=205">基于QJM/Qurom Journal Manager/Paxos的HDFS HA原理及代码分析&lt;/a>
还有一些fsimage、editlog的文章见: &lt;a href="http://yanbohappy.sinaapp.com/?tag=hdfs">http://yanbohappy.sinaapp.com/?tag=hdfs&lt;/a>
概括一下：&lt;/p>
&lt;ul>
&lt;li>fsimage是历史的元数据，会定期把editlog合并进来，editlog是最近一段时间对namenode的操作，当前的文件状态等于fsimage+editlog&lt;/li>
&lt;li>Datanode会同时向两个Namenode汇报块信息&lt;/li>
&lt;li>保证在一个时间内，客户端只会连接active Namenode，由active Namenode负责写editlog（写入QJM），standby Namenode从QJM中获取editlog，更新自己内存中的块信息。这样当standby 变成active时，只用合并最近一小段时间的editlog就可以提供服务了。&lt;/li>
&lt;li>客户端根据抛出的异常(StandbyException)来切换连接的namenode&lt;/li>
&lt;li>隔离(fence)，需要避免同时存在两个active Namenode，同时服务，同时往QJM写editlog&lt;/li>
&lt;li>为了避免namenode启动时合并fsimage和editlog时间过长，standby Namenode 负责定期合并editlog，生成新的fsimage，并且同步给active Namenode。(StandbyCheckpointer)
cdh4.2.1
回到原来的问题，在checkpoint时，FSNamesystem有一个ReentrantReadWriteLock fslock，它包含一个读写锁。
读锁时，允许其他线程读，但写操作会被阻塞。
写锁时，其他线程的读写都会被阻塞。
cdh4.2.1版本的代码在checkpoint时，会加上writelock，导致一些rpc操作需要readlock被阻塞。当时检查日志发现failover controller的心跳RPC请求被阻塞了，但没找到它用到这个锁。后来发现NameNodeRpcServer里public synchronized void monitorHealth()方法使用了synchronized，同时还有public synchronized HAServiceStatus getServiceStatus()等方法，在这个类中，同时只允许进入一个synchronized的方法内。在checkpoint期间，getServiceStatus使用了readLock，导致monitorHealth也被阻塞住。&lt;/li>
&lt;/ul>
&lt;h2 id="hdfs-5064">HDFS-5064&lt;/h2>
&lt;p>&lt;a href="https://issues.apache.org/jira/browse/HDFS-5064">Standby checkpoints should not block concurrent readers&lt;/a>
找到的第一个补丁是这个，主要修改是在checkpoint的过程中，不应该阻塞那些读操作（如getServiceStatus、monitorHealth）。专门给checkpoint增加了一个读锁fsLongReadLock，在writeLock方法先锁定fsLongReadLock&lt;/p>
&lt;h2 id="hdfs-7097">HDFS-7097&lt;/h2>
&lt;p>但是这样修改后，依然会阻塞一些需要writeLock的操作，然后有了新的patch&lt;/p>
&lt;p id="summary-val"> &lt;a href="https://issues.apache.org/jira/browse/HDFS-7097">Allow block reports to be processed during checkpointing on standby name node&lt;/a>&lt;/p>
Since block reports are not modifying any state that is being saved to fsimage, I propose letting them through during checkpointing.
补丁作者说&amp;#8221;块汇报&amp;#8221;不改变任何保存在fsimage的状态，所以允许在checkpoint期间执行块报告。（&lt;del>&lt;strong>没看懂为什么不影响&lt;/strong>，代码中好像是把当前的FSNameSystem持久化为文件，而block report也会操作FSNameSystem&amp;#8230;有可能我理解错了&lt;/del>）
这次修改也是新加了一个锁，去掉了上一个补丁的fsLongReadLock，换为cpLock，但是没有在writeLock中先锁定cpLock。
&amp;nbsp;
update: 2015-05-05
fsimage的存储结构可以看这篇文章，[NameNode启动过程详细剖析][5]
* block mapping(block ID &lt;=> DN location)没有存储在fsimage内，只是保留在内存。
* block report汇报每个block在datanode的状况(block id &lt;-> localtion)
* fsimage里面存储的只是blockid
&amp;nbsp;</description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category></item><item><title>hdfs选择datanode策略</title><link>https://fatkun.github.io/2015/04/hdfs%E9%80%89%E6%8B%A9datanode%E7%AD%96%E7%95%A5.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/04/hdfs%E9%80%89%E6%8B%A9datanode%E7%AD%96%E7%95%A5.html</guid><pubDate>Thu, 23 Apr 2015 07:04:22 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>前几天报错如下：&lt;/p>
&lt;pre lang="other" escaped="true">Error: org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /user/xxx/part-r-00002 could only be replicated to 0 nodes instead of minReplication (=1). There are 11 datanode(s) running and no node(s) are excluded in this operation.
at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.chooseTarget(BlockManager.java:1327)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:2278)
at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.addBlock(NameNodeRpcServer.java:480)
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTranslatorPB.addBlock(ClientNamenodeProtocolServerSideTranslatorPB.java:297)
at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$ClientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java:44080)
at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:453)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1002)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1695)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1691)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1689)&lt;/pre>
&lt;p>阅读一下代码了解hdfs选择块的策略，可能理解有误，如果有错误请指出，代码来自cdh-4.2.1版本
在 FSNamesystem.getAdditionalBlock()里，有个blockManager.chooseTarget(src, replication, clientNode, excludedNodes, blockSize);&lt;br>
这个方法用来决定在那个节点写数据
代码文件：hadoop-2.0.0-cdh4.2.1\src\hadoop-hdfs-project\hadoop-hdfs\src\main\java\org\apache\hadoop\hdfs\server\blockmanagement\BlockPlacementPolicyDefault.java
chooseTarget方法调用了几次转换，看最终调用的方法&lt;/p>
&lt;pre escaped="true" lang="java">/* choose &amp;lt;i&amp;gt;numOfReplicas&amp;lt;/i&amp;gt; from all data nodes */
private DatanodeDescriptor chooseTarget(int numOfReplicas,
DatanodeDescriptor writer,
HashMap&amp;lt;Node, Node&amp;gt; excludedNodes,
long blocksize,
int maxNodesPerRack,
List&amp;lt;DatanodeDescriptor&amp;gt; results) {
if (numOfReplicas == 0 &amp;brvbar;&amp;brvbar; clusterMap.getNumOfLeaves()==0) {
return writer;
}
int totalReplicasExpected = numOfReplicas; // 总共需要的副本数
// results是当前已分配的节点
int numOfResults = results.size();
boolean newBlock = (numOfResults==0);
if (writer == null &amp;&amp; !newBlock) {
writer = results.get(0);
}
try {
// 如果还没分配过，先选择本地节点
if (numOfResults == 0) {
writer = chooseLocalNode(writer, excludedNodes,
blocksize, maxNodesPerRack, results);
if (--numOfReplicas == 0) {
return writer;
}
}
// 如果之前已分配一个或零个，在其他机架的一台机器选择
if (numOfResults &amp;lt;= 1) {
chooseRemoteRack(1, results.get(0), excludedNodes,
blocksize, maxNodesPerRack, results);
if (--numOfReplicas == 0) {
return writer;
}
}
// 如果前面还没分配完，已有小于或等于两个副本
if (numOfResults &amp;lt;= 2) {
// 如果前两个在同一个机架上，选择一个其他机架的
if (clusterMap.isOnSameRack(results.get(0), results.get(1))) {
chooseRemoteRack(1, results.get(0), excludedNodes,
blocksize, maxNodesPerRack, results);
} else if (newBlock){
chooseLocalRack(results.get(1), excludedNodes, blocksize,
maxNodesPerRack, results);
} else {
chooseLocalRack(writer, excludedNodes, blocksize,
maxNodesPerRack, results);
}
if (--numOfReplicas == 0) {
return writer;
}
}
// 如果还需要副本，就随机选择
chooseRandom(numOfReplicas, NodeBase.ROOT, excludedNodes,
blocksize, maxNodesPerRack, results);
} catch (NotEnoughReplicasException e) {
LOG.warn("Not able to place enough replicas, still in need of "
+ numOfReplicas + " to reach " + totalReplicasExpected + "\n"
+ e.getMessage());
}
return writer;
}&lt;/pre>
&lt;p>看一下 chooseLocalNode&lt;/p>
&lt;pre escaped="true" lang="java">/* choose &amp;lt;i&amp;gt;localMachine&amp;lt;/i&amp;gt; as the target.
* if &amp;lt;i&amp;gt;localMachine&amp;lt;/i&amp;gt; is not available,
* choose a node on the same rack
* @return the chosen node
*/
private DatanodeDescriptor chooseLocalNode(
DatanodeDescriptor localMachine,
HashMap&amp;lt;Node, Node&amp;gt; excludedNodes,
long blocksize,
int maxNodesPerRack,
List&amp;lt;DatanodeDescriptor&amp;gt; results)
throws NotEnoughReplicasException {
// if no local machine, randomly choose one node 如果没有本地机器，随机选择一个
if (localMachine == null)
return chooseRandom(NodeBase.ROOT, excludedNodes,
blocksize, maxNodesPerRack, results);
if (preferLocalNode) { // 这个值写死为true
// otherwise try local machine first
Node oldNode = excludedNodes.put(localMachine, localMachine); // 把当前节点先加入排除列表
if (oldNode == null) { // was not in the excluded list 如果返回null表示之前没有在排除列表里
if (isGoodTarget(localMachine, blocksize,
maxNodesPerRack, false, results)) {//判断是否好的目标，后面再看这个方法
results.add(localMachine);
return localMachine;
}
}
}
// try a node on local rack
return chooseLocalRack(localMachine, excludedNodes,
blocksize, maxNodesPerRack, results);// 如果本机不适合，选择同机架的其他机器
}&lt;/pre>
&lt;p>继续看chooseLocalRack&lt;/p>
&lt;pre escaped="true" lang="java">/* choose one node from the rack that &amp;lt;i&amp;gt;localMachine&amp;lt;/i&amp;gt; is on.
* if no such node is available, choose one node from the rack where
* a second replica is on.
* if still no such node is available, choose a random node
* in the cluster.
* @return the chosen node
*/
private DatanodeDescriptor chooseLocalRack(
DatanodeDescriptor localMachine,
HashMap&amp;lt;Node, Node&amp;gt; excludedNodes,
long blocksize,
int maxNodesPerRack,
List&amp;lt;DatanodeDescriptor&amp;gt; results)
throws NotEnoughReplicasException {
// no local machine, so choose a random machine
if (localMachine == null) {
return chooseRandom(NodeBase.ROOT, excludedNodes,
blocksize, maxNodesPerRack, results);
}
// choose one from the local rack 选择同一个机架的
try {
return chooseRandom(
localMachine.getNetworkLocation(),
excludedNodes, blocksize, maxNodesPerRack, results);
} catch (NotEnoughReplicasException e1) {
// find the second replica 从已有副本里面找同一个机架的
DatanodeDescriptor newLocal=null;
for(Iterator&amp;lt;DatanodeDescriptor&amp;gt; iter=results.iterator();
iter.hasNext();) {
DatanodeDescriptor nextNode = iter.next();
if (nextNode != localMachine) {
newLocal = nextNode;
break;
}
}
if (newLocal != null) {
try {
return chooseRandom(
newLocal.getNetworkLocation(),
excludedNodes, blocksize, maxNodesPerRack, results);
} catch(NotEnoughReplicasException e2) {
//otherwise randomly choose one from the network 如果还是找不到，随机选择
return chooseRandom(NodeBase.ROOT, excludedNodes,
blocksize, maxNodesPerRack, results);
}
} else {
//otherwise randomly choose one from the network
return chooseRandom(NodeBase.ROOT, excludedNodes,
blocksize, maxNodesPerRack, results);
}
}
}&lt;/pre>
&lt;p>继续chooseRemoteRack&lt;/p>
&lt;pre escaped="true" lang="java">/* choose &amp;lt;i&amp;gt;numOfReplicas&amp;lt;/i&amp;gt; nodes from the racks
* that &amp;lt;i&amp;gt;localMachine&amp;lt;/i&amp;gt; is NOT on.
* if not enough nodes are available, choose the remaining ones
* from the local rack
*/
private void chooseRemoteRack(int numOfReplicas,
DatanodeDescriptor localMachine,
HashMap&amp;lt;Node, Node&amp;gt; excludedNodes,
long blocksize,
int maxReplicasPerRack,
List&amp;lt;DatanodeDescriptor&amp;gt; results)
throws NotEnoughReplicasException {
int oldNumOfReplicas = results.size();
// randomly choose one node from remote racks 选择其他机架的节点，注意这里的"~"是表示排除本机架，如果找不到就只有在本机架找
try {
chooseRandom(numOfReplicas, "~"+localMachine.getNetworkLocation(),
excludedNodes, blocksize, maxReplicasPerRack, results);
} catch (NotEnoughReplicasException e) {
chooseRandom(numOfReplicas-(results.size()-oldNumOfReplicas),
localMachine.getNetworkLocation(), excludedNodes, blocksize,
maxReplicasPerRack, results);
}
}
&lt;/pre>
&lt;p>最后一个 chooseRandom&lt;/p>
&lt;pre escaped="true" lang="java">/* Randomly choose &amp;lt;i&amp;gt;numOfReplicas&amp;lt;/i&amp;gt; targets from &amp;lt;i&amp;gt;nodes&amp;lt;/i&amp;gt;.
*/
private void chooseRandom(int numOfReplicas,
String nodes,
HashMap&amp;lt;Node, Node&amp;gt; excludedNodes,
long blocksize,
int maxNodesPerRack,
List&amp;lt;DatanodeDescriptor&amp;gt; results)
throws NotEnoughReplicasException {
int numOfAvailableNodes =
clusterMap.countNumOfAvailableNodes(nodes, excludedNodes.keySet()); // 当前可用节点数
StringBuilder builder = null;
if (LOG.isDebugEnabled()) {
builder = threadLocalBuilder.get();
builder.setLength(0);
builder.append("[");
}
boolean badTarget = false;
while(numOfReplicas &amp;gt; 0 &amp;&amp; numOfAvailableNodes &amp;gt; 0) { // 循环直到所有可用副本数为0
DatanodeDescriptor chosenNode =
(DatanodeDescriptor)(clusterMap.chooseRandom(nodes));
Node oldNode = excludedNodes.put(chosenNode, chosenNode);
if (oldNode == null) {
numOfAvailableNodes--;
if (isGoodTarget(chosenNode, blocksize, maxNodesPerRack, results)) {
numOfReplicas--;
results.add(chosenNode);
} else {
badTarget = true;
}
}
}
if (numOfReplicas&amp;gt;0) {
String detail = enableDebugLogging;
if (LOG.isDebugEnabled()) {
if (badTarget &amp;&amp; builder != null) {
detail = builder.append("]").toString();
builder.setLength(0);
} else detail = "";
}
throw new NotEnoughReplicasException(detail);
}
}&lt;/pre>
&lt;p>最后来看如何判断节点是否可用，isGoodTarget&lt;/p>
&lt;pre escaped="true" lang="java">/* judge if a node is a good target.
* return true if &amp;lt;i&amp;gt;node&amp;lt;/i&amp;gt; has enough space,
* does not have too much load, and the rack does not have too many nodes
*/
private boolean isGoodTarget(DatanodeDescriptor node,
long blockSize, int maxTargetPerLoc,
List&amp;lt;DatanodeDescriptor&amp;gt; results) {
return isGoodTarget(node, blockSize, maxTargetPerLoc,
this.considerLoad, results);
}
private boolean isGoodTarget(DatanodeDescriptor node,
long blockSize, int maxTargetPerLoc,
boolean considerLoad,
List&amp;lt;DatanodeDescriptor&amp;gt; results) {
// check if the node is (being) decommissed 判断是否退役了
if (node.isDecommissionInProgress() &amp;brvbar;&amp;brvbar; node.isDecommissioned()) {
if(LOG.isDebugEnabled()) {
threadLocalBuilder.get().append(node.toString()).append(": ")
.append("Node ").append(NodeBase.getPath(node))
.append(" is not chosen because the node is (being) decommissioned ");
}
return false;
}
long remaining = node.getRemaining() -
(node.getBlocksScheduled() * blockSize);
// check the remaining capacity of the target machine 判断剩余的磁盘空间， 块大小 * 5 > 剩余大小 表示不可用
if (blockSize* HdfsConstants.MIN_BLOCKS_FOR_WRITE&amp;gt;remaining) {
if(LOG.isDebugEnabled()) {
threadLocalBuilder.get().append(node.toString()).append(": ")
.append("Node ").append(NodeBase.getPath(node))
.append(" is not chosen because the node does not have enough space ");
}
return false;
}
// check the communication traffic of the target machine 判断各个datanode的负载情况，这里的负载不是系统负载，而是根据xceiver线程数，这个线程好像是负责读写的。
if (considerLoad) { // 默认这个为true，配置项 dfs.namenode.replication.considerLoad
double avgLoad = 0;
int size = clusterMap.getNumOfLeaves(); // 所有datanode数
if (size != 0 &amp;&amp; stats != null) {
avgLoad = (double)stats.getTotalLoad()/size; // 获取总的xceiver线程数除以所有datanode数，算出平均负载
}
if (node.getXceiverCount() &amp;gt; (2.0 * avgLoad)) { // 如果当前线程数 大于 平均值的两倍，则不可使用
if(LOG.isDebugEnabled()) {
threadLocalBuilder.get().append(node.toString()).append(": ")
.append("Node ").append(NodeBase.getPath(node))
.append(" is not chosen because the node is too busy ");
}
return false;
}
}
// check if the target rack has chosen too many nodes 检查是否有太多节点在当前机架上
String rackname = node.getNetworkLocation();
int counter=1;
for(Iterator&amp;lt;DatanodeDescriptor&amp;gt; iter = results.iterator();
iter.hasNext();) {
Node result = iter.next();
if (rackname.equals(result.getNetworkLocation())) {
counter++;
}
}
//maxNodesPerRack的算法，没看懂，可能是每个机架的平均数+2，不知道为什么定一个这样的值 int maxNodesPerRack = (totalNumOfReplicas-1)/clusterMap.getNumOfRacks()+2;
if (counter&amp;gt;maxTargetPerLoc) {
if(LOG.isDebugEnabled()) {
threadLocalBuilder.get().append(node.toString()).append(": ")
.append("Node ").append(NodeBase.getPath(node))
.append(" is not chosen because the rack has too many chosen nodes ");
}
return false;
}
return true;
}&lt;/pre>
&lt;p>我们当前集群状态，总共11台datanode，没有退役机器。其中7台机器磁盘已满或者基本满，剩下4台机器可写。没有划分机架，所以整个集群认为只有一个机架。所以应该不会触发“同一个机架不能有太多个节点的问题”（具体原因看上面代码，这里表述可能不是很准确）
&lt;strong>怀疑检查负载的逻辑，7台满的机器datanode负载可能很低，但因为磁盘满不可以使用，导致剩下的4台机器线程数超过平均值的两倍。&lt;/strong>&lt;br>
当前只能加入日志，等下次出错后检查。&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>JS Flowchart Diagrams</title><link>https://fatkun.github.io/post/test/js-flowchart-diagrams/</link><guid isPermaLink="true">https://fatkun.github.io/post/test/js-flowchart-diagrams/</guid><pubDate>Wed, 04 Mar 2015 21:57:50 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="usage">Usage&lt;/h2>
&lt;pre tabindex="0">&lt;code class="language-flow" data-lang="flow">st=&amp;gt;start: Start|past:&amp;gt;http://www.google.com[blank]
e=&amp;gt;end: End:&amp;gt;http://www.google.com
op1=&amp;gt;operation: My Operation|past
op2=&amp;gt;operation: Stuff|current
sub1=&amp;gt;subroutine: My Subroutine|invalid
cond=&amp;gt;condition: Yes
or No?|approved:&amp;gt;http://www.google.com
c2=&amp;gt;condition: Good idea|rejected
io=&amp;gt;inputoutput: catch something...|request
st-&amp;gt;op1(right)-&amp;gt;cond
cond(yes, right)-&amp;gt;c2
cond(no)-&amp;gt;sub1(left)-&amp;gt;op1
c2(yes)-&amp;gt;io-&amp;gt;e
c2(no)-&amp;gt;op2-&amp;gt;e
&lt;/code>&lt;/pre>&lt;pre tabindex="0">&lt;code class="language-linenos=table" data-lang="linenos=table">```flow
st=&amp;gt;start: Start|past:&amp;gt;http://www.google.com[blank]
e=&amp;gt;end: End:&amp;gt;http://www.google.com
op1=&amp;gt;operation: My Operation|past
op2=&amp;gt;operation: Stuff|current
sub1=&amp;gt;subroutine: My Subroutine|invalid
cond=&amp;gt;condition: Yes
or No?|approved:&amp;gt;http://www.google.com
c2=&amp;gt;condition: Good idea|rejected
io=&amp;gt;inputoutput: catch something...|request
st-&amp;gt;op1(right)-&amp;gt;cond
cond(yes, right)-&amp;gt;c2
cond(no)-&amp;gt;sub1(left)-&amp;gt;op1
c2(yes)-&amp;gt;io-&amp;gt;e
c2(no)-&amp;gt;op2-&amp;gt;e
```&lt;/code>&lt;/pre>
&lt;h2 id="legacy-usage">Legacy Usage&lt;/h2>
&lt;pre tabindex="0">&lt;code class="language-flowchart" data-lang="flowchart">st=&amp;gt;start: Start|past:&amp;gt;http://www.google.com[blank]
e=&amp;gt;end: End:&amp;gt;http://www.google.com
op1=&amp;gt;operation: My Operation|past
op2=&amp;gt;operation: Stuff|current
sub1=&amp;gt;subroutine: My Subroutine|invalid
cond=&amp;gt;condition: Yes
or No?|approved:&amp;gt;http://www.google.com
c2=&amp;gt;condition: Good idea|rejected
io=&amp;gt;inputoutput: catch something...|request
st-&amp;gt;op1(right)-&amp;gt;cond
cond(yes, right)-&amp;gt;c2
cond(no)-&amp;gt;sub1(left)-&amp;gt;op1
c2(yes)-&amp;gt;io-&amp;gt;e
c2(no)-&amp;gt;op2-&amp;gt;e
&lt;/code>&lt;/pre>&lt;pre>&lt;code>```flowchart
st=&amp;gt;start: Start|past:&amp;gt;http://www.google.com[blank]
e=&amp;gt;end: End:&amp;gt;http://www.google.com
op1=&amp;gt;operation: My Operation|past
op2=&amp;gt;operation: Stuff|current
sub1=&amp;gt;subroutine: My Subroutine|invalid
cond=&amp;gt;condition: Yes
or No?|approved:&amp;gt;http://www.google.com
c2=&amp;gt;condition: Good idea|rejected
io=&amp;gt;inputoutput: catch something...|request
st-&amp;gt;op1(right)-&amp;gt;cond
cond(yes, right)-&amp;gt;c2
cond(no)-&amp;gt;sub1(left)-&amp;gt;op1
c2(yes)-&amp;gt;io-&amp;gt;e
c2(no)-&amp;gt;op2-&amp;gt;e
```
&lt;/code>&lt;/pre>
&lt;h2 id="configuration">Configuration&lt;/h2>
&lt;p>Configure for all home and regular pages:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-toml" data-lang="toml">&lt;span class="line">&lt;span class="cl">&lt;span class="p">[&lt;/span>&lt;span class="nx">params&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">flowchartDiagrams&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">enable&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="kc">true&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">options&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>Configure for a single post in the front matter (&lt;strong>Params in front matter have higher precedence&lt;/strong>):&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">flowchartDiagrams&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">enable&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">options&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;{
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;x&amp;#39;: 0,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;y&amp;#39;: 0,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;line-width&amp;#39;: 3,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;line-length&amp;#39;: 50,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;text-margin&amp;#39;: 10,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;font-size&amp;#39;: 14,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;font-color&amp;#39;: &amp;#39;black&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;line-color&amp;#39;: &amp;#39;black&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;element-color&amp;#39;: &amp;#39;black&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;fill&amp;#39;: &amp;#39;white&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;yes-text&amp;#39;: &amp;#39;yes&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;no-text&amp;#39;: &amp;#39;no&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;arrow-end&amp;#39;: &amp;#39;block&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;scale&amp;#39;: 1,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;i-am-a-comment-1&amp;#39;: &amp;#39;Do not use /​/!&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;i-am-a-comment-2&amp;#39;: &amp;#39;style symbol types&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;symbols&amp;#39;: {
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;start&amp;#39;: {
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;font-color&amp;#39;: &amp;#39;red&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;element-color&amp;#39;: &amp;#39;green&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;fill&amp;#39;: &amp;#39;yellow&amp;#39;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> },
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;end&amp;#39;: {
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;class&amp;#39;: &amp;#39;end-element&amp;#39;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> }
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> },
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;i-am-a-comment-3&amp;#39;: &amp;#39;even flowstate support ;-)&amp;#39;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;flowstate&amp;#39;: {
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> &amp;#39;request&amp;#39;: {&amp;#39;fill&amp;#39;: &amp;#39;blue&amp;#39;}
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> }
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s2"> }&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>See more information from &lt;a href="https://github.com/adrai/flowchart.js">https://github.com/adrai/flowchart.js&lt;/a>.&lt;/p></description></item><item><title>JS Sequence Diagrams</title><link>https://fatkun.github.io/post/test/js-sequence-diagrams/</link><guid isPermaLink="true">https://fatkun.github.io/post/test/js-sequence-diagrams/</guid><pubDate>Wed, 04 Mar 2015 21:57:45 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="usage">Usage&lt;/h2>
&lt;pre tabindex="0">&lt;code class="language-sequence" data-lang="sequence">Andrew-&amp;gt;China: Says Hello
Note right of China: China thinks\nabout it
China--&amp;gt;Andrew: How are you?
Andrew-&amp;gt;&amp;gt;China: I am good thanks!
&lt;/code>&lt;/pre>&lt;pre tabindex="0">&lt;code class="language-sequence" data-lang="sequence"> Andrew-&amp;gt;China: Says Hello
Note right of China: China thinks\nabout it
China--&amp;gt;Andrew: How are you?
Andrew-&amp;gt;&amp;gt;China: I am good thanks!
```
## Configuration
Configure for all home and regular pages:
```toml
[params.sequenceDiagrams]
enable = true
options = &amp;#34;{theme: &amp;#39;hand&amp;#39;}&amp;#34;
&lt;/code>&lt;/pre>&lt;p>Configure for a single post in the front matter (&lt;strong>Params in front matter have higher precedence&lt;/strong>):&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-yaml" data-lang="yaml">&lt;span class="line">&lt;span class="cl">&lt;span class="nt">sequenceDiagrams&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">enable&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kc">true&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="nt">options&lt;/span>&lt;span class="p">:&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s2">&amp;#34;{theme: &amp;#39;hand&amp;#39;}&amp;#34;&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="options">Options&lt;/h3>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="nx">options&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// Change the styling of the diagram, typically one of &amp;#39;simple&amp;#39;, &amp;#39;hand&amp;#39;. New themes can be registered with registerTheme(...).
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">theme&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">string&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="c1">// CSS style to apply to the diagram&amp;#39;s svg tag. (Only supported if using snap.svg)
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span> &lt;span class="nx">css_class&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="nx">string&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>See more information from &lt;a href="https://github.com/bramp/js-sequence-diagrams">https://github.com/bramp/js-sequence-diagrams&lt;/a>.&lt;/p>
&lt;h2 id="examples">Examples&lt;/h2>
&lt;pre tabindex="0">&lt;code class="language-sequence" data-lang="sequence">Title: Here is a title
A-&amp;gt;B: Normal line
B--&amp;gt;C: Dashed line
C-&amp;gt;&amp;gt;D: Open arrow
D--&amp;gt;&amp;gt;A: Dashed open arrow
&lt;/code>&lt;/pre>&lt;pre>&lt;code>```sequence
Title: Here is a title
A-&amp;gt;B: Normal line
B--&amp;gt;C: Dashed line
C-&amp;gt;&amp;gt;D: Open arrow
D--&amp;gt;&amp;gt;A: Dashed open arrow
```
&lt;/code>&lt;/pre>
&lt;hr>
&lt;pre tabindex="0">&lt;code class="language-sequence" data-lang="sequence"># Example of a comment.
Note left of A: Note to the\n left of A
Note right of A: Note to the\n right of A
Note over A: Note over A
Note over A,B: Note over both A and B
&lt;/code>&lt;/pre>&lt;pre>&lt;code>```sequence
# Example of a comment.
Note left of A: Note to the\n left of A
Note right of A: Note to the\n right of A
Note over A: Note over A
Note over A,B: Note over both A and B
```
&lt;/code>&lt;/pre></description></item><item><title>impala因为invalidate语句导致执行DDL语句卡住</title><link>https://fatkun.github.io/2015/02/impala-invalidate-metadata.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/02/impala-invalidate-metadata.html</guid><pubDate>Sun, 01 Feb 2015 16:06:11 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="现象">现象&lt;/h2>
&lt;p>impala突然无法执行DDL语句，一直卡住，累积的很多任务。初步怀疑impala并发有问题，采取了一些减少并发的方法，有一点作用，但故障没有完全消除。&lt;/p>
&lt;h2 id="排查">排查&lt;/h2>
&lt;p>怀疑超时时间太短（2分钟），修改代码更改超时时间到10分钟，没效果，但发现一个规律，有些任务在超时后17秒成功。
开启详细debug日志。发现impalad的日志显示是获取元数据超时，但发现catalogd的获取元素据只需要10+秒。catalogd没有把结果返回给impalad？
这里解释一下impalad和catalogd的关系。客户端直接访问impalad，impalad在本地缓存找不到这个表的元素据，就会向catalogd发起请求，catalogd从hive metastore获取元数据以及namenode获取block信息，返回给impalad。impalad在获取的过程中，每隔2秒检查一下本地的缓存，看这个表获取完元素据了没有，直到超时。
但是。。。由于代码太复杂，C++和java的代码互相调用，我看不懂传递的过程。期望从代码了解为什么丢了结果是没办法了。另外还有一个办法是在代码里加上一些跟踪的日志重新编译，但耗时可能很长，没有继续下去。
偶然发现有些卡住的语句，在我执行refresh语句时居然不卡了。想起我们执行语句前加了-r参数，每次都会执行invalidate metadata语句，猜想是不是因为这个引起。取消这个参数后一切正常，之前加这个参数是为了避免有些表没有更新元素据，可能会导致table not found的错误。（现在不需要这个参数，建表和更改时会执行这个语句）&lt;/p>
&lt;h2 id="代码分析">代码分析&lt;/h2>
&lt;p>由于看不懂全部代码，所以以下分析可能有误。来看一下invalidate metadata做了什么。从注释来看应该没找错方法=。=&lt;/p>
&lt;pre lang="java" escaped="true">/**
* Executes a TResetMetadataRequest and returns the result as a
* TResetMetadataResponse. Based on the request parameters, this operation
* may do one of three things:
* 1) invalidate the entire catalog, forcing the metadata for all catalog
* objects to be reloaded.
* 2) invalidate a specific table, forcing the metadata to be reloaded
* on the next access.
* 3) perform a synchronous incremental refresh of a specific table.
*
* For details on the specific commands see comments on their respective
* methods in CatalogServiceCatalog.java.
*/
public TResetMetadataResponse execResetMetadata(TResetMetadataRequest req)&lt;/pre>
&lt;p>这个方法里调用了catalog_.reset();&lt;/p>
&lt;pre lang="java" escaped="true">///impala-fe/src/main/java/com/cloudera/impala/catalog/CatalogServiceCatalog.java
/**
* Resets this catalog instance by clearing all cached table and database metadata.
*/
public void reset() throws CatalogException {
catalogLock_.writeLock().lock();
try {
nextTableId_.set(0);
// Since UDFs/UDAs are not persisted in the metastore, we won't clear
// them across reset. To do this, we store all the functions before
// clearing and restore them after.
// TODO: Everything about this. Persist them.
List&amp;lt;Pair&amp;lt;String, HashMap&amp;lt;String, List&amp;lt;Function&amp;gt;&amp;gt;&amp;gt;&amp;gt; functions =
Lists.newArrayList();
for (Db db: dbCache_.get().values()) {
if (db.numFunctions() == 0) continue;
functions.add(Pair.create(db.getName(), db.getAllFunctions()));
}
// Build a new DB cache, populate it, and replace the existing cache in one
// step.
ConcurrentHashMap&amp;lt;String, Db&amp;gt; newDbCache = new ConcurrentHashMap&amp;lt;String, Db&amp;gt;();
List&amp;lt;TTableName&amp;gt; tblsToBackgroundLoad = Lists.newArrayList();
MetaStoreClient msClient = metaStoreClientPool_.getClient();
try {
for (String dbName: msClient.getHiveClient().getAllDatabases()) {
Db db = new Db(dbName, this);
db.setCatalogVersion(incrementAndGetCatalogVersion());
newDbCache.put(db.getName().toLowerCase(), db);
for (String tableName: msClient.getHiveClient().getAllTables(dbName)) {
Table incompleteTbl = IncompleteTable.createUninitializedTable(
getNextTableId(), db, tableName);
incompleteTbl.setCatalogVersion(incrementAndGetCatalogVersion());
db.addTable(incompleteTbl);
if (loadInBackground_) {
tblsToBackgroundLoad.add(
new TTableName(dbName.toLowerCase(), tableName.toLowerCase()));
}
}
}
} finally {
msClient.release();
}
// Restore UDFs/UDAs.
for (Pair&amp;lt;String, HashMap&amp;lt;String, List&amp;lt;Function&amp;gt;&amp;gt;&amp;gt; dbFns: functions) {
Db db = null;
try {
db = newDbCache.get(dbFns.first);
} catch (Exception e) {
continue;
}
if (db == null) {
// DB no longer exists - it was probably dropped externally.
// TODO: We could restore this DB and then add the functions back?
continue;
}
for (List&amp;lt;Function&amp;gt; fns: dbFns.second.values()) {
for (Function fn: fns) {
if (fn.getBinaryType() == TFunctionBinaryType.BUILTIN) continue;
fn.setCatalogVersion(incrementAndGetCatalogVersion());
db.addFunction(fn);
}
}
}
dbCache_.set(newDbCache);
// Submit tables for background loading.
for (TTableName tblName: tblsToBackgroundLoad) {
tableLoadingMgr_.backgroundLoad(tblName);
}
} catch (Exception e) {
LOG.error(e);
throw new CatalogException("Error initializing Catalog. Catalog may be empty.", e);
} finally {
catalogLock_.writeLock().unlock();
}
}&lt;/pre>
&lt;p>reset里面，dbCache_可能是impalad的本地缓存(又或者是catalogd的…)，里面存有各个表的元数据信息（包含block信息）。这里重新从metastore获取了所有的表信息（不包含分区和block信息），这些表称之为incomplete Table，因为还没有获取分区和block信息。如果启用了loadInBackground，就会在后台获取分区等信息，没启用的话就等使用的时候获取。最后设为dbCache_，相当于清空所有元素据缓存。&lt;/p>
&lt;h2 id="结论">结论&lt;/h2>
&lt;p>从代码上解释，impalad在向catalogd获取元素据信息过程中，执行了invalidate metadata，导致本地缓存清空，impalad在检查缓存时，发现元素据还是空的，一直等到超时重试。这也能解释并发多时，一直失败，因为出现invalidate metadata的概率多了。
另外取消这个后，应该能提高impalad的查询速度，能够利用本地缓存。&lt;/p>
&lt;h2 id="后续关注">后续关注&lt;/h2>
&lt;p>去掉这个参数后会不会导致元素据不同步，导致读取不到最新的数据。&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/impala/">Impala</category></item><item><title>apache php 不缓存配置</title><link>https://fatkun.github.io/2015/01/apache-php-no-cache.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/01/apache-php-no-cache.html</guid><pubDate>Sun, 25 Jan 2015 04:08:04 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> 
ExpiresDefault可以设置所有文件的缓存时间
针对php设置 header, “private, must-revalidate” 设成这个还能够后退，没搞清楚原理，但每次刷新不会使用旧的缓存。&lt;/p>
&lt;pre escaped="true" lang="xml">ExpiresDefault "access plus 2 day"
ExpiresByType text/php "access plus 5 seconds"
&amp;lt;FilesMatch ".(php)$"&amp;gt;
Header set Cache-Control "private, must-revalidate"
Header set Pragma "no-cache"
&amp;lt;/FilesMatch&amp;gt;&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://httpd.apache.org/docs/2.2/mod/mod_expires.html">http://httpd.apache.org/docs/2.2/mod/mod_expires.html&lt;/a>&lt;br>
&lt;a href="http://www.jb51.net/article/15009.htm">http://www.jb51.net/article/15009.htm&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>从日志分析impala查询慢的原因（2）</title><link>https://fatkun.github.io/2015/01/analyze-slow-impala-2.html</link><guid isPermaLink="true">https://fatkun.github.io/2015/01/analyze-slow-impala-2.html</guid><pubDate>Sat, 03 Jan 2015 08:51:57 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>上一篇文章看到 requestTblLoadAndWait 速度缓慢，继续分析。先上日志&lt;/p>
&lt;pre lang="other" escaped="true"># impalad日志
I0103 15:09:35.503356 27319 impala-beeswax-server.cc:170] query(): query=select distinct(disp_id) from default_impala.kpi_disp_user_info_stat_tb where pt='2014-04-08'
I0103 15:11:36.109915 27319 Frontend.java:779] Missing tables were not received in 120000ms. Load request will be retried.
I0103 15:11:36.110705 27319 Frontend.java:709] Requesting prioritized load of table(s): default_impala.kpi_disp_user_info_stat_tb
I0103 15:11:50.778054 27319 Frontend.java:833] create plan
I0103 15:11:50.806649 27319 HdfsScanNode.java:571] collecting partitions for table kpi_disp_user_info_stat_tb
I0103 15:11:51.070816 27319 impala-server.cc:590] Execution request: TExecRequest {
# catalog日志
I0103 15:09:35.892182 29165 rpc-trace.cc:133] RPC call: CatalogService.PrioritizeLoad(from ::ffff:127.0.0.1:44323)
I0103 15:09:39.563268 29185 HdfsTable.java:916] load table: default_impala.kpi_disp_user_info_stat_tb
I0103 15:10:48.357046 29185 HdfsTable.java:234] load block md for kpi_disp_user_info_stat_tb
I0103 15:11:36.110947 29165 rpc-trace.cc:133] RPC call: CatalogService.PrioritizeLoad(from ::ffff:127.0.0.1:44323)
I0103 15:11:48.948714 29185 HdfsTable.java:1056] table #rows=-1
# hive metastore日志
2015-01-03 15:09:38,991 INFO org.apache.hadoop.hive.metastore.HiveMetaStore: 54032: source:/IP地址 get_table : db=default_impala tbl=kpi_disp_user_info_stat_tb
2015-01-03 15:09:39,848 INFO org.apache.hadoop.hive.metastore.HiveMetaStore: 54032: source:/IP地址 get_partition_names : db=default_impala tbl=kpi_disp_user_info_stat_tb
2015-01-03 15:09:39,902 INFO org.apache.hadoop.hive.metastore.HiveMetaStore: 54032: source:/IP地址 get_partitions_by_names : db=default_impala tbl=kpi_disp_user_info_stat_tb
2015-01-03 15:09:52,839 INFO org.apache.hadoop.hive.metastore.HiveMetaStore: 54032: source:/IP地址 get_partitions_by_names : db=default_impala tbl=kpi_disp_user_info_stat_tb
2015-01-03 15:10:05,383 INFO org.apache.hadoop.hive.metastore.HiveMetaStore: 54032: source:/IP地址 get_partitions_by_names : db=default_impala tbl=kpi_disp_user_info_stat_tb&lt;/pre>
&lt;p>这次加多了metastore的日志进来
在15:09:35提交了查询语句，可以看到impalad和catalog都有一条日志，metastore在3秒后有一条日志（3秒的原因是hive metastore一个bug，我在测试时没修复，但不影响分析）。
catalogd开始获取这个表的元素据以及文件block信息，15:09:39至15:10:48从metastore获取完元素据，15:10:48开始获取文件block信息。直到15:11:48完成，期间因为impalad获取元素据超过120秒，15:11:36重新获取了一次。&lt;/p>
&lt;pre lang="java" escaped="true">// Frontend.java
private boolean requestTblLoadAndWait(Set&amp;lt;TableName&amp;gt; requestedTbls, long timeoutMs)
throws InternalException {
// impala本地缓存了元素据，每个表有一个版本号。本地的缓存一开始只缓存表名，分区信息等都没有缓存
Set&amp;lt;TableName&amp;gt; missingTbls = getMissingTbls(requestedTbls);
// There are no missing tables, return and avoid making an RPC to the CatalogServer.
if (missingTbls.isEmpty()) return true;
// Call into the CatalogServer and request the required tables be loaded.
LOG.info(String.format("Requesting prioritized load of table(s): %s",
Joiner.on(", ").join(missingTbls)));
// 这里通过jni的方式调用c++写的代码，与catalogd通信获取元素据
TStatus status = FeSupport.PrioritizeLoad(missingTbls);
if (status.getStatus_code() != TStatusCode.OK) {
throw new InternalException("Error requesting prioritized load: " +
Joiner.on("\n").join(status.getError_msgs()));
}
long startTimeMs = System.currentTimeMillis();
// Wait until all the required tables are loaded in the Impalad's catalog cache.
// 检查是不是在本地缓存里了
while (!missingTbls.isEmpty()) {
// Check if the timeout has been reached.
if (timeoutMs &amp;gt; 0 &amp;&amp; System.currentTimeMillis() - startTimeMs &amp;gt; timeoutMs) {
return false;
}
LOG.trace(String.format("Waiting for table(s) to complete loading: %s",
Joiner.on(", ").join(missingTbls)));
getCatalog().waitForCatalogUpdate(MAX_CATALOG_UPDATE_WAIT_TIME_MS);
missingTbls = getMissingTbls(missingTbls);
// TODO: Check for query cancellation here.
}
return true;
}&lt;/pre>
&lt;p>继续看FeSupport.PrioritizeLoad的代码，这里实际是调用c++的代码，在fe-support.cc里，直接看&lt;/p>
&lt;pre lang="csharp" escaped="true">extern "C"
JNIEXPORT jbyteArray JNICALL
Java_com_cloudera_impala_service_FeSupport_NativePrioritizeLoad(
JNIEnv* env, jclass caller_class, jbyteArray thrift_struct) {
TPrioritizeLoadRequest request;
DeserializeThriftMsg(env, thrift_struct, &amp;request);
CatalogOpExecutor catalog_op_executor(ExecEnv::GetInstance(), NULL);
TPrioritizeLoadResponse result;
Status status = catalog_op_executor.PrioritizeLoad(request, &amp;result);
if (!status.ok()) {
LOG(ERROR) &amp;lt;&amp;lt; status.GetErrorMsg();
// Create a new Status, copy in this error, then update the result.
Status catalog_service_status(result.status);
catalog_service_status.AddError(status);
status.ToThrift(&amp;result.status);
}
jbyteArray result_bytes = NULL;
THROW_IF_ERROR_RET(SerializeThriftMsg(env, &amp;result, &amp;result_bytes), env,
JniUtil::internal_exc_class(), result_bytes);
return result_bytes;
}&lt;/pre>
&lt;p>c++代码没看懂，不知道怎么调用到了catalogd的代码，不管了，从日志看执行了这行代码HdfsTable.java:916&lt;/p>
&lt;pre lang="java" escaped="true">public void load(Table cachedEntry, HiveMetaStoreClient client,
org.apache.hadoop.hive.metastore.api.Table msTbl) throws TableLoadingException {
numHdfsFiles_ = 0;
totalHdfsBytes_ = 0;
LOG.debug("load table: " + db_.getName() + "." + name_);
...
loadColumns(fieldSchemas, client);
//这里有一些判断是否使用缓存的代码，如果是完全没有缓存，会通过以下方法获取
msPartitions.addAll(MetaStoreUtil.fetchAllPartitions(
client, db_.getName(), name_, NUM_PARTITION_FETCH_RETRIES));
//如果部分分区已经获取过了，会只获取未知分区的元素据
LOG.info(String.format("Incrementally refreshing %d/%d partitions.",
modifiedPartitionNames.size(), totalPartitions));
// No need to make the metastore call if no partitions are to be updated.
if (modifiedPartitionNames.size() &amp;gt; 0) {
// Now reload the the remaining partitions.
msPartitions.addAll(MetaStoreUtil.fetchPartitionsByName(client,
Lists.newArrayList(modifiedPartitionNames), db_.getName(), name_));
}
...
// 加载元素据和获取block信息
loadPartitions(msPartitions, msTbl, oldFileDescMap);
// load table stats
numRows_ = getRowCount(msTbl.getParameters());
LOG.debug("table #rows=" + Long.toString(numRows_));
}&lt;/pre>
&lt;p>在MetaStoreUtil.fetchAllPartitions方法里会先get_partition_names获取全部的分区名，然后再分批get_partitions_by_names来获取分区的全部信息。每次RPC获取的分区数量由参数HiveConf.ConfVars.METASTORE_BATCH_RETRIEVE_TABLE_PARTITION_MAX指定，默认1000个分区一次。
在loadPartitions方法中，会创建一些分区对象和搜集分区的行数（这个应该是要用comput stat才有值，默认搜集不到），然后再调用loadBlockMd(fileDescsToLoad);方法&lt;/p>
&lt;pre lang="java" escaped="true">/**
* Loads the file block metadata for the given collection of FileDescriptors.
* The FileDescriptors are passed as a Map of partition location to list of
* files that exist under that directory.
*/
private void loadBlockMd(Map&amp;lt;String, List&amp;lt;FileDescriptor&amp;gt;&amp;gt; fileDescriptors)
throws RuntimeException {
Preconditions.checkNotNull(fileDescriptors);
LOG.debug("load block md for " + name_);
// Store all BlockLocations so they can be reused when loading the disk IDs.
List&amp;lt;BlockLocation&amp;gt; blockLocations = Lists.newArrayList();
// loop over all files and record their block metadata, minus volume ids
for (String parentPath: fileDescriptors.keySet()) {
for (FileDescriptor fileDescriptor: fileDescriptors.get(parentPath)) {
Path p = new Path(parentPath, fileDescriptor.getFileName());
BlockLocation[] locations = null;
try {
// 这里可能耗时，每个分区都获取文件信息（已缓存的不获取，但没看懂缓存的机制）
FileStatus fileStatus = DFS.getFileStatus(p);
// fileDescriptors should not contain directories.
Preconditions.checkArgument(!fileStatus.isDirectory());
// RPC操作
locations = DFS.getFileBlockLocations(fileStatus, 0, fileStatus.getLen());
Preconditions.checkNotNull(locations);
blockLocations.addAll(Arrays.asList(locations));
// Loop over all blocks in the file.
for (BlockLocation block: locations) {
String[] blockHostPorts = block.getNames();
try {
blockHostPorts = block.getNames();
} catch (IOException e) {
// this shouldn't happen, getNames() doesn't throw anything
String errorMsg = "BlockLocation.getNames() failed:\n" + e.getMessage();
LOG.error(errorMsg);
throw new IllegalStateException(errorMsg);
}
// Now enumerate all replicas of the block, adding any unknown hosts
// to hostIndex_ and the index for that host to replicaHostIdxs.
List&amp;lt;Integer&amp;gt; replicaHostIdxs = new ArrayList&amp;lt;Integer&amp;gt;(blockHostPorts.length);
for (int i = 0; i &amp;lt; blockHostPorts.length; ++i) {
String[] ip_port = blockHostPorts[i].split(":");
Preconditions.checkState(ip_port.length == 2);
TNetworkAddress network_address = new TNetworkAddress(ip_port[0],
Integer.parseInt(ip_port[1]));
replicaHostIdxs.add(hostIndex_.getIndex(network_address));
}
fileDescriptor.addFileBlock(
new FileBlock(block.getOffset(), block.getLength(), replicaHostIdxs));
}
} catch (IOException e) {
throw new RuntimeException("couldn't determine block locations for path '"
+ p + "':\n" + e.getMessage(), e);
}
}
}
if (SUPPORTS_VOLUME_ID) {
LOG.trace("loading disk ids for: " + getFullName() +
". nodes: " + getNumNodes());
loadDiskIds(blockLocations, fileDescriptors);
LOG.trace("completed load of disk ids for: " + getFullName());
}
}&lt;/pre>
&lt;p> 
另外找到一个有一点关系的issue， IMPALA-1480 &lt;a href="https://issues.cloudera.org/browse/IMPALA-1480">Slow DDL statements for tables with large number of partitions&lt;/a>
google group上的讨论 https://groups.google.com/a/cloudera.org/forum/#!topic/impala-user/Xv8d2jndzZ0&lt;/p>
&lt;div style="color: #222222;"> Dimitris：&lt;/div>
&lt;div style="color: #222222;"> It looks like an issue I am currently working on (&lt;a style="color: #6611cc;" href="https://issues.cloudera.org/browse/IMPALA-1480" target="_blank">https://issues.cloudera.org/&lt;wbr />browse/IMPALA-1480&lt;/a>). I have a patch in flight that significantly improves DDL and INSERT statements for partitioned tables. Currently, the issue is that we force-reload the entire table metadata even though only few partitions have been modified.&lt;/div>
&lt;div style="color: #222222;"> 不过他说的是DDL语句，会强制加载整个元数据，尽管只改几个分区，和这里的查询类似。&lt;/div>
## 结论
&lt;p>对于很多分区的表，获取全部元素据以及block信息花费很多时间导致查询变慢。如果impala能够针对查询只获取需要用到的分区信息将会加快很多。
 &lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/impala/">Impala</category></item><item><title>从日志分析impala查询慢的原因（1）</title><link>https://fatkun.github.io/2014/12/analyze-slow-impala.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/12/analyze-slow-impala.html</guid><pubDate>Sun, 28 Dec 2014 18:42:52 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>本文只是分析和代码的关联，并没有解决慢的问题。
有些语句在impala查询很慢，尝试把日志和代码关联起来，便于之后的分析。由于impala涉及到多个对象，有些代码搞不清楚是如何调用的。
当前发现在获取元数据的过程很慢。
代码中有fe和be两个目录,be是c++写的，fe是java写的。
c++通过jni调用java代码（或许还有rpc调用）
在be\src\service\impala-hs2-server.cc里是我们使用的hiveserver2协议的服务端&lt;/p>
&lt;h2 id="开始">开始&lt;/h2>
&lt;p>先把impalad的debug日志记录下来，修改/etc/default/impala里，增加一行export GLOG_v=2
通过impala-shell查询 select distinct(disp_id) from default_impala.kpi_disp_user_info_stat_tb where pt=’2014-04-08′
等查询完后的时间分析为：&lt;/p>
&lt;pre>Query Timeline: 2m34s
- Start execution: 77.818us (77.818us)
- Planning finished: 2m33s (2m33s)
- Ready to start remote fragments: 2m33s (4.473ms)
- Remote fragments started: 2m34s (580.800ms)
- Rows available: 2m34s (353.883ms)
- First row fetched: 2m34s (51.765ms)
- Unregister query: 2m34s (13.51ms)&lt;/pre>
&lt;p>其中大部分时间在Planning里面
在日志可以看到这两条
I1228 17:22:53.467937 11982 rpc-trace.cc:133] RPC call: BeeswaxService.query(from ::ffff:IP:39274)&lt;br>
I1228 17:22:53.467978 11982 impala-beeswax-server.cc:170] query(): query=select distinct(disp_id) from default_impala.kpi_disp_user_info_stat_tb where pt=’2014-04-08′
已经开始查询
I1228 17:22:53.471019 11982 Frontend.java:760] analyze query select distinct(disp_id) from default_impala.kpi_disp_user_info_stat_tb where pt=’2014-04-08′&lt;br>
I1228 17:22:53.472192 11982 Frontend.java:709] Requesting prioritized load of table(s): default_impala.kpi_disp_user_info_stat_tb&lt;br>
I1228 17:24:54.335124 11982 Frontend.java:779] Missing tables were not received in 120000ms. Load request will be retried.&lt;br>
I1228 17:24:54.335906 11982 Frontend.java:709] Requesting prioritized load of table(s): default_impala.kpi_disp_user_info_stat_tb&lt;br>
I1228 17:25:27.136531 11982 Frontend.java:833] create plan
impala-beeswax-server.cc中通过jni的方式调用Frontend.java的代码，这里日志中有一次超时了（120秒），重试了一次。第一次花了120秒，第二次重试后，在17:25:27后获取成功，第二次花了30秒。&lt;/p>
&lt;pre lang="java" escaped="true">private AnalysisContext.AnalysisResult analyzeStmt(TQueryCtx queryCtx)
throws AnalysisException, InternalException, AuthorizationException {
AnalysisContext analysisCtx = new AnalysisContext(impaladCatalog_, queryCtx,
authzConfig_);
LOG.debug("analyze query " + queryCtx.request.stmt);
// Run analysis in a loop until it any of the following events occur:
// 1) Analysis completes successfully.
// 2) Analysis fails with an AnalysisException AND there are no missing tables.
// 3) Analysis fails with an AuthorizationException.
try {
while (true) {
try {
analysisCtx.analyze(queryCtx.request.stmt);
Preconditions.checkState(analysisCtx.getAnalyzer().getMissingTbls().isEmpty());
return analysisCtx.getAnalysisResult();
} catch (AnalysisException e) {
Set&amp;lt;TableName&amp;gt; missingTbls = analysisCtx.getAnalyzer().getMissingTbls();
// Only re-throw the AnalysisException if there were no missing tables.
if (missingTbls.isEmpty()) throw e;
// Some tables/views were missing, request and wait for them to load.
if (!requestTblLoadAndWait(missingTbls, MISSING_TBL_LOAD_WAIT_TIMEOUT_MS)) {
LOG.info(String.format("Missing tables were not received in %dms. Load " +
"request will be retried.", MISSING_TBL_LOAD_WAIT_TIMEOUT_MS));
}
}
}
} finally {
// Authorize all accesses.
// AuthorizationExceptions must take precedence over any AnalysisException
// that has been thrown, so perform the authorization first.
analysisCtx.getAnalyzer().authorize(getAuthzChecker());
}
}&lt;/pre>
&lt;p>进去看requestTblLoadAndWait这个方法&lt;/p>
&lt;pre lang="java" escaped="true">/**
* Requests the catalog server load the given set of tables and waits until
* these tables show up in the local catalog, or the given timeout has been reached.
* The timeout is specified in milliseconds, with a value &amp;lt;= 0 indicating no timeout.
* The exact steps taken are:
* 1) Collect the tables that are missing (not yet loaded locally).
* 2) Make an RPC to the CatalogServer to prioritize the loading of these tables.
* 3) Wait until the local catalog contains all missing tables by (re)checking the
* catalog each time a new catalog update is received.
*
* Returns true if all missing tables were received before timing out and false if
* the timeout was reached before all tables were received.
*/
private boolean requestTblLoadAndWait(Set&amp;lt;TableName&amp;gt; requestedTbls, long timeoutMs)
throws InternalException {
Set&amp;lt;TableName&amp;gt; missingTbls = getMissingTbls(requestedTbls);
// There are no missing tables, return and avoid making an RPC to the CatalogServer.
if (missingTbls.isEmpty()) return true;
// Call into the CatalogServer and request the required tables be loaded.
LOG.info(String.format("Requesting prioritized load of table(s): %s",
Joiner.on(", ").join(missingTbls)));
TStatus status = FeSupport.PrioritizeLoad(missingTbls);
if (status.getStatus_code() != TStatusCode.OK) {
throw new InternalException("Error requesting prioritized load: " +
Joiner.on("\n").join(status.getError_msgs()));
}
long startTimeMs = System.currentTimeMillis();
// Wait until all the required tables are loaded in the Impalad's catalog cache.
while (!missingTbls.isEmpty()) {
// Check if the timeout has been reached.
if (timeoutMs &amp;gt; 0 &amp;&amp; System.currentTimeMillis() - startTimeMs &amp;gt; timeoutMs) {
return false;
}
LOG.trace(String.format("Waiting for table(s) to complete loading: %s",
Joiner.on(", ").join(missingTbls)));
getCatalog().waitForCatalogUpdate(MAX_CATALOG_UPDATE_WAIT_TIME_MS);
missingTbls = getMissingTbls(missingTbls);
// TODO: Check for query cancellation here.
}
return true;
}&lt;/pre>
&lt;p>这里没看懂怎么调用的，调用的是FeSupport.PrioritizeLoad，是放到一个SET里面，并且移到第一位。猜测是impalad自己有个catalog的缓存，如果在缓存找不到(missingTbls)，会通过rpc调用中心的catalogd服务。
看中心catalogd的日志，可以看到被调用了两次。时间上和impalad的日志一致。（因为在线上测试，catalogd没有打开更详细日志）
I1228 17:22:53.448292 9209 TableLoader.java:60] Loading metadata for: default_impala.kpi_disp_user_info_stat_tb&lt;br>
I1228 17:22:53.448468 9209 HiveMetaStoreClient.java:238] Trying to connect to metastore with URI thrift://vdc22:9083&lt;br>
I1228 17:22:53.449069 9209 HiveMetaStoreClient.java:326] Connected to metastore.&lt;br>
I1228 17:23:07.808981 15118 HiveMetaStoreClient.java:238] Trying to connect to metastore with URI thrift://vdc22:9083&lt;br>
I1228 17:23:07.809939 15118 HiveMetaStoreClient.java:326] Connected to metastore.&lt;br>
I1228 17:23:20.419278 26716 HiveMetaStoreClient.java:238] Trying to connect to metastore with URI thrift://vdc22:9083&lt;br>
I1228 17:23:20.419970 26716 HiveMetaStoreClient.java:326] Connected to metastore.&lt;br>
I1228 17:24:54.308159  3044 TableLoader.java:60] Loading metadata for: default_impala.kpi_disp_user_info_stat_tb
这里日志的代码在这里com.cloudera.impala.catalog.TableLoader
后面的步骤花费的时间不多，不继续分析了。&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/impala/">Impala</category></item><item><title>编译impala2.0.0</title><link>https://fatkun.github.io/2014/12/compile-impala.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/12/compile-impala.html</guid><pubDate>Sun, 21 Dec 2014 08:50:16 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>使用redhat5.8没编译成功，改用redhat6.4最终编译成功。
参考官方的文档https://github.com/cloudera/Impala/tree/v1.2.2
不知道官方的readme.md在新的版本为什么删掉了。。。囧&lt;/p>
&lt;h2 id="准备条件">准备条件&lt;/h2>
&lt;p>安装必须要的包，jdk，llvm，maven
注意它要求用oracle的jdk，redhat默认是openjdk，可以参考这里安装 &lt;a href="http://unix.stackexchange.com/questions/63587/how-to-install-g-4-7-2-c11-on-centos-5-x">http://unix.stackexchange.com/questions/63587/how-to-install-g-4-7-2-c11-on-centos-5-x&lt;/a>
 &lt;/p>
&lt;h2 id="安装boost">安装boost&lt;/h2>
&lt;p>CentOS 6.4上预装的是boost 1.41，但是impala需要更高版本的boost库（Note: Impala requires Boost 1.4.2 or later），所以先卸载掉boost 1.41&lt;/p>
&lt;pre lang="bash" escaped="true">rpm -e `rpm -qa|grep boost`&lt;/pre>
&lt;pre lang="bash" escaped="true">cd boost_1_46_1
sh ./bootstrap.sh
#注意要加上 cxxflags=-fPIC 参数，否则后面编译失败
./bjam --libdir=/usr/lib64 threading=multi --layout=tagged install cxxflags=-fPIC
#编译静态库，不知道有没有用...
./bjam --layout=tagged --libdir=/usr/lib64 cxxflags=-fPIC \
link=static threading=multi runtime-link=static install&lt;/pre>
&lt;h2 id="编译impala">编译impala&lt;/h2>
&lt;p>把代码下载下来，由于不是直接从git下载来的，所以用git init初始化一次。另外注意里面有clean的选项，使用git来clean会导致一些代码被删掉。&lt;/p>
&lt;pre lang="bash" escaped="true">sh ./buildall.sh -noclean -skiptests&lt;/pre>
&lt;p>bulitall.sh实际会用到bin下面的脚本，可以都看一下&lt;/p>
&lt;h2 id="报错处理">报错处理&lt;/h2>
&lt;pre lang="other" escaped="true">Linking CXX executable ../../build/debug/common/atomic-test
/usr/bin/ld: cannot find -lboost_date_time
collect2: ld returned 1 exit status
make[2]: *** [be/build/debug/common/atomic-test] Error 1
make[1]: *** [be/src/common/CMakeFiles/atomic-test.dir/all] Error 2
&lt;/pre>
&lt;p>我们用的是mt（多线程）的库，所以要改一下&lt;br>
修改了be/CMakeLists.txt的216行，将原有的：&lt;br>
-lrt -lboost_date_time&lt;br>
改为&lt;br>
-lrt -lboost_date_time-mt&lt;br>
如果要静态编译，要把-lboost_date_time去掉（这里我需要静态编译，所以把它去掉了）&lt;br>
修改./CMakeLists.txt，加入date_time-mt&lt;/p>
&lt;pre lang="other" escaped="true">find_package(Boost REQUIRED COMPONENTS thread regex-mt system-mt filesystem-mt date_time-mt)&lt;/pre>
&lt;p>修改./CMakeLists.txt找到 Boost_DEBUG 这一行，加上着一些&lt;/p>
&lt;pre lang="other" escaped="true">set(Boost_DEBUG FALSE)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
set(Boost_USE_MULTITHREADED ON)
add_definitions(-DBOOST_ALL_NO_LIB)&lt;/pre>
&lt;p>编译后的文件在 be/bulid里面，编译出来的东西有200MB+，和官方的比20MB吓尿了好吧。&lt;br>
执行strip –strip-debug impalad 会变成30MB+&lt;/p>
&lt;h3 id="报错could-not-find-jni-missing-jni_include_dirs">报错Could NOT find JNI (missing: JNI_INCLUDE_DIRS)&lt;/h3>
&lt;p>修改cmake_modules/FindJNI.cmake文件&lt;/p>
&lt;pre lang="other" escaped="true">找到JAVA_AWT_LIBRARY_DIRECTORIES，增加路径（和你jdk位置相关）
/usr/java/jdk1.7.0_67-cloudera/jre/lib/amd64/
找到JAVA_AWT_INCLUDE_DIRECTORIES，增加路径
/usr/java/jdk1.7.0_67-cloudera/include
其他路径注释掉
另外我还设定了几个路径
set(JAVA_INCLUDE_PATH
/usr/java/jdk1.7.0_67-cloudera/include
)
set(JAVA_INCLUDE_PATH2
/usr/java/jdk1.7.0_67-cloudera/include/linux/
)
set(JAVA_AWT_INCLUDE_PATH
/usr/java/jdk1.7.0_67-cloudera/include
)&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="cdh45-hive的bug">cdh4.5 hive的bug&lt;/h2>
&lt;p>impala2.0.0通过yum方法安装中，会使用cdh4.5的lib&lt;br>
cdh4.5中，org.apache.hadoop.hive.metastore.HiveMetaStoreClient有个bug，在每次连接metastore的时候都会等3秒钟，可以从catalog的日志看到，如果用background-load的方法会很慢。&lt;br>
照着 cdh4.6的代码改就可以了。一个低级的错误http://www.grepcode.com/file/repository.cloudera.com/content/repositories/releases/org.apache.hive/hive-metastore/0.10.0-cdh4.6.0/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java#314&lt;br>
把编译好的包替换掉，目录在/usr/lib/impala里&lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="https://github.com/cloudera/Impala/tree/v1.2.2">https://github.com/cloudera/Impala/tree/v1.2.2&lt;/a>&lt;br>
&lt;a href="http://blog.csdn.net/vah101/article/details/32343471">http://blog.csdn.net/vah101/article/details/32343471&lt;/a>&lt;br>
&lt;a href="http://blog.chinaunix.net/uid-21519621-id-3952587.html">http://blog.chinaunix.net/uid-21519621-id-3952587.html&lt;/a>&lt;br>
编译release版本 &lt;a href="http://johnjianfang.blogspot.com/2013/06/build-impala-release.html">http://johnjianfang.blogspot.com/2013/06/build-impala-release.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/impala/">Impala</category></item><item><title>在Redhat6.4手动安装impala2.0</title><link>https://fatkun.github.io/2014/12/manual-install-impala2-0.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/12/manual-install-impala2-0.html</guid><pubDate>Sun, 21 Dec 2014 08:21:17 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="背景"> 背景&lt;/h2>
&lt;p>已经通过cloudera manager装好了hadoop，但由于不敢升级cm，所以单独升级impala，采用yum的安装方式。原本已经安装了impala1.1，现在升级到impala2.0。所以有些配置没有说明，请参考官方文档。&lt;/p>
&lt;h2 id="在本地做个镜像">在本地做个镜像&lt;/h2>
&lt;p>把需要用到的rpm下载下来&lt;/p>
&lt;pre lang="bash" escaped="true">wget -r -np -k 'http://archive.cloudera.com/impala/redhat/6/x86_64/impala/2.0.0/'&lt;/pre>
&lt;p> 
配置一个nginx，用来提供下载
nginx配置&lt;/p>
&lt;pre lang="xml" escaped="true">server {
listen 9500;
server_name www.lnmp.org;
index index.html index.htm index.php;
root /home/kpi/impala/archive.cloudera.com;
autoindex on; #打开索引功能
autoindex_exact_size off; #人性化方式显示大小
autoindex_localtime on; #显示服务器时间
}
&lt;/pre>
&lt;h2 id="配置repo">配置repo&lt;/h2>
&lt;p>把以下内容保存为文件 impala.repo 到 /etc/yum.repos.d/目录下， 下面的地址 archive.cloudera.com 可以换成你本地镜像的地址&lt;/p>
&lt;pre lang="xml">[cloudera-impala]
name=Impala
baseurl=http://archive.cloudera.com/impala/redhat/6/x86_64/impala/2.0.0/
gpgkey = http://archive.cloudera.com/impala/redhat/6/x86_64/impala/RPM-GPG-KEY-cloudera
gpgcheck = 1
&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="安装">安装&lt;/h2>
&lt;p>安装服务，所有机器安装&lt;/p>
&lt;pre lang="bash" escaped="true">yum install impala impala-server impala-shell&lt;/pre>
&lt;p>在某台机器上装state-store这些启动脚本&lt;/p>
&lt;pre lang="bash" escaped="true">yum install impala-state-store impala-catalog&lt;/pre>
&lt;h2 id="配置">配置&lt;/h2>
&lt;pre lang="bash" escaped="true">ln -s /etc/hive/conf/hive-site.xml /etc/impala/conf/
ln -s /etc/hive/conf/hive-env.sh /etc/impala/conf/
ln -s /etc/hadoop/conf/core-site.xml /etc/impala/conf/
cp /etc/hadoop/conf/hdfs-site.xml /etc/impala/conf/
&lt;/pre>
&lt;p>hdfs-site.xml配置不能直接用客户端的配置，会缺少某个配置导致impala-server启动不了。如果启动不了可以检查impala的日志。
在hdfs-site.xml加入&lt;/p>
&lt;pre lang="xml" escaped="true">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;dfs.client.file-block-storage-locations.timeout&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;3000&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre>
&lt;p>hdfs配置查看下面的网址，注意影响性能的Short-Circuit Reads选项&lt;br>
&lt;a href="http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/impala">http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/impala&lt;/a>_config_performance.html?scroll=config_performance&lt;/p>
&lt;h3 id="修改impala默认用户为kpi">修改impala默认用户为kpi&lt;/h3>
&lt;p>这个只是我们需要用kpi这个账号来读取数据，如果你使用默认用户impala也是可以的，注意要在hdfs配置这个用户可以直接读取hdfs
修改/etc/init.d/impala-server, /etc/init.d/impala-state-store,/etc/init.d/impala-catalog 文件，&lt;br>
找到 SVC_USER=”impala” 改为 SVC_USER=”kpi”&lt;br>
找到install -d -m 0755 -o impala -g impala /var/run/impala 改为 install -d -m 0755 -o kpi -g kpi /var/run/impala&lt;br>
创建日志目录&lt;/p>
&lt;pre lang="bash" escaped="true">mkdir -p /home/hadoop/log/impala/
chown kpi:kpi /home/hadoop/log/impala/&lt;/pre>
&lt;p>修改impala 的默认配置/etc/default/impala文件&lt;/p>
&lt;pre lang="bash" escaped="true">IMPALA_CATALOG_SERVICE_HOST=catalog的机器名或IP
IMPALA_STATE_STORE_HOST=statestore的机器名或IP
IMPALA_STATE_STORE_PORT=24000
IMPALA_BACKEND_PORT=22000
IMPALA_LOG_DIR=/home/hadoop/log/impala
IMPALA_CATALOG_ARGS=" -log_dir=${IMPALA_LOG_DIR} "
IMPALA_STATE_STORE_ARGS=" -log_dir=${IMPALA_LOG_DIR} -state_store_port=${IMPALA_STATE_STORE_PORT}"
IMPALA_SERVER_ARGS=" \
-mem_limit=4294967296 \
-enable_webserver=true \
-webserver_port=25000 \
-beeswax_port=21000 \
-hs2_port=21050 \
-log_dir=${IMPALA_LOG_DIR} \
-catalog_service_host=${IMPALA_CATALOG_SERVICE_HOST} \
-state_store_port=${IMPALA_STATE_STORE_PORT} \
-use_statestore \
-state_store_host=${IMPALA_STATE_STORE_HOST} \
-be_port=${IMPALA_BACKEND_PORT}"
ENABLE_CORE_DUMPS=false
# LIBHDFS_OPTS=-Djava.library.path=/usr/lib/impala/lib
# MYSQL_CONNECTOR_JAR=/usr/share/java/mysql-connector-java.jar
# IMPALA_BIN=/usr/lib/impala/sbin
# IMPALA_HOME=/usr/lib/impala
# HIVE_HOME=/usr/lib/hive
# HBASE_HOME=/usr/lib/hbase
# IMPALA_CONF_DIR=/etc/impala/conf
# HADOOP_CONF_DIR=/etc/hadoop/conf&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="启动">启动&lt;/h2>
&lt;pre lang="bash" escaped="true">service impala-state-store start
service impala-catalog start
service impala-server start&lt;/pre>
&lt;p>报错/etc/init.d/impala-state-store: line 35: /etc/default/hadoop: No such file or directory 这个无关紧要，找不到hadoop默认配置文件
 &lt;/p>
&lt;h2 id="报错处理">报错处理&lt;/h2>
&lt;p>在redhat5.x版本中启动impala-shell会报sasl的错误，需要用pip安装python26-libs ,sasl
报错 ERROR: block location tracking is not properly enabled because&lt;br>
– dfs.client.file-block-storage-locations.timeout is too low. It should be at least 3000.
是因为hdfs的配置不对，需要在hdfs_site.xml加入dfs.client.file-block-storage-locations.timeout配置,见上面的配置&lt;/p>
&lt;h2 id="检查进程">检查进程&lt;/h2>
&lt;p>看一下进程是否都已经起来了&lt;/p>
&lt;pre lang="bash" escaped="true">ps auxf|grep state
ps auxf|grep catalog
&lt;/pre>
&lt;h2 id="安装impala-lzo可选">安装impala lzo（可选）&lt;/h2>
&lt;p>加入cloudera-gplextras5.repo&lt;/p>
&lt;pre lang="xml" escaped="true">[cloudera-gplextras5]
# Packages for Cloudera's GPLExtras, Version 5, on RedHat or CentOS 6 x86_64
name=Cloudera's GPLExtras, Version 5
baseurl=http://archive.cloudera.com/gplextras/redhat/6/x86_64/gplextras/4.3.0/
gpgkey = http://archive.cloudera.com/gplextras/redhat/6/x86_64/gplextras/RPM-GPG-KEY-cloudera
gpgcheck = 1&lt;/pre>
&lt;p>安装&lt;/p>
&lt;pre lang="bash" escaped="true">yum install impala-lzo-2.0.0&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://blog.javachen.com/2013/03/29/install-impala/">http://blog.javachen.com/2013/03/29/install-impala/&lt;/a>&lt;br>
&lt;a href="http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/impala_noncm_installation.html">http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/impala_noncm_installation.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/2.0.0/">2.0.0</category><category domain="https://fatkun.github.io/tags/impala/">Impala</category></item><item><title>hdfs httpfs与webhdfs的简单使用</title><link>https://fatkun.github.io/2014/11/httpfs-and-webhdfs.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/11/httpfs-and-webhdfs.html</guid><pubDate>Sun, 02 Nov 2014 08:46:33 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="httpfs和webhdfs">HttpFS和WebHDFS&lt;/h2>
&lt;p>通过http协议操作hdfs有两个组件，httpfs和webhdfs，我一开始还以为这两个是同一个东西，其实不是。webhdfs是namenode、datanode自带的，httpfs是完全独立的一个组件。
webhdfs上传文件等操作需要通过某个datanode进行，而不是直接通过namenode上传，客户端有可能访问多个机器。而httpfs，所有的操作都通过httpfs进行。
webhdfs和httpfs的使用方法基本是一样的，只有很小很小的差别。
 &lt;/p>
&lt;h2 id="httpfs一些常用的操作">HttpFS一些常用的操作&lt;/h2>
&lt;p>查看home目录&lt;br>
curl “http://osg11-vm06:8014/webhdfs/v1?op=GETHOMEDIRECTORY&amp;amp;user.name=kpi”
创建目录&lt;br>
curl -i -X PUT “http://osg11-vm06:8014/webhdfs/v1/tmp/chenyk?op=MKDIRS&amp;amp;user.name=kpi”
curl -i -X PUT “http://osg11-vm06:8014/webhdfs/v1/tmp/chenyk/a/b/c?op=MKDIRS&amp;amp;user.name=kpi”
删除目录，recursive参数删除非空目录&lt;br>
curl -i -X DELETE “http://osg11-vm06:8014/webhdfs/v1/tmp/chenyk/a?op=DELETE&amp;amp;recursive=true&amp;amp;user.name=kpi”
创建文件(httpfs执行这一步没意义，上传也是通过httpfs上传)&lt;br>
curl -i -X PUT “http://osg11-vm06:8014/webhdfs/v1/tmp/chenyk/test?op=CREATE&amp;amp;user.name=kpi”
创建文件和上传&lt;br>
这里需要加入header，否则提示出错，可能是个bug &lt;a href="https://issues.cloudera.org/browse/HUE-679">https://issues.cloudera.org/browse/HUE-679&lt;/a>
curl -i -X PUT -T /tmp/test.txt “http://osg11-vm06:8014/webhdfs/v1/tmp/chenyk/test?op=CREATE&amp;amp;data=true&amp;amp;user.name=kpi” -H “Content-Type:application/octet-stream”
追加文件&lt;br>
curl -i -X POST -T /tmp/test.txt “http://osg11-vm06:8014/webhdfs/v1/tmp/chenyk/test?op=APPEND&amp;amp;data=true&amp;amp;user.name=kpi” -H “Content-Type:application/octet-stream”
打开文件并读取&lt;br>
curl -i -L “http://osg11-vm06:8014/webhdfs/v1/tmp/chenyk/test?op=OPEN&amp;amp;user.name=kpi”
 &lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://hadoop.apache.org/docs/r1.0.4/webhdfs.html">http://hadoop.apache.org/docs/r1.0.4/webhdfs.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hdfs/">Hdfs</category><category domain="https://fatkun.github.io/tags/httpfs/">Httpfs</category><category domain="https://fatkun.github.io/tags/webhdfs/">Webhdfs</category></item><item><title>cdh4 spark配置LZO</title><link>https://fatkun.github.io/2014/09/spark-with-lzo.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/09/spark-with-lzo.html</guid><pubDate>Sat, 27 Sep 2014 05:36:21 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>使用的hadoop是cdh4.2.1版本 spark1.1，需要配置hadoop-native和lzo native
在spark-env.sh加入&lt;/p>
&lt;pre lang="html" escaped="true">HADOOP_CONF_DIR=/etc/hadoop/conf
SPARK_SUBMIT_CLASSPATH=$SPARK_SUBMIT_CLASSPATH:/etc/hive/conf:/opt/cloudera/parcels/HADOOP_LZO/lib/hadoop/lib/hadoop-lzo.jar
#SPARK_SUBMIT_LIBRARY_PATH=$SPARK_SUBMIT_LIBRARY_PATH:/opt/cloudera/parcels/CDH/lib/hadoop/lib/native:/opt/cloudera/parcels/HADOOP_LZO/lib/hadoop/lib/native
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/cloudera/parcels/CDH/lib/hadoop/lib/native:/opt/cloudera/parcels/HADOOP_LZO/lib/hadoop/lib/native
&lt;/pre>
&lt;p>我加了SPARK_SUBMIT_LIBRARY_PATH发现是加入了java.library.path，但是丢了默认的配置。改为加入LD_LIBRARY_PATH里
spark-defaults.conf的配置&lt;/p>
&lt;pre escaped="true" lang="bash">spark.ui.port 8810
spark.executor.extraLibraryPath /opt/cloudera/parcels/CDH/lib/hadoop/lib/native:/opt/cloudera/parcels/HADOOP_LZO/lib/hadoop/lib/native&lt;/pre>
&lt;p>可能还需要加上 spark.executor.extraClassPath，但我当前还是单机测试，没配也能跑成功。。&lt;br>
启动spark-sql试试，打开监控页面看看 http://xxxx:8810/environment/ 是否配置正确。
参考：&lt;br>
&lt;a href="http://hsiamin.com/posts/2014/05/03/enable-lzo-compression-on-hadoop-pig-and-spark/">http://hsiamin.com/posts/2014/05/03/enable-lzo-compression-on-hadoop-pig-and-spark/&lt;/a> （按这里的配置不成功，可能环境变量名称改了。）&lt;br>
&lt;a href="http://lotso.blog.51cto.com/3681673/1441737">http://lotso.blog.51cto.com/3681673/1441737&lt;/a>&lt;br>
&lt;a href="https://spark.apache.org/docs/latest/configuration.html">https://spark.apache.org/docs/latest/configuration.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/lzo/">Lzo</category><category domain="https://fatkun.github.io/tags/spark/">Spark</category></item><item><title>phpstorm CodeIgniter 自动完成配置</title><link>https://fatkun.github.io/2014/09/phpstorm-codeigniter-%E8%87%AA%E5%8A%A8%E5%AE%8C%E6%88%90%E9%85%8D%E7%BD%AE.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/09/phpstorm-codeigniter-%E8%87%AA%E5%8A%A8%E5%AE%8C%E6%88%90%E9%85%8D%E7%BD%AE.html</guid><pubDate>Fri, 19 Sep 2014 09:09:17 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;a href="https://github.com/topdown/phpStorm-CC-Helpers">https://github.com/topdown/phpStorm-CC-Helpers&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>hadoop本地目录相关代码分析</title><link>https://fatkun.github.io/2014/09/hadoop-local-dir.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/09/hadoop-local-dir.html</guid><pubDate>Thu, 04 Sep 2014 10:23:12 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>最近hadoop本地磁盘总是坏，伴随着有些hadoop job失败，阅读了一些相关的代码。&lt;/p>
&lt;h2 id="本地磁盘健康检查">本地磁盘健康检查&lt;/h2>
&lt;p>NodeManager默认会每两分钟检查本地磁盘（local-dirs），找出那些目录可以使用。注意这里如果判定这个磁盘不可用，则在重启NodeManager之前，就算磁盘好了，也不会把它变成可用。代码在LocalDirsHandlerService，DirectoryCollection。
当好磁盘数少于一定量时，会把这台机器变成unhealthy，将不会再给这台机器分配任务。
参数 ：&lt;/p>
&lt;pre lang="java" escaped="true">yarn.nodemanager.disk-health-checker.enable     是否开启磁盘健康检查，默认是开启
yarn.nodemanager.disk-health-checker.interval-ms 检查间隔时间，默认是2分钟
yarn.nodemanager.disk-health-checker.min-healthy-disks  最少健康磁盘的个数，默认值是0.25，如果少于这个值，则把这个节点变成unhealthy&lt;/pre>
&lt;h2 id="本地磁盘使用">本地磁盘使用&lt;/h2>
&lt;p>NodeManager会从hdfs下载job.jar等东西，这叫资源本地化。代码在ResourceLocalizationService和DefaultContainerExecutor里。
token文件会使用第一个好的local-dirs，其他的文件会顺序的使用local-dirs，文件可能分散在各个盘上。&lt;/p>
&lt;h2 id="appmaster重试"> AppMaster重试&lt;/h2>
&lt;p>AppMaster重试是由RM触发，代码在RMAppImpl的AttemptFailedTransition事件里。默认重试次数是1次（也就是不重试）
参数：&lt;/p>
&lt;pre lang="java" escaped="true">yarn.resourcemanager.am.max-retries AM最大重试次数&lt;/pre>
&lt;h2 id="taskattempt重试">TaskAttempt重试&lt;/h2>
&lt;p>我们的map和reduce任务都是一个个TaskAttempt，TaskAttempt由AppMaster来管理，启动和重启的操作都是由AppMaster来处理。代码在TaskImpl的AttemptFailedTransition里
参数：&lt;/p>
&lt;pre lang="java" escaped="true">mapreduce.map.maxattempts map最大重试次数，默认是4
mapreduce.reduce.maxattempts reduce最大重试次数，默认是4&lt;/pre>
&lt;h2 id="appmaster资源分配">AppMaster资源分配&lt;/h2>
&lt;p>AppMaster会定时申请、释放container资源，代码在RMContainerRequestor.containerFailedOnHost
当taskAttempt在一个节点的失败数目超过一定上限（通过参数 mapreduce.job.maxtaskfailures.per.tracker 配置，默认是3），该节点会被加入临时的黑名单，为了防止大量的机器加入黑名单，还有个参数 yarn.app.mapreduce.am.job.node-blacklisting.ignore-threshold-node-percent 设置最多被加入黑名单的比例，默认值是33，当超过33%的机器被加入黑名单，则黑名单将会失效。
加入黑名单后，会让RM回收这台机器的container，申请其他机器的container
参数：&lt;/p>
&lt;pre lang="java" escaped="true">mapreduce.job.maxtaskfailures.per.tracker 失败多少次后，加入黑名单，默认是3
yarn.app.mapreduce.am.job.node-blacklisting.ignore-threshold-node-percent 加入黑名单的比例超过这个值时，关闭黑名单，默认是33
yarn.app.mapreduce.am.job.node-blacklisting.enable 是否使用黑名单，默认true
&lt;/pre>
&lt;h2 id="最终处理">最终处理&lt;/h2>
&lt;p>在AM失败重启前，先sleep两分钟，等待磁盘健康检查完成。TaskAttempt有黑名单的方式，由于本地磁盘损坏造成的失败可能会比较少触发。&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/appmaster/">AppMaster</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/%E6%9C%AC%E5%9C%B0%E7%9B%AE%E5%BD%95/">本地目录</category><category domain="https://fatkun.github.io/tags/%E9%87%8D%E8%AF%95%E6%9C%BA%E5%88%B6/">重试机制</category></item><item><title>hive简单查询的过程</title><link>https://fatkun.github.io/2014/08/hive-simple-query.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/08/hive-simple-query.html</guid><pubDate>Thu, 21 Aug 2014 06:07:21 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>查询以下语句的过程&lt;/p>
&lt;pre escaped="true" lang="sql">select fr from xxxxxx where substr(fr, 1, 1) = 'a';&lt;/pre>
&lt;p>Hive查询在编译的阶段把语句转换成一个个有层级关系的Operator，然后执行下去。
ExecMapper中mo是一个MapOperator对象，里面有个childOperators存储了一个树形的操作步骤(Operator)，如本次查询的Operator结构如下:&lt;/p>
&lt;pre lang="html" escaped="true">TableScanOperator 表扫描
FilterOperator 过滤条件
SelectOperator 列裁剪，只查询fr出来
FileSinkOperator 输出到文件
&lt;/pre>
&lt;p>首先第一步是mo.process()，传入的value是整行内容&lt;/p>
&lt;pre lang="java" escaped="true">public void map(Object key, Object value, OutputCollector output,
Reporter reporter) throws IOException {
...
mo.process((Writable)value);
...
}&lt;/pre>
&lt;p>没做什么处理，只是做了个反序列化，放入rowWithPart[0]中&lt;/p>
&lt;pre lang="java" escaped="true">rowWithPart[0] = deserializer.deserialize((Writable) value);
...
forward(rowWithPart, rowObjectInspector); // 传递给下一个Operator
&lt;/pre>
&lt;p>遍历它的所有子Operator，一个个做&lt;/p>
&lt;pre lang="java" escaped="true">for (int i = 0; i &amp;lt; childOperatorsArray.length; i++) {
Operator&amp;lt;? extends OperatorDesc&amp;gt; o = childOperatorsArray[i];
if (o.getDone()) {
childrenDone++;
} else {
o.process(row, childOperatorsTag[i]);
}
}&lt;/pre>
&lt;p>下一个Operator是TableScan，这个只是单纯传给下一个Operator&lt;/p>
&lt;pre lang="java" escaped="true">public void processOp(Object row, int tag) throws HiveException {
if (conf != null &amp;&amp; conf.isGatherStats()) {
gatherStats(row);
}
forward(row, inputObjInspectors[tag]);
}&lt;/pre>
&lt;p>下一个Operator是FilterOperator，执行udf和判断条件是否成立，如果成立才传给下一个&lt;br>
这里有个计数器 PASSED记录通过的， FILTERED记录被过滤掉的。&lt;/p>
&lt;pre lang="java" escaped="true">Object condition = conditionEvaluator.evaluate(row);&lt;/pre>
&lt;p>从FilterOperator可以看到conditionEvaluator的expr值有&lt;/p>
&lt;pre escaped="true" lang="java">class org.apache.hadoop.hive.ql.udf.generic.GenericUDFOPEqual(class org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge(Column[fr], Const int 1, Const int 1(), Const string a()&lt;/pre>
&lt;p>这里面有一个substr的udf，来看一下他是怎么处理的。substr(fr, 1, 1) = ‘a’ ，这里很多地方都调用了get()方法，用来获取值。&lt;br>
udf是通过反射调用的, udf function看起来只实例化一次&lt;/p>
&lt;pre lang="java" escaped="true">@Override
public Object evaluate(DeferredObject[] arguments) throws HiveException {
assert (arguments.length == realArguments.length);
// Calculate all the arguments
for (int i = 0; i &amp;lt; realArguments.length; i++) {
realArguments[i] = arguments[i].get();
}
// Call the function
Object result = FunctionRegistry.invoke(udfMethod, udf, conversionHelper
.convertIfNecessary(realArguments));
return result;
}&lt;/pre>
&lt;p>下一个Operator是SelectOperator，只输出某些列，如果是select *，就原样输出&lt;/p>
&lt;pre lang="java" escaped="true">if (conf.isSelStarNoCompute()) {
forward(row, inputObjInspectors[tag]);
return;
}&lt;/pre>
&lt;p>我们是只取出fr的，所以有个eval[0]，取出的结果放到output里面，这里输出的是output=[‘android’]&lt;/p>
&lt;pre lang="java" escaped="true">for (int i = 0; i &amp;lt; eval.length; i++) {
try {
output[i] = eval[i].evaluate(row);
} catch (HiveException e) {
throw e;
} catch (RuntimeException e) {
throw new HiveException("Error evaluating "
+ conf.getColList().get(i).getExprString(), e);
}
}
forward(output, outputObjInspector);&lt;/pre>
&lt;p>最后一步FileSinkOperator,序列化结果写到磁盘&lt;/p>
&lt;pre lang="java" escaped="true">recordValue = serializer.serialize(row, inputObjInspectors[0]);
...
rowOutWriters[0].write(recordValue);&lt;/pre>
&lt;p>重复以上步骤，直到所有数据全部读完。&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/%E4%BB%A3%E7%A0%81%E5%88%86%E6%9E%90/">代码分析</category></item><item><title>Linux 编译 hadoop-cdh4.2.1</title><link>https://fatkun.github.io/2014/08/linux-compile-hadoop-cdh4-2-1.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/08/linux-compile-hadoop-cdh4-2-1.html</guid><pubDate>Sun, 10 Aug 2014 08:33:37 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="配置">配置&lt;/h2>
&lt;p>安装Maven, Ant, Findbugs, protobuf, cmake&lt;br>
参考:http://cn.soulmachine.me/blog/20140214/
注意CDH4.2.1需要用protobuf2.4.1编译，否则hadoop-common那里报错
在apache-maven-3.0.5/conf/settings.xml 更改maven镜像&lt;/p>
&lt;pre lang="xml" escaped="true">&amp;lt;mirror&amp;gt;
&amp;lt;id&amp;gt;nexus-osc&amp;lt;/id&amp;gt;
&amp;lt;mirrorOf&amp;gt;central&amp;lt;/mirrorOf&amp;gt;
&amp;lt;name&amp;gt;Nexus osc&amp;lt;/name&amp;gt;
&amp;lt;url&amp;gt;http://maven.oschina.net/content/groups/public/&amp;lt;/url&amp;gt;
&amp;lt;/mirror&amp;gt;
&amp;lt;mirror&amp;gt;
&amp;lt;id&amp;gt;nexus-spring&amp;lt;/id&amp;gt;
&amp;lt;mirrorOf&amp;gt;cdh.repo&amp;lt;/mirrorOf&amp;gt;
&amp;lt;name&amp;gt;spring&amp;lt;/name&amp;gt;
&amp;lt;url&amp;gt;http://repo.spring.io/repo/&amp;lt;/url&amp;gt;
&amp;lt;/mirror&amp;gt;
&amp;lt;mirror&amp;gt;
&amp;lt;id&amp;gt;nexus-spring2&amp;lt;/id&amp;gt;
&amp;lt;mirrorOf&amp;gt;cdh.releases.repo&amp;lt;/mirrorOf&amp;gt;
&amp;lt;name&amp;gt;spring2&amp;lt;/name&amp;gt;
&amp;lt;url&amp;gt;http://repo.spring.io/repo/&amp;lt;/url&amp;gt;
&amp;lt;/mirror&amp;gt;&lt;/pre>
&lt;h2 id="编译">编译&lt;/h2>
&lt;pre lang="bash" escaped="true">mvn package -DskipTests -Pdist,native -Dtar&lt;/pre>
&lt;h2 id="替换jar包">替换jar包&lt;/h2>
&lt;p>从src/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/target里面拿出mr-app.jar重命名为hadoop-mapreduce-client-app-2.0.0-cdh4.2.1-20140801.jar&lt;/p>
&lt;pre lang="bash" escaped="true">cd /opt/cloudera/parcels/CDH/lib/hadoop-mapreduce
# 上传jar包
chmod 755 hadoop-mapreduce-client-app-2.0.0-cdh4.2.1-20140801.jar
ln -snf hadoop-mapreduce-client-app-2.0.0-cdh4.2.1-20140801.jar hadoop-mapreduce-client-app.jar
mv hadoop-mapreduce-client-app-2.0.0-cdh4.2.1.jar /tmp
&lt;/pre>
&lt;h2 id="错误处理">错误处理&lt;/h2>
&lt;pre lang="other" escaped="true">Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.6:run (make) on project hadoop-common: An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "cmake" (in directory "/home/xx/hadoop-fix/hadoop/build/hadoop-2.0.0-cdh4.2.1/src/hadoop-common-project/hadoop-common/target/native"): java.io.IOException: error=2, No such file or directory -&amp;gt; [Help 1]&lt;/pre>
&lt;p>没有安装cmake，yum install cmake&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category></item><item><title>清理sendmail日志文件</title><link>https://fatkun.github.io/2014/08/%E6%B8%85%E7%90%86sendmail%E6%97%A5%E5%BF%97%E6%96%87%E4%BB%B6.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/08/%E6%B8%85%E7%90%86sendmail%E6%97%A5%E5%BF%97%E6%96%87%E4%BB%B6.html</guid><pubDate>Mon, 04 Aug 2014 11:05:26 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;pre lang="bash" escaped="true"># 关闭sendmail
service sendmail stop
chkconfig --list sendmail
chkconfig --level 2345 sendmail off
# 删除mail文件夹
rm -rf /var/spool/mqueue &amp;&amp; mkdir /var/spool/mqueue
rm -rf /var/spool/clientmqueue &amp;&amp; mkdir /var/spool/clientmqueue
rm -rf /var/spool/mail &amp;&amp; mkdir /var/spool/mail
# 删除logwatch
mv /etc/cron.daily/0logwatch /etc
rm -rf /var/cache/logwatch/*
&lt;/pre>
&lt;p>via: &lt;a href="http://hi.baidu.com/chenhj_brenda/item/e46c6b3fdb8f03b9124b14f0">http://hi.baidu.com/chenhj_brenda/item/e46c6b3fdb8f03b9124b14f0&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>hadoop重启Namenode时，appTokens报FileNotFoundException</title><link>https://fatkun.github.io/2014/07/hadoop-apptokens-filenotfoundexception.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/07/hadoop-apptokens-filenotfoundexception.html</guid><pubDate>Sun, 27 Jul 2014 13:56:09 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="现象">现象&lt;/h2>
&lt;p>报错如下&lt;/p>
&lt;pre escaped="true" lang="other">Application application_1405852606905_0014 failed 3 times due to AM Container for appattempt_1405852606905_0014_000003 exited with exitCode: -1000 due to: RemoteTrace: java.io.FileNotFoundException: File does not exist: hdfs://mycluster:8020/user/kpi/.staging/job_1405852606905_0014/appTokens at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:809)&lt;/pre>
&lt;p>同时注意到是因为每次重启nodemanager才发生。&lt;br>
首先用关键词“apptokens FileNotFoundException”在google和issue搜索没找到相关的问题。&lt;/p>
&lt;h2 id="猜测原因">猜测原因&lt;/h2>
&lt;p>可能找不到的原因：1.客户端没上传成功 2.上传成功了，但后面不知道给谁删了&lt;/p>
&lt;h2 id="重现">重现&lt;/h2>
&lt;p>既然在网上找不到，尝试在测试环境重现这个问题，运行一个sleep job&lt;/p>
&lt;pre escaped="true" lang="bash">cd /opt/cloudera/parcels/CDH/lib/hadoop-mapreduce;
hadoop jar hadoop-mapreduce-client-*-tests.jar sleep -Dmapred.job.queue.name=sleep -m5 -r5 -mt 60000 -rt 30000 -recordt 1000&lt;/pre>
&lt;p>重启nodemanage后会发现报错。&lt;/p>
&lt;h2 id="分析日志">分析日志&lt;/h2>
&lt;p>但发现找不到AM的日志，哪里去了？我们的hadoop环境都配置了“日志聚集”(yarn.log-aggregation-enable)，失败的任务就把日志删了(可能是bug)，尝试关掉后，从crontainer日志找到AM日志。&lt;br>
同时还可以看ResourceManager，NameNode，HDFS审计日志（hdfs-audit.log）&lt;br>
从AM日志可以看到第一次尝试好像是成功的，从HDFS审计日志发现了删除staging的目录&lt;/p>
&lt;pre escaped="true" lang="html">cmd=delete src=/user/kpi/.staging/job_1405852606905_0013&lt;/pre>
&lt;p>到此可以确认目录是被删除了，导致后面的job失败，但谁删了这个目录？&lt;/p>
&lt;h2 id="继续搜索">继续搜索&lt;/h2>
&lt;p>代码很多，需要定位一下那里操作.staging这个目录，确定谁删了这个目录。在issue搜索“staging delete”，看有没有相关的操作代码。&lt;br>
同时阅读代码发现了org.apache.hadoop.mapreduce.v2.app.MRAppMaster.cleanupStagingDir()方法，对照日志，可以确定是这个方法删除了staging目录。&lt;/p>
&lt;pre escaped="true" lang="java">public synchronized void stop() {
...
//这里判断了是不是AM的最后一次尝试，如果是才清理
if(isLastAMRetry) {
cleanupStagingDir();
}
...
}&lt;/pre>
&lt;p>这个逻辑还算正常, 继续找isLastAMRetry是怎么来的&lt;/p>
&lt;pre escaped="true" lang="java">public void shutDownJob() {
...
//We are finishing cleanly so this is the last retry
isLastAMRetry = true;
// Stop all services
// This will also send the final report to the ResourceManager
LOG.info("Calling stop for all the services");
MRAppMaster.this.stop();
...
}&lt;/pre>
&lt;p>发现调用了shutDownJob，会把isLastAMRetry设置为true，调用shutDownJob是因为接收到JobFinishEvent事件。&lt;br>
我们多了一些信息，偷懒在issue继续搜索一下，看有没有人解决了。&lt;br>
这次找到issue了，https://issues.apache.org/jira/browse/MAPREDUCE-5086
阅读patch，发现之前忽略了RM报的一个错误。&lt;/p>
&lt;pre escaped="true" lang="other">org.apache.hadoop.yarn.exceptions.impl.pb.YarnRemoteExceptionPBImpl: Application doesn't exist in cache appattempt_1405852606905_0014_000001&lt;/pre>
&lt;h2 id="结果">结果&lt;/h2>
&lt;p>重启nodemanager导致RM的appattempt cache数组删除，JobImpl返回了InternalError，AM认为出错了就没必要重试了，直接置isLastRetry=true。&lt;br>
修改方式是加了一个状态，表明这是“RM重启”了（注意这里不是nodemanager重启，有一些关联），还可以继续重试。具体修改阅读patch &lt;a href="https://issues.apache.org/jira/browse/MAPREDUCE-5086">https://issues.apache.org/jira/browse/MAPREDUCE-5086&lt;/a>
最后，由于patch修改的版本和我们用的版本不一致，还得需要用我们使用的版本依照它的思路改一遍。&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/apptokens/">AppTokens</category><category domain="https://fatkun.github.io/tags/exception/">Exception</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category></item><item><title>关闭linux sendmail</title><link>https://fatkun.github.io/2014/07/close-sendmail.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/07/close-sendmail.html</guid><pubDate>Wed, 23 Jul 2014 02:32:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;pre escaped="true" lang="bash">service sendmail stop
chkconfig --level 2345 sendmail off
chkconfig --list sendmail &lt;/pre>
&lt;p>via: &lt;a href="http://hi.baidu.com/chenhj_brenda/item/e46c6b3fdb8f03b9124b14f0">http://hi.baidu.com/chenhj_brenda/item/e46c6b3fdb8f03b9124b14f0&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category></item><item><title>python sax xml解析报错not well-formed error</title><link>https://fatkun.github.io/2014/06/python-sax-xml-not-well-formed-error.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/06/python-sax-xml-not-well-formed-error.html</guid><pubDate>Fri, 06 Jun 2014 08:51:43 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>可能的原因是有特殊的字符，或者xml编码不正确。
我用notepad++安装xml tool插件，检查xml格式发现错误
可能用命令 sed -i -e ‘s/[^[:print:]]/ /g’ 文件名 替换掉不可见字符也可以。&lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://stackoverflow.com/questions/11964023/python-sax-not-well-formed-error">http://stackoverflow.com/questions/11964023/python-sax-not-well-formed-error&lt;/a>&lt;br>
&lt;a href="http://www.megasolutions.net/python/Please-help!!-SAXParseException_not-well-formed-(invalid-token)-43696.aspx">http://www.megasolutions.net/python/Please-help!!-SAXParseException_not-well-formed-(invalid-token)-43696.aspx&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>mysql 排序规则 COLLATE 修改</title><link>https://fatkun.github.io/2014/03/mysql-alter-collate.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/03/mysql-alter-collate.html</guid><pubDate>Mon, 24 Mar 2014 07:23:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>使用以下语句转换。&lt;/p>
&lt;pre lang="sql" escaped="true">alter table &amp;lt;some_table&amp;gt; convert to character set utf8 collate utf8_unicode_ci;&lt;/pre>
&lt;p>来源：http://stackoverflow.com/questions/742205/mysql-alter-table-collation&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category><category domain="https://fatkun.github.io/tags/collate/">COLLATE</category><category domain="https://fatkun.github.io/tags/mysql/">Mysql</category><category domain="https://fatkun.github.io/tags/%E6%8E%92%E5%BA%8F%E8%A7%84%E5%88%99/">排序规则</category></item><item><title>【转】HADOOP 2.0 YARN中的MR/RM/NM状态转换图</title><link>https://fatkun.github.io/2014/03/hadoop-2-0-yarn-state.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/03/hadoop-2-0-yarn-state.html</guid><pubDate>Sun, 23 Mar 2014 07:36:48 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>hadoop2 可以用GRAPHVIZ来生成状态图，点击下面的连接查看状态转换图。
&lt;a href="http://www.rigongyizu.com/generate-hadoop-yarn-state-transit-graph/" target="_blank">&lt;a href="http://www.rigongyizu.com/generate-hadoop-yarn-state-transit-graph/">http://www.rigongyizu.com/generate-hadoop-yarn-state-transit-graph/&lt;/a>&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category></item><item><title>在eclipse远程调试mapreduce（hadoop2）</title><link>https://fatkun.github.io/2014/02/debug-mapreduce-with-eclipse.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/02/debug-mapreduce-with-eclipse.html</guid><pubDate>Sat, 22 Feb 2014 08:13:20 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="背景">背景&lt;/h2>
&lt;p>线上的服务器都是linux，直接在线上debug不需要准备太多测试数据。&lt;/p>
&lt;h2 id="实现">实现&lt;/h2>
&lt;p>远程调试实际上实在服务端开启一个监听端口，通过eclipse连接进行debug。调试mapreduce程序需要修改配置，让mapreduce就在本机运行。从hadoop拷贝一份配置出来，修改mapper-site.xml配置（基于hadoop2配置说明）&lt;/p>
&lt;pre lang="xml" escaped="true">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;mapreduce.jobtracker.staging.root.dir&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;/tmp&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;yarn.app.mapreduce.am.staging-dir&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;/tmp&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;mapreduce.framework.name&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;local&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;mapreduce.jobtracker.address&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;local&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;mapred.job.tracker&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;local&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre>
&lt;p>注意检查这些标签是不是都有了。。可以放到最后覆盖原来的值
在hadoop-env.sh加上，这里的address=52902是监听的端口，suspend=y表示等待我们连接才继续执行下去&lt;/p>
&lt;pre lang="xml" escaped="true">export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=52902"&lt;/pre>
&lt;p>执行hadoop程序，指定配置文件目录为我们改过的配置目录&lt;/p>
&lt;pre lang="bash" escaped="true">hadoop --config ./conf jar xx.jar xxx&lt;/pre>
&lt;p>最后，在eclipse的debug configuration新增一个remote java application，填入IP和端口，点击debug即可。&lt;/p>
&lt;h2 id="调试nodemanager">调试NodeManager&lt;/h2>
&lt;p>在yarn-env.sh加入&lt;/p>
&lt;pre escaped="true" lang="bash">YARN_NODEMANAGER_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8092"&lt;/pre>
&lt;h2 id="调试resoucemanager">调试ResouceManager&lt;/h2>
&lt;p>在yarn-env.sh加入&lt;/p>
&lt;pre escaped="true" lang="bash">export YARN_RESOURCEMANAGER_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"&lt;/pre>
&lt;h2 id="调试appmaster">调试appMaster&lt;/h2>
&lt;p>设置只有一台nodemanager，在mapred-site.xml 加入&lt;/p>
&lt;pre lang="xml" escaped="true">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;yarn.app.mapreduce.am.command-opts&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt; -Xmx512m -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8314&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre>
&lt;p>如果不可以，试多几次。。不知道为什么。检查一下进程有没有启动。 ps aux|grep MRAppMaster&lt;/p>
&lt;h2 id="不足">不足&lt;/h2>
&lt;p>不能调试一个jar包有两个job，执行到第二个job时会报错，可能原因是HADOOP_CLIENT_OPTS被加载了两次，并且第二个job启动时需要更换端口，否则会冲突。&lt;br>
不是很清楚hadoop LocalJobRunner是怎样调用的，并且暂时没调试第二个job就不深究了。&lt;/p>
&lt;h2 id="远程调试hive">远程调试hive&lt;/h2>
&lt;p>执行命令，会启动监听端口8000&lt;/p>
&lt;pre lang="bash" escaped="true">hive --debug&lt;/pre>
&lt;p>如果报错，&lt;span style="color: #555555;">ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.。打开${Hadoop_HOME}/bin/hadoop，注释掉HADOOP_OPTS=”$HADOOP_OPTS $HADOOP_CLIENT_OPTS”&lt;/span>
在hive输入以下命令，在单机执行&lt;/p>
&lt;pre lang="java" escaped="true">SET mapred.job.tracker=local;
SET hive.exec.mode.local.auto=true;
SET fs.defaultFS=file:///;&lt;/pre>
&lt;p> 
打印日志&lt;/p>
&lt;pre class="lang-java prettyprint prettyprinted">&lt;code>&amp;lt;span class="pln">hive &amp;lt;/span>&amp;lt;span class="pun">--&amp;lt;/span>&amp;lt;span class="pln">hiveconf hive&amp;lt;/span>&amp;lt;span class="pun">.&amp;lt;/span>&amp;lt;span class="pln">root&amp;lt;/span>&amp;lt;span class="pun">.&amp;lt;/span>&amp;lt;span class="pln">logger&amp;lt;/span>&amp;lt;span class="pun">=&amp;lt;/span>&amp;lt;span class="pln">DEBUG&amp;lt;/span>&amp;lt;span class="pun">,&amp;lt;/span>&amp;lt;span class="pln">console&amp;lt;/span>&lt;/code>&lt;/pre>
&lt;p>via: &lt;a href="http://fatkun.com/2012/10/debug-hive-mapreduce-with-eclipse.html">http://fatkun.com/2012/10/debug-hive-mapreduce-with-eclipse.html&lt;/a>&lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a title="hadoop2.2.0 源码远程调试" href="http://blog.sina.com.cn/s/blog_5ccc692d0101pikf.html" target="_blank">hadoop2.2.0 源码远程调试&lt;/a> 这里有图&lt;br>
&lt;a href="http://www.aboutyun.com/thread-6504-1-1.html">http://www.aboutyun.com/thread-6504-1-1.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/debug/">Debug</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/%E8%BF%9C%E7%A8%8B%E8%B0%83%E8%AF%95/">远程调试</category></item><item><title>【转】hive 结合执行计划 分析 limit 执行原理</title><link>https://fatkun.github.io/2014/01/hive-limit.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/01/hive-limit.html</guid><pubDate>Mon, 27 Jan 2014 08:57:05 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这篇文章介绍了limit是怎样执行的，从大体上看代码的运行情况。备忘。
&lt;a href="http://yaoyinjie.blog.51cto.com/3189782/923378">http://yaoyinjie.blog.51cto.com/3189782/923378&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category></item><item><title>impala文档的翻译</title><link>https://fatkun.github.io/2014/01/impala%E6%96%87%E6%A1%A3%E7%9A%84%E7%BF%BB%E8%AF%91.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/01/impala%E6%96%87%E6%A1%A3%E7%9A%84%E7%BF%BB%E8%AF%91.html</guid><pubDate>Sun, 12 Jan 2014 06:55:41 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h5 id="weiqingbin1翻译了很多赞">&lt;a href="http://my.oschina.net/weiqingbin">weiqingbin&lt;/a> 翻译了很多，赞！&lt;/h5>
&lt;p>电梯如下：
&lt;a href="http://my.oschina.net/weiqingbin/blog?catalog=423691">http://my.oschina.net/weiqingbin/blog?catalog=423691&lt;/a>
 &lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/impala/">Impala</category></item><item><title>vim格式化json</title><link>https://fatkun.github.io/2014/01/1597.html</link><guid isPermaLink="true">https://fatkun.github.io/2014/01/1597.html</guid><pubDate>Wed, 08 Jan 2014 02:36:08 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在vim输入以下命令就可以格式化&lt;/p>
&lt;pre lang="bash" escaped="true">:%!python -m json.tool&lt;/pre>
&lt;p>可以在~/.vimrc增加快捷键&lt;/p>
&lt;pre lang="bash" escaped="true">map &amp;lt;F4&amp;gt; &amp;lt;Esc&amp;gt;:%!python -m json.tool&amp;lt;CR&amp;gt;&lt;/pre>
&lt;p>来源: &lt;a href="http://blog.realnitro.be/2010/12/20/format-json-in-vim-using-pythons-jsontool-module/">http://blog.realnitro.be/2010/12/20/format-json-in-vim-using-pythons-jsontool-module/&lt;/a>
vim快捷键： &lt;a href="http://uniquejava.iteye.com/blog/1485884">http://uniquejava.iteye.com/blog/1485884&lt;/a>
 &lt;/p></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category><category domain="https://fatkun.github.io/tags/vim/">Vim</category></item><item><title>动态注册hive udf</title><link>https://fatkun.github.io/2013/12/register-udf.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/12/register-udf.html</guid><pubDate>Sun, 22 Dec 2013 15:07:35 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="目标">目标&lt;/h2>
&lt;p>可以不重启hive服务端动态增加或更新udf，本文用到动态加载以及hive hook实现。&lt;/p>
&lt;h2 id="看看原来的代码是怎样写的">看看原来的代码是怎样写的&lt;/h2>
&lt;p>我看的是cdh4.3.0代码，目前有两个地方注册udf，
一个是在org.apache.hadoop.hive.ql.exec.FunctionRegistry类里，大部分的内置udf都是在这里注册的，很多网站都是通过修改这里代码重新打包来注册udf。
第二个是最近新增了一个hive-builtins*.jar文件，注册函数是在&lt;/p>
&lt;pre lang="java" escaped="true">public SessionState(HiveConf conf) {
...
Class&amp;lt;?&amp;gt; pluginClass = Utilities.getBuiltinUtilsClass();
URL jarLocation = pluginClass.getProtectionDomain().getCodeSource().getLocation();
add_builtin_resource(ResourceType.JAR, jarLocation.toString());
FunctionRegistry.registerFunctionsFromPluginJar(jarLocation, pluginClass.getClassLoader());
...
}&lt;/pre>
&lt;p>通过找到org.apache.hive.builtins.BuiltinUtils类定位jar的位置，把jar包加入hive.added.jars.path配置里，然后通过FunctionRegistry.registerFunctionsFromPluginJar来注册udf&lt;/p>
&lt;pre lang="java" escaped="true">//我们可以用这两个方法来注册udf
public static void registerTemporaryUDF(String functionName, Class&amp;lt;? extends UDF&amp;gt; UDFClass, boolean isOperator)
public static void registerFunctionsFromPluginJar(URL jarLocation, ClassLoader classLoader)&lt;/pre>
&lt;h2 id="存在的问题">存在的问题&lt;/h2>
&lt;p>当我更新jar包时，发现执行的代码没有更新，发生什么问题了？原因是jar是动态加载的，udf.jar都是通过aux.path加入到当前线程里的，当一直都是同一个线程时，只是把jar放到classpath的末端，程序还是找到之前已经加载的代码。代码不能更新怎么办？&lt;strong>使用新的类名&lt;/strong>，当找不到这个类名的时候，会到jar文件里面找。注意新jar包不要直接替换，否则jvm会奔溃。&lt;/p>
&lt;h2 id="最终解决方法">最终解决方法&lt;/h2>
&lt;p>使用一个hook，通过registerFunctionsFromPluginJar来注册udf，hive hook的介绍可以看&lt;a href="http://www.slideshare.net/julingks/apache-hive-hooksminwookim130813" target="_blank">这个PPT&lt;/a>
udf的代码可以参考buildin udf那个jar包时怎么做的
hook 代码，在解析hive语句之前注册udf&lt;/p>
&lt;pre lang="java" escaped="true">public class AddUdfHook extends AbstractSemanticAnalyzerHook {
static final private Log LOG = LogFactory
.getLog(AddUdfHook.class.getName());
@Override
public void postAnalyze(HiveSemanticAnalyzerHookContext context,
List&amp;lt;Task&amp;lt;? extends Serializable&amp;gt;&amp;gt; rootTasks)
throws SemanticException {
super.postAnalyze(context, rootTasks);
}
@Override
public ASTNode preAnalyze(HiveSemanticAnalyzerHookContext context,
ASTNode ast) throws SemanticException {
LOG.warn("udf register hook");
try {
Class&amp;lt;?&amp;gt; pluginClass = Class.forName("cn.uc.udf.CustomUtils");
URL jarLocation = pluginClass.getProtectionDomain().getCodeSource()
.getLocation();
FunctionRegistry.registerFunctionsFromPluginJar(jarLocation,
pluginClass.getClassLoader());
} catch (Exception ex) {
LOG.error("load udf err", ex);
}
return super.preAnalyze(context, ast);
}&lt;/pre>
&lt;p>编译好了需要在hive-site.xml加上hook的配置&lt;/p>
&lt;pre lang="xml" escaped="true">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;hive.semantic.analyzer.hook&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;cn.uc.hook.AddUdfHook&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;hive.aux.jars.path&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;file:///home/xxx/myudf.jar&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre>
&lt;p>&lt;a href="http://pan.baidu.com/s/1ntnZFap" target="_blank">全部代码下载&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/udf/">Udf</category></item><item><title>使用jdbc连接impala例子</title><link>https://fatkun.github.io/2013/12/impala-jdbc-example.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/12/impala-jdbc-example.html</guid><pubDate>Sun, 15 Dec 2013 12:51:02 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>来源： &lt;a href="https://github.com/onefoursix/Cloudera-Impala-JDBC-Example">https://github.com/onefoursix/Cloudera-Impala-JDBC-Example&lt;/a>
 
需要依赖的lib见这篇文章。
&lt;a href="http://www.cloudera.com/content/cloudera-content/cloudera-docs/Impala/latest/Installing-and-Using-Impala/ciiu_impala_jdbc.html">http://www.cloudera.com/content/cloudera-content/cloudera-docs/Impala/latest/Installing-and-Using-Impala/ciiu_impala_jdbc.html&lt;/a>
 &lt;/p>
&lt;pre lang="java" escaped="true">import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class ClouderaImpalaJdbcExample {
// here is an example query based on one of the Hue Beeswax sample tables
private static final String SQL_STATEMENT = "SELECT a FROM test limit 10";
// set the impalad host
private static final String IMPALAD_HOST = "192.168.1.106";
// port 21050 is the default impalad JDBC port
private static final String IMPALAD_JDBC_PORT = "21050";
private static final String CONNECTION_URL = "jdbc:hive2://" + IMPALAD_HOST + ':' + IMPALAD_JDBC_PORT + "/;auth=noSasl";
private static final String JDBC_DRIVER_NAME = "org.apache.hive.jdbc.HiveDriver";
public static void main(String[] args) {
System.out.println("\n=============================================");
System.out.println("Cloudera Impala JDBC Example");
System.out.println("Using Connection URL: " + CONNECTION_URL);
System.out.println("Running Query: " + SQL_STATEMENT);
Connection con = null;
try {
Class.forName(JDBC_DRIVER_NAME);
con = DriverManager.getConnection(CONNECTION_URL);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(SQL_STATEMENT);
System.out.println("\n== Begin Query Results ======================");
// print the results to the console
while (rs.next()) {
// the example query returns one String column
System.out.println(rs.getString(1));
}
System.out.println("== End Query Results =======================\n\n");
} catch (SQLException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
con.close();
} catch (Exception e) {
// swallow
}
}
}
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/impala/">Impala</category><category domain="https://fatkun.github.io/tags/jdbc/">Jdbc</category></item><item><title>linux expect自动登录ssh</title><link>https://fatkun.github.io/2013/12/linux-expect-login-ssh.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/12/linux-expect-login-ssh.html</guid><pubDate>Thu, 12 Dec 2013 12:00:40 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> &lt;/p>
&lt;pre lang="bash" escaped="true">#!/usr/bin/expect
# 传送文件并且执行
set timeout 30
set host [lindex $argv 0]
set username [lindex $argv 1]
set password [lindex $argv 2]
set file [lindex $argv 3]
set center_password [lindex $argv 4]
spawn scp -P22 $file $username@$host:/tmp/tmp.sh
sleep 1
expect {
"*yes/no*" {send "yes\n"; exp_continue}
"*password:*" {send "$password\n" }
}
interact
spawn ssh -p22 $username@$host
sleep 1
expect {
"*yes/no*" {send "yes\n"; exp_continue}
"*password:*" {send "$password\n" }
}
sleep 1
expect "*$*"
send "sh /tmp/tmp.sh \n"
send "exit\n"
#interact
expect eof&lt;/pre>
&lt;p> 
 &lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://blog.51yip.com/linux/1462.html">http://blog.51yip.com/linux/1462.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category><category domain="https://fatkun.github.io/tags/expect/">Expect</category><category domain="https://fatkun.github.io/tags/linux/">Linux</category></item><item><title>改用rsync来覆盖正在运行的程序</title><link>https://fatkun.github.io/2013/12/rsync.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/12/rsync.html</guid><pubDate>Thu, 12 Dec 2013 09:08:34 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>cp会保持inode，如果程序正在执行，会导致不能覆盖。改用rsync来覆盖
 &lt;/p>
&lt;pre lang="bash" escaped="true">rsync -r src_dir target_dir&lt;/pre>
&lt;p> 
 
&lt;a href="http://unix.stackexchange.com/questions/9899/how-to-overwrite-target-files-with-mv">http://unix.stackexchange.com/questions/9899/how-to-overwrite-target-files-with-mv&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category><category domain="https://fatkun.github.io/tags/cp/">Cp</category></item><item><title>免密码ssh登陆</title><link>https://fatkun.github.io/2013/12/auto-ssh.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/12/auto-ssh.html</guid><pubDate>Tue, 10 Dec 2013 03:49:03 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>场景：机器A想要无密码访问机器B&lt;/p>
&lt;h2 id="方法一手工操作">方法一：手工操作&lt;/h2>
&lt;ol>
&lt;li>在机器A执行，ssh-keygen 按几次回车&lt;/li>
&lt;li>把生成的id_rsa.pub传输到机器B /tmp/ 目录下&lt;/li>
&lt;li>把id_rsa.pub加入到authorized_keys里
&lt;ol>
&lt;li>如果没有authorized_keys，mv /tmp/id_rsa.pub ~/.ssh/authorized_keys&lt;/li>
&lt;li>如果有authorized_keys， cat /tmp/id_rsa.pub &amp;gt;&amp;gt; ~/.ssh/authorized_keys&lt;/li>
&lt;/ol>
&lt;/li>
&lt;li>更改权限 chmod 700 ~/.ssh &amp;amp;&amp;amp; chmod 600 ~/.ssh/authorized_keys
 
&lt;strong>一定要注意权限对不对，如果不对还是需要输入密码&lt;/strong>
 &lt;/li>
&lt;/ol>
&lt;h2 id="方法二使用ssh-copy-id">方法二：使用ssh-copy-id&lt;/h2>
&lt;pre lang="bash" escaped="true">#步骤1: 用 ssh-key-gen 在本地主机上创建公钥和密钥
ssh-keygen -t rsa
#步骤2: 用 ssh-copy-id 把公钥复制到远程主机上
ssh-copy-id -i ~/.ssh/id_rsa.pub "-p 1122 user@server"&lt;/pre>
&lt;p> 
# 拷贝authorized_keys&lt;/p>
&lt;pre lang="bash" escaped="true">key='ssh-rsa xxx'
mkdir -p ~/.ssh &amp;&amp; chmod 700 ~/.ssh
content=`cat ~/.ssh/authorized_keys |grep "$key"`
if (($? != 0)); then
echo $key &amp;gt;&amp;gt; ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
fi&lt;/pre>
&lt;p> 
参考：http://baiqiuyi.com/linux/ssh-sshkeygen-linux.html
 
 &lt;/p></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category></item><item><title>hiveserver2 python client</title><link>https://fatkun.github.io/2013/11/hiveserver2-python-client.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/11/hiveserver2-python-client.html</guid><pubDate>Sun, 17 Nov 2013 16:45:11 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>一个hiveserver2 python客户端的例子，大部分代码来自于hue。
忽略了一些必要的判断，只是做一个简单的例子。&lt;br>
需要安装thrift以及把hive-0.10.0-cdh4.3.0/src/service/src/gen/thrift/gen-py目录拷贝到项目目录中。&lt;br>
thrift文件在hive-0.10.0-cdh4.3.0/src/service/if/TCLIService.thrift
默认需要通过sasl客户端，前端的表现是连接了没反应，后端hiveserver2有错误日志&lt;/p>
&lt;pre escaped="true" lang="java">java.lang.RuntimeException: org.apache.thrift.transport.TTransportException
at org.apache.thrift.transport.TSaslServerTransport$Factory.getTransport(TSaslServerTransport.java:219)&lt;/pre>
&lt;p>如果不用sasl客户端，可以设置参数（&lt;a href="http://stackoverflow.com/questions/15372388/hiveserver2-java-api/16008071#16008071">参考stackoverflow&lt;/a>）&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;property&amp;gt;&amp;lt;name&amp;gt;hive.server2.authentication&amp;lt;/name&amp;gt;&amp;lt;value&amp;gt;NOSASL&amp;lt;/value&amp;gt;&amp;lt;/property&amp;gt;&lt;/pre>
&lt;pre escaped="true" lang="python">#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
cur_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(cur_dir, "gen-py"))
from TCLIService import TCLIService
from TCLIService.ttypes import TOpenSessionReq, TGetTablesReq, TFetchResultsReq,\
TStatusCode, TGetResultSetMetadataReq, TGetColumnsReq, TType,\
TExecuteStatementReq, TGetOperationStatusReq, TFetchOrientation,\
TCloseSessionReq, TGetSchemasReq, TGetLogReq, TCancelOperationReq
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
class HiveServerTColumnValue:
def __init__(self, tcolumn_value):
self.column_value = tcolumn_value
@property
def val(self):
# TODO get index from schema
if self.column_value.boolVal is not None:
return self.column_value.boolVal.value
elif self.column_value.byteVal is not None:
return self.column_value.byteVal.value
elif self.column_value.i16Val is not None:
return self.column_value.i16Val.value
elif self.column_value.i32Val is not None:
return self.column_value.i32Val.value
elif self.column_value.i64Val is not None:
return self.column_value.i64Val.value
elif self.column_value.doubleVal is not None:
return self.column_value.doubleVal.value
elif self.column_value.stringVal is not None:
return self.column_value.stringVal.value
class HiveServerClient(object):
user = 'fatkun'
session_handle = None
def connect(self):
transport = TSocket.TSocket('localhost', 10000)
transport = TTransport.TBufferedTransport(transport)
protocol = TBinaryProtocol.TBinaryProtocol(transport)
client = TCLIService.Client(protocol)
transport.open()
self._client = client
def open_session(self, username):
req = TOpenSessionReq(username=username, configuration={})
res = self._client.OpenSession(req)
session_handle = res.sessionHandle
print res
return session_handle
def call(self, fn, req, status=TStatusCode.SUCCESS_STATUS):
if self.session_handle is None:
self.session_handle = self.open_session(self.user)
if hasattr(req, 'sessionHandle') and req.sessionHandle is None:
req.sessionHandle = self.session_handle
res = fn(req)
return res
def execute_statement(self, statement, max_rows=100):
req = TExecuteStatementReq(statement=statement, confOverlay={})
res = self.call(self._client.ExecuteStatement, req)
return self.fetch_result(res.operationHandle, max_rows=max_rows)
def fetch_result(self, operation_handle, orientation=TFetchOrientation.FETCH_NEXT, max_rows=100):
fetch_req = TFetchResultsReq(operationHandle=operation_handle, orientation=orientation, maxRows=max_rows)
res = self.call(self._client.FetchResults, fetch_req)
if operation_handle.hasResultSet:
meta_req = TGetResultSetMetadataReq(operationHandle=operation_handle)
schema = self.call(self._client.GetResultSetMetadata, meta_req)
else:
schema = None
return res, schema
def main():
client = HiveServerClient()
client.connect()
client.execute_statement(statement='SET hive.server2.blocking.query=true')
statement = 'select name from test'
res, schema = client.execute_statement(statement)
for row in res.results.rows:
for column in row.colVals:
print HiveServerTColumnValue(column).val
if __name__ == '__main__':
main()
&lt;/pre></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hiveserver2/">Hiveserver2</category><category domain="https://fatkun.github.io/tags/python/">Python</category></item><item><title>[备忘]使用log4j</title><link>https://fatkun.github.io/2013/11/use-log4j.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/11/use-log4j.html</guid><pubDate>Sun, 17 Nov 2013 08:01:11 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="加载配置的方法">加载配置的方法&lt;/h2>
&lt;p>&lt;strong>方法1：&lt;/strong>&lt;br>
把配置改名为log4j.properties，放在src目录下，打包成jar的时候，它就在jar的根目录下了。
&lt;strong>方法2：&lt;/strong>&lt;br>
使用getResource的方式&lt;/p>
&lt;pre lang="java" escaped="true">//假设这里把配置文件放在com.fatkun目录下
String resource = "/com/fatkun/log4j.properties";
URL configFileResource = TestLog4j.class.getResource(resource);
PropertyConfigurator.configure(configFileResource);&lt;/pre>
&lt;p>&lt;strong>方法3：&lt;/strong>&lt;br>
相对路径，把配置放在{项目根目录}/conf目录下，默认就是相对路径了&lt;/p>
&lt;pre lang="java" escaped="true">PropertyConfigurator.configure("conf/log4j.properties");&lt;/pre>
&lt;h2 id="例子">例子&lt;/h2>
&lt;pre lang="java" escaped="true">package com.fatkun;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
// Contributed by ThoughtWorks Inc.
public class TestLog4j {
private static Logger logger = Logger.getLogger(TestLog4j.class);
public static void main(String argv[]) {
PropertyConfigurator.configure("conf/log4j.properties");
// Add a bunch of logging statements ...
logger.debug("Hello, my name is Homer Simpson.");
logger.info("We are the Simpsons!");
}
}
&lt;/pre>
&lt;h2 id="配置文件">配置文件&lt;/h2>
&lt;pre lang="other" escaped="true">log4j.rootCategory=DEBUG,console,R
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
# R is the RollingFileAppender that outputs to a rolling log
# file called rolling_log_file.log.
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=log/rolling_log_file.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L %m%n
log4j.appender.R.MaxFileSize=5MB
log4j.appender.R.MaxBackupIndex=10&lt;/pre>
&lt;p>extra jar出来后可以用以下命令执行,lib目录里的是log4j.jar&lt;/p>
&lt;pre lang="bash" escaped="true">java -classpath test_log4j.jar -Djava.ext.dirs=./lib com.fatkun.TestLog4j&lt;/pre>
&lt;h2 id="如果想把某个package输出到独立的文件">如果想把某个package输出到独立的文件&lt;/h2>
&lt;pre escaped="true" lang="html">log4j.rootLogger=DEBUG,myConsole,syslog
log4j.logger.com.fatkun.xxx=INFO,jobdep
log4j.additivity.com.fatkun.xxx=false # 不在主日志记录&lt;/pre>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>官方example&lt;br>
&lt;a href="http://yuguanyin.iteye.com/blog/226549">Log4j 配置最全说明&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/log4j/">Log4j</category></item><item><title>hadoop wordcount新API例子</title><link>https://fatkun.github.io/2013/10/hadoop-wordcount-new-api.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/10/hadoop-wordcount-new-api.html</guid><pubDate>Sun, 27 Oct 2013 16:26:48 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="准备">准备&lt;/h2>
&lt;p>准备一些输入文件，可以用hdfs dfs -put xxx/* /user/fatkun/input上传文件&lt;/p>
&lt;h2 id="代码">代码&lt;/h2>
&lt;pre lang="java" escaped="true">package com.fatkun;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
public class WordCount extends Configured implements Tool {
static enum Counters {
INPUT_WORDS // 计数器
}
static Log logger = LogFactory.getLog(WordCount.class);
public static class CountMapper extends
Mapper&amp;lt;LongWritable, Text, Text, IntWritable&amp;gt; {
private final IntWritable one = new IntWritable(1);
private Text word = new Text();
private boolean caseSensitive = true;
@Override
protected void setup(Context context) throws IOException,
InterruptedException {
// 读取配置
Configuration conf = context.getConfiguration();
caseSensitive = conf.getBoolean("wordcount.case.sensitive", true);
super.setup(context);
}
@Override
protected void map(LongWritable key, Text value, Context context)
throws IOException, InterruptedException {
StringTokenizer itr = new StringTokenizer(value.toString());
while (itr.hasMoreTokens()) {
if (caseSensitive) { // 是否大小写敏感
word.set(itr.nextToken());
} else {
word.set(itr.nextToken().toLowerCase());
}
context.write(word, one);
context.getCounter(Counters.INPUT_WORDS).increment(1);
}
}
}
public static class CountReducer extends
Reducer&amp;lt;Text, IntWritable, Text, IntWritable&amp;gt; {
@Override
protected void reduce(Text text, Iterable&amp;lt;IntWritable&amp;gt; values,
Context context) throws IOException, InterruptedException {
int sum = 0;
for (IntWritable value : values) {
sum += value.get();
}
context.write(text, new IntWritable(sum));
}
}
@Override
public int run(String[] args) throws Exception {
Configuration conf = new Configuration(getConf());
Job job = Job.getInstance(conf, "Example Hadoop WordCount");
job.setJarByClass(WordCount.class);
job.setMapperClass(CountMapper.class);
job.setCombinerClass(CountReducer.class);
job.setReducerClass(CountReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
List&amp;lt;String&amp;gt; other_args = new ArrayList&amp;lt;String&amp;gt;();
for (int i = 0; i &amp;lt; args.length; ++i) {
other_args.add(args[i]);
}
FileInputFormat.addInputPath(job, new Path(other_args.get(0)));
FileOutputFormat.setOutputPath(job, new Path(other_args.get(1)));
int ret = job.waitForCompletion(true) ? 0 : 1;
long inputWord = job.getCounters().findCounter(Counters.INPUT_WORDS)
.getValue();
System.out.println("INPUT_WORDS:" + inputWord);
logger.info("test log: " + inputWord);
return ret;
}
public static void main(String[] args) throws Exception {
int res = ToolRunner.run(new Configuration(), new WordCount(), args);
System.exit(res);
}
}&lt;/pre>
&lt;h2 id="运行">运行&lt;/h2>
&lt;p>在eclipse导出jar包，执行以下命令&lt;/p>
&lt;pre lang="bash" escaped="true">hadoop jar wordcount.jar com.fatkun.WordCount -Dwordcount.case.sensitive=false /user/fatkun/input /user/fatkun/output&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://cxwangyi.blogspot.com/2009/12/wordcount-tutorial-for-hadoop-0201.html">http://cxwangyi.blogspot.com/2009/12/wordcount-tutorial-for-hadoop-0201.html&lt;/a>
&lt;a href="http://hadoop.apache.org/docs/r1.2.1/mapred_tutorial.html#Example%3A+WordCount+v2.0">http://hadoop.apache.org/docs/r1.2.1/mapred_tutorial.html#Example%3A+WordCount+v2.0&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/example/">Example</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/wordcount/">Wordcount</category></item><item><title>在hive中使用parquet (CDH4.3)</title><link>https://fatkun.github.io/2013/10/hive-use-parquet.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/10/hive-use-parquet.html</guid><pubDate>Mon, 21 Oct 2013 17:05:47 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>hadoop版本 cdh4.3
使用impala创建parquet表后，查询会出错。&lt;/p>
&lt;pre lang="sql" escaped="true">[impala:21000] &amp;gt; select * from foo;
Query: select * from foo
ERROR: AnalysisException: Failed to load metadata for table: default.foo
CAUSED BY: TableLoadingException: Failed to load metadata for table: foo
CAUSED BY: MetaException: org.apache.hadoop.hive.serde2.SerDeException SerDe parquet.hive.serde.ParquetHiveSerDe does not exist&lt;/pre>
&lt;p>原因是hive并没有这些lib，下载它们并放入/opt/cloudera/parcels/CDH/lib/hive/lib目录（我是使用cloudera manager部署的）,创建脚本下载&lt;/p>
&lt;pre lang="bash" escaped="true">#!/bin/sh
#parquet-pig parquet-scrooge parquet-test-hadoop2 parquet-thrift parquet-avro parquet-cascading
for f in parquet-column parquet-common parquet-encoding parquet-generator parquet-hadoop parquet-hive
do
curl -O http://repo1.maven.org/maven2/com/twitter/${f}/1.2.4/${f}-1.2.4.jar
#curl -O http://oss.sonatype.org/service/local/repositories/releases/content/com/twitter/${f}/1.2.4/${f}-1.2.4.jar
done
curl -O http://repo1.maven.org/maven2/com/twitter/parquet-format/1.0.0/parquet-format-1.0.0.jar
&lt;/pre>
&lt;p>然后把他们拷贝进去&lt;/p>
&lt;pre lang="bash" escaped="true">cp parquet-* /opt/cloudera/parcels/CDH/lib/hive/lib&lt;/pre>
&lt;p>可能要重启metastore，然后在impala中刷新metastore&lt;/p>
&lt;pre lang="sql" escaped="true">INVALIDATE METADATA;&lt;/pre>
&lt;p>在impala修改parquet表&lt;/p>
&lt;pre lang="bash" escaped="true">create table test2 (name STRING) STORED AS PARQUETFILE;&lt;/pre>
&lt;p>插入数据&lt;/p>
&lt;pre lang="bash" escaped="true">insert into test2 select * from test;&lt;/pre>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="https://issues.cloudera.org/browse/IMPALA-574">https://issues.cloudera.org/browse/IMPALA-574&lt;/a>
 &lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/impala/">Impala</category></item><item><title>记录cloudera manager安装hadoop的步骤</title><link>https://fatkun.github.io/2013/10/cloudera-manager-install-hadoop.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/10/cloudera-manager-install-hadoop.html</guid><pubDate>Sat, 19 Oct 2013 17:24:36 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="安装cloudera-manager">安装cloudera-manager&lt;/h2>
&lt;p>在&lt;a href="http://go.cloudera.com/cloudera-standard-download.html">http://go.cloudera.com/cloudera-standard-download.html&lt;/a>下载cloudera-manager-installer.bin
下载完要给它设置执行权限 chmod +x ./cloudera-manager-installer.bin
要用root权限运行, sudo ./cloudera-manager-installer.bin
一步步执行后，会下载安装jdk和cm，需要等一会儿，要下载200mb左右。(手工下载路径，http://archive.cloudera.com/cm4/cm/4/，但下载这个不知道怎么用，还是给程序下载吧。)
安装完后，提示打开 http://localhost:7180&lt;/p>
&lt;h2 id="部署hadoop">部署hadoop&lt;/h2>
&lt;p>ubuntu中的root用户没有密码，可以sudo passwd root设置密码
ubuntu默认没有openssh-server，使用sudo apt-get install openssh-server安装吧，需要测试ssh localhost是否有效
host好像不允许一个IP对应多个主机名称，编辑/etc/hosts把localhost的那个去掉，保留主机的那个。
到`http://archive.cloudera.com/cdh4/parcels/`下载你想要安装的CDH版本（我的是ubuntu12.04，下载CDH-4.3.0-1.cdh4.3.0.p0.22-precise.parcel文件），并且下载manifest.json文件，里面有hash值，把hash值找出来，保存为CDH-4.3.0-1.cdh4.3.0.p0.22-precise.parcel.sha文件（根据版本改名字），echo “1959e87dc6bfcfe9cc7eacd1ff7727bfd737f42d”  &amp;gt; /opt/cloudera/parcel-repo/CDH-4.3.0-1.cdh4.3.0.p0.22-precise.parcel.sha
把下载好的包放在/opt/cloudera/parcel-repo目录下,然后cm应该不会重新下载了。。
另外如果用mysql还要自己安装mysql-server和jdbc包。
 
 &lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category></item><item><title>在windows部署nexus编译hadoop cdh4.3</title><link>https://fatkun.github.io/2013/10/maven-nexus.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/10/maven-nexus.html</guid><pubDate>Mon, 14 Oct 2013 18:02:45 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="部署nexus">部署nexus&lt;/h2>
&lt;p>死活启动不了nexus，下载了多个版本。最后下载tomcat7 + 2.5的war才可以。把war包丢到webapps目录下，启动tomcat会自动解压。。停掉tomcat，把目录改名为nexus吧。。
修改nexus\WEB-INF\plexus.properties里的路径，jar包会下载到这里
nexus-work=E:/sonatype-work/nexus
 
为避免出现tomcat内存溢出，新建文件setenv.bat，设置内存&lt;/p>
&lt;pre lang="bash" escaped="true">set CATALINA_OPTS=-server -Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=1024m&lt;/pre>
&lt;p>重新启动tomcat，启动完成后，访问http://localhost:8080/nexus， 用户名:admin 密码:admin123
 &lt;/p>
&lt;h2 id="配置maven">配置maven&lt;/h2>
&lt;p>修改 {maven}/conf/settings.xml文件，指定本地repo目录，会把lib下载到这里&lt;/p>
&lt;pre lang="bash" escaped="true">&amp;lt;localRepository&amp;gt;E:\apache-maven-3.1.0\repository&amp;lt;/localRepository&amp;gt;&lt;/pre>
&lt;p>修改镜像，找到mirrors这里&lt;/p>
&lt;pre lang="bash" escaped="true">&amp;lt;mirror&amp;gt;
&amp;lt;id&amp;gt;central&amp;lt;/id&amp;gt;
&amp;lt;mirrorOf&amp;gt;central&amp;lt;/mirrorOf&amp;gt;
&amp;lt;name&amp;gt;central&amp;lt;/name&amp;gt;
&amp;lt;url&amp;gt;http://127.0.0.1:8080/nexus/content/repositories/central&amp;lt;/url&amp;gt;
&amp;lt;/mirror&amp;gt;
&amp;lt;mirror&amp;gt;
&amp;lt;id&amp;gt;cdh.repo&amp;lt;/id&amp;gt;
&amp;lt;mirrorOf&amp;gt;cdh.repo&amp;lt;/mirrorOf&amp;gt;
&amp;lt;name&amp;gt;cdh.repo&amp;lt;/name&amp;gt;
&amp;lt;url&amp;gt;http://localhost:8080/nexus/content/repositories/cdh.repo&amp;lt;/url&amp;gt;
&amp;lt;/mirror&amp;gt;
&amp;lt;/mirrors&amp;gt;&lt;/pre>
&lt;p>上面的cdh.repo是我新增的，要在nexus上新增一个mirror，注意mirrorOf这个参数，这个是从pom.xml里的repositories找出来的，而且有个路径。
 &lt;/p>
&lt;h2 id="编译hadoop">编译hadoop&lt;/h2>
&lt;p>编译前要改hadoop-project\pom.xml等里的protobuf-java版本，否则会下载个2.4的版本会用不了。
&lt;dependency>&lt;br>
&lt;groupId>com.google.protobuf&lt;/groupId>&lt;br>
&lt;artifactId>protobuf-java&lt;/artifactId>&lt;br>
&lt;version>2.5.0&lt;/version>&lt;br>
&lt;scope>compile&lt;/scope>&lt;br>
&lt;/dependency>
需要安装好cygwin和protoc.exe（从网站下载丢到cygwin的bin目录就可以了。。），需要在cygwin里执行 mvn eclipse:eclipse
 
 &lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/maven/">Maven</category><category domain="https://fatkun.github.io/tags/nexus/">Nexus</category></item><item><title>设计模式理解</title><link>https://fatkun.github.io/2013/09/design-pattern.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/09/design-pattern.html</guid><pubDate>Tue, 24 Sep 2013 15:55:14 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="设计模式学习">设计模式学习&lt;/h2>
&lt;h2 id="抽象工厂模式">抽象工厂模式&lt;/h2>
&lt;p>&lt;strong>场景：&lt;/strong> 把同一主题的工厂封装起来，对外提供一致的接口，返回不同的产品。
**使用：**利用接口建立一个抽象工厂，不同的工厂实现这个接口，产出的产品也要有一个接口。在使用时，需要选择具体工厂类（不能new 接口）。
**实例：**提供对不同的数据库访问的支持。IUser和IDepartment是两种不同的抽象产品，它们都有Access和SQL Server这两种不同的实现；IFactory是产生IUser和IDepartment的抽象工厂，根据具体实现（AccessFactory和SqlFactory）产生对应的具体的对象（CAccessUser与CAccessDepartment，或者CSqlUser与CSqlDepartment）。
&lt;img src="http://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Abstract_factory_UML.svg/677px-Abstract_factory_UML.svg.png" alt="File:Abstract factory UML.svg">&lt;/p>
&lt;pre lang="python" escaped="true">抽象工厂模式（python）
class IUser:
def GetUser(self):
pass
class IDepartment:
def GetDepartment(self):
pass
class CAccessUser(IUser):
def GetUser(self):
print "Access GetUser"
class CAccessDepartment(IDepartment):
def GetDepartment(self):
print "Access GetDepartment"
class CSqlUser(IUser):
def GetUser(self):
print "Sql GetUser"
class CSqlDepartment(IDepartment):
def GetDepartment(self):
print "Sql GetDepartment"
class IFactory:
def CreateUser(self):
pass
def CreateDepartment(self):
pass
class AccessFactory(IFactory):
def CreateUser(self):
temp=CAccessUser()
return temp
def CreateDepartment(self):
temp = CAccessDepartment()
return temp
class SqlFactory(IFactory):
def CreateUser(self):
temp = CSqlUser()
return temp
def CreateDepartment(self):
temp = CSqlDepartment()
return temp
if __name__ == "__main__":
factory = SqlFactory()
user=factory.CreateUser()
depart=factory.CreateDepartment()
user.GetUser()
depart.GetDepartment()&lt;/pre>
&lt;h2 id="工厂方法模式简单工厂">工厂方法模式/简单工厂&lt;/h2>
&lt;p>**场景：**创建实体类比较多，抽取出来，根据条件判断要创建哪个实现类。
**使用：**根据不同的参数选择具体的实现类。
**实例：**一个程序要读取图像文件。程序支持多种图像格式，每种格式都有一个对应的&lt;code>ImageReader&lt;/code>类用来读取图像。程序每次读取图像时，需要基于文件信息创建合适类型的&lt;code>ImageReader&lt;/code>。
 
&lt;img src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/FactoryMethod.svg/300px-FactoryMethod.svg.png" alt="">&lt;/p>
&lt;pre lang="java" escaped="true">public class ImageReaderFactory {
public static ImageReader imageReaderFactoryMethod(InputStream is) {
ImageReader product = null;
int imageType = determineImageType(is);
switch (imageType) {
case ImageReaderFactory.GIF:
product = new GifReader(is);
case ImageReaderFactory.JPEG:
product = new JpegReader(is);
//...
}
return product;
}
}&lt;/pre>
&lt;h2 id="生成器模式建造者模式">生成器模式/&lt;strong>建造者模式&lt;/strong>&lt;/h2>
&lt;p>**场景：**和抽象工厂类似，创建复杂的对象。生成器着重在一步一步的构造对象。
**使用：**一个Builder抽象类，一个实现Builder类，有多个方法来构造对象。Director是用来使用builder的。
**实例：**制造Pizza
&lt;img src="http://images.cnblogs.com/cnblogs_com/wuyuegb2312/468244/o_ch9.%e5%bb%ba%e9%80%a0%e8%80%85%e6%a8%a1%e5%bc%8f.png" alt="">&lt;/p>
&lt;pre lang="java" escaped="true">/** "Product" */
class Pizza {
private String dough = "";
private String sauce = "";
private String topping = "";
public void setDough (String dough) { this.dough = dough; }
public void setSauce (String sauce) { this.sauce = sauce; }
public void setTopping (String topping) { this.topping = topping; }
}
''/** "Abstract Builder" */''
abstract class PizzaBuilder {
protected Pizza pizza;
public Pizza getPizza() { return pizza; }
public void createNewPizzaProduct() { pizza = new Pizza(); }
public abstract void buildDough();
public abstract void buildSauce();
public abstract void buildTopping();
}
/** "ConcreteBuilder" */
class HawaiianPizzaBuilder extends PizzaBuilder {
public void buildDough() { pizza.setDough("cross"); }
public void buildSauce() { pizza.setSauce("mild"); }
public void buildTopping() { pizza.setTopping("ham+pineapple"); }
}
/** "ConcreteBuilder" */
class SpicyPizzaBuilder extends PizzaBuilder {
public void buildDough() { pizza.setDough("pan baked"); }
public void buildSauce() { pizza.setSauce("hot"); }
public void buildTopping() { pizza.setTopping("pepperoni+salami"); }
}
''/** "Director" */''
class Waiter {
private PizzaBuilder pizzaBuilder;
public void setPizzaBuilder (PizzaBuilder pb) { pizzaBuilder = pb; }
public Pizza getPizza() { return pizzaBuilder.getPizza(); }
public void constructPizza() {
pizzaBuilder.createNewPizzaProduct();
pizzaBuilder.buildDough();
pizzaBuilder.buildSauce();
pizzaBuilder.buildTopping();
}
}
/** A customer ordering a pizza. */
class BuilderExample {
public static void main(String[] args) {
Waiter waiter = new Waiter();
PizzaBuilder hawaiian_pizzabuilder = new HawaiianPizzaBuilder();
PizzaBuilder spicy_pizzabuilder = new SpicyPizzaBuilder();
waiter.setPizzaBuilder ( hawaiian_pizzabuilder );
waiter.constructPizza();
Pizza pizza = waiter.getPizza();
}
}&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="firstHeading" lang="zh-CN"> 惰性初始模式/惰性工厂&lt;/h2>
**场景：**延迟创建对象
**使用：**有一个map来存储创建出来的对象，如果没创建过就创建出来放到map里，否则直接返回。要注意要有锁。
&lt;pre lang="java" escaped="true">import java.util.*;
&lt;p>public class Fruit
{
private static final Map&amp;lt;String,Fruit&amp;gt; types = new HashMap&amp;lt;String,Fruit&amp;gt;();
private final String type;&lt;/p>
&lt;pre>&lt;code>// using a private constructor to force use of the factory method.
private Fruit(String type) {
this.type = type;
}
/**
* Lazy Factory method, gets the Fruit instance associated with a
* certain type. Instantiates new ones as needed.
* @param type Any string that describes a fruit type, e.g. &amp;quot;apple&amp;quot;
* @return The Fruit instance associated with that type.
*/
public static synchronized Fruit getFruit(String type) {
if(!types.containsKey(type))
types.put(type, new Fruit(type)); // Lazy initialization
return types.get(type);
}
&lt;/code>&lt;/pre>
&lt;p>}&lt;/pre>&lt;/p>
&lt;h2 id="heading">&lt;/h2>
&lt;h2 id="对象池模式">对象池模式&lt;/h2>
&lt;p>**场景：**创建实例的时间比较长
**使用：**一开始创建多个实例保存起来，每次用完之后还回池里。&lt;/p>
&lt;h2 id="heading-1">&lt;/h2>
&lt;h2 id="原型模式">原型模式&lt;/h2>
&lt;p>**场景：**创建实例的成本比较高，复制实例的成本低。
使用：实现clone()这个方法，每个对象可以从自身克隆。python可以使用deepcopy()方法来拷贝。
&lt;img src="http://images.cnblogs.com/cnblogs_com/wuyuegb2312/468244/o_ch6.%e5%8e%9f%e5%9e%8b%e6%a8%a1%e5%bc%8f.png" alt="">
 &lt;/p>
&lt;pre lang="java" escaped="true">/** Prototype Class **/
public class Cookie implements Cloneable {
public Object clone()
{
try{
//In an actual implementation of this pattern you would now attach references to
//the expensive to produce parts from the copies that are held inside the prototype.
return this.getClass().newInstance();
}
catch(InstantiationException e)
{
e.printStackTrace();
return null;
}
}
}
/** Concrete Prototypes to clone **/
public class CoconutCookie extends Cookie { }
/** Client Class**/
public class CookieMachine
{
private Cookie cookie;//cookie必须是可复制的
public CookieMachine(Cookie cookie) {
this.cookie = cookie;
}
public Cookie makeCookie() {
return (Cookie)cookie.clone();
}
public Object clone() { }
public static void main(String args[]){
Cookie tempCookie = null;
Cookie prot = new CoconutCookie();
CookieMachine cm = new CookieMachine(prot); //设置原型
for(int i=0; i&amp;lt;100; i++)
tempCookie = cm.makeCookie();//通过复制原型返回多个cookie
}
}&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="单例模式">单例模式&lt;/h2>
&lt;p>**场景：**只需要创建一个实例，多个使用
**使用：**要注意&lt;a href="http://blog.csdn.net/dl88250/article/details/5439024">Java 中的双重检查（Double-Check）&lt;/a>，可以使用在成员变量初始化、使用volatile变量、对方法sync
python单例例子：&lt;a href="http://blog.csdn.net/ghostfromheaven/article/details/7671853">http://blog.csdn.net/ghostfromheaven/article/details/7671853&lt;/a>，python的模块（module）本身是单例的&lt;/p>
&lt;pre lang="java" escaped="true">public class Singleton {
private static volatile Singleton INSTANCE = null;
// Private constructor suppresses
// default public constructor
private Singleton() {}
//thread safe and performance promote
public static Singleton getInstance() {
if(INSTANCE == null){
synchronized(Singleton.class){
//when more than two threads run into the first null check same time, to avoid instanced more than one time, it needs to be checked again.
if(INSTANCE == null){
INSTANCE = new Singleton();
}
}
}
return INSTANCE;
}
}&lt;/pre>
&lt;h2 id="heading-2">&lt;/h2>
&lt;h2 id="适配器模式">适配器模式&lt;/h2>
&lt;p>**场景：**和客户需要的接口有差异
**使用：**构建一个Adapter实现客户需要的接口，把对应的方法映射到自己的类上（Adaptee）
&lt;img src="http://images.cnblogs.com/cnblogs_com/wuyuegb2312/468244/o_ch13.%e9%80%82%e9%85%8d%e5%99%a8%e6%a8%a1%e5%bc%8f.png" alt="">&lt;/p>
&lt;pre lang="python" escaped="true">class Target:
def Request():
print "common request."
class Adaptee(Target):
def SpecificRequest(self):
print "specific request."
class Adapter(Target):
def __init__(self,ada):
self.adaptee = ada
def Request(self):
self.adaptee.SpecificRequest()
if __name__ == "__main__":
adaptee = Adaptee()
adapter = Adapter(adaptee)
adapter.Request()&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="桥接模式-bridge">桥接模式 /Bridge&lt;/h2>
&lt;p>**场景：**把抽象（abstraction）和实现（implementor）分离，两者可以独立变化
**使用：**Refined Abstraction是为了调用具体实现类
**实例：**不同的汽车有不同的引擎
参考代码见这里：&lt;a href="http://blog.csdn.net/shaopeng5211/article/details/8827507">http://blog.csdn.net/shaopeng5211/article/details/8827507&lt;/a>
&lt;img src="http://images.cnblogs.com/cnblogs_com/wuyuegb2312/468244/o_ch18.%e6%a1%a5%e6%8e%a5%e6%a8%a1%e5%bc%8f.png" alt="">
 &lt;/p>
&lt;h2 id="组合模式">组合模式&lt;/h2>
&lt;p>**场景：**把多个对象组成树状结构来表示局部与整体，这样用户可以一样的对待单个对象和对象的组合。
**实例：**公司人员结构
&lt;img src="http://images.cnblogs.com/cnblogs_com/wuyuegb2312/468244/o_ch15.%e7%bb%84%e5%90%88%e6%a8%a1%e5%bc%8f.png" alt="">&lt;/p>
&lt;pre lang="python" escaped="true">组合模式
class Component:
def __init__(self,strName):
self.m_strName = strName
def Add(self,com):
pass
def Display(self,nDepth):
pass
class Leaf(Component):
def Add(self,com):
print "leaf can't add"
def Display(self,nDepth):
strtemp = ""
for i in range(nDepth):
strtemp=strtemp+"-"
strtemp=strtemp+self.m_strName
print strtemp
class Composite(Component):
def __init__(self,strName):
self.m_strName = strName
self.c = []
def Add(self,com):
self.c.append(com)
def Display(self,nDepth):
strtemp=""
for i in range(nDepth):
strtemp=strtemp+"-"
strtemp=strtemp+self.m_strName
print strtemp
for com in self.c:
com.Display(nDepth+2)
if __name__ == "__main__":
p = Composite("Wong")
p.Add(Leaf("Lee"))
p.Add(Leaf("Zhao"))
p1 = Composite("Wu")
p1.Add(Leaf("San"))
p.Add(p1)
p.Display(1);&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="装饰模式decorator">&lt;strong>装饰模式/Decorator&lt;/strong>&lt;/h2>
&lt;p>装饰（ Decorator ）模式又叫做包装模式。通过一种对客户端透明的方式来扩展对象的功能，是继承关系的一个替换方案。
**场景：**对类扩展方法
&lt;strong>代码：&lt;/strong>&lt;a href="http://blog.csdn.net/shaopeng5211/article/details/8803120">http://blog.csdn.net/shaopeng5211/article/details/8803120&lt;/a>
&lt;img src="http://images.cnblogs.com/cnblogs_com/wuyuegb2312/468244/o_ch3.%e8%a3%85%e9%a5%b0%e6%a8%a1%e5%bc%8f.png" alt="">
 &lt;/p>
&lt;h2 id="外观模式facadec">外观模式/Facadec&lt;/h2>
&lt;p>**场景：**为client提供简单的方法，调用具体的多个实现类
&lt;strong>代码&lt;/strong>：&lt;a href="http://blog.csdn.net/shaopeng5211/article/details/8813135">http://blog.csdn.net/shaopeng5211/article/details/8813135&lt;/a>
&lt;img src="http://img.my.csdn.net/uploads/201304/17/1366170463_6144.png" alt="">
 &lt;/p>
&lt;h2 id="享元模式flyweight">享元模式/Flyweight&lt;/h2>
&lt;p>采用一个共享来避免大量拥有相同内容对象的开销。这种开销中最常见、直观的就是内存的损耗。享元模式以共享的方式高效的支持大量的细粒度对象。
** **&lt;/p>
&lt;h2 id="代理模式proxy">代理模式/Proxy&lt;/h2>
&lt;p>所谓代理，是指具有与代理元（被代理的对象）具有相同的接口的类，客户端必须通过代理与被代理的目标类交互，而代理一般在交互的过程中（交互前后），进行某些特别的处理。
需要与继承区分，继承是静态的增加方法，代理可以实现一些纵切的功能。
&lt;img src="http://images.cnblogs.com/cnblogs_com/wuyuegb2312/468244/o_ch.4%e4%bb%a3%e7%90%86%e6%a8%a1%e5%bc%8f.png" alt="">
 &lt;/p>
&lt;h2 id="firstHeading" lang="zh-CN"> 职责链模式/Chain of Responsibility&lt;/h2>
该模式构造一系列分别担当不同的职责的类的对象来共同完成一个任务，这些类的对象之间像链条一样紧密相连，所以被称作职责链模式。
**场景：**如一件事需要多个部门处理，这个部门处理完交给下个部门。
**使用：**每个对象设定下一个处理的对象是什么，并且在handle方法里调用下一个处理的方法。
**代码：**&lt;http://blog.csdn.net/shaopeng5211/article/details/8857776>
&amp;nbsp;
## 命令模式/Command
&lt;p>命令物件可以把行动(action) 及其参数封装起来，可以重复执行、取消。
&lt;img src="http://upload.wikimedia.org/wikipedia/commons/8/8e/Command_Design_Pattern_Class_Diagram.png" alt="Command Design Pattern Class Diagram.png">
Command                           Command抽象类。&lt;br>
ConcreteCommand        Command的具体实现类。&lt;br>
Receiver                             需要被调用的目标对象。&lt;br>
Invorker                             通过Invorker执行Command对象。&lt;/p>
&lt;pre lang="java" escaped="true">import java.util.List;
import java.util.ArrayList;
/* The Command interface */
public interface Command {
void execute();
}
/* The Invoker class */
public class Switch {
private List&amp;lt;Command&amp;gt; history = new ArrayList&amp;lt;Command&amp;gt;();
public Switch() {
}
public void storeAndExecute(Command cmd) {
this.history.add(cmd); // optional
cmd.execute();
}
}
/* The Receiver class */
public class Light {
public Light() {
}
public void turnOn() {
System.out.println("The light is on");
}
public void turnOff() {
System.out.println("The light is off");
}
}
/* The Command for turning on the light - ConcreteCommand #1 */
public class FlipUpCommand implements Command {
private Light theLight;
public FlipUpCommand(Light light) {
this.theLight = light;
}
public void execute(){
theLight.turnOn();
}
}
/* The Command for turning off the light - ConcreteCommand #2 */
public class FlipDownCommand implements Command {
private Light theLight;
public FlipDownCommand(Light light) {
this.theLight = light;
}
public void execute() {
theLight.turnOff();
}
}
/* The test class or client */
public class PressSwitch {
public static void main(String[] args){
Light lamp = new Light();
Command switchUp = new FlipUpCommand(lamp);
Command switchDown = new FlipDownCommand(lamp);
Switch mySwitch = new Switch();
try {
if ("ON".equalsIgnoreCase(args[0])) {
mySwitch.storeAndExecute(switchUp);
}
else if ("OFF".equalsIgnoreCase(args[0])) {
mySwitch.storeAndExecute(switchDown);
}
else {
System.out.println("Argument \"ON\" or \"OFF\" is required.");
}
} catch (Exception e) {
System.out.println("Arguments required.");
}
}
}&lt;/pre>
&lt;p> &lt;/p>
&lt;h2 id="解释器模式interpreter">解释器模式/Interpreter&lt;/h2>
&lt;p>它建立一个解释器，对于特定的计算机程序设计语言，用来解释预先定义的文法。简单地说，Interpreter模式是一种简单的语法解释器构架。
&lt;img src="http://img.my.csdn.net/uploads/201304/25/1366854216_4860.png" alt="">
Context 解释器上下文环境类。用来存储解释器的上下文环境，比如需要解释的文法等。&lt;br>
AbstractExpression 解释器抽象类。&lt;br>
ConcreteExpression 解释器具体实现类
&lt;strong>代码：&lt;/strong>&lt;a href="http://blog.csdn.net/shaopeng5211/article/details/8847991">http://blog.csdn.net/shaopeng5211/article/details/8847991&lt;/a>
 &lt;/p>
&lt;h2 id="迭代器">迭代器&lt;/h2>
&lt;p>提供一种方法顺序访问一个聚合对象中各个元素, 而又不需暴露该对象的内部表示。
 &lt;/p>
&lt;h2 id="中介者模式">中介者模式&lt;/h2>
&lt;p>**场景：**有多个类需要交互，由中介来调用他们。但中介者会变得复杂。
&lt;a href="http://haolloyin.blog.51cto.com/1177454/333810">http://haolloyin.blog.51cto.com/1177454/333810&lt;/a>
 &lt;/p>
&lt;h2 id="备忘录模式">备忘录模式&lt;/h2>
&lt;p>用另一个结构一样的类把变量存储起来。。o(╯□╰)o，可以在某个时间还原。
&lt;a href="http://blog.csdn.net/shaopeng5211/article/details/8879519">http://blog.csdn.net/shaopeng5211/article/details/8879519&lt;/a>
 &lt;/p>
&lt;h2 id="观察者模式">观察者模式&lt;/h2>
&lt;p>**场景：**一个目标对象管理所有相依于它的观察者对象，并且在它本身的状态改变时主动发出通知。
**使用：**Subject提供注册、删除、通知的方法，Observer注册到Subject，Subject状态变化时，就会通知所有注册的Observer。
&lt;strong>代码：&lt;/strong>&lt;a href="http://zh.wikipedia.org/wiki/观察者模式" target="_blank">&lt;a href="http://zh.wikipedia.org/wiki/">http://zh.wikipedia.org/wiki/&lt;/a>观察者模式&lt;/a>
&lt;img src="http://upload.wikimedia.org/wikipedia/commons/e/e2/Observer-pattern-class-diagram.png" alt="Observer-pattern-class-diagram.png">
 
 &lt;/p>
&lt;h2 id="状态模式">状态模式&lt;/h2>
&lt;p>State模式允许通过改变对象的内部状态而改变对象的行为，这个对象表现得就好像修改了它的类一样。
**使用：**Context维护一个state变量，并且使用这个state的方法。但state变更时，方法自然也变了。
&lt;img src="http://img.blog.csdn.net/20130504100850466" alt="">
 
 &lt;/p>
&lt;h2 id="策略模式">策略模式&lt;/h2>
&lt;p>策略模式作为一种&lt;a href="http://zh.wikipedia.org/wiki/%E8%BB%9F%E4%BB%B6%E8%A8%AD%E8%A8%88%E6%A8%A1%E5%BC%8F" title="软件设计模式">软件设计模式&lt;/a>，指对象有某个行为，但是在不同的场景中，该行为有不同的实现算法。比如每个人都要“交个人所得税”，但是“在美国交个人所得税”和“在中国交个人所得税”就有不同的算税方法。
**使用：**新建不同的策略让Context调用，需要与状态模式区分，状态模式的迁移对客户是透明的。
&lt;img src="http://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Strategy_Pattern_Diagram_ZP.svg/500px-Strategy_Pattern_Diagram_ZP.svg.png" alt="">
 &lt;/p>
&lt;h2 id="模板模式">模板模式&lt;/h2>
&lt;p>&lt;strong>模板方法模式&lt;/strong>定义了一个&lt;a href="http://zh.wikipedia.org/wiki/%E6%BC%94%E7%AE%97%E6%B3%95" title="算法">算法&lt;/a>的步骤，并允许次类别为一个或多个步骤提供其实践方式。
&lt;a href="http://zh.wikipedia.org/wiki/模板模式" target="_blank">&lt;a href="http://zh.wikipedia.org/wiki/">http://zh.wikipedia.org/wiki/&lt;/a>模板模式&lt;/a>
 &lt;/p>
&lt;h2 id="访问者模式">访问者模式&lt;/h2>
&lt;p>把对象和算法分开，通过使用回调的方式。对象实现accept方法，传入vistor调用它的方法。
&lt;a href="http://zh.wikipedia.org/wiki/访问者模式" target="_blank">&lt;a href="http://zh.wikipedia.org/wiki/">http://zh.wikipedia.org/wiki/&lt;/a>访问者模式&lt;/a>
&lt;img src="http://upload.wikimedia.org/wikipedia/commons/thumb/b/b1/Visitor_UML_class_diagram.svg/624px-Visitor_UML_class_diagram.svg.png" alt="File:Visitor UML class diagram.svg">&lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://www.cnblogs.com/wuyuegb2312/archive/2013/04/09/3008320.html">http://www.cnblogs.com/wuyuegb2312/archive/2013/04/09/3008320.html&lt;/a>
&lt;a href="http://blog.csdn.net/shaopeng5211">http://blog.csdn.net/shaopeng5211/&lt;/a>
&lt;a href="http://zh.wikipedia.org/zh-cn/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F_(%E8%AE%A1%E7%AE%97%E6%9C%BA)" title="http://zh.wikipedia.org/zh-cn/设计模式_(计算机)">http://zh.wikipedia.org/zh-cn/设计模式_(计算机)&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/">设计模式</category></item><item><title>安装pylibmc</title><link>https://fatkun.github.io/2013/08/install-pylibmc.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/08/install-pylibmc.html</guid><pubDate>Thu, 29 Aug 2013 10:51:00 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>首先需要安装libmemcached ，不要安装太新的版本，对gcc有要求
&lt;a href="http://launchpad.net/libmemcached/1.0/0.51/+download/libmemcached-0.51.tar.gz" rel="nofollow">&lt;a href="http://launchpad.net/libmemcached/1.0/0.51/+download/libmemcached-0.51.tar.gz">http://launchpad.net/libmemcached/1.0/0.51/+download/libmemcached-0.51.tar.gz&lt;/a>&lt;/a>
然后就可以安装了，
./configuare
make &amp;amp;&amp;amp; sudo make install
之后用pip安装pylibmc， &lt;a href="https://pypi.python.org/pypi/pylibmc">https://pypi.python.org/pypi/pylibmc&lt;/a>
pip install pylibmc
 
 
装完后报错&lt;/p>
&lt;pre lang="bash" escaped="true">&amp;gt;&amp;gt;&amp;gt; import pylibmc
Traceback (most recent call last):
File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
File "/usr/local/python2.6/lib/python2.6/site-packages/pylibmc/__init__.py", line 70, in &amp;lt;module&amp;gt;
import _pylibmc
ImportError: libmemcached.so.8: cannot open shared object file: No such file or directory&lt;/pre>
&lt;p> 
把/usr/local/lib加入/etc/ld.so.conf,然后执行/sbin/ldconfig
 &lt;/p></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/pylibmc/">Pylibmc</category></item><item><title>[备忘]Hive权限授权命令</title><link>https://fatkun.github.io/2013/08/hive-auth.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/08/hive-auth.html</guid><pubDate>Sun, 25 Aug 2013 08:13:58 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>官方文档：&lt;a href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Authorization">https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Authorization&lt;/a>
Hive支持的权限有Users,Groups,Roles
一个角色可以包含组或者用户
By default, the Metastore uses the HadoopDefaultAuthenticator for determing user -&amp;gt; group mappings
metastore默认会以metastore所在的机器根据用户名获取用户所属的组，而不是客户端的组。
 &lt;/p>
&lt;h2 id="创建角色">创建角色&lt;/h2>
&lt;pre lang="sql" escaped="true">CREATE ROLE role_name
DROP ROLE role_name&lt;/pre>
&lt;h2 id="角色分配">角色分配&lt;/h2>
&lt;pre lang="sql" escaped="true">GRANT ROLE role_name [, role_name] ...
TO principal_specification [, principal_specification] ...
REVOKE ROLE role_name [, role_name] ...
FROM principal_specification [, principal_specification] ...
principal_specification
: USER user
¦ GROUP group
¦ ROLE role
-- 查看权限
SHOW ROLE GRANT principal_specification
-- 例子：
CREATE ROLE youxi_role;
GRANT ROLE youxi_role TO USER fatkun;
&lt;/pre>
&lt;h2 id="权限">权限&lt;/h2>
&lt;p>Hive的权限支持全局权限(Global)、数据库、表、分区、列。
priv_type&lt;/p>
&lt;table> &lt;tr> &lt;th> 权限名称 &lt;/th>
&lt;th> 含义 &lt;/th> &lt;/tr>
&lt;tr> &lt;td> ALL &lt;/td>
&lt;td> 所有权限 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> ALTER &lt;/td>
&lt;td> 允许修改元数据（modify metadata data of object）&amp;#8212;表信息数据 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> UPDATE &lt;/td>
&lt;td> 允许修改物理数据（modify physical data of object）&amp;#8212;实际数据 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> CREATE &lt;/td>
&lt;td> 允许进行Create操作 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> DROP &lt;/td>
&lt;td> 允许进行DROP操作 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> INDEX &lt;/td>
&lt;td> 允许建索引（目前还没有实现） &lt;/td> &lt;/tr>
&lt;tr> &lt;td> LOCK &lt;/td>
&lt;td> 当出现并发的使用允许用户进行LOCK和UNLOCK操作 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> SELECT &lt;/td>
&lt;td> 允许用户进行SELECT操作 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> SHOW_DATABASE &lt;/td>
&lt;td> 允许用户查看可用的数据库 &lt;/td> &lt;/tr>&lt;/table>
&amp;nbsp;
&lt;pre lang="sql" escaped="true">GRANT
priv_type [(column_list)]
[, priv_type [(column_list)]] ...
[ON object_type]
TO principal_specification [, principal_specification] ...
[WITH GRANT OPTION]
&lt;p>REVOKE
priv_type [(column_list)]
[, priv_type [(column_list)]] ...
[ON object_type priv_level]
FROM principal_specification [, principal_specification] ...&lt;/p>
&lt;p>REVOKE ALL PRIVILEGES, GRANT OPTION
FROM user [, user] ...&lt;/p>
&lt;p>object_type:
TABLE
¦ DATABASE&lt;/p>
&lt;p>priv_level:
db_name
¦ tbl_name&lt;/p>
&lt;p>例子：
GRANT ALL ON DATABASE default TO USER fatkun;
GRANT ALL ON TABLE test TO GROUP kpi;
REVOKE ALL ON TABLE test FROM GROUP kpi;
GRANT ALL TO USER fatkun;
REVOKE ALL FROM fatkun;
&lt;/pre>
授权还是挺麻烦的。。你在哪一级别授权，只能在那个级别收回授权。&lt;/p>
&lt;h2 id="查看权限">查看权限&lt;/h2>
&lt;pre escaped="true" lang="sql">SHOW GRANT principal_specification
[ON object_type priv_level [(column_list)]]
例子：
SHOW GRANT GROUP kpi ON TABLE test;
&lt;/pre>
&lt;p> &lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/%E6%9D%83%E9%99%90/">权限</category></item><item><title>安卓应用：爱美女1.3</title><link>https://fatkun.github.io/2013/08/pretty-girl.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/08/pretty-girl.html</guid><pubDate>Sun, 18 Aug 2013 07:13:34 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>爱美女是一个android浏览图片的应用。
爱美女下载：&lt;a href="http://pan.baidu.com/share/link?shareid=1499420375&amp;amp;uk=1879467717">点此下载&lt;/a>
不用过多的介绍，图片高清，有广告但不会影响浏览图片的心情，试过就知道（觉得好可以点击广告支持作者）。
 
 &lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/%E7%88%B1%E7%BE%8E%E5%A5%B3/">爱美女</category></item><item><title>ADB server didn’t ACK解决方法</title><link>https://fatkun.github.io/2013/08/adb-server-didnt-ack%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/08/adb-server-didnt-ack%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html</guid><pubDate>Sat, 10 Aug 2013 10:06:19 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>原文：&lt;a href="http://www.cnblogs.com/longqi293/archive/2012/06/19/Android-Troubleshooting-ACK.html">【杂症】一个豌豆荚引发的血案——关于ADB server didn’t ACK的问题&lt;/a>&lt;br>
原文有图，本文只作为备忘。&lt;/p>
&lt;h2 id="现象">现象&lt;/h2>
&lt;p>ADB server didn’t ACK&lt;br>
* failed to start daemon *&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>找出那个程序占用了5037端口，然后把对应的进程kill掉。最后一位是PID。&lt;br>
netstat -a -o 5037
我遇到的是tadb.exe，这个是腾讯手机管家的进程。&lt;br>
如果你用了豌豆荚，也有个wangdoujia_hepler.exe之类的进程也要kill掉。&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/adb/">Adb</category></item><item><title>芒果广告平台混淆代码后不显示广告解决方法</title><link>https://fatkun.github.io/2013/08/adsmogo-proguard-config.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/08/adsmogo-proguard-config.html</guid><pubDate>Tue, 06 Aug 2013 17:37:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>使用芒果广告平台(adsmogo)混淆代码后广告不显示，我试了N次打包。。。o(╯□╰)o&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>新建proguard.cfg文件，不要用芒果提供的那份配置了。。我打死搞不定。。囧&lt;br>
-libraryjars 不知道有没有用，加了再说，把放到libs下的lib都加进来吧&lt;br>
然后把你用到的class都不混淆，除了自己的代码, -keep class 表示保留这个类不混淆。
参见以下例子&lt;/p>
&lt;pre escaped="true" lang="other">#The below is used for AdsMOGO_Android_SDK_1.3.4 settings
-dontwarn android.support.v4.**
-libraryjars libs/android-support-v4.jar
-libraryjars libs/AdsMOGO_Android_SDK_1.3.4.jar
-libraryjars libs/Baidu_MobAds_SDK_Agg_3.2.jar
-libraryjars libs/domob_android_sdk_v3.3.4.jar
-keep class uk.** {*;}
-keep class org.** {*;}
-keep class android.support.** {*;}
-keep class com.adsmogo.** {*;}
-keep class com.baidu.** {*;}
-keep class cn.domob.** {*;}
-keep class net.youmi.android.** {*;}
-keep class com.anwo.adsdk.** {*;}
-keep class com.suizong.** {*;}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/adsmogo/">Adsmogo</category><category domain="https://fatkun.github.io/tags/proguard/">Proguard</category><category domain="https://fatkun.github.io/tags/proguard.cfg/">Proguard.cfg</category><category domain="https://fatkun.github.io/tags/%E6%B7%B7%E6%B7%86%E4%BB%A3%E7%A0%81/">混淆代码</category><category domain="https://fatkun.github.io/tags/%E8%8A%92%E6%9E%9C/">芒果</category><category domain="https://fatkun.github.io/tags/%E8%8A%92%E6%9E%9C%E5%B9%BF%E5%91%8A%E5%B9%B3%E5%8F%B0/">芒果广告平台</category></item><item><title>jquery选择行(tr)勾选checkbox（避免冲突）</title><link>https://fatkun.github.io/2013/08/jquery-click-tr-and-check.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/08/jquery-click-tr-and-check.html</guid><pubDate>Sun, 04 Aug 2013 08:01:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>一般情况下点击行可以勾选多选框，但直接点勾选框会因为事件的冒泡导致再点击了一次。。&lt;br>
解决方法是判断最初点击的是不是checkbox
来源是：http://stackoverflow.com/, 找不回网址了。。&lt;/p>
&lt;pre escaped="true" lang="js">$("#album_list input.checkall").click(function(event) {
//prop 需要jquery1.6+才支持
$("#album_list input.chk_album").prop("checked", $(this).prop("checked"));
});
$("#album_list tr").click(function(event) {
var isCheckbox = $(event.target).is(":checkbox"); // 判断是否是checkbox本身
if (!isCheckbox) {
var chk = $(this).find(".chk_album");
if (chk) {
chk.prop("checked", !chk.prop("checked"));
}
}
});&lt;/pre></description><category domain="https://fatkun.github.io/categories/jquery/">Jquery</category><category domain="https://fatkun.github.io/tags/jquery/">Jquery</category><category domain="https://fatkun.github.io/tags/%E5%A4%9A%E9%80%89%E6%A1%86/">多选框</category></item><item><title>《模拟城市5》破解版提示下载失败解决方法</title><link>https://fatkun.github.io/2013/06/simcity5-download-error.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/06/simcity5-download-error.html</guid><pubDate>Thu, 20 Jun 2013 17:22:04 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>前面的步骤都没有问题，提示Everything sounds good !! 但是点击图标安装游戏的时候，过一会儿就提示下载失败了。。
&lt;img src="http://att.3dmgame.com/att/forum/201306/21/011625ktfvjnbjzvdmlmbr.png" alt="">
尼玛，搞了一晚上，自己解决了。。修改D:\simcity5\apache\httpd.conf 文件（注意我的目录可能和你不一样D:\simcity5）
在首行加入以下两句&lt;/p>
&lt;pre escaped="true" lang="html">EnableMMAP off
EnableSendfile off&lt;/pre>
&lt;p>保存，然后stop server再start server。
本文同时发在3dmgame论坛。。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/download-error/">Download Error</category><category domain="https://fatkun.github.io/tags/simcity5/">Simcity5</category></item><item><title>AES加密例子（python和php版本）</title><link>https://fatkun.github.io/2013/06/aes-encrypt-using-php-and-python.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/06/aes-encrypt-using-php-and-python.html</guid><pubDate>Wed, 12 Jun 2013 06:48:18 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>python版本&lt;br>
输入的加密字符必须是16的倍数，php的默认补零，所以解密的时候还需要rtrim掉零。python没有自动做这件事情，所以要自己补零。&lt;/p>
&lt;pre escaped="true" lang="python">class MyCrypt():
def __init__(self, key):
self.key = key
self.mode = AES.MODE_CBC
self.padding = '\0'
def encrypt(self, text):
cryptor = AES.new(self.key, self.mode)
length = 16
count = text.count('')
if count &amp;lt; length:
add = (length - count) + 1
text += (self.padding * add)
elif count &amp;gt; length:
add = (length - (count % length)) + 1
text += (self.padding * add)
self.ciphertext = cryptor.encrypt(text)
return self.ciphertext
def decrypt(self, text):
cryptor = AES.new(self.key, self.mode)
plain_text = cryptor.decrypt(text)
return plain_text.rstrip("\0")
if __name__ == '__main__':
key = '1234567890abcdef'
data = '{"a": "123中文", sss} '
ec = MyCrypt(key)
encrpt_data = ec.encrypt(data)
decrpt_data = ec.decrypt(encrpt_data)
print encrpt_data, decrpt_data, decrpt_data == data
from base64 import b64encode, b64decode
print b64encode(encrpt_data)&lt;/pre>
&lt;p>PHP版本:&lt;/p>
&lt;pre escaped="true" lang="php">&amp;lt;?php
$privateKey = "1234567890abcdef";
$iv = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
$data = '{"a": "123中文", sss} ';
//加密
$encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $privateKey, $data, MCRYPT_MODE_CBC, $iv);
$edata = base64_encode($encrypted);
echo $edata;
echo '&amp;lt;br/&amp;gt;';
//解密
$encryptedData = base64_decode('6PIG4DBcjsDDxY9GtHq2TXjTVE5linoc/7i8CdJNTU0=');
$decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $privateKey, $encryptedData, MCRYPT_MODE_CBC, $iv);
echo(rtrim($decrypted, "\0"));
?&amp;gt;
&lt;/pre></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/aes/">AES</category><category domain="https://fatkun.github.io/tags/encrypt/">Encrypt</category><category domain="https://fatkun.github.io/tags/%E5%8A%A0%E5%AF%86/">加密</category></item><item><title>使用base64加密在URL传递(python和php版本)</title><link>https://fatkun.github.io/2013/06/python-and-php-base64-urlencode.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/06/python-and-php-base64-urlencode.html</guid><pubDate>Wed, 12 Jun 2013 06:37:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>把base64加密后在url传输，会把“+“，”/”分别替换为”-“，”_”，以及会把末尾的等号“=”去掉。&lt;br>
另外base64加密后的长度必然是4的倍数，所以可以根据这个还原“=”号
解密的过程就是这个的逆向。
注意：python必须补齐=号才正常，不然会抛错no padding.
python版本：&lt;/p>
&lt;pre escaped="true" lang="python">def base64_url_decode(inp):
# 通过url传输时去掉了=号，所以需要补上=号
import base64
return base64.urlsafe_b64decode(str(inp + '=' * (4 - len(inp) % 4)))
def base64_url_encode(inp):
import base64
return base64.urlsafe_b64encode(str(inp)).rstrip('=')&lt;/pre>
&lt;p>php版本：&lt;/p>
&lt;pre escaped="true" lang="php">function base64url_encode($data) {
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
function base64url_decode($data) {
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/base64/">Base64</category><category domain="https://fatkun.github.io/tags/php/">Php</category><category domain="https://fatkun.github.io/tags/python/">Python</category></item><item><title>Hive的Lateral View</title><link>https://fatkun.github.io/2013/06/hive%E7%9A%84lateral-view.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/06/hive%E7%9A%84lateral-view.html</guid><pubDate>Tue, 11 Jun 2013 18:10:14 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Lateral View用于把UDTF的行转列结果集合在一起提供服务。Lateral View可以返回多列数据，前提是UDTF注册的输出个数。
UDTF代码参考：hive/src/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFExplode.java&lt;/p>
&lt;h2 id="准备数据">准备数据&lt;/h2>
&lt;pre escaped="true" lang="sql">create table test_array (a array&amp;lt;int>, b array&amp;lt;string>)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '`'
COLLECTION ITEMS TERMINATED BY ',';&lt;/pre>
&lt;p>测试数据，保存文件为/tmp/test&lt;/p>
&lt;pre escaped="true" lang="sql">10,11`tom,mary
20,21`kate,tim
&lt;/pre>
&lt;p>导入数据&lt;/p>
&lt;pre escaped="true" lang="sql">load data local inpath '/tmp/test' overwrite into table test_array;&lt;/pre>
&lt;h2 id="测试">测试&lt;/h2>
&lt;pre escaped="true" lang="sql">hive&amp;gt; select explode(b) as name, a from test_array;
FAILED: SemanticException 1:27 Only a single expression in the SELECT clause is supported with UDTF's. Error encountered near token 'a'
&lt;/pre>
&lt;p>UDTF只能select单列
使用LATERAL VIEW&lt;/p>
&lt;pre escaped="true" lang="sql">hive&amp;gt; SELECT a, name FROM test_array LATERAL VIEW explode(b) r1 AS name;
[10,11] tom
[10,11] mary
[20,21] kate
[20,21] tim
&lt;/pre>
&lt;p>可以有多个lateral view&lt;/p>
&lt;pre escaped="true" lang="sql">hive&amp;gt; SELECT id, name FROM test_array LATERAL VIEW explode(b) r1 AS name LATERAL VIEW explode(A) r2 AS id;
10 tom
11 tom
10 mary
11 mary
20 kate
21 kate
20 tim
21 tim
&lt;/pre>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://www.oratea.net/?p=650" target="_blank">hive中的Lateral View&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/lateral-view/">Lateral View</category></item><item><title>hive-builtins文件找不到</title><link>https://fatkun.github.io/2013/06/filenotfoundexception-hive-builtins.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/06/filenotfoundexception-hive-builtins.html</guid><pubDate>Tue, 11 Jun 2013 16:57:19 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;pre escaped="true" lang="java">java.io.FileNotFoundException: File does not exist: hdfs://localhost:8020/home/fatkun/hive-0.10.0-cdh4.3.0/lib/hive-builtins-0.10.0-cdh4.3.0.jar
at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:824)
at org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.getFileStatus(ClientDistributedCacheManager.java:288)
at org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.getFileStatus(ClientDistributedCacheManager.java:224)
at org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.determineTimestamps(ClientDistributedCacheManager.java:93)
at org.apache.hadoop.mapreduce.filecache.ClientDistributedCacheManager.determineTimestampsAndCacheVisibilities(ClientDistributedCacheManager.java:57)
at org.apache.hadoop.mapreduce.JobSubmitter.copyAndConfigureFiles(JobSubmitter.java:254)
at org.apache.hadoop.mapreduce.JobSubmitter.copyAndConfigureFiles(JobSubmitter.java:290)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:361)
at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1269)
at org.apache.hadoop.mapreduce.Job$11.run(Job.java:1266)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1266)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:606)
at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:601)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:601)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:586)
at org.apache.hadoop.hive.ql.exec.ExecDriver.execute(ExecDriver.java:448)
at org.apache.hadoop.hive.ql.exec.ExecDriver.main(ExecDriver.java:690)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
Job Submission failed with exception 'java.io.FileNotFoundException(File does not exist: hdfs://localhost:8020/home/fatkun/hive-0.10.0-cdh4.3.0/lib/hive-builtins-0.10.0-cdh4.3.0.jar)'&lt;/pre>
&lt;h2 id="可能的原因">可能的原因&lt;/h2>
&lt;p>刚开始我用伪分布模式没有提示这个错误，我配置了mapred-site.xml为local模式，但core-site.xml使用hdfs，从hdfs找不到这个文件。&lt;/p>
&lt;h2 id="可能的代码">可能的代码&lt;/h2>
&lt;pre escaped="true" lang="java">//ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
// Register the Hive builtins jar and all of its functions
try {
Class&amp;lt;?&amp;gt; pluginClass = Utilities.getBuiltinUtilsClass();
URL jarLocation = pluginClass.getProtectionDomain().getCodeSource()
.getLocation();
add_builtin_resource(
ResourceType.JAR, jarLocation.toString());
FunctionRegistry.registerFunctionsFromPluginJar(
jarLocation, pluginClass.getClassLoader());
sessionFunctionRegistry.putAll(FunctionRegistry.getStaticFunctionRegistry());
} catch (Exception ex) {
throw new RuntimeException("Failed to load Hive builtin functions", ex);
}
&lt;/pre>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>方法一：&lt;br>
更改core.site.xml，把fs.default.name改成local&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;fs.default.name&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;file:///&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&lt;/pre>
&lt;p>方法二（没试过）：&lt;br>
把hive-builtins包上传到提示的hdfs路径（我这里是/home/fatkun/hive-0.10.0-cdh4.3.0/lib/）&lt;br>
$ hadoop fs -mkdir /home/fatkun/hive-0.10.0-cdh4.3.0/lib/&lt;br>
$ hadoop fs -put $HIVE_HOME/lib/hive-builtins-*.jar /home/fatkun/hive-0.10.0-cdh4.3.0/lib/&lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://stackoverflow.com/questions/13527377/filenotfoundexception-for-hive-lib-hive-builtins-0-9-0-jar-in-hive">FileNotFoundException for hive/lib/hive-builtins-0.9.0.jar in Hive&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/filenotfoundexception/">FileNotFoundException</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive-builtins/">Hive-Builtins</category></item><item><title>[蛋疼向]cloudera文档最大化</title><link>https://fatkun.github.io/2013/06/cloudera-doc-max.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/06/cloudera-doc-max.html</guid><pubDate>Tue, 04 Jun 2013 17:09:42 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>cloudera的文档可视面积太小了。。。头部占了很大高度。。
&lt;a href="http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/4.2.0/CDH4-Release-Notes/CDH4-Release-Notes.html" target="_blank">点我到文档地址&lt;/a>&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>使用css改变一下样式。。
在浏览器加入一个书签
代码如下：&lt;/p>
&lt;pre lang="js" escaped="true">javascript:$("#center article").css("top", 0);$("#site-head").hide();$("#topnav").hide();$("#searchform").css("top", "auto").css("bottom", 0).css("left", "10px").css("right", "auto");$("#leftbar").css("top", 0);&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>Hive更改输入输出文件格式</title><link>https://fatkun.github.io/2013/06/alter-table-partition-file-format.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/06/alter-table-partition-file-format.html</guid><pubDate>Tue, 04 Jun 2013 07:52:01 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>文档：&lt;a href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL">https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL&lt;/a>&lt;br>
ALTER TABLE table_name [PARTITION partitionSpec] SET FILEFORMAT file_format
分区和表都会存储了文件格式，都要改过来才正确。。
例子：
ALTER TABLE foo SET FILEFORMAT&lt;br>
INPUTFORMAT “com.hadoop.mapred.DeprecatedLzoTextInputFormat”&lt;br>
OUTPUTFORMAT “org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat”;
ALTER TABLE foo PARTITION (pt=’2013-06-04′) SET FILEFORMAT&lt;br>
INPUTFORMAT “com.hadoop.mapred.DeprecatedLzoTextInputFormat”&lt;br>
OUTPUTFORMAT “org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat”;
也可以直接改metastore数据库，但要注意hive服务端可能有cache（默认是开了level2 cache），不知道会不会影响。
更改SD表&lt;br>
UPDATE SDS SET INPUT_FORMAT=’com.hadoop.mapred.DeprecatedLzoTextInputFormat’;&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category></item><item><title>Hive改表名后查询不了数据(DataNucleus缓存问题)</title><link>https://fatkun.github.io/2013/05/hive-rename.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/05/hive-rename.html</guid><pubDate>Wed, 29 May 2013 17:21:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="现象">现象&lt;/h2>
&lt;p>改了Hive表名后查询不了任何数据。&lt;/p>
&lt;h2 id="重现方式">重现方式&lt;/h2>
&lt;p>开启两个hive命令行，&lt;br>
先在第一个hive查询一条语句：select * from logs1;&lt;br>
然后在第二个hive把表名更改：alter table logs1 rename to logs2;&lt;br>
再在第一个hive查询：select * from logs2;//这时查询成功，但没有数据&lt;/p>
&lt;h2 id="调试">调试&lt;/h2>
&lt;p>想到可能是缓存或者事务的原因。。虽然发现查询条件没有错，但返回结果的预期不一样&lt;/p>
&lt;pre lang="java" escaped="true">public void getMetaData(QB qb) throws SemanticException {
tab = db.getTable(tab_name); // 这里返回了上一次的结果
}&lt;/pre>
&lt;p>代码太多了。。最终还是没搞懂哪里缓存了。。实际上跟踪调试是经过了mysql-connector的查询，中间结果返回了JDBCResult，但是二进制的结果，看不出什么东西，不知道为什么最后返回的结果却是缓存的。只能随便试试看DataNucleus有那些缓存的参数了，死马当活马医。
找到有以下参数：
datanucleus.query.compilation.cached&lt;br>
datanucleus.query.results.cached&lt;br>
datanucleus.cache.level2.type
最终试了datanucleus.cache.level2.type可行。。&lt;/p>
&lt;h2 id="解决方法"> 解决方法&lt;/h2>
&lt;p>在hive-site.xml加上这个参数&lt;/p>
&lt;pre lang="xml" escaped="true">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;datanucleus.cache.level2.type&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;none&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/cache/">Cache</category><category domain="https://fatkun.github.io/tags/datanucleus/">Datanucleus</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/%E7%BC%93%E5%AD%98/">缓存</category></item><item><title>[备忘]java指定一个目录加入classpath</title><link>https://fatkun.github.io/2013/04/java-dir-classpath.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/04/java-dir-classpath.html</guid><pubDate>Mon, 22 Apr 2013 02:08:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;pre lang="bash" escaped="true">java -classpath test.jar -Djava.ext.dirs=./lib com.fatkun.Test&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category></item><item><title>java反射引起的java.lang.OutOfMemoryError: PermGen space</title><link>https://fatkun.github.io/2013/04/java-reflection-outofmemoryerror.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/04/java-reflection-outofmemoryerror.html</guid><pubDate>Sun, 21 Apr 2013 13:50:58 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>由于之前为了不改hive的代码，用了反射的方式动态修改，导致了另一个问题出现。&lt;br>
我用的反射代码如下：（代码是针对local metastore写的）, 主要是为了调用ObjectStore的shutdown()方法。&lt;/p>
&lt;pre escaped="true" lang="java">            Hive hive = Hive.get();
            Method method = Hive.class.getDeclaredMethod("getMSC");
            method.setAccessible(true);
            HiveMetaStoreClient msc = (HiveMetaStoreClient)method.invoke(hive);
            Field field = HiveMetaStoreClient.class.getDeclaredField("client");
            field.setAccessible(true);
            HiveMetaStore.HMSHandler client = (HiveMetaStore.HMSHandler)field.get(msc);
            
            if (client != null) {
                method = HiveMetaStore.HMSHandler.class.getDeclaredMethod("getMS", boolean.class);
                method.setAccessible(true);
                ObjectStore os = (ObjectStore)method.invoke(client, false);
                os.shutdown();
            }
            method = null;
            field = null;
            
            Hive.closeCurrent();&lt;/pre>
&lt;p>使用反射后，用jprofiler检查发现多了很多这些类&lt;br>
sun.reflect.DelegatingClassLoader&lt;br>
sun.reflect.GeneratedConstructorAccessor77
估计是反射引起的，类越來越多（还没有严谨的测试过，因为perm内存增长很缓慢）&lt;br>
看了几篇文章，没搞懂。。到&lt;a href="http://stackoverflow.com/questions/16130292/java-lang-outofmemoryerror-permgen-space-java-reflection?answertab=active" target="_blank">StackOverflow&lt;/a>去问
使用这个参数，通过jni的方式调用反射&lt;/p>
&lt;pre escaped="true" lang="java">-Dsun.reflect.inflationThreshold=0&lt;/pre>
&lt;p>我理解是使用反射会有两种途径，jni和Java bytecode，（It can use a JNI accessor, or a Java bytecode accessor），使用jni调用会慢一些，但使用Java bytecode会生成一个类和classloader (sun/reflect/GeneratedMethodAccessor&lt;N> class and sun/reflect/DelegatingClassLoader)。JVM刚开始默认使用JNI的方式调用，当同一个类调用次数达到一定值后改为Java bytecode调用。
可能会有少许的性能缺失,但我调用的次数还不算多，应该可以接受。另外发现在线上的对象个数有150个左右，应该有些内存还是被回收了，调用的次数不止那么少。&lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://stackoverflow.com/questions/16130292/java-lang-outofmemoryerror-permgen-space-java-reflection?answertab=active" target="_blank">StackOverflow&lt;/a>&lt;br>
&lt;a href="http://www-01.ibm.com/support/docview.wss?uid=swg21566549" target="_blank">Potential native memory use in reflection delegating classloaders&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java/">JAVA</category><category domain="https://fatkun.github.io/tags/outofmemoryerror/">OutOfMemoryError</category><category domain="https://fatkun.github.io/tags/reflect/">Reflect</category></item><item><title>关于参考和抄袭小乐图客</title><link>https://fatkun.github.io/2013/04/%E5%85%B3%E4%BA%8E%E5%8F%82%E8%80%83%E5%92%8C%E6%8A%84%E8%A2%AD%E5%B0%8F%E4%B9%90%E5%9B%BE%E5%AE%A2.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/04/%E5%85%B3%E4%BA%8E%E5%8F%82%E8%80%83%E5%92%8C%E6%8A%84%E8%A2%AD%E5%B0%8F%E4%B9%90%E5%9B%BE%E5%AE%A2.html</guid><pubDate>Sat, 13 Apr 2013 14:21:08 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在开发fatkun图片批量下载时，遇到很多问题自己解决不了，之前保存都是靠浏览器的保存页面方式存储的。当时也在找HTML5是否有相关的资料可以保存文件，后面发现小乐图客和另一个扩展（忘记叫什么了，可以按大图小图分类来下载图片）实现了这个功能，那时参考了两者，都是用同样的方式实现的，模拟用户点击链接来保存文件，就把这个功能加入了fatkun图片批量下载中。
在互联网中，可以从各个途径中学习到不同的知识来提高自己，为了完善自己的扩展会参考其他扩展的做法，会添加一些新功能或者改进。有些功能是直接使用了小乐图客的代码，如：打开多个网址，但我也做了一些改变，不会打开多个标签，而是只在一个标签里打开多个页面。匹配规则也与小乐图客有些不一样，你不用关心你访问的网站是什么，如果匹配了就给你返回最大图。但这个功能也是参考小乐图客实现的。
小乐图客是基于MIT协议开放（见小乐图客源码开头），我没有标注部分源码来自小乐图客，在此向小乐道歉。&lt;br>
现在已经在博客和chrome store显著位置标注，之后下一个版本的扩展也会加上这个版权声明。
感谢小乐开发的扩展并以此协议发布代码，在代码中学习到一些东西。&lt;/p>
&lt;pre lang="js" escaped="true">/*
* zzllrr Imager &amp;lt;http://goo.gl/n8SMk&amp;gt;
* Copyright (c) 2011 zzllrr. All rights reserved.
* http://about.me/zzllrr
* Released under MIT License
*/&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>Hbase DependentColumnFilter</title><link>https://fatkun.github.io/2013/03/hbase-dependentcolumnfilter.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/03/hbase-dependentcolumnfilter.html</guid><pubDate>Mon, 25 Mar 2013 17:43:05 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;blockquote>
&lt;p>Here you have a more complex filter that does not simply filter out data based on&lt;br>
directly available information. Rather, it lets you specify a dependent column—or&lt;br>
reference column—that controls how other columns are filtered. It uses the timestamp&lt;br>
of the reference column and includes all other columns that have the same timestamp.
尝试找到该列所在的每一行，并返回该行具有相同时间戳的全部键值对。如果某一行不包含指定的列，则该行的任何键值对都不返回。&lt;br>
如果dropDependentColumn=true，则从属列不返回。
via: &lt;a href="http://abloz.com/2012/08/22/the-hbases-content-query-2.html" target="_blank">&lt;a href="http://abloz.com/2012/08/22/the-hbases-content-query-2.html">http://abloz.com/2012/08/22/the-hbases-content-query-2.html&lt;/a>&lt;/a>&lt;/p>
&lt;/blockquote>
&lt;pre escaped="true" lang="java">package com.fatkun.filter.comparison;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.filter.BinaryPrefixComparator;
import org.apache.hadoop.hbase.filter.CompareFilter;
import org.apache.hadoop.hbase.filter.DependentColumnFilter;
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.SubstringComparator;
import org.apache.hadoop.hbase.filter.ValueFilter;
import org.apache.hadoop.hbase.filter.WritableByteArrayComparable;
import org.apache.hadoop.hbase.util.Bytes;
public class TestHbaseDependentColumnFilter {
String tableName = "test_value_filter";
Configuration config = HBaseConfiguration.create();
public void filter(boolean drop, CompareFilter.CompareOp operator,
WritableByteArrayComparable comparator) throws IOException {
HTable table = new HTable(config, tableName);
//
Filter filter;
if (comparator != null) {
// drop为true时，filter表示对"col1"列以外的所有"data1"列族数据做filter操作
// drop为false时,表示对所有"data1"列族的数据做filter操作
filter = new DependentColumnFilter(Bytes.toBytes("data1"),
Bytes.toBytes("col1"), drop, operator, comparator);
} else {
filter = new DependentColumnFilter(Bytes.toBytes("data1"),
Bytes.toBytes("col1"), drop);
}
// filter应用于scan
Scan scan = new Scan();
scan.setFilter(filter);
ResultScanner scanner = table.getScanner(scan);
for (Result result : scanner) {
for (KeyValue kv : result.list()) {
System.out.println("kv=" + kv.toString() + ",value="
+ Bytes.toString(kv.getValue()));
}
}
scanner.close();
table.close();
}
/**
* 部分代码来自hbase权威指南
*
* @throws IOException
*/
public void testFilter() throws IOException {
// The dropDependentColumn parameter is giving you additional control
// over how the reference column is handled: it is either included or
// dropped by the filter
// 1.获取整个"data1"列族当前Version中的所有timestamp等于参照列"data1:col1"的数据
System.out.println("drop=false");
filter(false, CompareFilter.CompareOp.NO_OP, null);
// 2.获取除了"col1"列以外的"data1"列族中的所有timestamp等于参照列"data1:col1"的数据
System.out.println("drop=true");
filter(true, CompareFilter.CompareOp.NO_OP, null);
// 3.获取除了"col1"列以外的"data1"列族当前Version中的所有timestamp等于参照列"data1:col1"的,value以"data100"开头的所有数据
System.out.println("比较");
filter(true, CompareFilter.CompareOp.EQUAL, new BinaryPrefixComparator(
Bytes.toBytes("data100")));
}
/**
* 初始化数据
*/
public void init() {
// 创建表和初始化数据
try {
HBaseAdmin admin = new HBaseAdmin(config);
if (!admin.tableExists(tableName)) {
HTableDescriptor htd = new HTableDescriptor(tableName);
HColumnDescriptor hcd1 = new HColumnDescriptor("data1");
htd.addFamily(hcd1);
HColumnDescriptor hcd2 = new HColumnDescriptor("data2");
htd.addFamily(hcd2);
HColumnDescriptor hcd3 = new HColumnDescriptor("data3");
htd.addFamily(hcd3);
admin.createTable(htd);
}
HTable table = new HTable(config, tableName);
table.setAutoFlush(false);
int count = 50;
for (int i = 1; i &amp;lt;= count; ++i) {
Put p = new Put(String.format("row%03d", i).getBytes());
p.add("data1".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data1%03d", i).getBytes());
p.add("data2".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data2%03d", i).getBytes());
p.add("data3".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data3%03d", i).getBytes());
table.put(p);
}
table.close();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
TestHbaseDependentColumnFilter test = new TestHbaseDependentColumnFilter();
test.init();
test.testFilter();
}
}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/hbase/">Hbase</category><category domain="https://fatkun.github.io/tags/filter/">Filter</category><category domain="https://fatkun.github.io/tags/hbase/">Hbase</category></item><item><title>Hbase ValueFilter</title><link>https://fatkun.github.io/2013/03/hbase-valuefilter.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/03/hbase-valuefilter.html</guid><pubDate>Mon, 25 Mar 2013 16:52:03 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Hbase ValueFilter用于过滤值&lt;/p>
&lt;pre escaped="true" lang="java">package com.fatkun.filter.comparison;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.filter.BinaryComparator;
import org.apache.hadoop.hbase.filter.CompareFilter;
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.SubstringComparator;
import org.apache.hadoop.hbase.filter.ValueFilter;
import org.apache.hadoop.hbase.util.Bytes;
public class TestHbaseValueFilter {
String tableName = "test_value_filter";
Configuration config = HBaseConfiguration.create();
/**
* 部分代码来自hbase权威指南
*
* @throws IOException
*/
public void testFilter() throws IOException {
HTable table = new HTable(config, tableName);
Scan scan = new Scan();
System.out.println("只列出值包含data1的列");
Filter filter1 = new ValueFilter(CompareFilter.CompareOp.EQUAL,
new SubstringComparator("data1"));
scan.setFilter(filter1);
ResultScanner scanner1 = table.getScanner(scan);
for (Result res : scanner1) {
System.out.println(res);
}
scanner1.close();
System.out.println("get也可以设置filter");
Get get1 = new Get(Bytes.toBytes("row003"));
get1.setFilter(filter1);
Result result1 = table.get(get1);
System.out.println("Result of get(): " + result1);
}
/**
* 初始化数据
*/
public void init() {
// 创建表和初始化数据
try {
HBaseAdmin admin = new HBaseAdmin(config);
if (!admin.tableExists(tableName)) {
HTableDescriptor htd = new HTableDescriptor(tableName);
HColumnDescriptor hcd1 = new HColumnDescriptor("data1");
htd.addFamily(hcd1);
HColumnDescriptor hcd2 = new HColumnDescriptor("data2");
htd.addFamily(hcd2);
HColumnDescriptor hcd3 = new HColumnDescriptor("data3");
htd.addFamily(hcd3);
admin.createTable(htd);
}
HTable table = new HTable(config, tableName);
table.setAutoFlush(false);
int count = 50;
for (int i = 1; i &amp;lt;= count; ++i) {
Put p = new Put(String.format("row%03d", i).getBytes());
p.add("data1".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data1%03d", i).getBytes());
p.add("data2".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data2%03d", i).getBytes());
p.add("data3".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data3%03d", i).getBytes());
table.put(p);
}
table.close();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
TestHbaseValueFilter test = new TestHbaseValueFilter();
test.init();
test.testFilter();
}
}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/hbase/">Hbase</category><category domain="https://fatkun.github.io/tags/filter/">Filter</category><category domain="https://fatkun.github.io/tags/hbase/">Hbase</category></item><item><title>Hbase QualifierFilter</title><link>https://fatkun.github.io/2013/03/hbase-qualifierfilter.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/03/hbase-qualifierfilter.html</guid><pubDate>Mon, 25 Mar 2013 16:40:53 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Hbase QualifierFilter用于过滤qualifier，也就是一个列族里面data:xxx，冒号后面的字符串。 =。=&lt;/p>
&lt;pre escaped="true" lang="java">package com.fatkun.filter.comparison;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.filter.BinaryComparator;
import org.apache.hadoop.hbase.filter.CompareFilter;
import org.apache.hadoop.hbase.filter.FamilyFilter;
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.QualifierFilter;
import org.apache.hadoop.hbase.util.Bytes;
public class TestHbaseQualifierFilter {
String tableName = "test_qualifier_filter";
Configuration config = HBaseConfiguration.create();
/**
* 部分代码来自hbase权威指南
* @throws IOException
*/
public void testRowFilter() throws IOException {
HTable table = new HTable(config, tableName);
Scan scan = new Scan();
System.out.println("只列出小于col5的列");
Filter filter1 = new QualifierFilter(CompareFilter.CompareOp.LESS,
new BinaryComparator(Bytes.toBytes("col5")));
scan.setFilter(filter1);
ResultScanner scanner1 = table.getScanner(scan);
for (Result res : scanner1) {
System.out.println(res);
}
scanner1.close();
System.out.println("get也可以设置filter");
Get get1 = new Get(Bytes.toBytes("row003"));
get1.setFilter(filter1);
Result result1 = table.get(get1);
System.out.println("Result of get(): " + result1);
}
/**
* 初始化数据
*/
public void init() {
// 创建表和初始化数据
try {
HBaseAdmin admin = new HBaseAdmin(config);
if (!admin.tableExists(tableName)) {
HTableDescriptor htd = new HTableDescriptor(tableName);
HColumnDescriptor hcd1 = new HColumnDescriptor("data1");
htd.addFamily(hcd1);
HColumnDescriptor hcd2 = new HColumnDescriptor("data2");
htd.addFamily(hcd2);
HColumnDescriptor hcd3 = new HColumnDescriptor("data3");
htd.addFamily(hcd3);
admin.createTable(htd);
}
HTable table = new HTable(config, tableName);
table.setAutoFlush(false);
int count = 50;
for (int i = 1; i &amp;lt;= count; ++i) {
Put p = new Put(String.format("row%03d", i).getBytes());
p.add("data1".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data1%03d", i).getBytes());
p.add("data2".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data2%03d", i).getBytes());
p.add("data3".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data3%03d", i).getBytes());
table.put(p);
}
table.close();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
TestHbaseQualifierFilter test = new TestHbaseQualifierFilter();
test.init();
test.testRowFilter();
}
}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/hbase/">Hbase</category><category domain="https://fatkun.github.io/tags/filter/">Filter</category><category domain="https://fatkun.github.io/tags/hbase/">Hbase</category></item><item><title>Hbase FamilyFilter</title><link>https://fatkun.github.io/2013/03/hbase-familyfilter.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/03/hbase-familyfilter.html</guid><pubDate>Sun, 24 Mar 2013 17:01:05 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>FamilyFilter 用于过滤Family&lt;/p>
&lt;pre lang="java" escaped="true">package com.fatkun.filter;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.filter.BinaryComparator;
import org.apache.hadoop.hbase.filter.CompareFilter;
import org.apache.hadoop.hbase.filter.FamilyFilter;
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.util.Bytes;
public class TestHbaseFamilyFilter {
String tableName = "test_family_filter";
Configuration config = HBaseConfiguration.create();
/**
* 部分代码来自hbase权威指南
* @throws IOException
*/
public void testRowFilter() throws IOException {
HTable table = new HTable(config, tableName);
Scan scan = new Scan();
System.out.println("只列出小于data2的列");
Filter filter1 = new FamilyFilter(CompareFilter.CompareOp.LESS,
new BinaryComparator(Bytes.toBytes("data2")));
scan.setFilter(filter1);
ResultScanner scanner1 = table.getScanner(scan);
for (Result res : scanner1) {
System.out.println(res);
}
scanner1.close();
System.out.println("get也可以设置filter");
Get get1 = new Get(Bytes.toBytes("row005"));
get1.setFilter(filter1);
Result result1 = table.get(get1);
System.out.println("Result of get(): " + result1);
}
/**
* 初始化数据
*/
public void init() {
// 创建表和初始化数据
try {
HBaseAdmin admin = new HBaseAdmin(config);
if (!admin.tableExists(tableName)) {
HTableDescriptor htd = new HTableDescriptor(tableName);
HColumnDescriptor hcd1 = new HColumnDescriptor("data1");
htd.addFamily(hcd1);
HColumnDescriptor hcd2 = new HColumnDescriptor("data2");
htd.addFamily(hcd2);
HColumnDescriptor hcd3 = new HColumnDescriptor("data3");
htd.addFamily(hcd3);
admin.createTable(htd);
}
HTable table = new HTable(config, tableName);
table.setAutoFlush(false);
int count = 50;
for (int i = 1; i &amp;lt;= count; ++i) {
Put p = new Put(String.format("row%03d", i).getBytes());
p.add("data1".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data1%03d", i).getBytes());
p.add("data2".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data2%03d", i).getBytes());
p.add("data3".getBytes(), String.format("col%01d", i % 10)
.getBytes(), String.format("data3%03d", i).getBytes());
table.put(p);
}
table.close();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
TestHbaseFamilyFilter test = new TestHbaseFamilyFilter();
test.init();
test.testRowFilter();
}
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/hbase/">Hbase</category><category domain="https://fatkun.github.io/tags/filter/">Filter</category><category domain="https://fatkun.github.io/tags/hbase/">Hbase</category></item><item><title>hbase RowFilter</title><link>https://fatkun.github.io/2013/03/hbase-rowfilter.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/03/hbase-rowfilter.html</guid><pubDate>Sun, 24 Mar 2013 13:58:40 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>RowFilter用于过滤row key&lt;/p>
&lt;table summary="The possible comparison operators for CompareFilter-based filters"> &lt;tr> &lt;th> Operator &lt;/th>
&lt;th> Description &lt;/th> &lt;/tr>
&lt;tr> &lt;td> &lt;code>LESS&lt;/code> &lt;/td>
&lt;td> 小于 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> &lt;code>LESS_OR_EQUAL&lt;/code> &lt;/td>
&lt;td> 小于等于 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> &lt;code>EQUAL&lt;/code> &lt;/td>
&lt;td> 等于 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> &lt;code>NOT_EQUAL&lt;/code> &lt;/td>
&lt;td> 不等于 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> &lt;code>GREATER_OR_EQUAL&lt;/code> &lt;/td>
&lt;td> 大于等于 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> &lt;code>GREATER&lt;/code> &lt;/td>
&lt;td> 大于 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> &lt;code>NO_OP&lt;/code> &lt;/td>
&lt;td> 排除所有 &lt;/td> &lt;/tr>&lt;/table>
&amp;nbsp;
&lt;table summary="The HBase-supplied comparators, used with CompareFilter-based filters"> &lt;tr> &lt;th> Comparator &lt;/th>
&lt;th> Description &lt;/th> &lt;/tr>
&lt;tr> &lt;td> &lt;code>BinaryComparator&lt;/code> &lt;/td>
&lt;td> 使用Bytes.compareTo()比较 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> &lt;code>BinaryPrefixComparator&lt;/code> &lt;/td>
&lt;td> 和BinaryComparator差不多，从前面开始比较 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> &lt;code>NullComparator&lt;/code> &lt;/td>
&lt;td> Does&lt;a id="I_indexterm4_d1e13563">&lt;/a> not compare against an actual value but whether a given one is &lt;code>null&lt;/code>, or not &lt;code>null&lt;/code>. &lt;/td> &lt;/tr>
&lt;tr> &lt;td> &lt;code>BitComparator&lt;/code> &lt;/td>
&lt;td> Performs&lt;a id="I_indexterm4_d1e13579">&lt;/a> a bitwise comparison, providing a &lt;code>BitwiseOp&lt;/code> class with &lt;code>AND&lt;/code>, &lt;code>OR&lt;/code>, and &lt;code>XOR&lt;/code> operators. &lt;/td> &lt;/tr>
&lt;tr> &lt;td> &lt;code>RegexStringComparator&lt;/code> &lt;/td>
&lt;td> 正则表达式 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> &lt;code>SubstringComparator&lt;/code> &lt;/td>
&lt;td> 把数据当成字符串，用contains()来判断 &lt;/td> &lt;/tr>&lt;/table>
&amp;nbsp;
&amp;nbsp;
&lt;pre lang="java" escaped="true">import java.io.IOException;
&lt;p>import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.hadoop.hbase.client.ResultScanner;
import org.apache.hadoop.hbase.client.Scan;
import org.apache.hadoop.hbase.filter.BinaryComparator;
import org.apache.hadoop.hbase.filter.BinaryPrefixComparator;
import org.apache.hadoop.hbase.filter.CompareFilter;
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.RegexStringComparator;
import org.apache.hadoop.hbase.filter.RowFilter;
import org.apache.hadoop.hbase.filter.SubstringComparator;&lt;/p>
&lt;p>public class TestHbaseRowFilter {
String tableName = &amp;quot;test_row_filter&amp;quot;;
Configuration config = HBaseConfiguration.create();&lt;/p>
&lt;pre>&lt;code>/**
* 部分代码来自hbase权威指南
* @throws IOException
*/
public void testRowFilter() throws IOException {
HTable table = new HTable(config, tableName);
Scan scan = new Scan();
System.out.println(&amp;quot;小于等于row010的行&amp;quot;);
Filter filter1 = new RowFilter(CompareFilter.CompareOp.LESS_OR_EQUAL,
new BinaryComparator(&amp;quot;row010&amp;quot;.getBytes()));
scan.setFilter(filter1);
ResultScanner scanner1 = table.getScanner(scan);
for (Result res : scanner1) {
System.out.println(res);
}
scanner1.close();
System.out.println(&amp;quot;正则获取结尾为5的行&amp;quot;);
Filter filter2 = new RowFilter(CompareFilter.CompareOp.EQUAL,
new RegexStringComparator(&amp;quot;.*5$&amp;quot;));
scan.setFilter(filter2);
ResultScanner scanner2 = table.getScanner(scan);
for (Result res : scanner2) {
System.out.println(res);
}
scanner2.close();
System.out.println(&amp;quot;包行有5的行&amp;quot;);
Filter filter3 = new RowFilter(CompareFilter.CompareOp.EQUAL,
new SubstringComparator(&amp;quot;5&amp;quot;));
scan.setFilter(filter3);
ResultScanner scanner3 = table.getScanner(scan);
for (Result res : scanner3) {
System.out.println(res);
}
scanner3.close();
System.out.println(&amp;quot;开头是row01的&amp;quot;);
Filter filter4 = new RowFilter(CompareFilter.CompareOp.EQUAL,
new BinaryPrefixComparator(&amp;quot;row01&amp;quot;.getBytes()));
scan.setFilter(filter4);
ResultScanner scanner4 = table.getScanner(scan);
for (Result res : scanner4) {
System.out.println(res);
}
scanner3.close();
}
/**
* 初始化数据
*/
public void init() {
// 创建表和初始化数据
try {
HBaseAdmin admin = new HBaseAdmin(config);
if (!admin.tableExists(tableName)) {
HTableDescriptor htd = new HTableDescriptor(tableName);
HColumnDescriptor hcd1 = new HColumnDescriptor(&amp;quot;data&amp;quot;);
htd.addFamily(hcd1);
HColumnDescriptor hcd2 = new HColumnDescriptor(&amp;quot;url&amp;quot;);
htd.addFamily(hcd2);
admin.createTable(htd);
}
HTable table = new HTable(config, tableName);
table.setAutoFlush(false);
int count = 50;
for (int i = 1; i &amp;amp;lt;= count; ++i) {
Put p = new Put(String.format(&amp;quot;row%03d&amp;quot;, i).getBytes());
p.add(&amp;quot;data&amp;quot;.getBytes(), String.format(&amp;quot;col%01d&amp;quot;, i % 10)
.getBytes(), String.format(&amp;quot;data%03d&amp;quot;, i).getBytes());
p.add(&amp;quot;url&amp;quot;.getBytes(), String.format(&amp;quot;col%01d&amp;quot;, i % 10)
.getBytes(), String.format(&amp;quot;url%03d&amp;quot;, i).getBytes());
table.put(p);
}
table.close();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
TestHbaseRowFilter test = new TestHbaseRowFilter();
test.init();
test.testRowFilter();
}
&lt;/code>&lt;/pre>
&lt;p>}&lt;/pre>&lt;/p>
&lt;h2 id="输出结果">输出结果&lt;/h2>
&lt;pre escaped="true" lang="other">小于等于row010的行
keyvalues={row001/data:col1/1364133382268/Put/vlen=7, row001/url:col1/1364133382268/Put/vlen=6}
keyvalues={row002/data:col2/1364133382268/Put/vlen=7, row002/url:col2/1364133382268/Put/vlen=6}
keyvalues={row003/data:col3/1364133382268/Put/vlen=7, row003/url:col3/1364133382268/Put/vlen=6}
keyvalues={row004/data:col4/1364133382268/Put/vlen=7, row004/url:col4/1364133382268/Put/vlen=6}
keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
keyvalues={row006/data:col6/1364133382268/Put/vlen=7, row006/url:col6/1364133382268/Put/vlen=6}
keyvalues={row007/data:col7/1364133382268/Put/vlen=7, row007/url:col7/1364133382268/Put/vlen=6}
keyvalues={row008/data:col8/1364133382268/Put/vlen=7, row008/url:col8/1364133382268/Put/vlen=6}
keyvalues={row009/data:col9/1364133382268/Put/vlen=7, row009/url:col9/1364133382268/Put/vlen=6}
keyvalues={row010/data:col0/1364133382268/Put/vlen=7, row010/url:col0/1364133382268/Put/vlen=6}
正则获取结尾为5的行
keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
keyvalues={row025/data:col5/1364133382268/Put/vlen=7, row025/url:col5/1364133382268/Put/vlen=6}
keyvalues={row035/data:col5/1364133382268/Put/vlen=7, row035/url:col5/1364133382268/Put/vlen=6}
keyvalues={row045/data:col5/1364133382268/Put/vlen=7, row045/url:col5/1364133382268/Put/vlen=6}
包行有5的行
keyvalues={row005/data:col5/1364133382268/Put/vlen=7, row005/url:col5/1364133382268/Put/vlen=6}
keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
keyvalues={row025/data:col5/1364133382268/Put/vlen=7, row025/url:col5/1364133382268/Put/vlen=6}
keyvalues={row035/data:col5/1364133382268/Put/vlen=7, row035/url:col5/1364133382268/Put/vlen=6}
keyvalues={row045/data:col5/1364133382268/Put/vlen=7, row045/url:col5/1364133382268/Put/vlen=6}
keyvalues={row050/data:col0/1364133382268/Put/vlen=7, row050/url:col0/1364133382268/Put/vlen=6}
开头是row01的
keyvalues={row010/data:col0/1364133382268/Put/vlen=7, row010/url:col0/1364133382268/Put/vlen=6}
keyvalues={row011/data:col1/1364133382268/Put/vlen=7, row011/url:col1/1364133382268/Put/vlen=6}
keyvalues={row012/data:col2/1364133382268/Put/vlen=7, row012/url:col2/1364133382268/Put/vlen=6}
keyvalues={row013/data:col3/1364133382268/Put/vlen=7, row013/url:col3/1364133382268/Put/vlen=6}
keyvalues={row014/data:col4/1364133382268/Put/vlen=7, row014/url:col4/1364133382268/Put/vlen=6}
keyvalues={row015/data:col5/1364133382268/Put/vlen=7, row015/url:col5/1364133382268/Put/vlen=6}
keyvalues={row016/data:col6/1364133382268/Put/vlen=7, row016/url:col6/1364133382268/Put/vlen=6}
keyvalues={row017/data:col7/1364133382268/Put/vlen=7, row017/url:col7/1364133382268/Put/vlen=6}
keyvalues={row018/data:col8/1364133382268/Put/vlen=7, row018/url:col8/1364133382268/Put/vlen=6}
keyvalues={row019/data:col9/1364133382268/Put/vlen=7, row019/url:col9/1364133382268/Put/vlen=6}&lt;/pre>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>hbase权威指南&lt;/p></description><category domain="https://fatkun.github.io/categories/hbase/">Hbase</category><category domain="https://fatkun.github.io/tags/filter/">Filter</category><category domain="https://fatkun.github.io/tags/hbase/">Hbase</category></item><item><title>android接收长短信处理逻辑</title><link>https://fatkun.github.io/2013/03/android-recive-sms-logic.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/03/android-recive-sms-logic.html</guid><pubDate>Sun, 10 Mar 2013 13:14:08 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>长短信会分割成多条发送过来，每一条头部会带上总共有多少条，和这是第几条。（具体的细节我也没太深究）&lt;br>
手机收到其中一条短信时，如果辨别出是长短信，则先把短信存储在raw表内(sqlite路径：/data/data/com.android.providers.telephony/databases/mmssms.db)&lt;br>
当收完全部短信时，就把raw表的相关内容删除，传播到其他程序处理
贴代码充数。。。。o(╯□╰)o&lt;br>
主要代码在SMSDispatcher.java里&lt;/p>
&lt;pre escaped="true" lang="java">/**
* If this is the last part send the parts out to the application, otherwise
* the part is stored for later processing. Handles both 3GPP concatenated messages
* as well as 3GPP2 format WAP push messages processed by
* {@link com.android.internal.telephony.cdma.CdmaSMSDispatcher#processCdmaWapPdu}.
*
* @param pdu the message PDU, or the datagram portion of a CDMA WDP datagram segment
* @param address the originating address
* @param referenceNumber distinguishes concatenated messages from the same sender
* @param sequenceNumber the order of this segment in the message
* (starting at 0 for CDMA WDP datagrams and 1 for concatenated messages).
* @param messageCount the number of segments in the message
* @param timestamp the service center timestamp in millis
* @param destPort the destination port for the message, or -1 for no destination port
* @param isCdmaWapPush true if pdu is a CDMA WDP datagram segment and not an SM PDU
*
* @return a result code from {@link Telephony.Sms.Intents}, or
* {@link Activity#RESULT_OK} if the message has been broadcast
* to applications
*/
protected int processMessagePart(byte[] pdu, String address, int referenceNumber,
int sequenceNumber, int messageCount, long timestamp, int destPort,
boolean isCdmaWapPush) {
byte[][] pdus = null;
Cursor cursor = null;
try {
// used by several query selection arguments
String refNumber = Integer.toString(referenceNumber);
String seqNumber = Integer.toString(sequenceNumber);
// Check for duplicate message segment 检查有没有重复的片段，有就忽略了
cursor = mResolver.query(mRawUri, PDU_PROJECTION,
"address=? AND reference_number=? AND sequence=?",
new String[] {address, refNumber, seqNumber}, null);
// moveToNext() returns false if no duplicates were found
if (cursor.moveToNext()) {
Log.w(TAG, "Discarding duplicate message segment from address=" + address
+ " refNumber=" + refNumber + " seqNumber=" + seqNumber);
String oldPduString = cursor.getString(PDU_COLUMN);
byte[] oldPdu = HexDump.hexStringToByteArray(oldPduString);
if (!Arrays.equals(oldPdu, pdu)) {
Log.e(TAG, "Warning: dup message segment PDU of length " + pdu.length
+ " is different from existing PDU of length " + oldPdu.length);
}
return Intents.RESULT_SMS_HANDLED;
}
cursor.close();
// not a dup, query for all other segments of this concatenated message
String where = "address=? AND reference_number=?";
String[] whereArgs = new String[] {address, refNumber};
cursor = mResolver.query(mRawUri, PDU_SEQUENCE_PORT_PROJECTION, where, whereArgs, null);
int cursorCount = cursor.getCount();
if (cursorCount != messageCount - 1) { //如果不是最后一条，就插入raw表
// We don't have all the parts yet, store this one away
ContentValues values = new ContentValues();
values.put("date", timestamp);
values.put("pdu", HexDump.toHexString(pdu));
values.put("address", address);
values.put("reference_number", referenceNumber);
values.put("count", messageCount);
values.put("sequence", sequenceNumber);
if (destPort != -1) {
values.put("destination_port", destPort);
}
mResolver.insert(mRawUri, values);
return Intents.RESULT_SMS_HANDLED;
}
// All the parts are in place, deal with them
pdus = new byte[messageCount][];
for (int i = 0; i &amp;lt; cursorCount; i++) {
cursor.moveToNext();
int cursorSequence = cursor.getInt(SEQUENCE_COLUMN);
// GSM sequence numbers start at 1; CDMA WDP datagram sequence numbers start at 0
if (!isCdmaWapPush) {
cursorSequence--;
}
pdus[cursorSequence] = HexDump.hexStringToByteArray(
cursor.getString(PDU_COLUMN));
// Read the destination port from the first segment (needed for CDMA WAP PDU).
// It's not a bad idea to prefer the port from the first segment for 3GPP as well.
if (cursorSequence == 0 &amp;&amp; !cursor.isNull(DESTINATION_PORT_COLUMN)) {
destPort = cursor.getInt(DESTINATION_PORT_COLUMN);
}
}
// This one isn't in the DB, so add it
// GSM sequence numbers start at 1; CDMA WDP datagram sequence numbers start at 0
if (isCdmaWapPush) {
pdus[sequenceNumber] = pdu;
} else {
pdus[sequenceNumber - 1] = pdu;
}
// Remove the parts from the database
mResolver.delete(mRawUri, where, whereArgs);
} catch (SQLException e) {
Log.e(TAG, "Can't access multipart SMS database", e);
return Intents.RESULT_SMS_GENERIC_ERROR;
} finally {
if (cursor != null) cursor.close();
}
// Special handling for CDMA WDP datagrams
if (isCdmaWapPush) {
// Build up the data stream
ByteArrayOutputStream output = new ByteArrayOutputStream();
for (int i = 0; i &amp;lt; messageCount; i++) {
// reassemble the (WSP-)pdu
output.write(pdus[i], 0, pdus[i].length);
}
byte[] datagram = output.toByteArray();
// Dispatch the PDU to applications
if (destPort == SmsHeader.PORT_WAP_PUSH) {
// Handle the PUSH
return mWapPush.dispatchWapPdu(datagram);
} else {
pdus = new byte[1][];
pdus[0] = datagram;
// The messages were sent to any other WAP port
dispatchPortAddressedPdus(pdus, destPort);
return Activity.RESULT_OK;
}
}
// Dispatch the PDUs to applications
if (destPort != -1) {
if (destPort == SmsHeader.PORT_WAP_PUSH) {
// Build up the data stream
ByteArrayOutputStream output = new ByteArrayOutputStream();
for (int i = 0; i &amp;lt; messageCount; i++) {
SmsMessage msg = SmsMessage.createFromPdu(pdus[i], getFormat());
byte[] data = msg.getUserData();
output.write(data, 0, data.length);
}
// Handle the PUSH
return mWapPush.dispatchWapPdu(output.toByteArray());
} else {
// The messages were sent to a port, so concoct a URI for it
dispatchPortAddressedPdus(pdus, destPort);
}
} else {
// The messages were not sent to a port
dispatchPdus(pdus);
}
return Activity.RESULT_OK;
}
/**
* Dispatches standard PDUs to interested applications
*
* @param pdus The raw PDUs making up the message
*/
protected void dispatchPdus(byte[][] pdus) {
Intent intent = new Intent(Intents.SMS_RECEIVED_ACTION);
intent.putExtra("pdus", pdus);
intent.putExtra("format", getFormat());
dispatch(intent, RECEIVE_SMS_PERMISSION);
}&lt;/pre>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://blog.csdn.net/tanghaibo001/article/details/7548727" target="_blank">Android MMS模块数据存取&lt;/a>&lt;br>
&lt;a href="http://yinger-fei.iteye.com/blog/1517613" target="_blank">android sms接收流程（ril分析）&lt;/a>&lt;br>
&lt;a href="http://minhdanh2002.blogspot.com/2012/02/raw-access-to-sms-database-on-android.html" title="Raw access to SMS/MMS database on Android phones" target="_blank">Raw access to SMS/MMS database on Android phones&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>安装android sdk提示找不到JDK解决方法</title><link>https://fatkun.github.io/2013/03/install-android-sdk-can-not-find-jdk.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/03/install-android-sdk-can-not-find-jdk.html</guid><pubDate>Sun, 10 Mar 2013 05:29:01 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>我的环境WIN7 64bit
win7可以使用mklink做软链&lt;/p>
&lt;pre escaped="true" lang="bash">Can also create symbolic link if you don't want to copy the files. (requires administrator privileges):
mklink C:\Windows\SysWOW64\java.exe C:\Windows\System32\java.exe
mklink C:\Windows\SysWOW64\javaw.exe C:\Windows\System32\javaw.exe&lt;/pre>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://stackoverflow.com/questions/4382178/android-sdk-installation-doesnt-find-jdk">http://stackoverflow.com/questions/4382178/android-sdk-installation-doesnt-find-jdk&lt;/a>&lt;br>
&lt;a href="http://android-er.blogspot.com/2011/02/android-sdk-cannot-detect-jdk.html">http://android-er.blogspot.com/2011/02/android-sdk-cannot-detect-jdk.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/sdk/">Sdk</category></item><item><title>codeigniter数据库错误信息获取</title><link>https://fatkun.github.io/2013/03/codeigniter-db-error-message.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/03/codeigniter-db-error-message.html</guid><pubDate>Fri, 01 Mar 2013 07:37:35 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>db_debug – TRUE/FALSE (boolean) – Whether database errors should be displayed.&lt;br>
需要设置db_debug = false&lt;/p>
&lt;pre escaped="true" lang="php">Yes, this is the mysql_error() wrapper.
$this-&amp;gt;db-&amp;gt;_error_message();
And the mysql_errno wrapper is:
$this-&amp;gt;db-&amp;gt;_error_number();&lt;/pre>
&lt;p>via:&lt;br>
&lt;a href="http://stackoverflow.com/questions/3234564/under-codeigniter-is-it-possible-to-see-mysql-error">http://stackoverflow.com/questions/3234564/under-codeigniter-is-it-possible-to-see-mysql-error&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/codeigniter/">Codeigniter</category><category domain="https://fatkun.github.io/tags/php/">Php</category></item><item><title>Hive – JOIN实现过程</title><link>https://fatkun.github.io/2013/01/hive-join.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/01/hive-join.html</guid><pubDate>Sun, 20 Jan 2013 15:12:31 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="准备数据">准备数据&lt;/h2>
&lt;p>语句&lt;br>
SELECT a.uid,a.name,b.age FROM logs a JOIN users b ON (a.uid=b.uid);&lt;br>
我们希望的结果是把users表join进来获取age字段。&lt;/p>
&lt;pre escaped="true" lang="sql">hive&amp;gt; select * from logs;
OK
a 苹果 5
a 橙子 3
b 烧鸡 1
hive&amp;gt; select * from users;
OK
a 23
b 21
hive&amp;gt; SELECT a.uid,a.name,b.age FROM logs a JOIN users b ON (a.uid=b.uid);
a 苹果 23
a 橙子 23
b 烧鸡 21&lt;/pre>
&lt;h2 id="计算过程">计算过程&lt;/h2>
&lt;p>&lt;a href="http://fatkun.com/2013/01/hive-join.html/hive-join-cal" rel="attachment wp-att-1339">&lt;img src="http://fatkun.com/wp-content/uploads/hive-join-cal.png" alt="hive-join-cal" width="682" height="242" class="alignnone size-full wp-image-1339" srcset="http://fatkun.com/wp-content/uploads/hive-join-cal.png 682w, http://fatkun.com/wp-content/uploads/hive-join-cal-300x106.png 300w" sizes="(max-width: 682px) 100vw, 682px" />&lt;/a>&lt;/p>
&lt;ol>
&lt;li>key这里后面的数字是tag，后面在reduce阶段用来区分来自于那个表的数据。tag是附属在key后面的。那为什么会把a(0)和a(1)汇集在一起了呢，是因为对先对a求了hashcode，设在了HiveKey上，所以同一个key还是在一起的。&lt;/li>
&lt;li>Map阶段只是拆分key和value。&lt;/li>
&lt;li>reduce阶段主要看它是如何把它合并起来了，从图上可以直观的看到，其实就是把tag=1的内容，都加到tag=0的后面，就是这么简单。&lt;/li>
&lt;li>代码实现上，就是先临时用个变量把值存储起来在storage里面, storage(0) = [{a, 苹果}, {a, 橙子}] storage(1) = [{23}]，当key变化（如a变为b）或全部结束时，会调用endGroup()方法，把内容合并起来。变成[{a,苹果,23}, {a, 橙子,23}]&lt;/li>
&lt;/ol>
&lt;h2 id="operator">Operator&lt;/h2>
&lt;p>&lt;a href="http://fatkun.com/2013/01/hive-join.html/hive-join-op" rel="attachment wp-att-1340">&lt;img src="http://fatkun.com/wp-content/uploads/hive-join-op.png" alt="hive-join-op" width="449" height="400" class="alignnone size-full wp-image-1340" srcset="http://fatkun.com/wp-content/uploads/hive-join-op.png 449w, http://fatkun.com/wp-content/uploads/hive-join-op-300x267.png 300w" sizes="(max-width: 449px) 100vw, 449px" />&lt;/a>&lt;/p>
&lt;h2 id="explain">Explain&lt;/h2>
&lt;pre escaped="true" lang="java">hive&amp;gt; explain SELECT a.uid,a.name,b.age FROM logs a JOIN users b ON (a.uid=b.uid);
OK
//语法树
ABSTRACT SYNTAX TREE:
(TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF (TOK_TABNAME logs) a) (TOK_TABREF (TOK_TABNAME users) b) (= (. (TOK_TABLE_OR_COL a) uid) (. (TOK_TABLE_OR_COL b) uid)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) uid)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL a) name)) (TOK_SELEXPR (. (TOK_TABLE_OR_COL b) age)))))
//阶段
STAGE DEPENDENCIES:
Stage-1 is a root stage
Stage-0 is a root stage
STAGE PLANS:
Stage: Stage-1
Map Reduce
Alias -&amp;gt; Map Operator Tree: //mapper阶段
a
TableScan //扫描表, 就只是一行一行的传递下去而已
alias: a
Reduce Output Operator //输出给reduce的内容
key expressions: // key啦，这里的key是uid，就是我们写在ON子句那个，你可以试试加多几个条件
expr: uid
type: string
sort order: + //排序
Map-reduce partition columns://分区字段，貌似是和key一样的
expr: uid
type: string
tag: 0 //用来区分这个key是来自哪个表的
value expressions: //reduce用到的value字段
expr: uid
type: string
expr: name
type: string
b
TableScan //扫描表, 就只是一行一行的传递下去而已
alias: b
Reduce Output Operator //输出给reduce的内容
key expressions: //key
expr: uid
type: string
sort order: +
Map-reduce partition columns: //分区字段
expr: uid
type: string
tag: 1 //用来区分这个key是来自哪个表的
value expressions: //值
expr: age
type: int
Reduce Operator Tree: // reduce阶段
Join Operator // JOIN的Operator
condition map:
Inner Join 0 to 1 // 内连接0和1表
condition expressions: // 第0个表有两个字段，分别是uid和name, 第1个表有一个字段age
0 {VALUE._col0} {VALUE._col1}
1 {VALUE._col1}
handleSkewJoin: false //是否处理倾斜join，如果是，会分为两个MR任务
outputColumnNames: _col0, _col1, _col6 //输出字段
Select Operator //列裁剪（我们sql写的select字段）
expressions:
expr: _col0
type: string
expr: _col1
type: string
expr: _col6
type: int
outputColumnNames: _col0, _col1, _col2
File Output Operator //把结果输出到文件
compressed: false
GlobalTableId: 0
table:
input format: org.apache.hadoop.mapred.TextInputFormat
output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
Stage: Stage-0
Fetch Operator
limit: -1&lt;/pre>
&lt;p>可以看到里面都是一个个Operator顺序的执行下来&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/join/">Join</category><category domain="https://fatkun.github.io/tags/%E8%AE%A1%E7%AE%97%E8%BF%87%E7%A8%8B/">计算过程</category></item><item><title>Hive – Group By 的实现</title><link>https://fatkun.github.io/2013/01/hive-group-by.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/01/hive-group-by.html</guid><pubDate>Sun, 20 Jan 2013 14:53:23 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="准备数据">准备数据&lt;/h2>
&lt;pre escaped="true" lang="sql">SELECT uid, sum(count) FROM logs group by uid;&lt;/pre>
&lt;pre escaped="true" lang="sql">hive&amp;gt; select * from logs;
a 苹果 5
a 橙子 3
a 苹果 2
b 烧鸡 1
hive&amp;gt; SELECT uid, sum(count) FROM logs group by uid;
a 10
b 1&lt;/pre>
&lt;h2 id="计算过程">计算过程&lt;/h2>
&lt;p>&lt;a href="http://fatkun.com/2013/01/hive-group-by.html/hive-groupby-cal" rel="attachment wp-att-1333">&lt;img src="http://fatkun.com/wp-content/uploads/hive-groupby-cal.jpg" alt="hive-groupby-cal" width="643" height="227" class="alignnone size-full wp-image-1333" srcset="http://fatkun.com/wp-content/uploads/hive-groupby-cal.jpg 643w, http://fatkun.com/wp-content/uploads/hive-groupby-cal-300x105.jpg 300w" sizes="(max-width: 643px) 100vw, 643px" />&lt;/a>&lt;br>
默认设置了hive.map.aggr=true，所以会在mapper端先group by一次，最后再把结果merge起来，为了减少reducer处理的数据量。注意看explain的mode是不一样的。mapper是hash，reducer是mergepartial。如果把hive.map.aggr=false，那将groupby放到reducer才做，他的mode是complete.&lt;/p>
&lt;h2 id="operator">Operator&lt;/h2>
&lt;p>&lt;a href="http://fatkun.com/2013/01/hive-group-by.html/hive-groupby-op" rel="attachment wp-att-1334">&lt;img src="http://fatkun.com/wp-content/uploads/hive-groupby-op.png" alt="hive-groupby-op" width="439" height="555" class="alignnone size-full wp-image-1334" srcset="http://fatkun.com/wp-content/uploads/hive-groupby-op.png 439w, http://fatkun.com/wp-content/uploads/hive-groupby-op-237x300.png 237w" sizes="(max-width: 439px) 100vw, 439px" />&lt;/a>&lt;/p>
&lt;h2 id="explain">Explain&lt;/h2>
&lt;pre escaped="true" lang="java">hive&amp;gt; explain SELECT uid, sum(count) FROM logs group by uid;
OK
ABSTRACT SYNTAX TREE:
(TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME logs))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL uid)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_TABLE_OR_COL count)))) (TOK_GROUPBY (TOK_TABLE_OR_COL uid))))
STAGE DEPENDENCIES:
Stage-1 is a root stage
Stage-0 is a root stage
STAGE PLANS:
Stage: Stage-1
Map Reduce
Alias -&amp;gt; Map Operator Tree:
logs
TableScan // 扫描表
alias: logs
Select Operator //选择字段
expressions:
expr: uid
type: string
expr: count
type: int
outputColumnNames: uid, count
Group By Operator //这里是因为默认设置了hive.map.aggr=true，会在mapper先做一次聚合，减少reduce需要处理的数据
aggregations:
expr: sum(count) //聚集函数
bucketGroup: false
keys: //键
expr: uid
type: string
mode: hash //hash方式，processHashAggr()
outputColumnNames: _col0, _col1
Reduce Output Operator //输出key，value给reducer
key expressions:
expr: _col0
type: string
sort order: +
Map-reduce partition columns:
expr: _col0
type: string
tag: -1
value expressions:
expr: _col1
type: bigint
Reduce Operator Tree:
Group By Operator
aggregations:
expr: sum(VALUE._col0)
//聚合
bucketGroup: false
keys:
expr: KEY._col0
type: string
mode: mergepartial //合并值
outputColumnNames: _col0, _col1
Select Operator //选择字段
expressions:
expr: _col0
type: string
expr: _col1
type: bigint
outputColumnNames: _col0, _col1
File Output Operator //输出到文件
compressed: false
GlobalTableId: 0
table:
input format: org.apache.hadoop.mapred.TextInputFormat
output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
Stage: Stage-0
Fetch Operator
limit: -1
&lt;/pre></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/group-by/">Group By</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/mapreduce/">Mapreduce</category><category domain="https://fatkun.github.io/tags/%E8%AE%A1%E7%AE%97%E8%BF%87%E7%A8%8B/">计算过程</category></item><item><title>Hive – Distinct 的实现</title><link>https://fatkun.github.io/2013/01/hive-distinct.html</link><guid isPermaLink="true">https://fatkun.github.io/2013/01/hive-distinct.html</guid><pubDate>Sun, 20 Jan 2013 14:34:13 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="准备数据">准备数据&lt;/h2>
&lt;p>语句&lt;/p>
&lt;pre escaped="true" lang="sql">select count, count(distinct uid) from logs group by count;&lt;/pre>
&lt;pre escaped="true" lang="sql">hive&amp;gt; select * from logs;
OK
a 苹果 3
a 橙子 3
a 烧鸡 1
b 烧鸡 3
hive&amp;gt; select count, count(distinct uid) from logs group by count;
1 1
3 2&lt;/pre>
&lt;p>根据count分组，计算独立用户数。&lt;/p>
&lt;h2 id="计算过程">计算过程&lt;/h2>
&lt;p>&lt;a href="http://fatkun.com/2013/01/hive-distinct.html/hive-distinct-cal" rel="attachment wp-att-1324">&lt;img src="http://fatkun.com/wp-content/uploads/hive-distinct-cal.jpg" alt="hive-distinct-cal" width="633" height="229" class="alignnone size-full wp-image-1324" srcset="http://fatkun.com/wp-content/uploads/hive-distinct-cal.jpg 633w, http://fatkun.com/wp-content/uploads/hive-distinct-cal-300x108.jpg 300w" sizes="(max-width: 633px) 100vw, 633px" />&lt;/a>&lt;/p>
&lt;ol>
&lt;li>第一步先在mapper计算部分值，会以count和uid作为key，如果是distinct并且之前已经出现过，则忽略这条计算。第一步是以&amp;lt;count, uid&amp;gt;组合为key，第二步是以count为key.&lt;/li>
&lt;li>ReduceSink是在mapper.close()时才执行的，在GroupByOperator.close()时，把结果输出。注意这里虽然key是count和uid，但是在reduce时分区是按count来的！&lt;/li>
&lt;li>第一步的distinct计算的值没用，要留到reduce计算的才准确。这里只是减少了key组合相同的行。不过如果是普通的count，后面是会合并起来的。&lt;/li>
&lt;li>distinct通过比较lastInvoke判断要不要+1（因为在reduce是排序过了的，所以判断distict的字段变了没有，如果没变，则不+1）&lt;/li>
&lt;/ol>
&lt;h2 id="operator">Operator&lt;/h2>
&lt;p>&lt;a href="http://fatkun.com/2013/01/hive-distinct.html/hive-distinct-op" rel="attachment wp-att-1325">&lt;img src="http://fatkun.com/wp-content/uploads/hive-distinct-op.png" alt="hive-distinct-op" width="347" height="467" class="alignnone size-full wp-image-1325" srcset="http://fatkun.com/wp-content/uploads/hive-distinct-op.png 347w, http://fatkun.com/wp-content/uploads/hive-distinct-op-222x300.png 222w" sizes="(max-width: 347px) 100vw, 347px" />&lt;/a>&lt;/p>
&lt;h2 id="explain">Explain&lt;/h2>
&lt;pre escaped="true" lang="java">hive&amp;gt; explain select count, count(distinct uid) from logs group by count;
OK
ABSTRACT SYNTAX TREE:
(TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME logs))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL count)) (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_TABLE_OR_COL uid)))) (TOK_GROUPBY (TOK_TABLE_OR_COL count))))
STAGE DEPENDENCIES:
Stage-1 is a root stage
Stage-0 is a root stage
STAGE PLANS:
Stage: Stage-1
Map Reduce
Alias -&amp;gt; Map Operator Tree:
logs
TableScan //表扫描
alias: logs
Select Operator//列裁剪，取出uid，count字段就够了
expressions:
expr: count
type: int
expr: uid
type: string
outputColumnNames: count, uid
Group By Operator //先来map聚集
aggregations:
expr: count(DISTINCT uid) //聚集表达式
bucketGroup: false
keys:
expr: count
type: int
expr: uid
type: string
mode: hash //hash方式
outputColumnNames: _col0, _col1, _col2
Reduce Output Operator
key expressions: //输出的键
expr: _col0 //count
type: int
expr: _col1 //uid
type: string
sort order: ++
Map-reduce partition columns: //这里是按group by的字段分区的
expr: _col0 //这里表示count
type: int
tag: -1
value expressions:
expr: _col2
type: bigint
Reduce Operator Tree:
Group By Operator //第二次聚集
aggregations:
expr: count(DISTINCT KEY._col1:0._col0) //uid:count
bucketGroup: false
keys:
expr: KEY._col0 //count
type: int
mode: mergepartial //合并
outputColumnNames: _col0, _col1
Select Operator //列裁剪
expressions:
expr: _col0
type: int
expr: _col1
type: bigint
outputColumnNames: _col0, _col1
File Output Operator //输出结果到文件
compressed: false
GlobalTableId: 0
table:
input format: org.apache.hadoop.mapred.TextInputFormat
output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
Stage: Stage-0
Fetch Operator
limit: -1
&lt;/pre></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/distinct/">Distinct</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category></item><item><title>python嵌套作用域问题</title><link>https://fatkun.github.io/2012/12/python-nested-scopes.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/12/python-nested-scopes.html</guid><pubDate>Thu, 27 Dec 2012 16:28:02 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>之前都不太理解这个。。。&lt;/p>
&lt;blockquote>
&lt;p>在Python中，使用一个变量之前不必预先声明它，但是在真正使用它之前，它必须已经绑定到某个对象；而名字绑定将在当前作用域中引入新的变量，同时屏蔽外层作用域中的同名变量，不论这个名字绑定发生在当前作用域中的哪个位置。
 &lt;/p>
&lt;/blockquote>
&lt;h2 id="代码一">代码一&lt;/h2>
&lt;pre lang="python">i = 6
def f():
def g():
print i # 返回10
i = 10 # 会绑定在f函数上
g()
f()
&lt;/pre>
&lt;p>在f函数里，i有个赋值操作，所以全局变量i=6被屏蔽掉了。i绑定后，执行g函数，g函数会有f函数的作用域（？？），打印的i值=10&lt;/p>
&lt;h2 id="代码二">代码二&lt;/h2>
&lt;pre lang="python">i = 6
def f():
def g():
print i # NameError: free variable 'i' referenced before assignment in enclosing scope
g()
i = 10
f()
&lt;/pre>
&lt;p>把位置换了一下,i赋值在g函数的后面。print的时候就抛异常NameError了。&lt;br>
由于f函数中有一个同名的i参数赋值，会把外层的全局变量i给屏蔽掉（不管这个赋值在f函数的什么地方，都会先屏蔽掉上层的同名变量），但由于还没有绑定值就先执行g函数了，所以抛出异常。&lt;/p>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>&lt;a href="http://www.cnblogs.com/frydsh/archive/2012/08/12/2602100.html">http://www.cnblogs.com/frydsh/archive/2012/08/12/2602100.html&lt;/a>&lt;br>
&lt;a href="http://www.python.org/dev/peps/pep-0227/">http://www.python.org/dev/peps/pep-0227/&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/python/">Python</category><category domain="https://fatkun.github.io/tags/%E4%BD%9C%E7%94%A8%E5%9F%9F/">作用域</category><category domain="https://fatkun.github.io/tags/%E5%B5%8C%E5%A5%97%E4%BD%9C%E7%94%A8%E5%9F%9F/">嵌套作用域</category></item><item><title>Extjs3.x带搜索的下拉多选框</title><link>https://fatkun.github.io/2012/12/extjs3-x-mulitcombo.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/12/extjs3-x-mulitcombo.html</guid><pubDate>Sat, 22 Dec 2012 14:44:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;img src="http://image.fatkun.com/blog/ext_combo.png" alt="">
修改自deebugger：https://github.com/deebugger/Ext.ux.form.ExtendedComboBox&lt;br>
修复了一些bug和加入预先过滤功能、延迟搜索。
把例子放入extjs3.x的目录下，就可以看到了&lt;br>
例子下载：&lt;a href="http://pan.baidu.com/share/link?shareid=169034&amp;#038;uk=1879467717&amp;#038;third=0" title="点此下载" target="_blank">点此下载&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/jquery/">Jquery</category><category domain="https://fatkun.github.io/tags/extjs/">Extjs</category><category domain="https://fatkun.github.io/tags/%E4%B8%8B%E6%8B%89%E6%A1%86/">下拉框</category><category domain="https://fatkun.github.io/tags/%E5%A4%9A%E9%80%89%E6%A1%86/">多选框</category></item><item><title>Ext.util.DelayedTask很好用</title><link>https://fatkun.github.io/2012/12/ext-util-delayedtask.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/12/ext-util-delayedtask.html</guid><pubDate>Sat, 22 Dec 2012 11:51:27 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Ext3.x有个这个类Ext.util.DelayedTask，&lt;br>
实现好简单。。做个定时器，如果还没执行又被触发就取消上一个定时器。。&lt;br>
应用场景在于想要延迟搜索，触发了keyup事件，但如果连续输入了N个字母，可不希望过滤N次，只需要过滤一次就够了。&lt;br>
可以在new的时候指定scope&lt;/p>
&lt;pre escaped="true" lang="js">var task = new Ext.util.DelayedTask(function(){
alert(Ext.getDom('myInputField').value.length);
});
Ext.get('myInputField').on('keypress', function(){
task.delay(500);
});
&lt;/pre></description><category domain="https://fatkun.github.io/categories/jquery/">Jquery</category><category domain="https://fatkun.github.io/tags/extjs/">Extjs</category><category domain="https://fatkun.github.io/tags/extjs3.x/">Extjs3.x</category></item><item><title>使用jsduck生成extjs3.x的代码</title><link>https://fatkun.github.io/2012/12/jsduck-generate-extjs3-api.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/12/jsduck-generate-extjs3-api.html</guid><pubDate>Tue, 18 Dec 2012 15:54:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>直接按说明的命令会出错&lt;br>
Error: Error while parsing /root/PROJECTS/foundation-ui/src/main/webapp/scripts/ext/src/ext-core/src/adapter/ext-base-begin.js: Line 18: Unexpected end of input&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>&lt;code>jsduck ext-3.4.0/src/{core,data,dd,direct,ext-core/src/core,ext-core/src/data,ext-core/src/util,state,widgets} --output api&lt;/code>
来源：http://www.sencha.com/forum/showthread.php?151739-JSDuck-the-tool-for-documenting-your-Ext-JS-apps&amp;amp;p=870848&amp;amp;viewfull=1#post870848&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/extjs/">Extjs</category></item><item><title>解决M2Crypto报错ImportError: DLL load failed</title><link>https://fatkun.github.io/2012/12/m2crypto-install-error.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/12/m2crypto-install-error.html</guid><pubDate>Mon, 17 Dec 2012 06:13:22 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="提示这个错误">提示这个错误&lt;/h2>
&lt;blockquote>
&lt;blockquote>
&lt;blockquote>
&lt;p>import M2Crypto&lt;br>
Traceback (most recent call last):&lt;br>
File “&lt;stdin>“, line 1, in &lt;module>&lt;br>
File “C:\PYTHON26\lib\site-packages\M2Crypto__init__.py”, line 22, in &lt;module >&lt;br>
import __m2crypto&lt;br>
ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。&lt;/p>
&lt;/blockquote>
&lt;/blockquote>
&lt;/blockquote>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>需要安装win32OpenSSL
&lt;a href="http://slproweb.com/products/Win32OpenSSL.html">http://slproweb.com/products/Win32OpenSSL.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>Hive内容包含有\001会当成分割符</title><link>https://fatkun.github.io/2012/10/hive-seprator.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/10/hive-seprator.html</guid><pubDate>Sun, 21 Oct 2012 14:45:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="起因">起因&lt;/h2>
&lt;p>发现某一行一列数据多了一个\001字符，导致select的时候在这一列后面的结果都不正确。&lt;/p>
&lt;h2 id="重现">重现&lt;/h2>
&lt;p>hive版本：0.7.1cdh3u4&lt;/p>
&lt;pre lang="sql" escaped="true"># 建表语句
create table test ( sn string, pv int) ROW FORMAT DELIMITED FIELDS TERMINATED BY '`';
# 在另一个窗口构造一个错误数据文件
printf "a\001`12" &amp;gt; /tmp/test.txt
# 把数据load进表里
LOAD DATA LOCAL INPATH '/tmp/test.txt' OVERWRITE INTO TABLE test;&lt;/pre>
&lt;p>这里指定了字段的分割符为反引号（`），后来发现中途并不是全部用这个分割字段。&lt;br>
这时如果查询&lt;/p>
&lt;pre lang="sql" escaped="true">select sn,pv from test;&lt;/pre>
&lt;p>返回的值居然是a NULL，而不是 a 12&lt;/p>
&lt;h2 id="原因">原因&lt;/h2>
&lt;p>这条语句（select sn,pv from test;）会有三个Opertor，分别是TableScanOperator, SelectOperator, FileSinkOperator。FileSinkOperator是负责把结果输出到文件，输出前需要把对象做一次序列化存储到文件里。&lt;/p>
&lt;pre escaped="true" lang="java">//FileSinkOperator.java文件
@Override
public void processOp(Object row, int tag) throws HiveException {
...
// use SerDe to serialize r, and write it out
recordValue = serializer.serialize(row, inputObjInspectors[0]);
...
}&lt;/pre>
&lt;p>这里的row是由它的父Operator（SelectOperator）传入的，值是一个数组，暂且用row = [a\001, 12]表示(实际上这里面还包裹一些对象，但不妨碍分析)。&lt;br>
单步跟进后，发现recordValue返回的值是a\001\00112，这里的serializer用的分割符号是\001，所以现在变成了两个\001。&lt;br>
那么，这个serializer哪里来的？&lt;/p>
&lt;pre escaped="true" lang="java">//FileSinkOperator.java文件
serializer = (Serializer) conf.getTableInfo().getDeserializerClass().newInstance();
serializer.initialize(null, conf.getTableInfo().getProperties());&lt;/pre>
&lt;p>conf.getTableInfo()返回的是一个TableDesc，这个是在编译阶段genFileSinkPlan()构造的。&lt;/p>
&lt;pre escaped="true" lang="java">// SemanticAnalyzer.java
private Operator genFileSinkPlan(String dest, QB qb, Operator input)
throws SemanticException {
...
CreateTableDesc tblDesc = qb.getTableDesc(); //到qb里面找
...
if (tblDesc == null) {
if (qb.getIsQuery()) {
String fileFormat = HiveConf.getVar(conf, HiveConf.ConfVars.HIVEQUERYRESULTFILEFORMAT);
table_desc = PlanUtils.getDefaultQueryOutputTableDesc(cols, colTypes, fileFormat);
} else {
table_desc = PlanUtils.getDefaultTableDesc(Integer
.toString(Utilities.ctrlaCode), cols, colTypes, false);
}
} else {
table_desc = PlanUtils.getTableDesc(tblDesc, cols, colTypes);
}
...
}&lt;/pre>
&lt;p>发现在SemanticAnalyzer.java文件里，只有在CTAS的语句才会调用qb.setTableDesc()，所以这里tblDesc没有值，它自己用默认值创建了一个。PlanUtils.getDefaultQueryOutputTableDesc(cols, colTypes, fileFormat);分割符是Utilities.ctrlaCode，也就是\001
目前还没搞明白为什么分割符这么混乱。但可以知道为什么第二列本来应该返回数字却返回了null，是这里的分割符号是\001，那么就多了一列出来。&lt;/p>
&lt;h2 id="结论">结论&lt;/h2>
&lt;p>就算你指定了分割符（FIELDS TERMINATED BY），但hive在中间交换数据时仍然使用它默认的分割符号\001-\009，暂时只想到在数据中过滤这些字符了，还不了解hive的序列化\反序列化。&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/seprator/">Seprator</category><category domain="https://fatkun.github.io/tags/%E5%88%86%E5%89%B2%E7%AC%A6/">分割符</category></item><item><title>使用eclipse调试hive mapreduce</title><link>https://fatkun.github.io/2012/10/debug-hive-mapreduce-with-eclipse.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/10/debug-hive-mapreduce-with-eclipse.html</guid><pubDate>Sun, 21 Oct 2012 12:12:35 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>我们知道Hive经过一些转换后，提交job到hadoop，一般我们只能debug到submitJob这里，而不知道后面那些mapper到底是怎样执行的。如果想要跟踪一下像SelectOperator是怎么处理的怎样做呢？&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;h3 id="使用local模式运行">使用local模式运行&lt;/h3>
&lt;p>确保配置hive-site.xml中mapred.job.tracker设为local&lt;/p>
&lt;pre lang="xml" escaped="true">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;mapred.job.tracker&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;local&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre>
&lt;p>在hadoop的mapred-site.xml也有mapred.job.tracker配置，我这里也设为了local（不确定是否可以不设置）&lt;br>
如果设为local，系统会调用命令的方式运行&lt;/p>
&lt;pre lang="java" escaped="true">//MapRedTask.java
public int execute(DriverContext driverContext) {
//....
// Run ExecDriver in another JVM
executor = Runtime.getRuntime().exec(cmdLine, env, new File(workDir));
//....
}&lt;/pre>
&lt;p>上面的代码会最终调用这样的命令&lt;/p>
&lt;pre lang="bash" escaped="true">/home/fatkun/hadoop/bin/hadoop jar /home/fatkun/local/hive-0.7.1-cdh3u4/lib/hive-exec-0.7.1-cdh3u4.jar org.apache.hadoop.hive.ql.exec.ExecDriver -plan file:/tmp/fatkun/hive_2012-10-21_19-55-58_644_8079645408059698793/-local-10002/plan.xml -jobconf ...&lt;/pre>
&lt;p>如果这里提示找不到null/bin/hadoop，是环境变量HADOOP_HOME读取不到的原因，在eclipse的debug environment加上一个HADOOP_HOME配置。(&lt;a href="http://blog.csdn.net/liwei_1988/article/details/7311691" target="_blank">这里有图&lt;/a>)&lt;/p>
&lt;h3 id="远程-debug-hadoop">远程 debug hadoop&lt;/h3>
&lt;p>其实貌似不像远程debug，都是在本地进行的，我们知道上面是通过hadoop jar运行的。拷贝%HADOOP_HOME%/bin/hadoop一个备份出来，然后修改这个文件。&lt;/p>
&lt;pre lang="bash" escaped="true"># 找到jar这一行
elif [ "$COMMAND" = "jar" ] ; then
CLASS=org.apache.hadoop.util.RunJar
# 加上下面这一行代码用于调试，6666是端口
HADOOP_OPTS="$HADOOP_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=6666,server=y,suspend=y"
HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS"&lt;/pre>
&lt;p>这样，每次调用hadoop jar这个命令时，就会等着eclipse调试了。&lt;br>
eclipse在Debug configuration配置一个Remote Java Application，端口填6666就可以开始调试了。&lt;br>
&lt;a href="http://www.lifeba.org/arch/hadoop_debug.html" target="_blank">hadoop调试的更多信息点击这里&lt;br /> &lt;/a>这样就可以在ExecMapper.java下断点调试了。&lt;/p>
&lt;h3 id="远程-debug-hadoop-2">远程 debug hadoop 2&lt;/h3>
&lt;ol>
&lt;li>以debug模式启动Cli，${HIVE_HOME}/bin/hive –debug。进程会监听在8000端口等待调试连接。如果想更改监听端口，可以修改配置文件:${HIVE_HOME}bin/ext/debug.sh 。&lt;/p>&lt;/li>
&lt;li>在Eclipse中, 选择Debug configurations-&amp;gt;Remote Java Application，填好Host和Port，确定。&lt;/li>
&lt;li>如果Hadoop是0.23以上版本，debug模式启动Cli会报错：ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.。打开${Hadoop_HOME}/bin/hadoop，注释掉HADOOP_OPTS=”$HADOOP_OPTS $HADOOP_CLIENT_OPTS”即可。
注1：https://issues.apache.org/jira/browse/HIVE-2500
&lt;a href="http://long-xie.iteye.com/blog/1779072">http://long-xie.iteye.com/blog/1779072&lt;/a>
 
在yarn中单步调试时使用local job
SET mapred.job.tracker=local;
SET hive.exec.mode.local.auto=true;
SET fs.defaultFS=file:///; &lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/debug/">Debug</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category></item><item><title>JAVA反射(Reflect)的使用</title><link>https://fatkun.github.io/2012/10/java-reflect.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/10/java-reflect.html</guid><pubDate>Sun, 07 Oct 2012 15:59:52 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="反射方法method">反射方法Method&lt;/h2>
&lt;p>getDeclaredMethod是获取该类声明的方法，不包括继承的。&lt;/p>
&lt;blockquote>
&lt;p>Method getDeclaredMethod(String name, Class… parameterTypes)&lt;br>
返回一个 Method 对象，该对象反映此 Class 对象所表示的类或接口的指定已声明方法。
还有一个getMethod是只能获取public的方法
getMethod(String name, Class… parameterTypes)&lt;br>
返回一个 Method 对象，它反映此 Class 对象所表示的类或接口的指定公共成员方法。
name参数是方法名；parameterTypes 参数是按声明顺序标识该方法形参类型的 Class 对象的一个数组&lt;br>
如：&lt;/p>
&lt;/blockquote>
&lt;pre lang="html" escaped="true">LogFactory.class.getDeclaredMethod("functionName",new Class[]{String.class,int.class})&lt;/pre>
&lt;p>如果方法没有参数，提供null或者省略都可以。&lt;br>
method.invoke中，invoke(Object obj, Object… args) ，obj是对象，如果是静态方法，填入null；args参数是一个Object对象数组，如 new Object[] {“test”, new Integer(10)}
下面的例子是想要反射common logging 包里的LogFactory getContextClassLoader方法。这是一个private static方法&lt;/p>
&lt;pre lang="java" escaped="true">Method method = LogFactory.class.getDeclaredMethod("getContextClassLoader");
method.setAccessible(true); // 如果是private的方法，要把它设为可访问
ClassLoader classLoader = (ClassLoader)method.invoke(null);&lt;/pre>
&lt;h2 id="反射属性field">反射属性Field&lt;/h2>
&lt;p>和method差不多，也有getDeclaredField和getField方法。&lt;br>
可以通过field.get来获取值，参数是你要获取的是哪个对象的属性。如果是静态变量，填入null&lt;br>
另外可以通过field.set来赋值。&lt;/p>
&lt;pre lang="java" escaped="true">Field field = LogFactory.class.getDeclaredField("factories");
field.setAccessible(true);
Hashtable obj = (Hashtable)field.get(null);&lt;/pre>
&lt;h2 id="例子">例子&lt;/h2>
&lt;p>在SesstionState里有一个ThreadLocal的pravate tss变量，我们要取到这个变量，并且调用它的remove方法。注意：ThreadLocal的对象是在每个线程都存有一个map，把值存在那里，所以，必须和原线程一致才能取到他的值。&lt;/p>
&lt;pre lang="java" escaped="true">// SessionState里有一个private static的tss局部变量
Class clazz = SessionState.class;
Field field = clazz.getDeclaredField("tss"); // 由于是private的，不能通过getField获取
field.setAccessible(true); // 设为可访问
ThreadLocal threadLocal = (ThreadLocal)field.get(sessionState);// 通过field.get(对象) 获取它的值
threadLocal.remove();&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java/">JAVA</category><category domain="https://fatkun.github.io/tags/reflect/">Reflect</category><category domain="https://fatkun.github.io/tags/threadlocal/">ThreadLocal</category></item><item><title>python安装pywin32出现DLL load failed的解决办法</title><link>https://fatkun.github.io/2012/09/python-pywin32-dll-load-failed.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/09/python-pywin32-dll-load-failed.html</guid><pubDate>Fri, 21 Sep 2012 05:46:22 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在cmd执行python c:/Python26/Scripts/pywin32_postinstall.py -install
我的python目录是python2.6
 
来源：&lt;a href="http://stackoverflow.com/questions/6379195/dll-load-errors-in-python-executable-made-from-pywin32">http://stackoverflow.com/questions/6379195/dll-load-errors-in-python-executable-made-from-pywin32&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/python/">Python</category></item><item><title>mysql kill process解决死锁</title><link>https://fatkun.github.io/2012/09/mysql-kill-process.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/09/mysql-kill-process.html</guid><pubDate>Thu, 06 Sep 2012 06:11:56 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>主要是两个命令：&lt;/p>
&lt;pre escaped="true" lang="html">show processlist;
和
kill id,id...;&lt;/pre>
&lt;p>版权声明：转载时请以超链接形式标明文章原始出处和作者信息及本声明&lt;br>
来源：http://ri0day.blogbus.com/logs/59186177.html
mysql使用myisam的时候锁表比较多，尤其有慢查询的时候，造成死锁.这时需要手动kill掉locked的process.使他释放.
(以前我都是重起服务)..惭愧啊..
演示:(id 7是我用python 来连过来的一个会话,虽然是状态是sleep,为了演示，干掉他)&lt;/p>
&lt;pre escaped="true" lang="sql">mysql&amp;gt; show processlist;
+----+------+-----------+------+---------+------+-------+------------------+
&amp;brvbar; Id &amp;brvbar; User &amp;brvbar; Host &amp;brvbar; db &amp;brvbar; Command &amp;brvbar; Time &amp;brvbar; State &amp;brvbar; Info &amp;brvbar;
+----+------+-----------+------+---------+------+-------+------------------+
&amp;brvbar; 7 &amp;brvbar; root &amp;brvbar; localhost &amp;brvbar; yy &amp;brvbar; Sleep &amp;brvbar; 154 &amp;brvbar; &amp;brvbar; NULL &amp;brvbar;
&amp;brvbar; 8 &amp;brvbar; root &amp;brvbar; localhost &amp;brvbar; NULL &amp;brvbar; Query &amp;brvbar; 0 &amp;brvbar; NULL &amp;brvbar; show processlist &amp;brvbar;
+----+------+-----------+------+---------+------+-------+------------------+
2 rows in set (0.00 sec)
mysql&amp;gt; kill 7
-&amp;gt; ;
mysql&amp;gt; show processlist;
+----+------+-----------+------+---------+------+-------+------------------+
&amp;brvbar; Id &amp;brvbar; User &amp;brvbar; Host &amp;brvbar; db &amp;brvbar; Command &amp;brvbar; Time &amp;brvbar; State &amp;brvbar; Info &amp;brvbar;
+----+------+-----------+------+---------+------+-------+------------------+
&amp;brvbar; 8 &amp;brvbar; root &amp;brvbar; localhost &amp;brvbar; NULL &amp;brvbar; Query &amp;brvbar; 0 &amp;brvbar; NULL &amp;brvbar; show processlist &amp;brvbar;
+----+------+-----------+------+---------+------+-------+------------------+
1 row in set (0.00 sec)&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>Fatkun批量下载图片扩展已经在chrome webstore上线</title><link>https://fatkun.github.io/2012/08/fatkun-batch-download-picture-on-chrome-webstore.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/08/fatkun-batch-download-picture-on-chrome-webstore.html</guid><pubDate>Tue, 14 Aug 2012 17:16:46 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>非常感谢(此处应要求匿名)的大力支持~！！帮忙支付了webstore的验证费用！！帮了大忙。。
暂时上线的还是当前版本。。。。之后再做一个更新。。如果喜欢这个扩展，给好评哦，亲~
&lt;a href="https://chrome.google.com/webstore/detail/%E6%89%B9%E9%87%8F%E4%B8%8B%E8%BD%BD%E5%9B%BE%E7%89%87/nnjjahlikiabnchcpehcpkdeckfgnohf" title="围观地址" target="_blank">点此去围观&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/chrome/">Chrome</category></item><item><title>鉴于有些人说图片下载扩展的图标太难看，求图标</title><link>https://fatkun.github.io/2012/07/ask-for-icon.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/07/ask-for-icon.html</guid><pubDate>Mon, 30 Jul 2012 15:41:21 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>目前这个扩展是我用photoshop叠加了几个图片做出来的，自我感觉没那么难看啊。。
主要表达下载图片的意思。。你觉得呢？
另外，喜欢这个扩展的人有设计师么，或者身边有设计师朋友么，能不能帮这个扩展设计一个图标？&lt;br>
作为回报，如果扩展使用了你的图标，会在选项中加入你的链接标注图标是由你提供的，虽然目前这个扩展的用户不多，但我觉得还算是一个好用的扩展吧。。
图标可以通过邮件发送给我，我的邮箱：cyk.cn#qq.com(把#换成@)&lt;/p>
&lt;h2 id="目前在使用的我自己设计的">目前在使用的（我自己设计的=。=）：&lt;/h2>
&lt;p>&lt;img class="alignleft" src="http://image.fatkun.com/blog/imageicon/icon-small.png" alt="" width="32" height="32" />&lt;img src="http://image.fatkun.com/blog/imageicon/icon.png" alt="" width="128" height="128" />&lt;/p>
&lt;h2 id="目前收到的图标">目前收到的图标：&lt;/h2>
&lt;p>&lt;strong>来自：墨鱼&lt;/strong>
&lt;img class="alignleft" src="http://image.fatkun.com/blog/imageicon/icon1-small.png" alt="" width="32" height="32" />&lt;img class="alignleft" src="http://image.fatkun.com/blog/imageicon/icon1.png" alt="" width="128" height="128" />&lt;/p>
&lt;div style="clear:both">&lt;/div>
**来自：大翠**
&lt;img class="alignleft" src="http://image.fatkun.com/blog/imageicon/icon2-small.png" alt="" width="32" height="32" />&lt;img class="alignleft" src="http://image.fatkun.com/blog/imageicon/icon2.png" alt="" width="128" height="128" /></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>Fatkun图片批量下载谷歌浏览器扩展1.4.3版下载</title><link>https://fatkun.github.io/2012/07/batch-image-download-1-4-2.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/07/batch-image-download-1-4-2.html</guid><pubDate>Sun, 22 Jul 2012 09:22:53 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>1.4.3下载：&lt;a href="http://bath-image-download.googlecode.com/files/batch1_4_3.crx" target="_blank">点此下载&lt;/a>
如果上一版本用不了，试试下载1.4.2这个版本。目前1.4.2这个版本还没自动更新。如果好了或者还有问题，在评论告诉我。
另外，在chrome22版本，谷歌已经不允许从外部的网站安装扩展了，可以打开扩展界面，把下载好的扩展拖进去安装。
&lt;strong>1.4.2版update:2012-07-22&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>尝试修复某些版本使用的问题，请通过评论反馈给我&lt;/li>
&lt;li>允许每次把图片汇集到一个输出页面（在【选项】可以关闭）&lt;/li>
&lt;li>增加花瓣网取大图（所有支持的网站可以在【选项】看到）&lt;/li>
&lt;li>增加了一个改扩展名的脚本，在输出页面可以下载下来放到图片文件夹双击运行&lt;/li>
&lt;/ul></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/batch-image-download/">Batch Image Download</category><category domain="https://fatkun.github.io/tags/chrome-extensions/">Chrome Extensions</category><category domain="https://fatkun.github.io/tags/google/">Google</category></item><item><title>chrome扩展让指定标签作为当前浏览标签</title><link>https://fatkun.github.io/2012/07/chrome-highlight-tab.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/07/chrome-highlight-tab.html</guid><pubDate>Sat, 21 Jul 2012 15:34:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Tab有一个active表示这个标签是否是激活的，但想要把某个tab变成激活怎么办呢？&lt;br>
可以使用chrome.tabs.highlight，可以传入多个index，或者一个，第一个会变成激活状态。&lt;/p>
&lt;pre escaped="true" lang="html">chrome.tabs.highlight(object highlightInfo, function callback)
高亮突出指定标签页。
参数
highlightInfo ( object )
windowId ( optional integer ) [从r136510开始该属性可选]
包含标签页的窗口。
tabs ( array of integer or integer )
要高亮突出的一个或多个标签页索引。
callback ( function )
回调函数
callback参数应该指定一个如下形式的函数：
function(Window window) {...};
window ( Window )
高亮突出的标签页所在窗口的详情。&lt;/pre>
&lt;p>中文api来源：https://sites.google.com/site/crxdoczh/devguide/browserinteraction/tabs&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/chrome/">Chrome</category><category domain="https://fatkun.github.io/tags/chrome-extensions/">Chrome Extensions</category></item><item><title>hive命令行抛NullPointerException</title><link>https://fatkun.github.io/2012/07/hive-cmd-nullpointerexception.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/07/hive-cmd-nullpointerexception.html</guid><pubDate>Wed, 18 Jul 2012 16:11:23 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>我只是执行了一下这个代码&lt;/p>
&lt;pre escaped="true" lang="java">create temporary function strip as 'com.fatkun.Strip';&lt;/pre>
&lt;p>就抛出异常&lt;/p>
&lt;pre escaped="true" lang="java">hive&amp;gt; create temporary function strip as 'com.fatkun.Strip';
OK
Exception in thread "main" java.lang.NullPointerException
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:221)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:286)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:516)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:197)&lt;/pre>
&lt;p>从代码中看CliDriver.java:221，&lt;br>
原来和print header有关系。。。囧之前是为了打印header&lt;br>
默认这个是false的，所以把它去掉或者在hive-site置为false即可&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;hive.cli.print.header&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;false&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&lt;/pre></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category></item><item><title>挂载fuse-dfs遇到的问题</title><link>https://fatkun.github.io/2012/07/mount-fuse-dfs.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/07/mount-fuse-dfs.html</guid><pubDate>Wed, 18 Jul 2012 15:27:01 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>以下是在ubuntu12.04 amd64， hadoop cdh3u3下安装
在${HADOOP_HOME}/contrib/fuse-dfs目录下已经帮我编译了一个64bit的fuse-dfs了，不用自己编译（苦逼，自己编译出错=。=）&lt;/p>
&lt;h2 id="缺少某些so文件">缺少某些.so文件&lt;/h2>
&lt;p>把这些so加入到LD_LIBRARY_PATH中，可以写入~/.bashrc文件&lt;br>
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/jre/lib/amd64/server&lt;br>
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HADOOP_HOME/c++/lib&lt;/p>
&lt;h2 id="提示etcfuseconf没权限">提示/etc/fuse.conf没权限&lt;/h2>
&lt;p>把当前用户加入fuse组， adduser 用户名 fuse&lt;br>
检查一下/etc/fuse.conf权限是否是可读&lt;/p>
&lt;h2 id="挂载点inputoutput-error">挂载点input/output error&lt;/h2>
&lt;p>变成一堆？？？号，原因是没有加上-d参数&lt;br>
./fuse_dfs_wrapper.sh dfs://localhost:8020 /mnt/dfs -d&lt;br>
变成？？？可以通过sudo umount /mnt/xxx解除挂载&lt;/p>
&lt;h2 id="class-not-found">class not found&lt;/h2>
&lt;p>Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.conf.Configuration&lt;br>
把hadoop的lib加进去&lt;/p>
&lt;pre escaped="true" lang="bash">for f in $(find $HADOOP_HOME/ -name '*.jar')
do
export CLASSPATH=$CLASSPATH:$f
done&lt;/pre>
&lt;p>最终的脚本是：&lt;/p>
&lt;pre escaped="true" lang="bash">#!/bin/sh
for f in $(find $HADOOP_HOME/ -name '*.jar')
do
export CLASSPATH=$CLASSPATH:$f
done
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/jre/lib/amd64/server
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HADOOP_HOME/c++/lib
./fuse_dfs_wrapper.sh dfs://localhost:8020 /mnt/dfs -d &amp;&lt;/pre></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category></item><item><title>Fatkun图片批量下载1.4版更新</title><link>https://fatkun.github.io/2012/07/fatkun%E5%9B%BE%E7%89%87%E6%89%B9%E9%87%8F%E4%B8%8B%E8%BD%BD1-4%E7%89%88%E6%9B%B4%E6%96%B0.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/07/fatkun%E5%9B%BE%E7%89%87%E6%89%B9%E9%87%8F%E4%B8%8B%E8%BD%BD1-4%E7%89%88%E6%9B%B4%E6%96%B0.html</guid><pubDate>Sun, 08 Jul 2012 14:31:29 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>图片批量下载，可以找出当前页面的所有图片,提供按分辨率筛选图片，用另存为页面就可以把所有图片下载下来。
只为做一个&lt;strong>简单好用的&lt;/strong>批量下图扩展。
1.4.1正式版下载地址：&lt;a href="http://bath-image-download.googlecode.com/files/batch1_4.crx" target="_blank">&lt;a href="https://bath-image-download.googlecode.com/files/batch1_4_1.crx">https://bath-image-download.googlecode.com/files/batch1_4_1.crx&lt;/a>&lt;/a>
（已经下载了1.4抢先版的应该不用重新下，会自动更新）
&lt;strong>1.4版&lt;/strong>update:2012-07-08****&lt;/p>
&lt;ul>
&lt;li>支持多标签获取图片&lt;/li>
&lt;li>支持快捷键&lt;strong>Alt + Z&lt;/strong>&lt;/li>
&lt;li>增加特定网站获取大图片：QQ空间、QQ相册、百度相册、豆瓣相册&lt;/li>
&lt;li>修正新浪微博相册取不了大图的问题&lt;/li>
&lt;li>改了脚本加载方式，可能要重启浏览器才生效&lt;/li>
&lt;li>Ctrl + S保存网页的时候要注意保存类型是：网页/全部
 
这次支持了多个相册取图，QQ空间也可以取图了，快去试试吧！&lt;/li>
&lt;/ul></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category></item><item><title>在Windows下编译hadoop eclipse-plugin</title><link>https://fatkun.github.io/2012/07/compile-hadoop-eclipse-plugin-on-windows.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/07/compile-hadoop-eclipse-plugin-on-windows.html</guid><pubDate>Sat, 07 Jul 2012 09:06:01 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>1.首先准备好ant和maven，配置好ANT_HOME和MAVEN_HOME的环境变量，把%ANT_HOME%/bin和%MAVEN/HOME%/bin配置在PATH变量。&lt;br>
（貌似如果只是编译eclipse-plugin不用安装maven）
我这里的版本是hadoop-core-0.20.2-cdh3u3，其他版本的编译方法也一样。
 
2.在你下载的hadoop根目录下，把hadoop-core-0.20.2-cdh3u3.jar解压到build\classes目录下。&lt;br>
3.把hadoop-core-0.20.2-cdh3u3.jar拷贝到build目录下
 
4.从CMD进入到src\contrib\eclipse-plugin目录，执行以下命令：&lt;br>
eclipse.home=D:/eclipse/需要指定你eclipse的安装目录&lt;br>
version=0.20.2-cdh3u3 是你的hadoop版本
 &lt;/p>
&lt;pre lang="html">ant -Declipse.home=D:/eclipse/ -Dversion=0.20.2-cdh3u3 jar&lt;/pre>
&lt;p>会在build\contrib\eclipse-plugin生成jar文件，但这时还不可以用。&lt;br>
否则会出现错误：&lt;/p>
&lt;pre lang="html">An internal error occurred during: "Map/Reduce location status updater".
org/codehaus/jackson/map/JsonMappingException
An internal error occurred during: "Connecting to DFS myhadoop".
org/apache/hadoop/thirdparty/guava/common/collect/LinkedListMultimap&lt;/pre>
&lt;pre lang="html">&lt;/pre>
&lt;p>5.还要从{hadoop根目录}/lib下，找到jackson-core-asl-1.5.2.jar,jackson-mapper-asl-1.5.2.jar,guava-r09-jarjar.jar把他们都解压出来放入刚生成的hadoop-eclipse-plugin-0.20.2-cdh3u3.jar classes目录下（可以通过winrar直接拖进去）
 
6.最后，把hadoop-eclipse-plugin-0.20.2-cdh3u3.jar放进eclipse的dropin目录，重启eclipse就可以了。
 
PS:本来想把这些包拷贝进lib目录下，然后改MANIFEST.MF，发现打死不可以。。不知道为什么
 
我编译的版本，适用于eclipse3.7和hadoop-0.20.2-cdh3u3：&lt;a href="http://115.com/file/e7xzixp3#hadoop-eclipse-plugin-0.20.2-cdh3u3.jar" target="_blank">下载&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category></item><item><title>Hive查询用到的语句记录</title><link>https://fatkun.github.io/2012/07/hive-query.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/07/hive-query.html</guid><pubDate>Thu, 05 Jul 2012 09:03:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="子查询">子查询&lt;/h2>
&lt;p>子查询需要一个别名&lt;/p>
&lt;pre lang="sql">SELECT * FROM (SELECT A,B FROM atable) alaisName&lt;/pre>
&lt;h2 id="group-by">group by&lt;/h2>
&lt;p>&lt;strong>这样的语句会报错，提示a不在group by里面&lt;/strong>&lt;/p>
&lt;pre lang="sql">select a,sum(b) from atable group by b&lt;/pre>
&lt;p>hive Expression Not In Group By Key&lt;br>
via:&lt;a href="http://stackoverflow.com/questions/5746687/hive-expression-not-in-group-by-key">来源&lt;/a>&lt;br>
解决方法是，使用 max、min、或者collect_set，如：&lt;/p>
&lt;pre lang="sql">select max(a),sum(b) from atable group by b&lt;/pre>
&lt;p>&lt;strong>group by 之后字段可以作为条件再继续查找&lt;/strong>&lt;/p>
&lt;pre lang="sql">SELECT * FROM (SELECT SUM(A) ASUM FROM ATABLE GROUP BY A) SUBQ1 WHERE ASUM &amp;gt; 10&lt;/pre>
&lt;h2 id="join">Join&lt;/h2>
&lt;p>默认join是内连接，还有left outer join 、right outer join和 full outer join&lt;/p>
&lt;h2 id="可以用case-when-8230-then-8230-else-8230">可以用case when … then … else …&lt;/h2>
&lt;p>语法: CASE a WHEN b THEN c [WHEN d THEN e]* [ELSE f] END via:&lt;a href="http://www.oratea.net/?p=948">HIVE UDF整理（九）&lt;/a>
via:&lt;a href="http://www.tbdata.org/archives/2109">数据倾斜总结&lt;/a>&lt;/p>
&lt;pre lang="sql">select *
from log a
left outer join users b
on case when a.user_id is null then concat(‘hive’,rand() ) else a.user_id end = b.user_id;&lt;/pre>
&lt;pre lang="sql">&lt;/pre>
&lt;h2 lang="sql"> Not in&lt;/h2>
not in 在Hive0.8才支持，在之前的版本可以用left outer join代替
&lt;a href="http://chiyx.iteye.com/blog/1530981" target="_blank">Hive使用LEFT OUTER JOIN 实现not in &lt;/a>
&lt;pre lang="html">-- 要实现这个，key不在B表
select a.key from a where key not in(select key from b)
-- 改写为 左连接key，找出B表key为null的
select a.key from a left outer join b on a.key=b.key where b.key1 is null&lt;/pre>
&amp;nbsp;
&lt;pre lang="sql">&lt;/pre></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/query/">Query</category></item><item><title>android PopupWindow</title><link>https://fatkun.github.io/2012/06/android-popupwindow.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/06/android-popupwindow.html</guid><pubDate>Sun, 24 Jun 2012 05:28:13 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;pre escaped="true" lang="java">View loadingView = this.getLayoutInflater().inflate(R.layout.loading, null);
PopupWindow loaddingPopup = new PopupWindow(loadingView, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
loaddingPopup.setAnimationStyle(R.style.popupWindow); //配置动画
loaddingPopup.update();
loaddingPopup.showAtLocation(findViewById(R.id.btnRefresh), Gravity.CENTER, 0, 0); //显示在中间
&lt;/pre>
&lt;p>配置一个animate, popupwindow.xml&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;set xmlns:android="http://schemas.android.com/apk/res/android" &amp;gt;
&amp;lt;alpha
android:duration="500"
android:fromAlpha="0.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="1.0" /&amp;gt;
&amp;lt;/set&amp;gt;&lt;/pre>
&lt;p>除了要配置一个animate外，还需要配置style&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;resources&amp;gt;
&amp;lt;style name="popupWindow"&amp;gt;
&amp;lt;item name="android:windowEnterAnimation"&amp;gt;@anim/popupwindow&amp;lt;/item&amp;gt;
&amp;lt;/style&amp;gt;
&amp;lt;/resources&amp;gt; &lt;/pre>
&lt;p>容易犯错的地方是，这里的setAnimationStyle是指style，不是动画&lt;/p>
&lt;pre escaped="true" lang="java">popupWindow.setAnimationStyle(R.anim.popupwindow); // 错误写法 &lt;/pre>
&lt;p>popwindow通过setAnimationStyle(int animationStyle)函数来设置动画效果&lt;br>
android:windowEnterAnimation表示进入窗口动画&lt;br>
android:windowExitAnimation表示窗口退出动画
更多信息：&lt;a href="http://lipeng88213.iteye.com/blog/1115014">android PopupWindow 以及activity切换的动画效果对比&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/popwindow/">Popwindow</category></item><item><title>Hive Select * 替换回列字段</title><link>https://fatkun.github.io/2012/06/hive-select-star.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/06/hive-select-star.html</guid><pubDate>Sun, 03 Jun 2012 16:11:42 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Hive中会把TOK_ALLCOLREF替换成各个列名称，来看看代码中是如何做到的。&lt;br>
我以TOK_ALLCOLREF入手看代码，执行顺序不是这样的，这算是倒叙？=。=
来看SemanticAnalyzer.class这个类，这是查询中用得最多了。&lt;br>
首先看到genSelectPlan()方法&lt;/p>
&lt;pre escaped="true" lang="java">private Operator&amp;lt;?&amp;gt; genSelectPlan(ASTNode selExprList, QB qb,
Operator&amp;lt;?&amp;gt; input) throws SemanticException {
...
if (expr.getType() == HiveParser.TOK_ALLCOLREF) {
pos = genColListRegex(".*", expr.getChildCount() == 0 ? null
: getUnescapedName((ASTNode)expr.getChild(0)).toLowerCase(),
expr, col_list, inputRR, pos, out_rwsch, qb.getAliases());
selectStar = true;
}
...
}&lt;/pre>
&lt;p>咱们的列名称就在col_list存着，继续看genColListRegex()方法。可以发现它是由传入的inputRR字段获取的。&lt;br>
这inputRR是从调用这个方法就传过来了。。继续往上看。&lt;br>
genBodyPlan(QB qb, Operator input)&lt;br>
还是传过来的。。&lt;/p>
&lt;pre escaped="true" lang="java">Operator bodyOpInfo = genBodyPlan(qb, srcOpInfo);&lt;/pre>
&lt;p>srcOpInfo就是从这里来的，看一下genTablePlan&lt;/p>
&lt;pre escaped="true" lang="java">// Recurse over all the source tables
for (String alias : qb.getTabAliases()) {
Operator op = genTablePlan(alias, qb);
aliasToOpInfo.put(alias, op);
}&lt;/pre>
&lt;pre escaped="true" lang="java">private Operator genTablePlan(String alias, QB qb) throws SemanticException {
String alias_id = (qb.getId() == null ? alias : qb.getId() + ":" + alias);
Table tab = qb.getMetaData().getSrcForAlias(alias);
RowResolver rwsch;
........................
rwsch = new RowResolver();
try {
// 先从Table中取到所有字段，加入RowResolver中
StructObjectInspector rowObjectInspector = (StructObjectInspector) tab
.getDeserializer().getObjectInspector();
List&amp;lt;? extends StructField&amp;gt; fields = rowObjectInspector
.getAllStructFieldRefs();
for (int i = 0; i &amp;lt; fields.size(); i++) {
rwsch.put(alias, fields.get(i).getFieldName(), new ColumnInfo(fields
.get(i).getFieldName(), TypeInfoUtils
.getTypeInfoFromObjectInspector(fields.get(i)
.getFieldObjectInspector()), alias, false));
}
} catch (SerDeException e) {
throw new RuntimeException(e);
}
// 这里再把Partition的字段给补上
// Hack!! - refactor once the metadata APIs with types are ready
// Finally add the partitioning columns
for (FieldSchema part_col : tab.getPartCols()) {
LOG.trace("Adding partition col: " + part_col);
// TODO: use the right type by calling part_col.getType() instead of
// String.class
rwsch.put(alias, part_col.getName(), new ColumnInfo(part_col.getName(),
TypeInfoFactory.stringTypeInfo, alias, true));
}
&lt;/pre>
&lt;p>可以看到RowResolver存的值是列字段+分区字段。&lt;br>
最终select * 会得到这些值。。&lt;/p></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/%E4%BA%91%E8%AE%A1%E7%AE%97/">云计算</category></item><item><title>android抓包</title><link>https://fatkun.github.io/2012/06/android-tcpdump.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/06/android-tcpdump.html</guid><pubDate>Sat, 02 Jun 2012 18:29:14 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>首先要安装好adb驱动,手机通过usb连接.
通过adb shell进入shell,再su有root权限&lt;br>
把/system分区变成可读写&lt;br>
android4.0的命令是这个,具体可以参考&lt;a href="http://blog.csdn.net/Zengyangtech/article/details/6030390">这篇文章&lt;/a>,有点不同&lt;br>
mount -o remount /dev/block/platform/s3c-sdhci.0/by-name/system /system
下载&lt;a href="http://www.strazzere.com/android/tcpdump">tcpdump&lt;/a> ,&lt;a href="http://files.cnblogs.com/yunsean/tcpdump.rar">备用地址&lt;/a>
上传文件并添加权限&lt;br>
adb push tcpdump /system/xbin/&lt;br>
adb shell&lt;br>
cd /system/xbin/&lt;br>
chmod +x tcpdump
然后执行一下&lt;br>
tcpdump -p -vv -s 0 -w /sdcard/capture.pcap
执行要监控的程序
最后把日志取下来&lt;br>
adb pull /sdcard/capture.pcap
使用WireShark打开日志文件进行分析。&lt;/p>
&lt;h2 id="参考文章">参考文章&lt;/h2>
&lt;p>&lt;a href="http://yezhiqiu-love-yeah-net.iteye.com/blog/1122237">http://yezhiqiu-love-yeah-net.iteye.com/blog/1122237&lt;/a>&lt;br>
&lt;a href="http://blog.csdn.net/Zengyangtech/article/details/6030390">http://blog.csdn.net/Zengyangtech/article/details/6030390&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/%E6%8A%93%E5%8C%85/">抓包</category></item><item><title>python生成缩略图和合并图片</title><link>https://fatkun.github.io/2012/06/python-create-thumb-and-merge-images.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/06/python-create-thumb-and-merge-images.html</guid><pubDate>Sat, 02 Jun 2012 14:58:25 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>第一次使用&lt;a href="http://www.pythonware.com/products/pil/index.htm">Python Imaging Library&lt;/a>,参考了各类文章.&lt;br>
直接贴代码吧,不长.容易理解
以下代码是把一个目录下的图片生成正方形的缩略图,并把缩略图合并成一个大图…&lt;/p>
&lt;pre escaped="true" lang="python">#!/usr/bin/env python
#coding=utf-8
'''
Created on 2012-6-2
@author: fatkun
'''
import Image
import os
import sys
import glob
import time
def make_thumb(path, thumb_path, size):
"""生成缩略图"""
img = Image.open(path)
width, height = img.size
# 裁剪图片成正方形
if width &amp;gt; height:
delta = (width - height) / 2
box = (delta, 0, width - delta, height)
region = img.crop(box)
elif height &amp;gt; width:
delta = (height - width) / 2
box = (0, delta, width, height - delta)
region = img.crop(box)
else:
region = img
# 缩放
thumb = region.resize((size, size), Image.ANTIALIAS)
base, ext = os.path.splitext(os.path.basename(path))
filename = os.path.join(thumb_path, '%s_thumb.jpg' % (base,))
print filename
# 保存
thumb.save(filename, quality=70)
def merge_thumb(files, output_file):
"""合并图片"""
imgs = []
width = 0
height = 0
# 计算总宽度和长度
for file in files:
img = Image.open(file)
if img.mode != 'RGB':
img = img.convert('RGB')
imgs.append(img)
if img.size[0] &amp;gt; width:
width = img.size[0]
height += img.size[1]
# 新建一个白色底的图片
merge_img = Image.new('RGB', (width, height), 0xffffff)
cur_height = 0
for img in imgs:
# 把图片粘贴上去
merge_img.paste(img, (0, cur_height))
cur_height += img.size[1]
merge_img.save(output_file, quality=70)
if __name__ == '__main__':
ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
IMG_PATH = os.path.join(ROOT_PATH, 'img')
THUMB_PATH = os.path.join(IMG_PATH, 'thumbs')
if not os.path.exists(THUMB_PATH):
os.makedirs(THUMB_PATH)
# 生成缩略图
files = glob.glob(os.path.join(IMG_PATH, '*.jpg'))
begin_time = time.clock()
for file in files:
make_thumb(file, THUMB_PATH, 90)
end_time = time.clock()
print ('make_thumb time:%s' % str(end_time - begin_time))
# 合并图片
files = glob.glob(os.path.join(THUMB_PATH, '*_thumb.jpg'))
merge_output = os.path.join(THUMB_PATH, 'thumbs.jpg')
begin_time = time.clock()
merge_thumb(files, merge_output)
end_time = time.clock()
print ('merge_thumb time:%s' % str(end_time - begin_time))
&lt;/pre>
&lt;h2 id="参考文章">参考文章&lt;/h2>
&lt;p>&lt;a href="http://www.pythonware.com/library/pil/handbook/image.htm" title="http://www.pythonware.com/library/pil/handbook/image.htm">API&lt;/a>&lt;br>
&lt;a href="http://www.cnblogs.com/RChen/archive/2007/03/31/pil_thumb.html" title="用 PIL 写了个简单的缩略图生成程序" target="_blank">用 PIL 写了个简单的缩略图生成程序&lt;/a>&lt;br>
&lt;a href="http://hi.baidu.com/bluebanboom/item/08a7f4e2280a25adcf2d4f29" title="Python代码：合并图片" target="_blank">Python代码：合并图片&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/pil/">PIL</category><category domain="https://fatkun.github.io/tags/%E5%90%88%E5%B9%B6%E5%9B%BE%E7%89%87/">合并图片</category><category domain="https://fatkun.github.io/tags/%E5%9B%BE%E7%89%87%E5%A4%84%E7%90%86/">图片处理</category><category domain="https://fatkun.github.io/tags/%E7%BC%A9%E7%95%A5%E5%9B%BE/">缩略图</category></item><item><title>格式化Hive语法树(python)</title><link>https://fatkun.github.io/2012/05/format-hive-astnode.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/05/format-hive-astnode.html</guid><pubDate>Sat, 19 May 2012 17:19:02 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>为了容易看一点，把用explain得到的语法树加上一些缩进.
该代码只是简单的加上缩进.&lt;/p>
&lt;h2 id="效果">效果&lt;/h2>
&lt;p>这是查询explain select key from kv mykv join test mytest on (mykv.key == mytest.id);语句获取的语法树&lt;/p>
&lt;pre escaped="true" lang="xml">(TOK_QUERY
(TOK_FROM
(TOK_JOIN
(TOK_TABREF
(TOK_TABNAME kv)
mykv)
(TOK_TABREF
(TOK_TABNAME test)
mytest)
(==
(.
(TOK_TABLE_OR_COL mykv)
key)
(.
(TOK_TABLE_OR_COL mytest)
id)
)
)
)
(TOK_INSERT
(TOK_DESTINATION
(TOK_DIR TOK_TMP_FILE)
)
(TOK_SELECT
(TOK_SELEXPR
(TOK_TABLE_OR_COL key)
)
)
)
)
&lt;/pre>
&lt;h2 id="代码如下">代码如下&lt;/h2>
&lt;pre escaped="true" lang="python">#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 2012-5-20
@author: fatkun
'''
import sys
# explain select key from kv mykv join test mytest on (mykv.key == mytest.id);
original_str = """(TOK_QUERY (TOK_FROM (TOK_JOIN (TOK_TABREF
(TOK_TABNAME kv) mykv) (TOK_TABREF (TOK_TABNAME test) mytest)
(== (. (TOK_TABLE_OR_COL mykv) key) (. (TOK_TABLE_OR_COL mytest) id))))
(TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)))))"""
tmp_str = original_str.strip().replace('\n', '')
def my_print(mystr):
sys.stdout.write(mystr)
def print_indent(indent_level):
for i in range(indent_level):
my_print(' ' * 4)
indent_level = 0
for char in tmp_str:
if char == '(':
# 如果是左括号,先换行,然后打印缩进+(
my_print('\n')
print_indent(indent_level)
my_print(char)
indent_level += 1
elif char == ')':
# 如果是右括号,先打印),再换行,打印下一级别的缩进
indent_level -= 1
my_print(char)
my_print('\n')
print_indent(indent_level - 1)
else:
# 其他的直接打印出来
my_print(char)
&lt;/pre></description><category domain="https://fatkun.github.io/categories/hive/">Hive</category><category domain="https://fatkun.github.io/tags/hadoop/">Hadoop</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category></item><item><title>[转]解决ubuntu下mysql不能远程连接数据库的问题</title><link>https://fatkun.github.io/2012/05/ubuntu-mysql.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/05/ubuntu-mysql.html</guid><pubDate>Thu, 03 May 2012 18:00:09 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>来源：&lt;a href="http://www.php100.com/html/webkaifa/database/Mysql/2010/1115/6818.html">http://www.php100.com/html/webkaifa/database/Mysql/2010/1115/6818.html&lt;/a>&lt;br>
Ubuntu10.04上自带的MySQL，执行了&lt;br>
root@ubuntu:~#sudo apt-get install mysql&lt;br>
安装完mysql-server
启动mysql&lt;br>
root@ubuntu:~#/etc/init.d/mysql start
本地可以连接进入数据库。&lt;br>
root@ubuntu:~#mysql -uroot -p
设置了远程访问权限：&lt;br>
mysql&amp;gt; grant all PRIVILEGES on *.* to admin@’%’ identified by ‘123456′;&lt;br>
Query OK, 0 rows affected (0.04 sec)
mysql&amp;gt; use information_schema&lt;br>
mysql&amp;gt; select * from user_privileges;&lt;br>
查询到有下面的结果：’admin’@’%’，说明mysql已经授权远程连接。
在windows下访问Ubuntu的数据库，连接不上，但是Ubuntu上安装的apache可以访问。&lt;br>
用iptalbes添加端口3306后也无法访问。&lt;br>
root@ubuntu:~# iptables -A INPUT -p tcp –dport 3306 -j ACCEPT
Ubuntu上查看Mysql网络连接：&lt;br>
root@ubuntu:~# netstat -an |grep 3306&lt;br>
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN&lt;br>
本地端口也在监听
root@ubuntu:~# ufw status&lt;br>
Firewall not loaded&lt;br>
本地防火墙未打开
后来在网上找到一个解决办法：&lt;br>
查看/etc/mysql/my.cnf找到bind-address才发现配置的是 127.0.0.1(bind-address=127.0.0.1)，直接改为bind-address=192.168.0.xxx(本机ip)，然 后再查看3306端口打开了，ok，可以正常连接了&lt;/p></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category><category domain="https://fatkun.github.io/tags/mysql/">Mysql</category><category domain="https://fatkun.github.io/tags/mysql%E6%9D%83%E9%99%90/">Mysql权限</category><category domain="https://fatkun.github.io/tags/ubuntu/">Ubuntu</category><category domain="https://fatkun.github.io/tags/%E6%9D%83%E9%99%90/">权限</category></item><item><title>Fatkun图片批量下载谷歌浏览器扩展1.3版更新了</title><link>https://fatkun.github.io/2012/05/fatkun-batch-image-download-1-3.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/05/fatkun-batch-image-download-1-3.html</guid><pubDate>Tue, 01 May 2012 14:00:51 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>1.3版插件地址：&lt;a href="http://bath-image-download.googlecode.com/files/batch1_3.crx" target="_blank">&lt;a href="https://bath-image-download.googlecode.com/files/batch1_3.crx">https://bath-image-download.googlecode.com/files/batch1_3.crx&lt;/a>&lt;/a>
&lt;strong>1.3版&lt;/strong>update:2012-05-01****&lt;/p>
&lt;ol>
&lt;li>支持特定网站取大图，添加新浪微博和新浪轻博客的支持&lt;/li>
&lt;li>支持input图片&lt;/li>
&lt;li>添加视图切换
 
最近工作上有点忙，先做一个小更新。有好多东西要学，是压力也是动力~！
详细信息：&lt;a href="http://fatkun.com/2010/09/batch-image-download.html">http://fatkun.com/2010/09/batch-image-download.html&lt;/a>&lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/batch-image-download/">Batch Image Download</category></item><item><title>Ubuntu 11.04 下安装配置 JDK 7</title><link>https://fatkun.github.io/2012/04/ubuntu-11-04-%E4%B8%8B%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE-jdk-7.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/04/ubuntu-11-04-%E4%B8%8B%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE-jdk-7.html</guid><pubDate>Sun, 29 Apr 2012 17:44:19 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>文章来源：&lt;a href="http://blog.csdn.net/yang_hui1986527/article/details/6677450" title="Ubuntu 11.04 下安装配置 JDK 7" target="_blank">Ubuntu 11.04 下安装配置 JDK 7&lt;/a>
这篇文章说得很清晰。。复制过来。。以作备用。。&lt;br>
———————&lt;br>
第一步：下载jdk-7-linux-i586.tar.gz&lt;/p>
&lt;pre escaped="true" lang="bash">wget -c http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz &lt;/pre>
&lt;p>(注：如果下载不下来，建议使用迅雷下载，然后拷贝到Linux系统上。)&lt;br>
第二步：解压安装&lt;/p>
&lt;pre escaped="true" lang="bash">sudo tar zxvf ./jdk-7-linux-i586.tar.gz -C /usr/lib/jvm
cd /usr/lib/jvm
sudo mv jdk1.7.0/ java-7-sun &lt;/pre>
&lt;p>第三步：修改环境变量&lt;/p>
&lt;pre escaped="true" lang="bash">vim ~/.bashrc &lt;/pre>
&lt;p>添加：&lt;/p>
&lt;pre escaped="true" lang="bash">export JAVA_HOME=/usr/lib/jvm/java-7-sun
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH &lt;/pre>
&lt;p>保存退出，输入以下命令使之立即生效。&lt;/p>
&lt;pre escaped="true" lang="bash">source ~/.bashrc &lt;/pre>
&lt;p>第四步：配置默认JDK版本&lt;br>
由于ubuntu中可能会有默认的JDK，如openjdk，所以，为了将我们安装的JDK设置为默认JDK版本，还要进行如下工作。&lt;br>
执行代码:&lt;/p>
&lt;pre escaped="true" lang="bash">sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-sun/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-sun/bin/javac 300
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java-7-sun/bin/jar 300 &lt;/pre>
&lt;p>执行代码：&lt;/p>
&lt;pre escaped="true" lang="bash">sudo update-alternatives --config java &lt;/pre>
&lt;p>系统会列出各种JDK版本，如下所示：&lt;/p>
&lt;pre escaped="true" lang="bash">snowdream@snowdream:~$ sudo update-alternatives --config java
有 3 个候选项可用于替换 java (提供 /usr/bin/java)。
选择 路径 优先级 状态
------------------------------------------------------------
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 自动模式
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 手动模式
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 手动模式
3 /usr/lib/jvm/java-7-sun/bin/java 300 手动模式
&lt;/pre>
&lt;p>要维持当前值[*]请按回车键，或者键入选择的编号：3&lt;br>
update-alternatives: 使用 /usr/lib/jvm/java-7-sun/bin/java 来提供 /usr/bin/java (java)，于 手动模式 中。&lt;br>
第五步：测试&lt;/p>
&lt;pre escaped="true" lang="bash">snowdream@snowdream:~$ java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Server VM (build 21.0-b17, mixed mode)
&lt;/pre></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category><category domain="https://fatkun.github.io/tags/java/">JAVA</category><category domain="https://fatkun.github.io/tags/jdk/">Jdk</category><category domain="https://fatkun.github.io/tags/linux/">Linux</category></item><item><title>eclipse上单步调试Hive</title><link>https://fatkun.github.io/2012/04/eclipse-debug-hive.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/04/eclipse-debug-hive.html</guid><pubDate>Sat, 14 Apr 2012 10:06:16 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在百度找到这篇文章：&lt;a href="http://wenku.baidu.com/view/f4d9b407e87101f69e319599.html">在Windows eclipse上单步调试Hive教程&lt;/a>
可是我死活搞不定在windows安装hadoop和hive，cgywin不靠普啊。。还是在ubuntu下调试了。&lt;/p>
&lt;h2 id="准备">准备&lt;/h2>
&lt;p>前提条件是你已经部署好hadoop和hive，能够正常的执行hive查询。
我在~/workspace/hive新建了两个目录lib和conf&lt;/p>
&lt;ol>
&lt;li>从hive目录中的lib和hadoop目录中的lib复制一份到一个目录里，我是放在~/workspace/hive/lib&lt;/li>
&lt;li>还要把hadoop目录下的hadoop*.jar都拷贝过来吧。&lt;/li>
&lt;li>如果用mysql做metastore的数据库，还需要把mysql-connector的lib加上&lt;/li>
&lt;li>把hive的conf文件夹拷贝过来（要已配置好的conf文件哦）&lt;/li>
&lt;li>把hive中的src目录拷贝进来&lt;/li>
&lt;/ol>
&lt;h2 id="创建项目">创建项目&lt;/h2>
&lt;p>在这个目录下（~/workspace/hive/src/cli）的代码是hive命令行的代码，我们可以通过调试它来了解hive的执行过程。
在这个目录下，用eclipse新建一个项目。
配置bulid path，把我们准备好的lib全部加上
这个时候，代码应该没有编译错误了，如果有，请检查一下那个lib没加上。
还有个重要的步骤！hive是怎样找它的配置文件的呢？
我们要把conf目录加入classpath中，在debug configuration中的Classpath，点击左侧的advanced，add exteral path，选上我们准备好的conf目录。
这样就可以开始debug了！
如果你运行报does not have a sch错误，应该是由于没找到配置文件引起的。&lt;br>
 
顺便看看hive是怎么找到配置文件的。&lt;br>
都是通过getClassLoader().getResource()方法来获取的，所以配置文件夹必须在classpath中！&lt;/p>
&lt;pre escaped="true" lang="java">URL hconfurl = getClassLoader().getResource("hive-default.xml");
if (hconfurl == null) {
l4j.debug("hive-default.xml not found.");
} else {
addResource(hconfurl);
}
URL hsiteurl = getClassLoader().getResource("hive-site.xml");
if (hsiteurl == null) {
l4j.debug("hive-site.xml not found.");
} else {
addResource(hsiteurl);
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/debug/">Debug</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category></item><item><title>Hive为什么会创建DELETEME表</title><link>https://fatkun.github.io/2012/04/hive-deleteme-table.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/04/hive-deleteme-table.html</guid><pubDate>Tue, 10 Apr 2012 16:16:45 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在Hive中会去取schme name和catalog（暂时不知道这个东西有什么用）&lt;br>
是第三方的库datanucleus在操作，&lt;br>
可以看到它创建DELETEME123213一些随机数字的表，然后删掉。。目的就为了去获取schme name和catalog
可以在hive-site.xml配置，不让做这个操作…&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;datanucleus.fixedDatastore&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;true&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre>
&lt;p>这样会导致的结果暂时未知。。。o(╯□╰)o&lt;br>
另外，最好把datanucleus.autoCreateSchema设为false&lt;br>
官方的注释中表明，如果你第一次已经建好了表，就把这个设回false，为了方便第一次创建表结构。&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;datanucleus.autoCreateSchema&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;false&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category></item><item><title>Hive MetaStore建表与修改表分析</title><link>https://fatkun.github.io/2012/04/hive-metastore-create-table-and-alter-table.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/04/hive-metastore-create-table-and-alter-table.html</guid><pubDate>Tue, 10 Apr 2012 15:57:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="问题">问题&lt;/h2>
&lt;p>使用Hive MetaStore（这里指的是通过thrift连接hiveserver） Create table 和 Alter table的时候遇到一个问题&lt;br>
建表时指定的location为 /mnt/dfs/xxx，实质上使用hiveMetastore会帮你做一个转换，最后location变成 hdfs://hostname:port/mnt/dfs/xxx的路径&lt;br>
但在修改表的时候，却不会帮你做这样的转换！！坑爹啊。。你指定的是什么就是什么~
注：通过hive命令行方式执行sql命令建表也是这样，不过修改表的时候，location必须是这样的路径hdfs://hostname:port/mnt/dfs/xxx才可以修改成功，否则报错。&lt;/p>
&lt;h2 id="分析问题">分析问题&lt;/h2>
&lt;p>从代码入手吧。。&lt;br>
进入这个目录&lt;br>
hive-0.7.1-cdh3u3\src\metastore\src\java\org\apache\hadoop\hive\metastore&lt;br>
这里都是hiveserver的代码了。
打开HiveMetaStore.java代码，咱们直奔主题，找create_table和alter_table去&lt;/p>
&lt;pre escaped="true" lang="java">public void create_table(final Table tbl) throws AlreadyExistsException,
MetaException, InvalidObjectException {
...
create_table_core(ms, tbl);
&lt;/pre>
&lt;p>调用了create_table_core(ms, tbl);继续&lt;/p>
&lt;pre escaped="true" lang="java">private void create_table_core(final RawStore ms, final Table tbl)
throws AlreadyExistsException, MetaException, InvalidObjectException {
//检查了一些名称，列名，分区之类的
//...
ms.openTransaction();
//....
if (!TableType.VIRTUAL_VIEW.toString().equals(tbl.getTableType())) {
if (tbl.getSd().getLocation() == null
|| tbl.getSd().getLocation().isEmpty()) {
tblPath = wh.getDefaultTablePath(
tbl.getDbName(), tbl.getTableName());
} else {
if (!isExternal(tbl) &amp;&amp; !MetaStoreUtils.isNonNativeTable(tbl)) {
LOG.warn("Location: " + tbl.getSd().getLocation()
+ " specified for non-external table:" + tbl.getTableName());
}
// 主要就是这里啦！getDnsPath！！！帮我们把dataurl补全
tblPath = wh.getDnsPath(new Path(tbl.getSd().getLocation()));
}
tbl.getSd().setLocation(tblPath.toString());
}
//...
ms.createTable(tbl);
}&lt;/pre>
&lt;p>因为我们的location不为空~所以..&lt;br>
主要就是这一句：tblPath = wh.getDnsPath(new Path(tbl.getSd().getLocation()));&lt;br>
看看getDnsPath()做了什么，打开代码Warehouse.java&lt;/p>
&lt;pre escaped="true" lang="java">public Path getDnsPath(Path path) throws MetaException {
FileSystem fs = getFs(path);
return (new Path(fs.getUri().getScheme(), fs.getUri().getAuthority(), path
.toUri().getPath()));
}&lt;/pre>
&lt;p>就帮我们做了些转换。。。我们建表看到的hdfs://hostname:port就是这里加上的。
再来看一下alter_table&lt;/p>
&lt;pre escaped="true" lang="java">public void alter_table(final String dbname, final String name, final Table newTable)
throws InvalidOperationException, MetaException {
\\...
alterHandler.alterTable(ms, wh, dbname, name, newTable);&lt;/pre>
&lt;p>跳入这个类HiveAlterHandler.java，只有一个方法：&lt;/p>
&lt;pre escaped="true" lang="java">public void alterTable(RawStore msdb, Warehouse wh, String dbname,
String name, Table newt) throws InvalidOperationException, MetaException {
//这里主要判断表名有没有改
//如果改了分区字段则抛错误
//如果改了表名但location没改或者为空，并且不是外部表，则把数据给移了~
//最后，直接的alterTable了。。？虾米，location就这样保存进去了？！
// now finally call alter table
msdb.alterTable(dbname, name, newt);
// commit the changes
success = msdb.commitTransaction();
}&lt;/pre>
&lt;p>location没做什么处理就保存进去了。。。
RawStore是什么东西？代码中很多用了反射的方式调用。。貌似实质上是ObjectStore.java类。。&lt;br>
这个类使用jdo来操作metastore数据库&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/alter-table/">Alter Table</category><category domain="https://fatkun.github.io/tags/hive/">Hive</category><category domain="https://fatkun.github.io/tags/metastore/">MetaStore</category><category domain="https://fatkun.github.io/tags/table/">Table</category></item><item><title>记录一些常用的linux shell命令</title><link>https://fatkun.github.io/2012/03/linux-shell.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/03/linux-shell.html</guid><pubDate>Sun, 25 Mar 2012 13:31:35 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="日期">日期&lt;/h2>
&lt;h1 id="取前一天">取前一天&lt;/h1>
&lt;p>date -d ‘1 days ago’ +%Y-%m-%d&lt;/p>
&lt;h2 id="命令別名設定功能-alias">命令別名設定功能： (alias)&lt;/h2>
&lt;p>alias ll=’ls -al’&lt;/p>
&lt;h2 id="一些特殊值">一些特殊值&lt;/h2>
&lt;p>$$：(關於本 shell 的 PID)&lt;br>
$!：得到子进程的进程PID,例如nohup的命令可以通过这个获取PID&lt;br>
$?：(關於上個執行指令的回傳值)&lt;br>
$#: 参数个数
$@ ：代表『 “$1” “$2” “$3” “$4” 』&lt;br>
$* ：代表『 “$1c$2c$3c$4” 』，其中 c 為分隔字元&lt;/p>
&lt;h2 id="declare">declare&lt;/h2>
&lt;p>数值计算要用 declare -i sum=100+12&lt;br>
也可以用sum=$((100+12))计算&lt;br>
[root@www ~]# declare [-aixr] variable&lt;br>
選項與參數：&lt;br>
-a ：將後面名為 variable 的變數定義成為陣列 (array) 類型&lt;br>
-i ：將後面名為 variable 的變數定義成為整數數字 (integer) 類型&lt;br>
-x ：用法與 export 一樣，就是將後面的 variable 變成環境變數；&lt;br>
-r ：將變數設定成為 readonly 類型，該變數不可被更改內容，也不能 unset&lt;/p>
&lt;h2 id="数组">数组&lt;/h2>
&lt;p>var&lt;a href="http://unix.stackexchange.com/questions/186453/cut-for-key-value-pairs">1&lt;/a>=”small min”&lt;br>
echo $(var&lt;a href="http://unix.stackexchange.com/questions/186453/cut-for-key-value-pairs">1&lt;/a>)&lt;/p>
&lt;h2 id="截取字符串">截取字符串&lt;/h2>
&lt;pre lang="bash" escaped="true"># 从第0位开始截取2个字符
echo ${a:0:2}&lt;/pre>
&lt;h2 id="删除替换字符">删除/替换字符&lt;/h2>
&lt;p>echo ${PATH#/usr_:} #从前到后开始删除掉第一个符合条件的字符&lt;br>
echo ${PATH##/usr_:} #从前到后开始删除掉所有符合条件的字符&lt;br>
也可以从后面开始，就是把#号替换成%号&lt;br>
echo ${PATH/usr/USR} #替换&lt;br>
echo ${PATH//usr/USR} #替换所有&lt;/p>
&lt;h2 id="和">&amp;amp;&amp;amp;和||&lt;/h2>
&lt;p>可以把多条命令串起来，例如&lt;br>
ls ./test/||mkdir ./test/ #如果目录不存在，创建一个&lt;/p>
&lt;h2 id="判断">判断&lt;/h2>
&lt;p>使用中括号时注意空格必须要有[ -e “xxx” ]
语法&lt;/p>
&lt;pre lang="bash">if [ "$name" == "Fatkun" ]; then
echo "Hi!Fatkun"
elif [ ... ]; then
echo "..."
else
echo "..."
fi&lt;/pre>
&lt;p> &lt;/p>
&lt;table style="width: 85%;" border="1" cellspacing="0" cellpadding="3" bgcolor="lightyellow"> &lt;tr align="center" bgcolor="lightblue"> &lt;td width="100"> 測試的標誌 &lt;/td>
&lt;td> 代表意義 &lt;/td> &lt;/tr>
&lt;tr bgcolor="lightblue"> &lt;td colspan="2"> 1. 關於某個檔名的『檔案類型』判斷，如 test -e filename 表示存在否 &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -e &lt;/td>
&lt;td> 該『檔名』是否存在？(常用) &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -f &lt;/td>
&lt;td> 該『檔名』是否存在且為檔案(file)？(常用) &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -d &lt;/td>
&lt;td> 該『檔名』是否存在且為目錄(directory)？(常用) &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -b &lt;/td>
&lt;td> 該『檔名』是否存在且為一個 block device 裝置？ &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -c &lt;/td>
&lt;td> 該『檔名』是否存在且為一個 character device 裝置？ &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -S &lt;/td>
&lt;td> 該『檔名』是否存在且為一個 Socket 檔案？ &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -p &lt;/td>
&lt;td> 該『檔名』是否存在且為一個 FIFO (pipe) 檔案？ &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -L &lt;/td>
&lt;td> 該『檔名』是否存在且為一個連結檔？ &lt;/td> &lt;/tr>
&lt;tr bgcolor="lightblue"> &lt;td colspan="2"> 2. 關於檔案的權限偵測，如 test -r filename 表示可讀否 (但 root 權限常有例外) &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -r &lt;/td>
&lt;td> 偵測該檔名是否存在且具有『可讀』的權限？ &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -w &lt;/td>
&lt;td> 偵測該檔名是否存在且具有『可寫』的權限？ &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -x &lt;/td>
&lt;td> 偵測該檔名是否存在且具有『可執行』的權限？ &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -u &lt;/td>
&lt;td> 偵測該檔名是否存在且具有『SUID』的屬性？ &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -g &lt;/td>
&lt;td> 偵測該檔名是否存在且具有『SGID』的屬性？ &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -k &lt;/td>
&lt;td> 偵測該檔名是否存在且具有『Sticky bit』的屬性？ &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -s &lt;/td>
&lt;td> 偵測該檔名是否存在且為『非空白檔案』？ &lt;/td> &lt;/tr>
&lt;tr bgcolor="lightblue"> &lt;td colspan="2"> 3. 兩個檔案之間的比較，如： test file1 -nt file2 &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -nt &lt;/td>
&lt;td> (newer than)判斷 file1 是否比 file2 新 &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -ot &lt;/td>
&lt;td> (older than)判斷 file1 是否比 file2 舊 &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -ef &lt;/td>
&lt;td> 判斷 file1 與 file2 是否為同一檔案，可用在判斷 hard link 的判定上。 主要意義在判定，兩個檔案是否均指向同一個 inode 哩！ &lt;/td> &lt;/tr>
&lt;tr bgcolor="lightblue"> &lt;td colspan="2"> 4. 關於兩個整數之間的判定，例如 test n1 -eq n2 &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -eq &lt;/td>
&lt;td> 兩數值相等 (equal) &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -ne &lt;/td>
&lt;td> 兩數值不等 (not equal) &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -gt &lt;/td>
&lt;td> n1 大於 n2 (greater than) &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -lt &lt;/td>
&lt;td> n1 小於 n2 (less than) &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -ge &lt;/td>
&lt;td> n1 大於等於 n2 (greater than or equal) &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -le &lt;/td>
&lt;td> n1 小於等於 n2 (less than or equal) &lt;/td> &lt;/tr>
&lt;tr bgcolor="lightblue"> &lt;td colspan="2"> 5. 判定字串的資料 &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> test -z string &lt;/td>
&lt;td> 判定字串是否為 0 ？若 string 為空字串，則為 true &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> test -n string &lt;/td>
&lt;td> 判定字串是否非為 0 ？若 string 為空字串，則為 false。&lt;br /> 註： -n 亦可省略 &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> test str1 = str2 &lt;/td>
&lt;td> 判定 str1 是否等於 str2 ，若相等，則回傳 true &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> test str1 != str2 &lt;/td>
&lt;td> 判定 str1 是否不等於 str2 ，若相等，則回傳 false &lt;/td> &lt;/tr>
&lt;tr bgcolor="lightblue"> &lt;td colspan="2"> 6. 多重條件判定，例如： test -r filename -a -x filename &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -a &lt;/td>
&lt;td> (and)兩狀況同時成立！例如 test -r file -a -x file，則 file 同時具有 r 與 x 權限時，才回傳 true。 &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> -o &lt;/td>
&lt;td> (or)兩狀況任何一個成立！例如 test -r file -o -x file，則 file 具有 r 或 x 權限時，就可回傳 true。 &lt;/td> &lt;/tr>
&lt;tr> &lt;td align="center"> ! &lt;/td>
&lt;td> 反相狀態，如 test ! -x file ，當 file 不具有 x 時，回傳 true &lt;/td> &lt;/tr>&lt;/table>
## case语法
&lt;pre lang="bash" escaped="true">case $變數名稱 in &amp;lt;==關鍵字為 case ，還有變數前有錢字號
"第一個變數內容") &amp;lt;==每個變數內容建議用雙引號括起來，關鍵字則為小括號 )
程式段
;; &amp;lt;==每個類別結尾使用兩個連續的分號來處理！
"第二個變數內容")
程式段
;;
*) &amp;lt;==最後一個變數內容都會用 * 來代表所有其他值
不包含第一個變數內容與第二個變數內容的其他程式執行段
exit 1
;;
esac &amp;lt;==最終的 case 結尾！『反過來寫』思考一下！&lt;/pre>
&lt;h2 id="while语法">while语法&lt;/h2>
&lt;pre lang="bash" escaped="true">while [ condition ] &amp;lt;==中括號內的狀態就是判斷式
do &amp;lt;==do 是迴圈的開始！
程式段落
done &amp;lt;==done 是迴圈的結束&lt;/pre>
&lt;h2 id="for8230do8230done语法">for…do…done语法&lt;/h2>
&lt;pre lang="bash" escaped="true">for var in con1 con2 con3 ...
do
程式段
done&lt;/pre>
&lt;pre escaped="true" lang="bash">CLUSTERS=(aaa bbb ccc)
for cluster in ${CLUSTERS[@]};
do
echo $cluster
done&lt;/pre>
&lt;pre lang="bash" escaped="true">for((i=1;i&amp;lt;100;i++));do
echo $i
done&lt;/pre>
&lt;h2 id="软链接替换">软链接替换&lt;/h2>
&lt;p>ln -snf ./hive-0.7.1/ hive&lt;/p>
&lt;h2 id="利用grep和gawkxargs来kill">利用grep和gawk，xargs来kill&lt;/h2>
&lt;p>xargs会把gawk的每一行变成kill的参数，如 kill 1 2 3
grep -v 是排除
ps -ef|grep scott|grep -v grep|gawk {‘print $1’}|xargs kill&lt;/p>
&lt;h2 id="sed命令替换文本">sed命令替换文本&lt;/h2>
&lt;pre lang="bash" escaped="true">sed -i "s/oldstring/newstring/g" file #在原文件修改
sed "s/oldstring/newstring/g" file &amp;gt;file.new # 输出到其他文件
file="/tmp/crontab_`date +"%H%M%S"`.bak"; crontab -l &amp;gt; $file; sed "s/\*\/5 \* \* \* \* run-parts/\* \* \* \* \* run-parts/g" $file &amp;gt; "$file.new"; crontab "$file.new"; # 替换crontab文件
sed -r 's/^\s+([0-9]+) /\1|/g'
sed -i '$i\eeeeeeeee'  urfile # 在倒数一行插入内容&lt;/pre>
&lt;h2 id="tar">tar&lt;/h2>
&lt;pre lang="bash">tar --exclude=log -cvzf xxx_`date +"%Y-%m-%d_%H_%M"`.tar.gz ./xxx
# 使用xz压缩，如果使用lzma压缩也是用XZ_OPT
XZ_OPT=-1 tar -cf 1.tar.xz --xz xx.log
&lt;/pre>
&lt;h2 id="获取机器ip">获取机器IP&lt;/h2>
&lt;p>via:http://www.cnblogs.com/starspace/archive/2009/02/13/1390062.html&lt;/p>
&lt;pre lang="bash" escaped="true">/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"&lt;/pre>
&lt;h2 id="grep-获取前几行后几行的内容">GREP 获取前几行后几行的内容&lt;/h2>
&lt;pre lang="html">grep -n -B1 -A1 "关键字" file #匹配关键字的前一行与后一行.&lt;/pre>
&lt;h2 id="rsync-通过ssh传输">Rsync 通过ssh传输&lt;/h2>
&lt;pre lang="bash"># -e 参数指定用ssh传输
rsync --exclude 'logs' --size-only --progress -rave "ssh -p2222" /home/xx/ 用户名@IP地址:/tmp/xx&lt;/pre>
&lt;h2 id="kill进程树">kill进程树&lt;/h2>
&lt;p>&lt;a href="http://stackoverflow.com/questions/392022/best-way-to-kill-all-child-processes">http://stackoverflow.com/questions/392022/best-way-to-kill-all-child-processes&lt;/a>&lt;/p>
&lt;h2 id="gawk">gawk&lt;/h2>
&lt;pre lang="bash" escaped="true">gawk -F'|' 'BEGIN {OFS="|"}{print $1,$2,$3}'
gawk '{a=index($0, " from ");if(a&amp;gt;0){b=substr($0,a+6);print substr(b, 0, index(b, " "))}}'
gawk 'BEGIN{sum=0}{sum+=$1}END{print sum}' data.txt
&lt;/pre>
&lt;h2 id="输出一大段文本">输出一大段文本&lt;/h2>
&lt;pre lang="bash" escaped="true">cat &amp;lt;&amp;lt;'EOF' &amp;gt;&amp;gt; ./test.txt
XXX
EOF&lt;/pre>
&lt;h2 id="简单的http服务">简单的http服务&lt;/h2>
&lt;p lang="bash"> python -m SimpleHTTPServer 8080&lt;/p>
## NC传文件
&lt;pre lang="bash" escaped="true">接收方
/sbin/ifconfig |grep 'inet addr:10'
nc -l 9999 | tar zxvf -
发送方 tar czvf - ./xxx | nc server 9999
如果nc -l执行失败，下载旧版本 http://vault.centos.org/6.6/os/x86_64/Packages/nc-1.84-22.el6.x86_64.rpm
&lt;/pre>
&lt;h2 id="find">Find&lt;/h2>
&lt;pre lang="bash">find /tmp/ -mtime +1 -name 'xxx_*.log' -delete
find /tmp/ -mmin +60 -name 'xxx_*.log' -delete
&lt;/pre>
&lt;h2 id="date">date&lt;/h2>
&lt;pre lang="bash">dt=$(date +"%Y%m%d_%H%M%S")&lt;/pre>
&lt;h2 id="用户组管理命令">用户/组管理命令&lt;/h2>
&lt;p>&lt;a href="http://cnzhx.net/blog/linux-add-user-to-group/">http://cnzhx.net/blog/linux-add-user-to-group/&lt;/a>&lt;/p>
&lt;pre lang="bash"># 把xxx加入apache组
usermod -a -G apache xxx
&lt;/pre>
&lt;h2 id="sort">sort&lt;/h2>
&lt;pre lang="bash" escaped="true"># 按human readable 方式排序（sort -h）
hdfs dfs -du -h /user/|sed -r 's/([0-9.]*)[ ]/\1/'|sort -hr
# -t是分隔符
# 先按第一列排序，再按第二列数字排序
cat 1.txt |sort -t',' -k1,1 -k2,2n
&lt;/pre>
&lt;h2 id="截取kv文件">截取kv文件&lt;/h2>
&lt;p>&lt;a href="http://unix.stackexchange.com/questions/186453/cut-for-key-value-pairs">via&lt;/a>&lt;/p>
&lt;pre lang="bash" escaped="true">head 000000_0 |awk -v RS='`' -F'=' '$1=="keyname"'
head 000000_0 |grep -o '`keyname=[^`]*'&lt;/pre>
&lt;h2 id="只复制目录结构">只复制目录结构&lt;/h2>
&lt;pre lang="bash" escaped="true"># 把dir1的目录结构复制到dir2内
find ./dir1 -type d -exec mkdir -p dir2/\{\} \;&lt;/pre>
&lt;h2 id="shell重试方法">shell重试方法&lt;/h2>
&lt;pre lang="bash" escaped="true">retry() {
local -r -i max_attempts="$1"; shift
local -r cmd="$@"
local -i attempt_num=1
until $cmd
do
if (( attempt_num == max_attempts ))
then
echo "Attempt $attempt_num failed and there are no more attempts left!"
return 1
else
echo "Attempt $attempt_num failed! Trying again in 60 seconds..."
echo $(( attempt_num++ ))
sleep 60
fi
done
}
# 使用方式
retry 6 echo "ok"&lt;/pre>
&lt;h2 id="参考">参考&lt;/h2>
&lt;p>大部分内容来自：http://linux.vbird.org/linux_basic/0320bash.php&lt;br>
&lt;a href="http://man.linuxde.net/">linux命令行查询&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category><category domain="https://fatkun.github.io/tags/linux/">Linux</category><category domain="https://fatkun.github.io/tags/linux-shell/">Linux Shell</category><category domain="https://fatkun.github.io/tags/shell/">Shell</category></item><item><title>Extjs3 PagingToolbar下拉框分页插件</title><link>https://fatkun.github.io/2012/03/extjs3-pagingtoolbar-combbox.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/03/extjs3-pagingtoolbar-combbox.html</guid><pubDate>Sun, 11 Mar 2012 17:37:40 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Extjs PagingToolbar下拉框分页插件&lt;/p>
&lt;pre escaped="true" lang="js">Ext.namespace('Ext.ui.plugins');
Ext.ui.plugins.ComboPageSize = function(config) {
Ext.apply(this, config);
};
Ext.extend(Ext.ui.plugins.ComboPageSize, Ext.util.Observable, {
pageSizes: [25, 50, 100, 200, 500],
prefixText: '每页显示',
postfixText: '条',
addToItem: true, //true添加到items中去，配合index；false则直接添加到最后
index: 10, //在items中的位置
init: function(pagingToolbar) {
var ps = this.pageSizes;
var combo = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
lazyRender: true,
mode: 'local',
width: 80,
store: ps,
enableKeyEvents: true,
editable: false,
loadPages: function() {
var rowIndex = 0;
var gp = pagingToolbar.findParentBy(
function(ct, cmp) { return (ct instanceof Ext.grid.GridPanel) ? true : false; }
);
var sm = gp.getSelectionModel();
if (undefined != sm &amp;&amp; sm.hasSelection()) {
if (sm instanceof Ext.grid.RowSelectionModel) {
rowIndex = gp.store.indexOf(sm.getSelected());
} else if (sm instanceof Ext.grid.CellSelectionModel) {
rowIndex = sm.getSelectedCell()[0];
}
}
rowIndex += pagingToolbar.cursor;
pagingToolbar.doLoad(Math.floor(rowIndex / pagingToolbar.pageSize) * pagingToolbar.pageSize);
},
listeners: {
select: function(c, r, i) {
pagingToolbar.pageSize = ps[i];
this.loadPages();
},
blur: function() {
var pagesizeTemp = Number(this.getValue());
if (isNaN(pagesizeTemp)) {
this.setValue(pagingToolbar.pageSize);
return;
}
pagingToolbar.pageSize = Number(this.getValue());
this.loadPages();
}
}
});
if (this.addToItem) {
var inputIndex = this.index;
if (inputIndex &amp;gt; pagingToolbar.items.length) inputIndex = pagingToolbar.items.length;
pagingToolbar.insert(++inputIndex, '-');
pagingToolbar.insert(++inputIndex, this.prefixText);
pagingToolbar.insert(++inputIndex, combo);
pagingToolbar.insert(++inputIndex, this.postfixText);
}
else {
pagingToolbar.add('-');
pagingToolbar.add(this.prefixText);
pagingToolbar.add(combo);
pagingToolbar.add(this.postfixText);
}
pagingToolbar.on({
beforedestroy: function() {
combo.destroy();
},
change: function() {
combo.setValue(pagingToolbar.pageSize);
}
});
}
})
&lt;/pre>
&lt;h2 id="使用方法">使用方法&lt;/h2>
&lt;pre escaped="true" lang="js">bbar: new Ext.PagingToolbar({
plugins: new Ext.ui.plugins.ComboPageSize(),
pageSize: myPageSize,
displayInfo : true,
displayMsg : '当前记录数: {0} - {1} 总记录数: {2}',
emptyMsg : '没有符合条件的记录',
store : config.store
})&lt;/pre>
&lt;p>来源：&lt;a href="http://www.cnblogs.com/badwps/archive/2011/04/15/2016440.html" title="Ext.PagingToolbar设置每页显示条数插件" target="_blank">Ext.PagingToolbar设置每页显示条数插件&lt;/a>&lt;br>
作者还有个滑动条改变分页的，赞，链接过去看吧。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/combbox/">Combbox</category><category domain="https://fatkun.github.io/tags/extjs/">Extjs</category><category domain="https://fatkun.github.io/tags/paging/">Paging</category><category domain="https://fatkun.github.io/tags/%E5%88%86%E9%A1%B5/">分页</category></item><item><title>hue runcpserver has restarted more than 3 times</title><link>https://fatkun.github.io/2012/03/hue-runcpserver-has-restarted-more-than-3-times.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/03/hue-runcpserver-has-restarted-more-than-3-times.html</guid><pubDate>Tue, 06 Mar 2012 17:07:38 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>运行hue时，~/hue/build/env/bin$ ./supervisor 遇到这个错误，查看logs可以看到这句：&lt;/p>
&lt;blockquote>
&lt;p>runcpserver has restarted more than 3 times&lt;/p>
&lt;/blockquote>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>更改hue/desktop/conf/hue.ini配置&lt;br>
# Set to true to use CherryPy as the webserver, set to false&lt;br>
# to use Spawning as the webserver. Defaults to Spawning if&lt;br>
# key is not specified.&lt;br>
use_cherrypy_server = true
去掉注释并改为true&lt;br>
默认为Spawning，不知道我错误的原因。。不过盖茨用cherrypy就正常了。&lt;br>
如果需要用beeswax还需要配置hue_beeswax.ini，把注释去掉就可以了。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/hue/">Hue</category></item><item><title>gcc: error trying to exec ‘cc1plus’: execvp: 没有那个文件或目录</title><link>https://fatkun.github.io/2012/03/cc1plus.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/03/cc1plus.html</guid><pubDate>Tue, 06 Mar 2012 15:47:25 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>参考&lt;a href="http://archive.cloudera.com/cdh/3/hue/manual.html">http://archive.cloudera.com/cdh/3/hue/manual.html&lt;/a>安装hue，首先把那些lib都安装先。
然后&lt;/p>
&lt;pre>$ HADOOP_HOME=/path/to/hadoop-0.20 PREFIX=/path/to/install/into make install&lt;/pre>
&lt;p>遇到这个错误&lt;/p>
&lt;blockquote>
&lt;p>gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Isasl -I/usr/include/python2.7 -c sasl/saslwrapper.cpp -o build/temp.linux-i686-2.7/sasl/saslwrapper.o&lt;br>
gcc: error trying to exec ‘cc1plus’: execvp: 没有那个文件或目录&lt;br>
error: command ‘gcc’ failed with exit status 1&lt;br>
make[2]: *** [/home/fatkun/hue-1.2.0.0-cdh3u3/desktop/core/build/sasl-0.1.1/egg.stamp] 错误 1
安装g++即可,apt-get install g++
注意g++的版本要和gcc的一致， g++ –version查看版本。
 &lt;/p>
&lt;/blockquote></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/g-/">G++</category><category domain="https://fatkun.github.io/tags/gcc/">Gcc</category><category domain="https://fatkun.github.io/tags/hue/">Hue</category></item><item><title>图片批量下载扩展捐赠名单(6月10日更新)</title><link>https://fatkun.github.io/2012/03/batch-download-image-donate.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/03/batch-download-image-donate.html</guid><pubDate>Sun, 04 Mar 2012 15:21:01 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>捐赠名单好久不更新了。。是因为我懒（也是因为懒才有了这个扩展）。。。但支付成功的我都收的到，谢谢。
 
不说什么了，感谢你们的支持！
如果你不想出现在此页面上或有其他要求，请在下面的评论和我联系。
很多人给我捐款，真的很感动。。 &lt;a href="https://me.alipay.com/fatkun" target="_blank">捐赠链接&lt;/a>
(以下按捐赠时间排序,姓名用星号替代避免隐私泄露，&lt;strong>未支付成功的没有列出来&lt;/strong>)&lt;/p>
&lt;table> &lt;tr> &lt;th> 姓名 &lt;/th>
&lt;th> 留言 &lt;/th>
&lt;th> 金额 &lt;/th>
&lt;th> 捐赠日期 &lt;/th> &lt;/tr>
&lt;tr> &lt;td> *志鹏 &lt;/td>
&lt;td> 图片批量下载 &lt;/td>
&lt;td> 6元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *沛 &lt;/td>
&lt;td> 很好用，希望不短完善 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *日厚 &lt;/td>
&lt;td> FATKUN图片指下载 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *驰 &lt;/td>
&lt;td> 好 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> 2013.05.21 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *宗仁 &lt;/td>
&lt;td> 非常感谢您的工具，保存名序号能不能从20 或 其它设置呀？ &lt;/td>
&lt;td> 1元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *鸿元 &lt;/td>
&lt;td> 谢谢你的努力，这是我的第一笔开发者捐赠 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *锋 &lt;/td>
&lt;td> &lt;/td>
&lt;td> 30元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *天贵 &lt;/td>
&lt;td> Fatkun图片批量下载 &lt;/td>
&lt;td> 1元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *仁波 &lt;/td>
&lt;td> 加油 这个插件不错 继续改进 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *显 &lt;/td>
&lt;td> 从不吃免费午餐 &lt;/td>
&lt;td> 1元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 张*鸣 &lt;/td>
&lt;td> 谢谢制作Fatkun图片批量下载谷歌浏览器扩展 &lt;/td>
&lt;td> 20元 &lt;/td>
&lt;td> 2013.04.08 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *炯 &lt;/td>
&lt;td> &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 刘*峰 &lt;/td>
&lt;td> 一定要坚持下去哈 &lt;/td>
&lt;td> 5元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *鹏 &lt;/td>
&lt;td> 还在上学，没有多少钱，心意一下，希望继续开发。很好用，十分感 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 杨*达 &lt;/td>
&lt;td> 谢谢你的批量图片下载猎豹插件啊 &lt;/td>
&lt;td> 1元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 吴*端 &lt;/td>
&lt;td> 鼓励 &lt;/td>
&lt;td> 49元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 刘*曦 &lt;/td>
&lt;td> 谢谢！ &lt;/td>
&lt;td> 1元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *沛 &lt;/td>
&lt;td> 辛苦了 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *恒 &lt;/td>
&lt;td> 感谢 &lt;/td>
&lt;td> 20元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *田 &lt;/td>
&lt;td> 浏览器插件很好用，望继续开发 &lt;/td>
&lt;td> 20元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 胡*仁 &lt;/td>
&lt;td> 友情捐助 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> 2013.03.04 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 郎*一 &lt;/td>
&lt;td> 谢谢 &lt;/td>
&lt;td> 3元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *菲 &lt;/td>
&lt;td> 支持你开发了这么好的插件！ &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *全 &lt;/td>
&lt;td> 谢谢您开发的软件,对我很有帮助,一点小小心意 &lt;/td>
&lt;td> 5元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 胡*凡 &lt;/td>
&lt;td> 感謝分享插件 &lt;/td>
&lt;td> 50元 &lt;/td>
&lt;td> 史上金额最高！！感谢支持！ &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *田 &lt;/td>
&lt;td> 很好的软件 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> 2013.02.02 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 费*军 &lt;/td>
&lt;td> 买瓶健康点的饮料，别多喝可乐。 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> ：）谢谢 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *力 &lt;/td>
&lt;td> 一瓶可乐。略表谢意~ &lt;/td>
&lt;td> 2.5元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 杨*卿 &lt;/td>
&lt;td> 加油，运行起来小卡一下 &lt;/td>
&lt;td> 3元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 李*敏 &lt;/td>
&lt;td> xie &lt;/td>
&lt;td> 1元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 徐*靓 &lt;/td>
&lt;td> 我爱死你了~ &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> 我也爱你^_^ &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *健 &lt;/td>
&lt;td> 下载百度贴吧图片再排序,忙一下午就哥们你这方案最佳,送可乐！ &lt;/td>
&lt;td> 2.5元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 李*梅 &lt;/td>
&lt;td> 支持 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *旻炅 &lt;/td>
&lt;td> 我是穷学生，不过也要支持你，希望你继续加油 &lt;/td>
&lt;td> 2元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *文龙 &lt;/td>
&lt;td> 穷学生，还是学计算机的不学习的菜鸟，用着不错，谢谢分享 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> 2012.12.02 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *崧博 &lt;/td>
&lt;td> 用着挺好 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *云潇 &lt;/td>
&lt;td> 。。一瓶可乐 &lt;/td>
&lt;td> 3元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *志立 &lt;/td>
&lt;td> 鼓励作者继续开发 &lt;/td>
&lt;td> 4元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *光明 &lt;/td>
&lt;td> 图片批量下载很好用，希望继续开发 &lt;/td>
&lt;td> 2元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *美锋 &lt;/td>
&lt;td> 很感谢你做的图片下载扩展！略表谢意 &lt;/td>
&lt;td> 5元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *文龙 &lt;/td>
&lt;td> 本人热爱编程，望赐教与指导！ &lt;/td>
&lt;td> 5元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *娜 &lt;/td>
&lt;td> 谢谢，很实用的工具 &lt;/td>
&lt;td> 0.5元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *家冀 &lt;/td>
&lt;td> 支持作者 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *龙 &lt;/td>
&lt;td> 穷学生，没什么钱 &lt;/td>
&lt;td> 1元 &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 匿名 &lt;/td>
&lt;td> 帮忙支付google webstore验证费用 &lt;/td>
&lt;td> 5$ &lt;/td>
&lt;td> &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *子铭 &lt;/td>
&lt;td> 想知道怎么使用 &lt;/td>
&lt;td> 5元 &lt;/td>
&lt;td> 2012.08.18 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *东明 &lt;/td>
&lt;td> 支持 &lt;/td>
&lt;td> 2元 &lt;/td>
&lt;td> 2012.08.17 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *培文 &lt;/td>
&lt;td> 感谢您这么多年来的努力，钱虽不多，仅表敬意。 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> 2012.07.20 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *韬 &lt;/td>
&lt;td> 一瓶汽水 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> 2012.07.18 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *文达 &lt;/td>
&lt;td> 谢谢 &lt;/td>
&lt;td> 3元 &lt;/td>
&lt;td> 2012.07.16 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *巍 &lt;/td>
&lt;td> 希望你继续 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> 2012.07.13 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *颢 &lt;/td>
&lt;td> 支持 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> 2012.07.11 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *剑勋 &lt;/td>
&lt;td> 赞助 &lt;/td>
&lt;td> 4元 &lt;/td>
&lt;td> 2012.06.29 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *旗 &lt;/td>
&lt;td> 一直使用，能力有限，支持。 &lt;/td>
&lt;td> 30元 &lt;/td>
&lt;td> 2012.06.28 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 艾孜热提艾力·*森 &lt;/td>
&lt;td> 非常感谢你的批量下载插件, 我是一位维吾尔小伙子! 呵呵.. &lt;/td>
&lt;td> 5元 &lt;/td>
&lt;td> 2012.06.01 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 张*辉 &lt;/td>
&lt;td> 谢谢。 &lt;/td>
&lt;td> 1元 &lt;/td>
&lt;td> 2012.05.17 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *诚 &lt;/td>
&lt;td> 余额不多。还请笑纳。 &lt;/td>
&lt;td> 5元 &lt;/td>
&lt;td> 2012.05.07 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 刘*锴 &lt;/td>
&lt;td> 面包总会有的，好用的插件；可以合并多页取图就好了 &lt;/td>
&lt;td> 5元 &lt;/td>
&lt;td> 2012.05.07 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *成 &lt;/td>
&lt;td> 没想到作者还惦记着这扩展，希望继续完善 &lt;/td>
&lt;td> 2元 &lt;/td>
&lt;td> 2012.04.04 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 王*聿 &lt;/td>
&lt;td> 这个扩展很好用，无奈本人学生财力有限，但还是支持一下 &lt;/td>
&lt;td> 5元 &lt;/td>
&lt;td> 2012.03.30 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 叶*锋 &lt;/td>
&lt;td> 支持 &lt;/td>
&lt;td> 20元 &lt;/td>
&lt;td> 2012.03.23 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *迪 &lt;/td>
&lt;td> 谢谢你的chrome图片作品，很荣幸能使用您的作品 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> 2012.03.13 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 马*龙 &lt;/td>
&lt;td> 加油，我很喜欢这个插件，希望你能进一步的完善它，感谢！ &lt;/td>
&lt;td> 20元 &lt;/td>
&lt;td> 2012.03.12 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 崔*辉 &lt;/td>
&lt;td> 方便，继续加油。小钱表示心意。 &lt;/td>
&lt;td> 10元 &lt;/td>
&lt;td> 2012.03.08 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *珂 &lt;/td>
&lt;td> 支持 &lt;/td>
&lt;td> 1元 &lt;/td>
&lt;td> 2012.03.07 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> *兴 &lt;/td>
&lt;td> 小小心意，支持开发 &lt;/td>
&lt;td> 9.2元 &lt;/td>
&lt;td> 2012.02.29 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 韩*泓 &lt;/td>
&lt;td> 只剩半瓶汽水的钱了 &lt;/td>
&lt;td> 0.5元 &lt;/td>
&lt;td> 2012.02.20 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> 刘*锐 &lt;/td>
&lt;td> fatkun &lt;/td>
&lt;td> 0.1元 &lt;/td>
&lt;td> 2012.02.06 &lt;/td> &lt;/tr>&lt;/table>
&amp;nbsp;</description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/%E6%8D%90%E8%B5%A0/">捐赠</category></item><item><title>Fatkun图片批量下载谷歌浏览器扩展1.2版更新</title><link>https://fatkun.github.io/2012/03/fatkun-batch-image-download-1-2.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/03/fatkun-batch-image-download-1-2.html</guid><pubDate>Sun, 04 Mar 2012 14:55:44 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;div id="update_info"> &lt;h2> Fatkun图片批量下载1.2版更新了！ &lt;/h2>
&lt;p> 首先，特别感谢三位朋友的捐赠，谢谢你们的鼓励！这是我人生中第一次收到的捐赠，非常感谢你们！ &lt;/p>
&lt;p> 欢迎使用Fatkun图片批量下载1.2版，有以下更新： &lt;/p>
&lt;ul> &lt;li> 增加了针对特定网站获取大图片，现在支持&lt;a href="http://topit.me" target="_blank">topit.me&lt;/a>和&lt;a href="http://mmfuli.com" target="_blank">mmfuli.com&lt;/a>，后期会继续增加其他网站的支持 &lt;/li>
&lt;li> 图片分批次获取图片大小 &lt;/li>
&lt;li> 添加新浪微博分享 &lt;/li> &lt;/ul>
&lt;p> 这个扩展虽然功能还不算很强大，但依然花费了我一些时间来完善它，如果你认为这个扩展对你有用并且愿意支持作者开发，&lt;a class="donate" title="如果对你有用并愿意支持作者继续开发完善，使用支付宝捐助作者。" href="https://me.alipay.com/fatkun" target="_blank">点此捐助作者&lt;/a>，或者向身边的朋友推荐这个扩展，谢谢。 &lt;/p>
&lt;p> &lt;a href="http://topit.me" target="_blank">topit.me&lt;/a>和&lt;a href="http://mmfuli.com" target="_blank">mmfuli.com&lt;/a>这两个网站，可以去试试。 &lt;/p>
&lt;p> mmfuli的要进到图片列表的目录才有效果哦。。如下面的网址。 &lt;/p>
&lt;p> &lt;a href="http://mmfuli.com/beautyleg/no550_kate">http://mmfuli.com/beautyleg/no550_kate&lt;/a> &lt;/p>
&lt;p> 为什么要针对特定网站获取大图片呢？因为有些图片是要打开页面才能看到大图片的，不过对于部分图片，缩略图和大图存在一些关系，我们可以把这关系找出来，然后进行替换。 &lt;/p>
&lt;p> 考虑到编写替换规则有困难（需要了解js，正则表达式），暂时还是由我在日后更新中添加更多网站的支持。 &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> 更多信息：&lt;a href="http://fatkun.com/2010/09/batch-image-download.html">http://fatkun.com/2010/09/batch-image-download.html&lt;/a> &lt;/p>
&lt;p> &lt;a href="http://fatkun.com/wp-content/uploads/2012/03/mmfuli.jpg">&lt;img class="alignnone size-full wp-image-1051" title="mmfuli" src="http://fatkun.com/wp-content/uploads/2012/03/mmfuli.jpg" alt="" width="905" height="632" />&lt;/a> &lt;/p>&lt;/div></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/batch-image-download/">Batch Image Download</category><category domain="https://fatkun.github.io/tags/chrome/">Chrome</category><category domain="https://fatkun.github.io/tags/chrome-extensions/">Chrome Extensions</category></item><item><title>js模拟限制图片同时下载个数(使用setTimeout)</title><link>https://fatkun.github.io/2012/03/limit-download-images-using-settimeout.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/03/limit-download-images-using-settimeout.html</guid><pubDate>Sat, 03 Mar 2012 13:24:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>浏览器默认会对同一域名的图片有一个限制同时最多下载X个图片，但是如果图片是多域名的，有时候就会同时下载了很多图片，导致有些图片下载失败！&lt;br>
先来看一段代码：&lt;/p>
&lt;pre escaped="true" lang="js">&amp;lt;script language="javascript"&amp;gt;
// 构造一些不同子域名的图片链接
url = '.topit.me/4/cf/69/1130159413c3c69cf4l.jpg';
var array = [];
var hex = ['1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']
for (var i=0; i &amp;lt; 20; i++) {
var index = hex[i % 15];
array.push('http://i' + index + url + '?time=' + i);
}
console.log(array);
for (var i=0; i &amp;lt; array.length; i++) {
var img = new Image();
img.onload = function() {
console.log('onload', this.src);
}
img.onerror = function() {
console.log('onerror', this.src);
}
img.src = array[i];
console.log('array[i]', array[i]);
}
&amp;lt;/script&amp;gt;&lt;/pre>
&lt;p>这段代码模拟网页打开时加载图片，一次性给浏览器加载N个图片。&lt;br>
把代码保存为html文件，在chrome浏览器打开。&lt;br>
可以在控制台network看到图片的加载，如果是同一域名下，会限制X个图片同时下载，但不同域名就会看到一堆的图片在下载了，还有些图片下载失败了。&lt;/p>
&lt;h2 id="需求">需求&lt;/h2>
&lt;p>我们需要人为限制一下图片同时下载的个数！并且分批来完成下载所有图片。&lt;/p>
&lt;h2 id="思路">思路&lt;/h2>
&lt;p>有点像消费者/生产者模式，有一个生产者（目前已经生产了产品啦，就是一堆图片url），然后就有多个消费者去消费（拿url去下载图片）&lt;br>
利用一个数组来模拟队列~然后取吧。。&lt;/p>
&lt;h2 id="实现">实现&lt;/h2>
&lt;pre escaped="true" lang="js">&amp;lt;script language="javascript"&amp;gt;
// 构造一些不同子域名的图片链接
url = '.topit.me/4/cf/69/1130159413c3c69cf4l.jpg';
var array = [];
var hex = ['1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']
for (var i=0; i &amp;lt; 20; i++) {
var index = hex[i % 15];
array.push('http://i' + index + url + '?time=' + i);
}
console.log(array);
var QueneEnginer = function(){
this.Quene = [];
}
QueneEnginer.prototype = {
processTime: 100,
loadNum: 0,
maxDownloadNum: 5,
add: function(arr) {
for (var i=0; i &amp;lt; arr.length; i++) {
this.Quene.push(arr[i]);
}
},
start: function() {
var that = this;
setTimeout(function() {that.process();}, that.processTime);
},
process: function() {
var that = this;
if (this.Quene.length &amp;gt; 0) {
while (this.loadNum &amp;lt; this.maxDownloadNum) { // 如果有空位，就加载图片吧
var url = this.Quene.shift(); // 从数组取一个出来吧
if (url == null) {break;} // 取完了就中断
this.loadNum++;// 标记一下，我要开始下载咯
this.loadPic(url, function(src) {
document.write(src + '&amp;lt;br/&amp;gt;');
that.loadNum--; // 加载完图片记得减一哦
console.log('callback');
});
}
this.start(); // 这里是重点，利用了setTimeout，不断的循环，直到this.Quene.length &amp;lt;= 0
}
},
loadPic: function(url, callback) { //加载图片，实现callback为了回调计数
var img = new Image();
img.onload = function() {
console.log('onload', this.src);
callback(this.src);
}
img.onerror = function() {
console.log('onerror', this.src);
callback(this.src);
}
img.src = url;
console.log('array[i]', url);
}
}
var qe = new QueneEnginer();
qe.add(array);
qe.start();
&amp;lt;/script&amp;gt;&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/javascript/">Javascript</category><category domain="https://fatkun.github.io/tags/js/">Js</category><category domain="https://fatkun.github.io/tags/settimeout/">SetTimeout</category><category domain="https://fatkun.github.io/tags/%E5%9B%BE%E7%89%87%E4%B8%8B%E8%BD%BD/">图片下载</category></item><item><title>Django实战(Django admin)</title><link>https://fatkun.github.io/2012/02/use-django.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/02/use-django.html</guid><pubDate>Wed, 22 Feb 2012 04:08:23 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这个django教程不错，看了admin部分，说得很清楚。记录一下&lt;br>
包括如何使用Django admin等
&lt;a href="http://blog.csdn.net/thinkinside/article/details/7249001">http://blog.csdn.net/thinkinside/article/details/7249001&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/django/">Django</category><category domain="https://fatkun.github.io/tags/django-admin/">Django Admin</category></item><item><title>Android真机调试访问本地服务器（localhost）的解决方案</title><link>https://fatkun.github.io/2012/02/android-get-localhost-access.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/02/android-get-localhost-access.html</guid><pubDate>Sun, 05 Feb 2012 15:21:33 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Android系统把它自己作为了localhost!当连接localhost都是他自己啊。。
囧，在这里晕了好久才发现。。
网上介绍的都是模拟器连接本地服务器的，我试着把链接改为http://10.0.2.2/依然不可以。。&lt;br>
我是真机调试，不是模拟器，那怎么办呢？&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>我的环境是用手机通过WIFI上网，和本地电脑在同一个局域网内。找出本地电脑的ip即可，手机可以直接访问这个IP。
如果不是在局域网内，只能把网页放到可以给外部访问的地方了（例如服务器）&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/localhost/">Localhost</category><category domain="https://fatkun.github.io/tags/%E7%9C%9F%E6%9C%BA%E8%B0%83%E8%AF%95/">真机调试</category></item><item><title>Android Handler和HandlerThread使用方法</title><link>https://fatkun.github.io/2012/02/android-handler-and-handlerthread.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/02/android-handler-and-handlerthread.html</guid><pubDate>Sun, 05 Feb 2012 14:10:55 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Handler的官方注释如下：&lt;/p>
&lt;blockquote>
&lt;p>A Handler allows you to send and process &lt;code>&amp;lt;a href=&amp;quot;file:///F:/android%E5%AD%A6%E4%B9%A0/docs-3.0_r01-linux/docs/reference/android/os/Message.html&amp;quot;&amp;gt;Message&amp;lt;/a&amp;gt;&lt;/code> and Runnable objects associated with a thread’s &lt;code>&amp;lt;a href=&amp;quot;file:///F:/android%E5%AD%A6%E4%B9%A0/docs-3.0_r01-linux/docs/reference/android/os/MessageQueue.html&amp;quot;&amp;gt;MessageQueue&amp;lt;/a&amp;gt;&lt;/code>. Each Handler instance is associated with a single thread and that thread’s message queue.
Handler会关联一个单独的线程和消息队列。Handler默认关联主线程，虽然要提供Runnable参数 ，但默认是直接调用Runnable中的run()方法。也就是默认下会在主线程执行，如果在这里面的操作会有阻塞，界面也会卡住。如果要在其他线程执行，可以使用HandlerThread。&lt;/p>
&lt;/blockquote>
&lt;h2 id="handler使用方法">Handler使用方法：&lt;/h2>
&lt;pre lang="java">Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
// 处理发送过来的消息
Bundle b = msg.getData();
System.out.println("msg:" + msg.arg1);
System.out.println("msg:" + b.getString("name") + " - age:" + b.getInt("age"));
super.handleMessage(msg);
}
};
Message msg = handler.obtainMessage();
msg.arg1 = 121;
Bundle b = new Bundle();
b.putInt("age", 24);
b.putString("name", "Fatkun");
msg.setData(b);
msg.sendToTarget();
handler.post(r);
}
Runnable r = new Runnable() {
public void run() {
try {
// 在这里只是睡一下
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
};&lt;/pre>
&lt;h2 id="handlerthread使用方法">HandlerThread使用方法：&lt;/h2>
&lt;pre escaped="true" lang="java">//把上面创建Handler的代码
Handler handler = new Handler() {
...
}
//改为：
HandlerThread thread = new HandlerThread("athread");
thread.start(); //要把线程启动
Handler handler = new Handler(thread.getLooper()) {
...
}&lt;/pre>
&lt;h2 id="参考">参考：&lt;/h2>
&lt;p>&lt;a href="http://www.cnblogs.com/xirihanlin/archive/2011/04/11/2012746.html" title="Android中的Handler, Looper, MessageQueue和Thread" target="_blank">Android中的Handler, Looper, MessageQueue和Thread的关系&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/handler/">Handler</category><category domain="https://fatkun.github.io/tags/handlerthread/">HandlerThread</category></item><item><title>Fatkun图片批量下载谷歌浏览器扩展1.0版更新了！</title><link>https://fatkun.github.io/2012/02/batch-image-download-1-0.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/02/batch-image-download-1-0.html</guid><pubDate>Thu, 02 Feb 2012 16:25:28 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h3 id="delspan-stylecolor-ff0000strong乱码的问题今天晚上更新非常抱歉将会自动更新不需要任何操作strongspandel">&lt;del>&lt;span style="color: #ff0000;">&lt;strong>乱码的问题今天晚上更新，非常抱歉。将会自动更新，不需要任何操作。&lt;/strong>&lt;/span>&lt;/del>&lt;/h3>
&lt;p>已更新到服务器，可以等自动更新也可以下载下面链接立即更新。
（尝试解决乱码）1.1版插件地址：&lt;a href="http://bath-image-download.googlecode.com/files/batch1_0.crx" target="_blank">&lt;a href="https://bath-image-download.googlecode.com/files/batch1_1.crx">https://bath-image-download.googlecode.com/files/batch1_1.crx&lt;/a>&lt;/a>
 
Fatkun图片批量下载谷歌浏览器扩展是一个从网页批量下载图片的扩展，提供方便简单的筛选功能，快速的批量下载图片。
 
&lt;strong>1.0版&lt;/strong>update:2012-02-03****&lt;/p>
&lt;ol>
&lt;li>完全重构了一次代码，以前的代码写的很乱，趁春节在家重写一遍代码&lt;/li>
&lt;li>支持框架网页获取图片（例如猫扑）&lt;/li>
&lt;li>支持直接链接是图片的文本链接图片&lt;/li>
&lt;li>重新自己画了一个图标：）
 
下一次更新将加入一些特定代码针对特定网站取得大图片。
做这个扩展，刚开始是因为当时的扩展并不好用，自己写了一个简单的自己用着爽。现在还花时间更新这个扩展，一是想通过做学习多一点js，二是这个扩展也还不算完善。如果你喜欢这个扩展并愿意捐赠作者，给一点点鼓励也好。。。&lt;a href="https://me.alipay.com/fatkun" target="_blank">点此给我买瓶汽水&lt;/a>（支付宝）。
 
更多内容见此：&lt;a href="http://fatkun.com/2010/09/batch-image-download.html">http://fatkun.com/2010/09/batch-image-download.html&lt;/a>&lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/batch-image-download/">Batch Image Download</category></item><item><title>event.getAction()&amp;MotionEvent.ACTION_MASK的原因</title><link>https://fatkun.github.io/2012/01/motionevent-action_mask.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/01/motionevent-action_mask.html</guid><pubDate>Tue, 10 Jan 2012 17:36:45 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>看到下面代码中用了AND位运算是为了什么呢？&lt;/p>
&lt;pre lang="java" escaped="true">public boolean onTouchEvent(MotionEvent event) {
int action = event.getAction();
switch (action &amp; MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
showMsg("ACTION_DOWN" + action);
break;
case MotionEvent.ACTION_UP:
showMsg("ACTION_UP" + action);
break;
case MotionEvent.ACTION_POINTER_UP:
showMsg("ACTION_POINTER_UP" + action);
break;
case MotionEvent.ACTION_POINTER_DOWN:
showMsg("ACTION_POINTER_DOWN" + action);
break;
}
return super.onTouchEvent(event);
}&lt;/pre>
&lt;p>首先来看看这些常量的值&lt;/p>
&lt;pre lang="other" escaped="true">ACTION_MASK 0x000000ff
ACTION_DOWN 0x00000000 ACTION_UP 0x00000001 ACTION_MOVE 0x00000002
ACTION_POINTER_DOWN 0x00000005 ACTION_POINTER_UP 0x00000006
ACTION_POINTER_1_DOWN 0x00000005 ACTION_POINTER_1_UP 0x00000006
ACTION_POINTER_2_DOWN 0x00000105 ACTION_POINTER_2_UP 0x00000106
ACTION_POINTER_3_DOWN 0x00000205 ACTION_POINTER_3_UP 0x00000206&lt;/pre>
&lt;p>看到这么多16进制有没有怕呢。。。我数学不太好，看着有点怕呢~&lt;br>
先做做十六进制AND运算&lt;br>
来看看ACTION_MASK &amp;amp; ACTION_POINTER_2_DOWN 即 0x000000ff &amp;amp; 0x00000105&lt;br>
&lt;del>换成二进制 1111 1111(2) &amp;amp; 1 0000 0110(2) = 0110(2) = 0x00000006&lt;/del>
update：上面换算错了。。囧，应该是 1111 1111(2) &amp;amp; 1 0000 0101(2) = 0101(2) = 0x00000005&lt;br>
如果不会换算，试试用计算器啦。。（掩面，我也是用计算器，快速计算的方法是把16进制的每一位扩展为4位的二进制）&lt;br>
可以看到，and运算的结果总是小于等于0x000000ff，那就是说and之后，无论你多少根手指加进来，都是会ACTION_POINTER_DOWN或者ACTION_POINTER_UP
补充一下，当第二个手指触摸屏幕时，event.getAction()的值是0x00000105，第三个手指触摸是0x00000205，放开相应的手指数量会返回相应的值。&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/action_mask/">ACTION_MASK</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/touch/">Touch</category></item><item><title>Android ViewHolder模式</title><link>https://fatkun.github.io/2012/01/android-viewholder.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/01/android-viewholder.html</guid><pubDate>Sat, 07 Jan 2012 07:46:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这个ViewHolder到底是什么呢？我们可以在官方sample看到这段代码&lt;br>
&lt;a href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html" title="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html" target="_blank">&lt;a href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html">http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html&lt;/a>&lt;/a>&lt;/p>
&lt;pre escaped="true" lang="java">static class ViewHolder {
TextView text;
ImageView icon;
}&lt;/pre>
&lt;p>可以看到它只是一个静态类，&lt;strong>它的作用就在于减少不必要的调用findViewById&lt;/strong>&lt;br>
完整的官方例子，官方例子中convertView 也是避免inflating View。&lt;br>
然后把对底下的控件引用存在ViewHolder里面，再在View.setTag(holder)把它放在view里，下次就可以直接取了。
效率相差多少？看这篇文章：&lt;a href="http://www.ideasandroid.com/archives/295#more-295" title="http://www.ideasandroid.com/archives/295#more-295" target="_blank">Android开发之ListView 适配器（Adapter）优化&lt;/a>&lt;/p>
&lt;pre escaped="true" lang="java">/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.android.apis.view;
import android.app.ListActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import android.widget.ImageView;
import android.graphics.BitmapFactory;
import android.graphics.Bitmap;
import com.example.android.apis.R;
/**
* Demonstrates how to write an efficient list adapter. The adapter used in this example binds
* to an ImageView and to a TextView for each row in the list.
*
* To work efficiently the adapter implemented here uses two techniques:
* - It reuses the convertView passed to getView() to avoid inflating View when it is not necessary
* - It uses the ViewHolder pattern to avoid calling findViewById() when it is not necessary
*
* The ViewHolder pattern consists in storing a data structure in the tag of the view returned by
* getView(). This data structures contains references to the views we want to bind data to, thus
* avoiding calls to findViewById() every time getView() is invoked.
*/
public class List14 extends ListActivity {
private static class EfficientAdapter extends BaseAdapter {
private LayoutInflater mInflater;
private Bitmap mIcon1;
private Bitmap mIcon2;
public EfficientAdapter(Context context) {
// Cache the LayoutInflate to avoid asking for a new one each time.
mInflater = LayoutInflater.from(context);
// Icons bound to the rows.
mIcon1 = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon48x48_1);
mIcon2 = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon48x48_2);
}
/**
* The number of items in the list is determined by the number of speeches
* in our array.
*
* @see android.widget.ListAdapter#getCount()
*/
public int getCount() {
return DATA.length;
}
/**
* Since the data comes from an array, just returning the index is
* sufficent to get at the data. If we were using a more complex data
* structure, we would return whatever object represents one row in the
* list.
*
* @see android.widget.ListAdapter#getItem(int)
*/
public Object getItem(int position) {
return position;
}
/**
* Use the array index as a unique id.
*
* @see android.widget.ListAdapter#getItemId(int)
*/
public long getItemId(int position) {
return position;
}
/**
* Make a view to hold each row.
*
* @see android.widget.ListAdapter#getView(int, android.view.View,
* android.view.ViewGroup)
*/
public View getView(int position, View convertView, ViewGroup parent) {
// A ViewHolder keeps references to children views to avoid unneccessary calls
// to findViewById() on each row.
ViewHolder holder;
// When convertView is not null, we can reuse it directly, there is no need
// to reinflate it. We only inflate a new View when the convertView supplied
// by ListView is null.
if (convertView == null) {
convertView = mInflater.inflate(R.layout.list_item_icon_text, null);
// Creates a ViewHolder and store references to the two children views
// we want to bind data to.
holder = new ViewHolder();
holder.text = (TextView) convertView.findViewById(R.id.text);
holder.icon = (ImageView) convertView.findViewById(R.id.icon);
convertView.setTag(holder);
} else {
// Get the ViewHolder back to get fast access to the TextView
// and the ImageView.
holder = (ViewHolder) convertView.getTag();
}
// Bind the data efficiently with the holder.
holder.text.setText(DATA[position]);
holder.icon.setImageBitmap((position &amp; 1) == 1 ? mIcon1 : mIcon2);
return convertView;
}
static class ViewHolder {
TextView text;
ImageView icon;
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setListAdapter(new EfficientAdapter(this));
}
private static final String[] DATA = Cheeses.sCheeseStrings;
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/adapter/">Adapter</category><category domain="https://fatkun.github.io/tags/viewholder/">ViewHolder</category></item><item><title>找不到管理网页和文件夹对处理方法</title><link>https://fatkun.github.io/2012/01/manager-web-page.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/01/manager-web-page.html</guid><pubDate>Wed, 04 Jan 2012 14:33:23 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>把下面内容保存为aa.reg文件，双击运行导入&lt;br>
（未测试是否成功，注册表从我电脑导出的,WIN7和XP应该是一样可以用的）&lt;/p>
&lt;pre escaped="true" lang="other">Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets]
"Text"="管理网页和文件夹对"
"HelpID"="TBD"
"Type"="group"
"Bitmap"="C:\\Windows\\system32\\\\SHELL32.DLL,4"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets\AUTO]
"CheckedValue"=dword:00000000
"Type"="radio"
"ValueName"="NoFileFolderConnection"
"HelpID"="TBD"
"Text"="作为单一文件显示和管理对"
"DefaultValue"=dword:00000000
"RegPath"="Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"
"HKeyRoot"=dword:80000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets\NOHIDE]
"ValueName"="NoFileFolderConnection"
"DefaultValue"=dword:00000000
"Text"="显示两部分但是作为单一文件进行管理"
"RegPath"="Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"
"HelpID"="TBD"
"Type"="radio"
"CheckedValue"=dword:00000002
"HKeyRoot"=dword:80000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Thickets\NONE]
"CheckedValue"=dword:00000001
"Type"="radio"
"HKeyRoot"=dword:80000001
"RegPath"="Software\\Microsoft\\Windows\\CurrentVersion\\Explorer"
"HelpID"="TBD"
"ValueName"="NoFileFolderConnection"
"DefaultValue"=dword:00000000
"Text"="显示两部分并分别进行管理"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
"NoFileFolderConnection"=dword:00000001
&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/windows/">Windows</category></item><item><title>Activity startActivityForResult</title><link>https://fatkun.github.io/2012/01/activity-startactivityforresult.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/01/activity-startactivityforresult.html</guid><pubDate>Sun, 01 Jan 2012 14:24:32 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>public void startActivityForResult (Intent intent, int requestCode)&lt;br>
从一个Activity启动另一个activity，得到结果返回给前一个activity。&lt;/p>
&lt;h2 id="简单说">简单说&lt;/h2>
&lt;p>OneActivity实现onActivityResult (int requestCode, int resultCode, Intent data)方法，然后使用startActivityForResult启动另一个Activity&lt;br>
另一个Activity取得结果后通过setResult (…)把结果传回。&lt;/p>
&lt;h2 id="代码如下">代码如下&lt;/h2>
&lt;p>界面代码不提供了，两个都是一个简单的button&lt;br>
注意要在AndroidManifest.xml定义你新增的Activity&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;activity android:name=".OtherActivity"&amp;gt;&amp;lt;/activity&amp;gt;&lt;/pre>
&lt;p>第一个Activity&lt;/p>
&lt;pre escaped="true" lang="java">package com.fatkun;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
public class OneActivity extends Activity {
private final int myRequestCode = 1; //请求码
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btn = (Button)findViewById(R.id.button1);
btn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(OneActivity.this, OtherActivity.class);
//第二个参数是请求码，会在onActivityResult返回
startActivityForResult(intent, myRequestCode);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case myRequestCode:
if (resultCode == Activity.RESULT_OK) {
//如果resultCode是RESULT_OK的话，就把内容显示出来。
Toast.makeText(this, data.getExtras().getString("info"), Toast.LENGTH_SHORT).show();
}
break;
}
}
}&lt;/pre>
&lt;p>第二个Activity&lt;/p>
&lt;pre escaped="true" lang="java">package com.fatkun;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class OtherActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.other);
Button btn = (Button) findViewById(R.id.button1);
btn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(OtherActivity.this, OneActivity.class);
intent.putExtra("info", "我是从OtherActivity返回的数据");
OnClickListener a = this;
// 这里的OtherActivity.this是为了得到OtherActivity类的对象，因为现在在button的内部类里面，this指向的是OnClickListener
OtherActivity.this.setResult(Activity.RESULT_OK, intent);
OtherActivity.this.finish(); // 结束自己
}
});
}
}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/activity/">Activity</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/startactivityforresult/">StartActivityForResult</category></item><item><title>Android BroadcastReceiver 广播</title><link>https://fatkun.github.io/2012/01/android-broadcastreceiver-%E5%B9%BF%E6%92%AD.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/01/android-broadcastreceiver-%E5%B9%BF%E6%92%AD.html</guid><pubDate>Sun, 01 Jan 2012 08:44:20 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>总结如下：&lt;br>
广播可用于Service与Activity的之间的通信，也可用于接收一些系统的事件，例如收到短信，电量等信息。
有两种方法注册，静态注册和动态注册&lt;/p>
&lt;h2 id="静态注册">静态注册&lt;/h2>
&lt;p>创建一个类继承BroadcastReceiver，然后在AndroidManifest.xml 添加&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;receiver android:name="clsReceiver2"&amp;gt;
&amp;lt;intent-filter&amp;gt;
&amp;lt;action android:name="com.testBroadcastReceiver.Internal_2"/&amp;gt;
&amp;lt;/intent-filter&amp;gt;
&amp;lt;/receiver&amp;gt;
&lt;/pre>
&lt;h2 id="动态注册">动态注册&lt;/h2>
&lt;p>继承BroadcastReceiver类，实现onReceive方法。然后registerReceiver它。同一个Receiver还可以“听多个广播”，可以在IntentFilter加多个action。&lt;br>
主要通过IntentFilter，别人用sendBroadcast(intent)发广播，如果频率一样（IntentFilter里的Action一样）就可以听到广播。&lt;/p>
&lt;pre escaped="true" lang="java">//动态注册广播消息
registerReceiver(bcrIntenal1, new IntentFilter(INTENAL_ACTION_1)); &lt;/pre>
&lt;pre escaped="true" lang="java">//取消广播接收器
unregisterReceiver(rhelper);&lt;/pre>
&lt;p>两篇参考文章：
&lt;a href="http://blog.csdn.net/hellogv/article/details/5999170" target="_blank">&lt;a href="http://blog.csdn.net/hellogv/article/details/5999170">http://blog.csdn.net/hellogv/article/details/5999170&lt;/a>&lt;/a>&lt;br>
&lt;a href="http://www.cnblogs.com/jico/articles/1838293.html" title="http://www.cnblogs.com/jico/articles/1838293.html" target="_blank">&lt;a href="http://www.cnblogs.com/jico/articles/1838293.html">http://www.cnblogs.com/jico/articles/1838293.html&lt;/a>&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/broadcastreceiver/">BroadcastReceiver</category><category domain="https://fatkun.github.io/tags/%E5%B9%BF%E6%92%AD/">广播</category></item><item><title>WP-Syntax代码编辑器插件</title><link>https://fatkun.github.io/2012/01/wp-syntax-code-editor.html</link><guid isPermaLink="true">https://fatkun.github.io/2012/01/wp-syntax-code-editor.html</guid><pubDate>Sun, 01 Jan 2012 07:54:49 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>升级到WP3.3后，之前的那些插入代码按钮都没有用啦。。上去找插件没找到，自己改了一个syntanx-highlighter的。&lt;br>
感谢原作者leo108，http://leo108.com/
把下面的代码保存下来，放在一个文件夹里，打包成zip文件，然后就可以在插件处上传安装了。&lt;br>
或者下载这个文件：&lt;a href="http://fatkun.googlecode.com/files/wp-syntax-editor.zip" title="http://fatkun.googlecode.com/files/wp-syntax-editor.zip" target="_blank">&lt;a href="http://fatkun.googlecode.com/files/wp-syntax-editor.zip">http://fatkun.googlecode.com/files/wp-syntax-editor.zip&lt;/a>&lt;/a>&lt;/p>
&lt;pre escaped="true" lang="js">&amp;lt;?php
/*
Plugin Name: WP-Syntax Code Editor
Plugin URI: http://fatkun.com/2012/01/wp-syntax-code-editor.html
Description: 在编辑框加入一个插入wp-syntax代码的按钮，修改自syntax-highlighter-with-add-button-in-editor（原作者leo108）
Version: 1.0.0
Original Author: leo108
Author URI: http://fatkun.com/
*/
function codebox_init(){
?&amp;gt;
&amp;lt;div id="codebox" class="meta-box-sortables ui-sortable" style="position: relative;"&amp;gt;&amp;lt;div class="postbox"&amp;gt;
&amp;lt;div class="handlediv" title="Click to toggle"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;h3 class="hndle"&amp;gt;&amp;lt;span&amp;gt;WP-Syntax&amp;lt;/span&amp;gt;&amp;lt;/h3&amp;gt;
&amp;lt;div class="inside"&amp;gt;
Language:
&amp;lt;select id="language"&amp;gt;
&amp;lt;option value="other"&amp;gt;Other&amp;lt;/option&amp;gt;
&amp;lt;option value="bash"&amp;gt;Bash&amp;lt;/option&amp;gt;
&amp;lt;option value="c"&amp;gt;C&amp;lt;/option&amp;gt;
&amp;lt;option value="cpp"&amp;gt;C++&amp;lt;/option&amp;gt;
&amp;lt;option value="csharp"&amp;gt;C#&amp;lt;/option&amp;gt;
&amp;lt;option value="css"&amp;gt;CSS&amp;lt;/option&amp;gt;
&amp;lt;option value="delphi"&amp;gt;Delphi&amp;lt;/option&amp;gt;
&amp;lt;option value="diff"&amp;gt;Diff&amp;lt;/option&amp;gt;
&amp;lt;option value="erl"&amp;gt;Erlang&amp;lt;/option&amp;gt;
&amp;lt;option value="groovy"&amp;gt;Groovy&amp;lt;/option&amp;gt;
&amp;lt;option value="html"&amp;gt;HTML&amp;lt;/option&amp;gt;
&amp;lt;option value="java"&amp;gt;Java&amp;lt;/option&amp;gt;
&amp;lt;option value="js"&amp;gt;Javascript&amp;lt;/option&amp;gt;
&amp;lt;option value="perl"&amp;gt;Perl&amp;lt;/option&amp;gt;
&amp;lt;option value="php"&amp;gt;PHP&amp;lt;/option&amp;gt;
&amp;lt;option value="ps"&amp;gt;PowerShell&amp;lt;/option&amp;gt;
&amp;lt;option value="python"&amp;gt;Python&amp;lt;/option&amp;gt;
&amp;lt;option value="ruby"&amp;gt;Ruby&amp;lt;/option&amp;gt;
&amp;lt;option value="sql"&amp;gt;SQL&amp;lt;/option&amp;gt;
&amp;lt;option value="vb"&amp;gt;VisualBasic&amp;lt;/option&amp;gt;
&amp;lt;option value="vb"&amp;gt;VB.NET&amp;lt;/option&amp;gt;
&amp;lt;option value="xml"&amp;gt;XML&amp;lt;/option&amp;gt;
&amp;lt;/select&amp;gt;
&amp;lt;br&amp;gt;
Code:&amp;lt;br&amp;gt;&amp;lt;textarea id="code" rows="8" cols="70" style="width:97%;"&amp;gt;&amp;lt;/textarea&amp;gt;&amp;lt;br&amp;gt;
&amp;lt;input type="button" value="INSERT" onclick="javascript:settext();"&amp;gt;
&amp;lt;script&amp;gt;
function settext()
{
var str='&amp;lt;pre escaped="true" lang="';
var lang=document.getElementById("language").value;
var code=document.getElementById("code").value;
str=str+lang;
str=str+'"&amp;gt;';
str=str+filter(code)+"&amp;lt;/pre&amp;gt;";
var win = window.dialogArguments ¦¦ opener ¦¦ parent ¦¦ top;
win.send_to_editor(str);
document.getElementById("code").value="";
}
function filter (str) {
str = str.replace(/&amp;/g, '&amp;amp;');
str = str.replace(/&amp;lt;/g, '&amp;lt;');
str = str.replace(/&amp;gt;/g, '&amp;gt;');
str = str.replace(/'/g, '&amp;#39;');
str = str.replace(/"/g, '&amp;quot;');
str = str.replace(/\¦/g, '&amp;brvbar;');
return str;
}
&amp;lt;/script&amp;gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;script&amp;gt;document.getElementById("postdivrich").appendChild(document.getElementById("codebox"));&amp;lt;/script&amp;gt;
&amp;lt;?php
}
add_action('dbx_post_sidebar','codebox_init');
?&amp;gt;&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/plugin/">Plugin</category><category domain="https://fatkun.github.io/tags/wordpress/">Wordpress</category><category domain="https://fatkun.github.io/tags/wp-syntax/">Wp-Syntax</category></item><item><title>Fatkun图片批量下载谷歌浏览器扩展0.5版更新了</title><link>https://fatkun.github.io/2011/12/batch-image-download-0-5.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/12/batch-image-download-0-5.html</guid><pubDate>Thu, 15 Dec 2011 15:45:21 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;strong>0.5版插件地址：&lt;a href="http://bath-image-download.googlecode.com/files/batch0_5.crx" target="_blank">&lt;a href="https://bath-image-download.googlecode.com/files/batch0_5.crx">https://bath-image-download.googlecode.com/files/batch0_5.crx&lt;/a>&lt;/a>&lt;/strong>
 
主要是修复性更新。。最近都感觉很累，晚上回来就不想做什么了~很久没更新博客了。
&lt;strong>0.5版&lt;/strong>更新****&lt;/p>
&lt;ol>
&lt;li>修复CHROMEV15点击图片不删除的问题&lt;/li>
&lt;li>图片居中显示&lt;/li>
&lt;/ol>
&lt;div> 更多信息围观&lt;a title="Fatkun图片批量下载谷歌浏览器扩展（Chrome Extensions）(0.5版)" href="http://fatkun.com/2010/09/batch-image-download.html">Fatkun图片批量下载谷歌浏览器扩展（Chrome Extensions）(0.5版)&lt;/a>&lt;/div></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/chrome/">Chrome</category><category domain="https://fatkun.github.io/tags/%E5%9B%BE%E7%89%87%E6%89%B9%E9%87%8F%E4%B8%8B%E8%BD%BD/">图片批量下载</category><category domain="https://fatkun.github.io/tags/%E8%B0%B7%E6%AD%8C%E6%B5%8F%E8%A7%88%E5%99%A8%E6%89%A9%E5%B1%95/">谷歌浏览器扩展</category></item><item><title>在Extjs Grid扩展一个链接按钮列</title><link>https://fatkun.github.io/2011/10/extjs-grid-link-column.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/10/extjs-grid-link-column.html</guid><pubDate>Sun, 30 Oct 2011 06:19:29 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="问题">问题&lt;/h2>
&lt;p>想要在Extjs grid每一行添加一个链接或者添加一个按钮，怎么办？&lt;br>
&lt;a href="http://fatkun.com/wp-content/uploads/2011/10/extjs.bmp">&lt;img class="alignnone size-full wp-image-963" title="extjs" src="http://fatkun.com/wp-content/uploads/2011/10/extjs.bmp" alt="" />&lt;/a>&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>实现方法一是用renderer，但是这个链接的方法必须调用全局的变量。&lt;br>
方法二就是我将要介绍的。
ActionColumn是显示一个图标按钮，而我需要一个链接按钮呢？改写ActionColumn代码即可。&lt;br>
代码如下，主要是修改了renderer，如果你想改成button也是可以的：&lt;/p>
&lt;pre escaped="true" lang="js">/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
Ext.grid.LinkColumn = Ext.extend(Ext.grid.Column, {
header: '&amp;#160;',
linkIdRe: /x-link-col-(\d+)/,
constructor: function(cfg) {
var me = this,
items = cfg.items || (me.items = [me]),
l = items.length,
i,
item;
Ext.grid.LinkColumn.superclass.constructor.call(me, cfg);
me.renderer = function(v, meta) {
// Allow a configured renderer to create initial value (And set the other values in the "metadata" argument!)
v = Ext.isFunction(cfg.renderer) ? cfg.renderer.apply(this, arguments)||'' : '';
meta.css += ' x-link-col-cell';
for (i = 0; i &amp;lt; l; i++) {
item = items[i];
v += '&amp;lt;a href="javascript:;" class="x-link-col-icon x-link-col-' + String(i) + ' ' + (Ext.isFunction(item.getClass) ? item.getClass.apply(item.scope||this.scope||this, arguments) : '') + '"' +
((item.tooltip) ? ' ext:qtip="' + item.tooltip + '"' : '') + '&amp;gt;' + (item.text||'') + '&amp;lt;/a&amp;gt;';
if (i &amp;lt; l - 1) v += '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
}
return v;
};
},
destroy: function() {
delete this.items;
delete this.renderer;
return Ext.grid.LinkColumn.superclass.destroy.apply(this, arguments);
},
/**
* @private
* Process and refire events routed from the GridView's processEvent method.
* Also fires any configured click handlers. By default, cancels the mousedown event to prevent selection.
* Returns the event handler's status to allow cancelling of GridView's bubbling process.
*/
processEvent : function(name, e, grid, rowIndex, colIndex){
var m = e.getTarget().className.match(this.linkIdRe),
item, fn;
if (m &amp;&amp; (item = this.items[parseInt(m[1], 10)])) {
if (name == 'click') {
(fn = item.handler || this.handler) &amp;&amp; fn.call(item.scope||this.scope||this, grid, rowIndex, colIndex, item, e);
} else if ((name == 'mousedown') &amp;&amp; (item.stopSelection !== false)) {
return false;
}
}
return Ext.grid.LinkColumn.superclass.processEvent.apply(this, arguments);
}
});
//register ptype
Ext.preg('linkcolumn', Ext.grid.LinkColumn);
// register Column xtype
Ext.grid.Column.types.linkcolumn = Ext.grid.LinkColumn;&lt;/pre>
&lt;h2 id="使用方法">使用方法&lt;/h2>
&lt;p>引用扩展的文件后，在grid columns加一个xtype: ‘linkcolumn’的列&lt;/p>
&lt;pre escaped="true" lang="js">{
xtype: 'linkcolumn',
header: '操作',
width: 100,
sortable: true,
items: [{
text: '查看',
handler: function(grid, rowIndex, colIndex) {
var record = grid.store.getAt(rowIndex);
new stat_task_his_win({
record: record
});
}
}]
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/extjs/">Extjs</category><category domain="https://fatkun.github.io/tags/grid/">Grid</category><category domain="https://fatkun.github.io/tags/%E6%8C%89%E9%92%AE%E5%88%97/">按钮列</category><category domain="https://fatkun.github.io/tags/%E9%93%BE%E6%8E%A5%E6%8C%89%E9%92%AE%E5%88%97/">链接按钮列</category></item><item><title>Extjs combobox下拉框模糊匹配</title><link>https://fatkun.github.io/2011/10/extjs-combobox-filter.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/10/extjs-combobox-filter.html</guid><pubDate>Fri, 21 Oct 2011 17:30:28 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Ext中的combobox有属性typeAhead：true 可以实现模糊匹配，但是是从开始匹配的，如果需要自定的的匹配，则需要监听beforequery方法，实现自己的匹配查询方法：&lt;/p>
&lt;pre escaped="true" lang="js">// 判断某个值str是否存在store里,field是store的字段
var checkIfInStore = function(str, store, field, ignoreCase) {
var count = store.getCount();
for( var i = 0; i &amp;lt; count; i++) {
var val = store.getAt(i).get(field);
if (ignoreCase) {
str = str.toUpperCase();
val = val.toUpperCase();
}
if (str == val) {
return true;
}
}
return false;
};
var ComboSearchPlugin = {
init: function(combo) {
combo.addListener('blur', function(combo) {
// 如果没有写完整则设置为空
var isValid = checkIfInStore(combo.getRawValue(), combo.store, combo.displayField, false);
if (!isValid) {
combo.setValue('');
}
});
combo.addListener('beforequery', function(qe) {
var combo = qe.combo;
var q = qe.query;
var forceAll = qe.forceAll;
if (forceAll === true || (q.length &amp;gt;= this.minChars)) {
if (this.lastQuery !== q) {
this.lastQuery = q;
if (this.mode == 'local') {
this.selectedIndex = -1;
if (forceAll) {
this.store.clearFilter();
} else {
// 检索的正则
var regExp = new RegExp(".*" + q + ".*", "i");
// 执行检索
this.store.filterBy(function(record, id) {
// 得到每个record的项目名称值
var text = record.get(combo.displayField);
return regExp.test(text);
});
}
this.onLoad();
} else {
this.store.baseParams[this.queryParam] = q;
this.store.load({
params: this.getParams(q)
});
this.expand();
}
} else {
this.selectedIndex = -1;
this.onLoad();
}
}
return false;
});
}
};&lt;/pre>
&lt;p>参考文章：http://weibaojun.iteye.com/blog/1098731&lt;br>
原文我试了一下有问题，第一次输入时会不显示结果，主要差别在onLoad上&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/combobox/">Combobox</category><category domain="https://fatkun.github.io/tags/extjs/">Extjs</category><category domain="https://fatkun.github.io/tags/js/">Js</category></item><item><title>误删contacts.apk解决方法（不用刷机）</title><link>https://fatkun.github.io/2011/10/recovery-contacts-apk.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/10/recovery-contacts-apk.html</guid><pubDate>Mon, 03 Oct 2011 15:21:11 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>从完整的刷机包内，注意，版本最好是和你手机一致的。如果找不到，可以上网问别人要。
在压缩包目录下android2.3.6.zip\system\app找到Contacts.apk，Contacts.odex文件，如果你把其他文件也删了，也可以按照这个步骤。
连接手机U盘，复制到SD卡。
然后用ROOT Explor从SD卡把这两个文件复制到 手机的这个目录下/system/app/
最后一步！注意，一定要给这两个文件&lt;strong>设置权限&lt;/strong>，在RE里按住文件，选permissions，都勾上read/write权限。
重启一下你的手机，就可以编辑联系人了。&lt;/p></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/contacts.apk/">Contacts.apk</category><category domain="https://fatkun.github.io/tags/%E8%AF%AF%E5%88%A0android%E6%96%87%E4%BB%B6/">误删android文件</category></item><item><title>Thrift入门篇-运行Tutorial</title><link>https://fatkun.github.io/2011/09/thrift-tutorial.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/09/thrift-tutorial.html</guid><pubDate>Mon, 12 Sep 2011 16:06:53 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>本文假设你已经了解Thrift是什么了，如果还不了解，请借助强大的谷歌。
本文的开发环境是windows 7 + python2.6
Thrift官方主页：&lt;a href="http://thrift.apache.org/">http://thrift.apache.org/&lt;/a>
 
先来这里下载thrift-0.7.0.tar.gz 和Thrift compiler for Windows (thrift-0.7.0.exe) 。thrift-0.7.0.exe是帮你编译好的，可以在windows下运行。
解压thrift-0.7.0.tar.gz
 
学一样东西之前，当然是看Tutorial啦，不过文档还不完善啊。下面将以Python来举例子。&lt;/p>
&lt;h3 id="1安装thrift库">1.安装thrift库&lt;/h3>
&lt;p>先要安装thrift-0.7.0\lib\py里的库，setup.py install 注意，在windows下安装不成功，需要用VC编译，还要对代码做相应修改，很麻烦，就不说了，直接在这里下载已经编译好的版本。&lt;a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/">http://www.lfd.uci.edu/~gohlke/pythonlibs/&lt;/a> （这里真的是个好地方，感谢大神）&lt;/p>
&lt;h3 id="2thrift生成代码">2.Thrift生成代码&lt;/h3>
&lt;p>Thrift能够帮你生成一部分代码，让你更关注你的业务部分，而不必关注它是怎么通信的。
在thrift-0.7.0\tutorial，就是一个官方教程了。可以先看看tutorial.thrift，这是thrift定义的语法，就是通过它来生成各种代码的了。
 
生成代码开始啦，使用之前下载的thrift-0.7.0.exe，在thrift-0.7.0\tutorial目录下执行命令&lt;/p>
&lt;pre escaped="true" lang="bash">thrift-0.7.0.exe –r –gen py –gen java tutorial.thrift&lt;/pre>
&lt;p>搞定，在当前文件夹就产生两个文件夹了，分别是gen-java和gen-py。gen-java咱暂时用不着，生成来玩的：）如果你想生成更多其他类型的代码，–gen xxx就可以了。&lt;/p>
&lt;h3 id="3运行">3.运行&lt;/h3>
&lt;p>进入thrift-0.7.0\tutorial\py目录，在运行之前，先改一下PythonServer.py
不知道是我安装的thrift库有问题还是它的tutorial写错了，找到下面这行代码。&lt;/p>
&lt;pre escaped="true" lang="py">transport = TSocket.TServerSocket(9090)&lt;/pre>
&lt;p>把它改为&lt;/p>
&lt;pre escaped="true" lang="py">transport = TSocket.TServerSocket(port=9090)&lt;/pre>
&lt;p>好吧，双击运行服务端PythonServer.py。看到Starting the server就证明你成功运行服务端了！如果黑乎乎的窗口一闪而过，那看看哪一步做错了吧。用cmd运行看看。
 
接下来，再运行客户端PythonClient.py，这时就可以看到服务端有信息输出了~~成功！
 &lt;/p></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/thrift/">Thrift</category></item><item><title>下载新浪音乐</title><link>https://fatkun.github.io/2011/09/download-sina-music.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/09/download-sina-music.html</guid><pubDate>Mon, 12 Sep 2011 07:48:21 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>新浪音乐没有直接下载音乐的地方。。听到一首好歌想要下载怎么办呢··找出它的下载地址
只要你得到新浪音乐的短地址，就行啦。（你可以分享一条歌曲获得短地址）
&lt;a title="http://fatkun.com/sina.php" href="http://fatkun.com/sina.php" target="_blank">&lt;a href="http://fatkun.com/sina.php">http://fatkun.com/sina.php&lt;/a>&lt;/a>
这样就可以找出新浪音乐的下载地址，从此爽歪歪..
 &lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/%E4%B8%8B%E8%BD%BD%E5%9C%B0%E5%9D%80/">下载地址</category><category domain="https://fatkun.github.io/tags/%E6%96%B0%E6%B5%AA/">新浪</category><category domain="https://fatkun.github.io/tags/%E6%96%B0%E6%B5%AA%E9%9F%B3%E4%B9%90/">新浪音乐</category></item><item><title>Syntax Highlighting</title><link>https://fatkun.github.io/post/test/syntax-highlighting/</link><guid isPermaLink="true">https://fatkun.github.io/post/test/syntax-highlighting/</guid><pubDate>Tue, 30 Aug 2011 16:01:23 +0800</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-js" data-lang="js">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">function&lt;/span> &lt;span class="nx">helloWorld&lt;/span> &lt;span class="p">()&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">alert&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Hello, World!&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">class&lt;/span> &lt;span class="nc">HelloWorld&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="kd">public&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kd">static&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nf">main&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="o">[]&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">args&lt;/span>&lt;span class="p">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="n">System&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">out&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">println&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;Hello, World!&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w"> &lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="w">&lt;/span>&lt;span class="p">}&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-kotlin" data-lang="kotlin">&lt;span class="line">&lt;span class="cl">&lt;span class="k">package&lt;/span> &lt;span class="nn">hello&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">fun&lt;/span> &lt;span class="nf">main&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">args&lt;/span>&lt;span class="p">:&lt;/span> &lt;span class="n">Array&lt;/span>&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="n">String&lt;/span>&lt;span class="p">&amp;gt;)&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">println&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Hello World!&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-c" data-lang="c">&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#include&lt;/span> &lt;span class="cpf">&amp;lt;stdio.h&amp;gt;&lt;/span>&lt;span class="cp">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cm">/* Hello */&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kt">int&lt;/span> &lt;span class="nf">main&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="kt">void&lt;/span>&lt;span class="p">){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nf">printf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;Hello, World!&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;span class="lnt">8
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-cpp" data-lang="cpp">&lt;span class="line">&lt;span class="cl">&lt;span class="c1">// &amp;#39;Hello World!&amp;#39; program
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">#include&lt;/span> &lt;span class="cpf">&amp;lt;iostream&amp;gt;&lt;/span>&lt;span class="cp">
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kt">int&lt;/span> &lt;span class="nf">main&lt;/span>&lt;span class="p">(){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">cout&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="s">&amp;#34;Hello World!&amp;#34;&lt;/span> &lt;span class="o">&amp;lt;&amp;lt;&lt;/span> &lt;span class="n">std&lt;/span>&lt;span class="o">::&lt;/span>&lt;span class="n">endl&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="mi">0&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-cs" data-lang="cs">&lt;span class="line">&lt;span class="cl">&lt;span class="k">using&lt;/span> &lt;span class="nn">System&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">class&lt;/span> &lt;span class="nc">HelloWorld&lt;/span>&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="kd">public&lt;/span> &lt;span class="kd">static&lt;/span> &lt;span class="k">void&lt;/span> &lt;span class="n">Main&lt;/span>&lt;span class="p">(){&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">System&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">Console&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="n">WriteLine&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;Hello, World!&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-html" data-lang="html">&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">html&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">body&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> Hello, World!
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">body&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">html&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;span class="lnt">6
&lt;/span>&lt;span class="lnt">7
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-go" data-lang="go">&lt;span class="line">&lt;span class="cl">&lt;span class="kn">package&lt;/span> &lt;span class="nx">main&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nx">fmt&lt;/span> &lt;span class="s">&amp;#34;fmt&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="kd">func&lt;/span> &lt;span class="nf">main&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">fmt&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nf">Printf&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s">&amp;#34;Hello, World!\n&amp;#34;&lt;/span>&lt;span class="p">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-scala" data-lang="scala">&lt;span class="line">&lt;span class="cl">&lt;span class="k">object&lt;/span> &lt;span class="nc">HelloWorld&lt;/span> &lt;span class="k">with&lt;/span> &lt;span class="nc">Application&lt;/span> &lt;span class="o">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nc">Console&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">println&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="s">&amp;#34;Hello, World!&amp;#34;&lt;/span>&lt;span class="o">);&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="o">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-php" data-lang="php">&lt;span class="line">&lt;span class="cl">&lt;span class="o">&amp;lt;?&lt;/span>&lt;span class="nx">php&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">echo&lt;/span> &lt;span class="s1">&amp;#39;Hello, World!&amp;#39;&lt;/span>&lt;span class="p">;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">?&amp;gt;&lt;/span>&lt;span class="err">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="s2">&amp;#34;Hello, World!&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-clojure" data-lang="clojure">&lt;span class="line">&lt;span class="cl">&lt;span class="p">(&lt;/span>&lt;span class="kd">defn &lt;/span>&lt;span class="nv">hello-world&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="s">&amp;#34;A function print &amp;#39;Hello world&amp;#39;.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">[]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">(&lt;/span>&lt;span class="nb">prn &lt;/span>&lt;span class="s">&amp;#34;Hello world&amp;#34;&lt;/span>&lt;span class="p">))&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-go-html-template" data-lang="go-html-template">&lt;span class="line">&lt;span class="cl">&lt;span class="cp">&amp;lt;!DOCTYPE html&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">html&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">head&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">title&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>&lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Title&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">title&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">head&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">body&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">h1&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>&lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Title&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">h1&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Content&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">body&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">html&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-go-html-template" data-lang="go-html-template">&lt;span class="line">&lt;span class="cl">&lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nx">partial&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;header.html&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">h1&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>posts&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">h1&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">range&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nx">first&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nx">10&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Data.Pages&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">eq&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Type&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;post&amp;#34;&lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">h2&lt;/span>&lt;span class="p">&amp;gt;&amp;lt;&lt;/span>&lt;span class="nt">a&lt;/span> &lt;span class="na">href&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;&lt;/span>&lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Permalink&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>&lt;span class="s">&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>&lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Title&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">a&lt;/span>&lt;span class="p">&amp;gt;&amp;lt;/&lt;/span>&lt;span class="nt">h2&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">end&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">end&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">h1&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>pages&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">h1&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">range&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Data.Pages&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">if&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">or&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="k">eq&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Type&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;page&amp;#34;&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="k">eq&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Type&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;about&amp;#34;&lt;/span>&lt;span class="o">)&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">h2&lt;/span>&lt;span class="p">&amp;gt;&amp;lt;&lt;/span>&lt;span class="nt">a&lt;/span> &lt;span class="na">href&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;&lt;/span>&lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Permalink&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>&lt;span class="s">&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>&lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Type&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span> - &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Title&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span> - &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.RelPermalink&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">a&lt;/span>&lt;span class="p">&amp;gt;&amp;lt;/&lt;/span>&lt;span class="nt">h2&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">end&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">end&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="nx">partial&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;footer.html&amp;#34;&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;hr>
&lt;p>Detect the language&lt;/p>
&lt;pre tabindex="0">&lt;code>package hello
fun main(args: Array&amp;lt;String&amp;gt;) {
println(&amp;#34;Hello World!&amp;#34;)
}
&lt;/code>&lt;/pre>&lt;pre tabindex="0">&lt;code>&amp;lt;?php
echo &amp;#39;Hello, World!&amp;#39;;
?&amp;gt;
&lt;/code>&lt;/pre>&lt;hr>
&lt;p>By &lt;code>{{&amp;lt; highlight go-html-template &amp;quot;linenos=table,hl_lines=1 3-7,linenostart=199&amp;quot; &amp;gt;}}..{{&amp;lt; / highlight &amp;gt;}}&lt;/code>&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="hl">&lt;span class="lnt">199
&lt;/span>&lt;/span>&lt;span class="lnt">200
&lt;/span>&lt;span class="hl">&lt;span class="lnt">201
&lt;/span>&lt;/span>&lt;span class="hl">&lt;span class="lnt">202
&lt;/span>&lt;/span>&lt;span class="hl">&lt;span class="lnt">203
&lt;/span>&lt;/span>&lt;span class="hl">&lt;span class="lnt">204
&lt;/span>&lt;/span>&lt;span class="hl">&lt;span class="lnt">205
&lt;/span>&lt;/span>&lt;span class="lnt">206
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-go-html-template" data-lang="go-html-template">&lt;span class="line hl">&lt;span class="cl">&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">section&lt;/span> &lt;span class="na">id&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;main&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">div&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line hl">&lt;span class="cl"> &lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">h1&lt;/span> &lt;span class="na">id&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;title&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>&lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Title&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">h1&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line hl">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">range&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Data.Pages&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line hl">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="na">.Render&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="s">&amp;#34;summary&amp;#34;&lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line hl">&lt;span class="cl"> &lt;span class="cp">{{&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="k">end&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="cp">}}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line hl">&lt;span class="cl"> &lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">div&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">section&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div></description><category domain="https://fatkun.github.io/categories/syntax-highlighting/">Syntax Highlighting</category><category domain="https://fatkun.github.io/tags/preview/">Preview</category><category domain="https://fatkun.github.io/tags/syntax-highlighting/">Syntax Highlighting</category><category domain="https://fatkun.github.io/tags/tag-5/">Tag-5</category></item><item><title>更换新主题</title><link>https://fatkun.github.io/2011/08/change-theme.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/08/change-theme.html</guid><pubDate>Sat, 20 Aug 2011 18:39:25 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>把&lt;a href="http://www.fadonet.net/2008/11/08/wordpress-theme-zindi/" title="Fadonet WordPress Themes: Zindi">Zindi&lt;/a>主题改了一下，主要是改了页面宽度，文字大小。。我还是喜欢14px的文字，看起来容易阅读。
悲剧的是发现评论不是嵌套的···o(╯□╰)o这个还没改。。
嵌套评论是必须的··怎么能木有呢···迟点试着改一下。。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/wordpress/">Wordpress</category><category domain="https://fatkun.github.io/tags/%E4%B8%BB%E9%A2%98/">主题</category></item><item><title>Django values(*fields) 如何使用</title><link>https://fatkun.github.io/2011/08/django-values.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/08/django-values.html</guid><pubDate>Sun, 14 Aug 2011 09:08:12 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;div> &lt;p> 官方文档:&lt;a href="https://docs.djangoproject.com/en/1.3/ref/models/querysets/#values">https://docs.djangoproject.com/en/1.3/ref/models/querysets/#values&lt;/a> &lt;/p>
&lt;h1> 1. values(*fields) &lt;/h1>
&lt;p> 这个方法返回的是ValuesQuerySet,是QuerySet 的子类，也就是说，你可以用QuerySet里的方法。 需要注意的是，返回的不是list，不要直接当list来用了。对ValuesQuerySet遍历，每一个元素是“字典”dict。 &lt;/p>
&lt;p> 当不传入参数时，返回这个model的所有字段 &lt;/p>
&lt;pre escaped="true" lang="python">AppDef.objects.values()
[{'creator': u'admin', 'apptype_name': u'uc3g', 'apptype_chn_name': u'3G\u95e8\u6237', 'note': u'', ...},...]&lt;/pre>
&lt;p> 当传入参数时，只会列出你指定的参数 &lt;/p>
&lt;pre escaped="true" lang="python">AppDef.objects.values('apptype_name')
[{'apptype_name': u'uc3g'},...]&lt;/pre>
&lt;p> 也可以加上&lt;span style="font-family: 'Courier New';">filter&lt;/span>&lt;span style="font-family: 宋体;">，&lt;/span>&lt;span style="font-family: 'Courier New';">filter&lt;/span>&lt;span style="font-family: 宋体;">在前或者后面都是一样的&lt;/span> &lt;/p>
&lt;pre escaped="true" lang="python">AppDef.objects.filter(pk=1).values('apptype_name')
AppDef.objects.values('apptype_name').filter(pk=1)&lt;/pre>
&lt;p> 如果想把关联的字段也一起查出来&lt;br /> OneToOneField, ForeignKey 和ManyToManyField 关系的都可以。&lt;br /> ManyToManyField 在Django1.3&lt;span style="font-family: 微软雅黑;">版后才支持&lt;/span>&lt;br /> LogTypeDef定义了一个app&lt;span style="font-family: 宋体;">的&lt;/span>&lt;span style="font-family: 'Courier New';">ForeignKey&lt;/span> &lt;/p>
&lt;pre escaped="true" lang="python">LogTypeDef.objects.filter(pk=6).values('pk', 'app__apptype_name')
[{'pk': 6L, 'app__apptype_name': u'wapsearch'}]&lt;/pre>
&lt;p> 如果你只想拿到app_id&lt;span style="font-family: 宋体;">，可以这样&lt;/span>&lt;br /> 下面三种方法都是一样的，只是返回的结果名字对应你的查询语句 &lt;/p>
&lt;pre escaped="true" lang="python">LogTypeDef.objects.filter(pk=6).values('pk', 'app_id')
LogTypeDef.objects.filter(pk=6).values('pk', 'app')
LogTypeDef.objects.filter(pk=6).values('pk', 'app__id')&lt;/pre>
&lt;p> 注意在关联关系为多对多的时候，它只会帮你一条一条的列出来，而不会帮你合并为一个&lt;span style="font-family: 'Courier New';">list&lt;/span>&lt;span style="font-family: 宋体;">。&lt;/span>&lt;br /> 例如会返回类型的结果：同一个&lt;span style="font-family: 'Courier New';">pk&lt;/span>&lt;span style="font-family: 宋体;">并不会帮你合并&lt;/span>&lt;span style="font-family: 'Courier New';">app_id&lt;/span> &lt;/p>
&lt;pre escaped="true" lang="python">[{pk: 6, app_id: 2}, {pk: 6, app_id: 3}]&lt;/pre>
&lt;h1> 2. 注意事项 &lt;/h1>
&lt;p> 当同时使用distinct()和values()，需要注意order_by() (或者默认 model ordering) ，会自动加入select 中作为distinct项，所以返回的结果你以为是重复的，其实是order by的字段没列出来。&lt;br /> 如果在extra() 之后用values()，一定要把extra用到的字段也加进来；如果extra()在values()之后，extra的字段会自动加进select。&lt;br /> Because &lt;a href="https://docs.djangoproject.com/en/1.3/ref/models/fields/#django.db.models.ManyToManyField">ManyToManyField&lt;/a> attributes and reverse relations can have multiple related rows, including these can have a multiplier effect on the size of your result set. This will be especially pronounced if you include multiple such fields in your values() query, in which case all possible combinations will be returned. (&lt;span style="font-family: 微软雅黑;">这个不太懂什么意思，应该是当&lt;/span>&lt;span style="font-family: Arial;">values&lt;/span>&lt;span style="font-family: 微软雅黑;">有多个&lt;/span>&lt;span style="font-family: Arial;">manytomanyfield&lt;/span>&lt;span style="font-family: 微软雅黑;">的时候，会尽量合并一些&lt;/span>&lt;span style="font-family: Arial;">)&lt;/span> &lt;/p>
&lt;h1> 3. 适用范围 &lt;/h1>
&lt;p> l 只需要返回&lt;span style="font-family: Arial;">dict&lt;/span>&lt;span style="font-family: 微软雅黑;">，而不需要返回&lt;/span>&lt;span style="font-family: Arial;">model object&lt;/span>&lt;span style="font-family: 微软雅黑;">。&lt;/span>&lt;br /> l 只需要返回简单的数据（包括层次简单） &lt;/p>
&lt;h1> 4. Values_list &lt;/h1>
&lt;p> 和&lt;span style="font-family: Arial;">values&lt;/span>&lt;span style="font-family: 微软雅黑;">一样，只是返回的不是字典而是元组。&lt;/span> &lt;/div></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/django/">Django</category><category domain="https://fatkun.github.io/tags/python/">Python</category><category domain="https://fatkun.github.io/tags/values/">Values</category></item><item><title>Extjs FormPanel.getForm().getValues()对下拉框(Combobox)取值的问题</title><link>https://fatkun.github.io/2011/06/formpanel-get-combobox-value.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/06/formpanel-get-combobox-value.html</guid><pubDate>Mon, 27 Jun 2011 05:36:01 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="遇到的问题">遇到的问题&lt;/h2>
&lt;p>我使用的是Extjs3.3&lt;br>
在FormPanel中，可以通过 FormPanel.getForm().getValues()取得这个FormPanel下的所有值。&lt;br>
但是，在取下拉框值时，得到的是显示名称（displayValue），而不是真正的值（value）&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>原因是没有在下拉框指定hiddenName，指定hiddenName 和 name的值一样就可以了。
&lt;span style="color: #ff0000;">2011-8-30update : 用FormPanel.getForm().getFieldValues()可以不用设置hiddenName。&lt;/span>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/combobox/">Combobox</category><category domain="https://fatkun.github.io/tags/extjs/">Extjs</category><category domain="https://fatkun.github.io/tags/getvalues/">GetValues</category></item><item><title>Extjs3 EditorGridPanel的beforeedit事件参数</title><link>https://fatkun.github.io/2011/06/extjs-editorgridpanel-beforeedit.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/06/extjs-editorgridpanel-beforeedit.html</guid><pubDate>Thu, 02 Jun 2011 02:21:37 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="beforeedit---object-e-">beforeedit : ( Object e )&lt;/h2>
&lt;p>只有一个事件(edit event)参数，但这个参数内容很丰富，可以满足很多需求。&lt;br>
参数分别如下：&lt;br>
grid – 表格本身&lt;br>
record – 你要编辑的那一行记录&lt;br>
field – 你编辑的列名&lt;br>
value – 你编辑的值&lt;br>
row – 行号&lt;br>
column – 列号&lt;br>
cancel – 设这个为true或者return false可以取消编辑（不显示那个编辑框）&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/beforeedit/">Beforeedit</category><category domain="https://fatkun.github.io/tags/editorgridpanel/">EditorGridPanel</category><category domain="https://fatkun.github.io/tags/extjs/">Extjs</category></item><item><title>Extjs renderer参数</title><link>https://fatkun.github.io/2011/05/extjs-renderer.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/05/extjs-renderer.html</guid><pubDate>Tue, 31 May 2011 09:05:24 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>function myRenderer(value, cellmeta, record, rowIndex, columnIndex, store) {&lt;br>
[…]&lt;br>
}&lt;br>
看上面的myRenderer，依次最多有6个参数&lt;br>
1 value： 当前单元格的值&lt;br>
2 cellmeta里保存的是cellId单元格id，id不知道是干啥的，似乎是列号，css是这个单元格的css样式。（没看懂？？？）&lt;br>
3 record：这行的所有数据，可以通过record.data[“id”]获得本行中“id”字段的值。&lt;br>
4 rowIndex：行号，不是从头往下数的意思，而是计算了分页以后的结果。&lt;br>
5 columnIndex：列号&lt;br>
6 store：整个grid关联的数据
来源：&lt;a href="http://blog.sina.com.cn/s/blog_5140a6a50100bfat.html">http://blog.sina.com.cn/s/blog_5140a6a50100bfat.html&lt;/a>&lt;br>
关于该store的访问，可以看&lt;a href="http://blog.chinaunix.net/u1/37472/showart_2190023.html">http://blog.chinaunix.net/u1/37472/showart_2190023.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/extjs/">Extjs</category><category domain="https://fatkun.github.io/tags/renderer/">Renderer</category></item><item><title>Ext.encode与Ext.decode的JSON转换</title><link>https://fatkun.github.io/2011/05/ext-encode-and-decode.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/05/ext-encode-and-decode.html</guid><pubDate>Sat, 14 May 2011 13:51:30 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在Extjs中，我们可以通过json来交换数据，Extjs内置了两个方法来互相转换。&lt;/p>
&lt;h2 id="extdecode-string-json---object">Ext.decode( String json ) : Object&lt;/h2>
&lt;p>把json字符串转换为对象&lt;/p>
&lt;h2 id="extencode-mixed-o---string">Ext.encode( Mixed o ) : String&lt;/h2>
&lt;p>把对象转换为字符串，用这个方法可以在ajax提交时返回数据&lt;/p>
&lt;pre escaped="true" lang="javascript">var arr = [];
var field1 = {};
field1['name'] = 'fatkun';
field1['age'] = 23;
var field2 = {};
field2['name'] = 'test';
field2['age'] = 24;
arr.push(field1);
arr.push(field2);
Ext.encode(arr);
//返回结果"[{"name":"fatkun","age":23},{"name":"test","age":24}]"&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/decode/">Decode</category><category domain="https://fatkun.github.io/tags/encode/">Encode</category><category domain="https://fatkun.github.io/tags/extjs/">Extjs</category></item><item><title>Python遍历淘宝成交记录（版本二）</title><link>https://fatkun.github.io/2011/05/python-get-taobao-deal-data-2.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/05/python-get-taobao-deal-data-2.html</guid><pubDate>Tue, 10 May 2011 15:49:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在&lt;a href="http://fatkun.com/2011/05/python-get-taobao-deal-data.html">前一版本&lt;/a>的基础上，加入了排序。按物品和日期来排序，排除重复的价格和物品&lt;/p>
&lt;pre escaped="true" lang="python">#-*- encoding: gbk -*-
'''
Created on 2011-5-8
@author: fatkun
'''
import urllib2
import re
import time
import string
from operator import itemgetter
#读取网页
def read(url):
opener = urllib2.build_opener()
#opener.handle_open["http"][0].set_http_debuglevel(1)
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
f= opener.open(url)
content = f.read()
return content
#正则表达式返回需要的内容
def display(content):
pattern = re.compile(r"""&amp;lt;tr(?:[^&amp;gt;]+)?&amp;gt; #TR
[\S\s]*?&amp;lt;td[\S\s]*?&amp;lt;/td&amp;gt;[\S\s]*?&amp;lt;td(?:[^&amp;gt;]+)?&amp;gt; #Second TD
[\S\s]*?&amp;lt;a [^&amp;gt;]+&amp;gt;([\S\s]*?)&amp;lt;/a&amp;gt; # 链接
[\S\s]*?&amp;lt;br/&amp;gt;\s+((?:[\S]+[ ]?)+)\s+&amp;lt;/td&amp;gt; # 物品名称
[\S\s]*?&amp;lt;em&amp;gt;(\d+)&amp;lt;/em&amp;gt; # 价格
[\S\s]*?&amp;lt;td&amp;gt;[\S\s]*?&amp;lt;/td&amp;gt; # TD
[\S\s]*?&amp;lt;td&amp;gt;([\S\s]*?)&amp;lt;/td&amp;gt; # 日期
[\S\s]*?&amp;lt;/tr&amp;gt; #Last TR
""", flags=re.MULTILINE|re.IGNORECASE|re.VERBOSE)
matchs = re.findall(pattern, content )
alist = []
for match in matchs:
alist.append((match[2].strip(), match[3].strip()[:11], match[1].strip()))
return alist
filepath = 'c:\\log.txt'
resultfilepath = 'c:\\log_result.txt'
open(filepath, 'w').close()
lastpage = 50
#淘宝物品的成交记录下一页的链接，请复制链接，把最后一个页数的数字删掉，放在url变量里
url = 'http://tbskip.taobao.com/json/show_buyer_list.htm?is_offline=&amp;page_size=15&amp;is_start=false&amp;item_type=b&amp;ends=1305198406000&amp;starts=1304593606000&amp;item_id=5964804060&amp;user_tag=475363344&amp;old_quantity=5521&amp;sold_total_num=3057&amp;closed=false&amp;seller_num_id=69211806&amp;zhichong=true&amp;bidPage='
onlyonelist = []
allfieldlist = []
for i in range(1, lastpage + 1):
fullurl = '%s%d' % (url, i)
#不出错运行后设为False
runfail = True
#重试次数
retry = 2
print '第%d页 - %s' % (i, fullurl)
try:
logfile = open(filepath, 'a')
while (runfail and retry &amp;gt;= 0):
try:
content = read(fullurl)
alist = display(content)
str = '';
for record in alist:
price_product_record = (record[0], record[2])
if price_product_record not in onlyonelist:
onlyonelist.append(price_product_record)
allfieldlist.append(record)
str += string.ljust(record[0], 7) + string.ljust(record[1], 15) + record[2]
str += '\n'
if str != '': logfile.write(str)
runfail = False
except IOError:
print 'IO error'
retry = retry - 1
time.sleep(5)
if (retry == 0):time.sleep(10) #最后一次尝试等10秒
logfile.flush()
except:
print 'write file fail!'
finally:
logfile.close()
#保存排序后结果
allfieldlist.sort(key=itemgetter(2, 1))
resultfile = open(resultfilepath, 'w')
str = ''
for record in allfieldlist:
str += string.ljust(record[0], 7) + string.ljust(record[1], 15) + record[2]
str += '\n'
resultfile.write(str)
resultfile.close()
print 'Success!'
&lt;/pre></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/python/">Python</category><category domain="https://fatkun.github.io/tags/%E6%88%90%E4%BA%A4%E8%AE%B0%E5%BD%95/">成交记录</category><category domain="https://fatkun.github.io/tags/%E6%B7%98%E5%AE%9D/">淘宝</category></item><item><title>Python list的多列排序</title><link>https://fatkun.github.io/2011/05/python-list-sort.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/05/python-list-sort.html</guid><pubDate>Mon, 09 May 2011 15:02:55 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Python 中的排序真的很方便&lt;br>
你可以使用alist.sort()或者sorted(alist)进行排序。不同的是，前者会改变原来list的顺序。&lt;br>
在python中你可以简单的指定key则可以按照某一列排序&lt;/p>
&lt;pre escaped="true" lang="python">#默认顺序
&amp;gt;&amp;gt;&amp;gt; l
[('aa', '2'), ('aa', '1'), ('bb', '1'), ('dd', '3'), ('cc', '4')]
#普通排序，默认会按顺序进行排序
&amp;gt;&amp;gt;&amp;gt; sorted(l)
[('aa', '1'), ('aa', '2'), ('bb', '1'), ('cc', '4'), ('dd', '3')]
#指定排序的优先级，在这里你可以看到多列排序只需要用逗号隔开即可
&amp;gt;&amp;gt;&amp;gt; from operator import itemgetter, attrgetter
&amp;gt;&amp;gt;&amp;gt; sorted(l, key=itemgetter(1, 0))
[('aa', '1'), ('bb', '1'), ('aa', '2'), ('dd', '3'), ('cc', '4')]
&lt;/pre>
&lt;p>对List里的dict排序，key=lambda x:x[‘b’]。b为你想排序的列&lt;/p>
&lt;pre escaped="true" lang="python">&amp;gt;&amp;gt;&amp;gt; l = [{'a':'fatkun', 'b':23}, {'a':'ken', 'b':21}]
&amp;gt;&amp;gt;&amp;gt; sorted(l, key=lambda x:x['b'])
[{'a': 'ken', 'b': 21}, {'a': 'fatkun', 'b': 23}]&lt;/pre>
&lt;p>这样的排序方法实在是太简单了~~另外如果需要更复杂的方法，可以使用cmp参数，自己写一个方法比较。
参考文章：&lt;br>
&lt;a href="http://wiki.python.org/moin/HowTo/Sorting/">http://wiki.python.org/moin/HowTo/Sorting/&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/python/">Python</category><category domain="https://fatkun.github.io/tags/sorted/">Sorted</category><category domain="https://fatkun.github.io/tags/%E5%A4%9A%E5%88%97%E6%8E%92%E5%BA%8F/">多列排序</category><category domain="https://fatkun.github.io/tags/%E6%8E%92%E5%BA%8F/">排序</category></item><item><title>Python遍历淘宝成交记录</title><link>https://fatkun.github.io/2011/05/python-get-taobao-deal-data.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/05/python-get-taobao-deal-data.html</guid><pubDate>Sun, 08 May 2011 13:19:21 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>本着学习urllib和正则re的原因和无比蛋疼，另外想把淘宝的成交记录全部列出来看看价格的变化&lt;br>
在这个例子中你可以学到&lt;/p>
&lt;ol>
&lt;li>urllib2 addHeader的使用&lt;/li>
&lt;li>正则表达式的使用
使用前需要配置一下url变量，淘宝物品的成交记录下一页的链接，请复制链接，把最后一个页数的数字删掉，放在url变量里&lt;br>
因为里面太多参数了，没办法只改变某些变量
结果会保存在c:\log.txt文件内。&lt;/li>
&lt;/ol>
&lt;p>以下是代码&lt;/p>
&lt;pre escaped="true" lang="python">#-*- encoding: gbk -*-
'''
Created on 2011-5-8
@author: fatkun
'''
import urllib2
import re
import time
import string
#读取网页
def read(url):
opener = urllib2.build_opener()
#opener.handle_open["http"][0].set_http_debuglevel(1)
opener.addheaders = [('User-agent', 'Mozilla/5.0')]
f= opener.open(url)
content = f.read()
return content
#正则表达式返回需要的内容
def display(content):
pattern = re.compile(r"""&amp;lt;tr(?:[^&amp;gt;]+)?&amp;gt; #TR
[\S\s]*?&amp;lt;td[\S\s]*?&amp;lt;/td&amp;gt;[\S\s]*?&amp;lt;td(?:[^&amp;gt;]+)?&amp;gt; #Second TD
[\S\s]*?&amp;lt;a [^&amp;gt;]+&amp;gt;([\S\s]*?)&amp;lt;/a&amp;gt; # 链接
[\S\s]*?&amp;lt;br/&amp;gt;\s+((?:[\S]+[ ]?)+)\s+&amp;lt;/td&amp;gt; # 物品名称
[\S\s]*?&amp;lt;em&amp;gt;(\d+)&amp;lt;/em&amp;gt; # 价格
[\S\s]*?&amp;lt;td&amp;gt;[\S\s]*?&amp;lt;/td&amp;gt; # TD
[\S\s]*?&amp;lt;td&amp;gt;([\S\s]*?)&amp;lt;/td&amp;gt; # 日期
[\S\s]*?&amp;lt;/tr&amp;gt; #Last TR
""", flags=re.MULTILINE|re.IGNORECASE|re.VERBOSE)
matchs = re.findall(pattern, content )
str = ''
for match in matchs:
str += string.ljust(match[2].strip(), 7) + string.ljust(match[3][:11], 15) + match[1].strip()
str += '\n'
return str
filepath = 'c:\\log.txt'
open(filepath, 'w').close()
lastpage = 150
#淘宝物品的成交记录下一页的链接，请复制链接，把最后一个页数的数字删掉，放在url变量里
url = 'http://tbskip.taobao.com/json/show_buyer_list.htm?is_offline=&amp;page_size=15&amp;is_start=false&amp;item_type=b&amp;ends=1305101478000&amp;starts=1304496678000&amp;item_id=8689953932&amp;user_tag=475363344&amp;old_quantity=1187&amp;sold_total_num=365&amp;closed=false&amp;seller_num_id=69211806&amp;zhichong=true&amp;bidPage='
for i in range(1, lastpage + 1):
fullurl = url + '%d' % (i,)
#不出错运行后设为False
runfail = True
#重试次数
retry = 2
print fullurl
try:
logfile = open(filepath, 'a')
while (runfail and retry &amp;gt;= 0):
try:
content = read(fullurl)
str = display(content)
logfile.write(str)
runfail = False
except:
print '*' * 100
print 'error'
print '*' * 100
retry = retry - 1
time.sleep(5)
if (retry == 0):time.sleep(10) #最后一次尝试等10秒
logfile.flush()
except:
print 'write file fail!'
finally:
logfile.close()&lt;/pre></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/python/">Python</category><category domain="https://fatkun.github.io/tags/%E4%BB%B7%E6%A0%BC%E5%8F%98%E5%8C%96/">价格变化</category><category domain="https://fatkun.github.io/tags/%E6%88%90%E4%BA%A4%E8%AE%B0%E5%BD%95/">成交记录</category><category domain="https://fatkun.github.io/tags/%E6%B7%98%E5%AE%9D/">淘宝</category></item><item><title>Ubuntu中配置Mysql编码</title><link>https://fatkun.github.io/2011/05/ubuntu-mysql-charset.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/05/ubuntu-mysql-charset.html</guid><pubDate>Tue, 03 May 2011 08:42:34 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="找到配置文件">找到配置文件&lt;/h2>
&lt;p>我是通过sudo apt-get install mysql来安装的。mysql的配置文件在/etc/mysql/my.cnf&lt;br>
如果找不到这个文件，可以运行sudo find / -iname ‘*.cnf’查找所有的cnf文件&lt;/p>
&lt;h2 id="修改配置文件">修改配置文件&lt;/h2>
&lt;p>在[mysqld]下添加&lt;br>
default-character-set=utf8&lt;br>
在[client]下添加&lt;br>
default-character-set=utf8&lt;/p>
&lt;h2 id="重启mysql">重启mysql&lt;/h2>
&lt;pre escaped="true" lang="bash">sudo service mysql restart&lt;/pre>
&lt;h2 id="登录mysql查看是否成功">登录mysql查看是否成功&lt;/h2>
&lt;p># mysql -u root&lt;/p>
&lt;pre escaped="true" lang="sql">mysql> show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
&lt;/pre>
&lt;h2 id="修改已经部署的数据库编码">修改已经部署的数据库编码&lt;/h2>
&lt;p>感觉还是挺麻烦的，注意要修改数据库、表、字段的编码。&lt;br>
具体的命令请参考&lt;a href="http://fatkun.com/2011/05/mysql-alter-charset.html">mysql修改表、字段、库的字符集&lt;/a>
参考文章：&lt;br>
&lt;a href="http://www.linuxidc.com/Linux/2008-05/13128.htm">Linux平台下修正MySQL中文乱码问题&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category><category domain="https://fatkun.github.io/tags/mysql/">Mysql</category><category domain="https://fatkun.github.io/tags/ubuntu/">Ubuntu</category><category domain="https://fatkun.github.io/tags/%E7%BC%96%E7%A0%81/">编码</category></item><item><title>mysql修改表、字段、库的字符集</title><link>https://fatkun.github.io/2011/05/mysql-alter-charset.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/05/mysql-alter-charset.html</guid><pubDate>Mon, 02 May 2011 08:20:27 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>修改数据库字符集：&lt;/p>
&lt;pre escaped="true" lang="sql">ALTER DATABASE db_name DEFAULT CHARACTER SET character_name [COLLATE ...];&lt;/pre>
&lt;p>把表默认的字符集和所有字符列（CHAR,VARCHAR,TEXT）改为新的字符集：&lt;/p>
&lt;pre escaped="true" lang="sql">ALTER TABLE tbl_name CONVERT TO CHARACTER SET character_name [COLLATE ...]
如：ALTER TABLE logtest CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;&lt;/pre>
&lt;p>只是修改表的默认字符集：&lt;/p>
&lt;pre escaped="true" lang="sql">ALTER TABLE tbl_name DEFAULT CHARACTER SET character_name [COLLATE...];
如：ALTER TABLE logtest DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;&lt;/pre>
&lt;p>修改字段的字符集：&lt;/p>
&lt;pre escaped="true" lang="sql">ALTER TABLE tbl_name CHANGE c_name c_name CHARACTER SET character_name [COLLATE ...];
如：ALTER TABLE logtest CHANGE title title VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci;&lt;/pre>
&lt;p>查看数据库编码：&lt;/p>
&lt;pre escaped="true" lang="sql">show create database db_name;&lt;/pre>
&lt;p>查看表编码：&lt;/p>
&lt;pre escaped="true" lang="sql">show create table tbl_name;&lt;/pre>
&lt;p>查看字段编码：&lt;/p>
&lt;pre escaped="true" lang="sql">show full columns from tbl_name;&lt;/pre>
&lt;p>来源：&lt;a href="http://www.diannaowa.com/index.php/archives/233">http://www.diannaowa.com/index.php/archives/233&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category><category domain="https://fatkun.github.io/tags/charset/">Charset</category><category domain="https://fatkun.github.io/tags/mysql/">Mysql</category><category domain="https://fatkun.github.io/tags/%E5%AD%97%E7%AC%A6%E9%9B%86/">字符集</category></item><item><title>在VIM加入Ctrl+S快捷键保存当前文件</title><link>https://fatkun.github.io/2011/05/vim-ctrl-s.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/05/vim-ctrl-s.html</guid><pubDate>Sun, 01 May 2011 03:56:22 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>由于Ctrl+S被其他使用，首先要修改~/.bashrc文件，在最后加上&lt;/p>
&lt;pre escaped="true" lang="bash">stty stop ''
&lt;/pre>
&lt;p>然后在~/.vimrc文件中加入&lt;/p>
&lt;pre escaped="true" lang="bash">map &amp;lt;C-s&amp;gt; :w&amp;lt;CR&amp;gt;
imap &amp;lt;C-s&amp;gt; &amp;lt;C-o&amp;gt;:w&amp;lt;CR&amp;gt;
&lt;/pre>
&lt;p>参考来源，有修改：&lt;a href="http://sigttou.com/vim-ctrl-s">http://sigttou.com/vim-ctrl-s&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category><category domain="https://fatkun.github.io/tags/vim/">Vim</category><category domain="https://fatkun.github.io/tags/%E5%BF%AB%E6%8D%B7%E9%94%AE/">快捷键</category></item><item><title>部署outlook2003插件</title><link>https://fatkun.github.io/2011/04/deploy-outlook-addin.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/04/deploy-outlook-addin.html</guid><pubDate>Thu, 21 Apr 2011 03:53:29 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>如果你的插件部署失败，很可能是没有信任的原因，请参考下面的文章吧。&lt;/p>
&lt;h2 id="问题">问题&lt;/h2>
&lt;p>outlook addin 部署成功了，但打死不能切换语言，无论切换哪个都是英文。（多语言是通过ResourceManager读取的）&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>原因是资源文件是放在子目录下的dll文件，例如”zh-CN\xxx.resource.dll”，这些dll并没有授权。&lt;br>
你可以在 VS的命令行中输入 “caspol -lg” 列出所有授权的组。&lt;br>
如果你是按照MSDN的文章进行部署，你应该会有个CaspolSecurityPolicyCreator.cs的文件用于授权。&lt;/p>
&lt;pre escaped="true" lang="csharp">//找到这句
string arguments = policyLevel + " -q -ag " + parentCodeGroup + " -url \"" + solutionInstallationUrl + "\" Nothing -n \"" + solutionCodeGroupName + "\" -d \"" + solutionCodeGroupDescription + "\"";
//把Nothing改为FullTrust，其实就是把这个目录的所有文件都信任了
string arguments = policyLevel + " -q -ag " + parentCodeGroup + " -url \"" + solutionInstallationUrl + "\" FullTrust -n \"" + solutionCodeGroupName + "\" -d \"" + solutionCodeGroupDescription + "\"";
&lt;/pre>
&lt;p>如果你没有上面这个文件（其实这个文件也是调用caspol.exe来授权的），可以尝试自己来运行caspol.exe -m -ag …来授权。&lt;/p>
&lt;h2 id="参考文章">参考文章&lt;/h2>
&lt;p>&lt;a href="http://www.cnblogs.com/bluewelkin/archive/2008/09/03/1283231.html">Outlook 2003 Add in 部署笔记&lt;/a>&lt;br>
&lt;a href="http://msdn.microsoft.com/zh-cn/library/bb332051(v=office.12).aspx">Deploying Visual Studio 2005 Tools for the Office System SE Solutions Using Windows Installer (Part 1 of 2)&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/asp.net/">ASP.NET</category><category domain="https://fatkun.github.io/tags/deploy/">Deploy</category><category domain="https://fatkun.github.io/tags/outlook/">Outlook</category><category domain="https://fatkun.github.io/tags/outlook-addin/">Outlook Addin</category><category domain="https://fatkun.github.io/tags/%E9%83%A8%E7%BD%B2%E6%8F%92%E4%BB%B6/">部署插件</category></item><item><title>python实现一个简单的地址簿</title><link>https://fatkun.github.io/2011/04/python-addressbook.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/04/python-addressbook.html</guid><pubDate>Sun, 17 Apr 2011 10:51:16 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>看了简明python教程，动手试试，用python实现一个简单的地址簿&lt;/p>
&lt;h2 id="版本一">版本一&lt;/h2>
&lt;p>这只是一个简单的试验版本，如何新建对象并保存。&lt;/p>
&lt;pre escaped="true" lang="python">#!/usr/bin/python
# Filename: addressBook.py
import cPickle as pickle
class PersonInfo:
def __init__(self, name, age):
self.name = name
self.age = age
def __str__(self):
return '姓名:%s，年龄:%s' % (self.name, self.age)
addrFileName = 'address.data'
addrList = {}
pi = PersonInfo('Fatkun', 23)
addrList[pi.name] = pi
pi = PersonInfo('Olunx', 22)
addrList[pi.name] = pi
addrFile = file(addrFileName, 'w')
pickle.dump(addrList, addrFile)
addrFile.close()
del pi
addrFile = file(addrFileName)
storedPi = pickle.load(addrFile)
for key, pi in storedPi.items():
print pi
&lt;/pre>
&lt;h2 id="版本2">版本2&lt;/h2>
&lt;p>这个版本是较完整的例子，实现了多个方法。&lt;/p>
&lt;pre escaped="true" lang="python">#!/usr/bin/python
# -*- coding: gbk -*-
# Filename: addressBook.py
import cPickle as pickle
import sys
class PersonInfo:
def __init__(self, name, age):
self.name = name
self.age = age
def __str__(self):
return '姓名:%s，年龄:%s' % (self.name, self.age)
#读取文件
def readObj(addrFileName):
addrFile = file(addrFileName)
storedList = pickle.load(addrFile)
return storedList
#添加或更新
def addOrUpdatePerson(name, age):
global addrList
pi = PersonInfo(name, age)
addrList[name] = pi
#保存对象到文件
def save(addrFileName):
global addrList
addrFile = file(addrFileName, 'w')
pickle.dump(addrList, addrFile)
addrFile.close()
def delPersion(name):
global addrList
#if addrList.has_key(name): 可以用这个判断是否有key，但我想练习一下捕捉异常，so...
try:
del addrList[name]
except KeyError:
print "出错啦，可能已经删除了。\n"
#遍历
def printAll():
global addrList
for key, pi in addrList.items():
print pi
#保存对象的文件名
addrFileName = 'address.data'
#map
addrList = readObj(addrFileName)
if len(sys.argv) &amp;lt; 2:
printAll()
elif sys.argv[1].startswith('--'):
option = sys.argv[1][2:]
if option == 'version':
print 'Version 1.0'
elif option == 'help':
print '''\
这只是一个简单的地址簿（坑爹啊，哪里有地址了，就一个名字和年龄）
参数：
--version : 打印版本
--help : 显示帮助
-a username age ：添加
-u username age ：更新
-d username : 删除
'''
else:
print '未知参数'
elif sys.argv[1].startswith('-'):
option = sys.argv[1][1:]
if option == 'a':#添加
if len(sys.argv) == 4:
addOrUpdatePerson(sys.argv[2],sys.argv[3])
elif option == 'u':#更新
if len(sys.argv) == 4:
addOrUpdatePerson(sys.argv[2],sys.argv[3])
elif option == 'd':#删除
if len(sys.argv) == 3:
delPersion(sys.argv[2])
printAll()
save(addrFileName)
&lt;/pre></description><category domain="https://fatkun.github.io/categories/python/">Python</category><category domain="https://fatkun.github.io/tags/python/">Python</category><category domain="https://fatkun.github.io/tags/%E5%9C%B0%E5%9D%80%E7%B0%BF/">地址簿</category></item><item><title>CSS实现的三角形</title><link>https://fatkun.github.io/2011/04/css-triangle.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/04/css-triangle.html</guid><pubDate>Sun, 10 Apr 2011 07:23:49 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;a href="http://fatkun.com/wp-content/uploads/2011/04/triangle.png">&lt;img class="alignnone size-full wp-image-878" title="triangle" src="http://fatkun.com/wp-content/uploads/2011/04/triangle.png" alt="" width="209" height="146" />&lt;/a>
看着喜欢，就试着自己做一个了。&lt;/p>
&lt;h2 id="原理">原理&lt;/h2>
&lt;p>主要是利用border来实现。
看上图的的正方形的代码&lt;/p>
&lt;pre escaped="true" lang="css">&amp;lt;div style="width:0; height:0; border:40px solid transparent;border-top-color:green;border-left-color:red;border-right-color:blue;border-bottom-color:yellow;"&amp;gt;&amp;lt;/div&amp;gt;&lt;/pre>
&lt;p>分别给四边的border设了四种颜色。也许你看到这里就知道了，取一部分不就是三角形了嘛。没错，把其他三边设为透明即可。&lt;/p>
&lt;pre escaped="true" lang="css">&amp;lt;style type="text/css"&amp;gt;
.triangle_contianer{ position:relative; background:#FFE4CA; color:#000; border:4px solid #F90; padding:5px;}
.triangle_border{ width:0; position:absolute; left:50%;bottom:-24px; margin-left:-12px; border:12px solid transparent;border-top-color:#F90;}
.triangle{ position:absolute; left:50%;bottom:-12px; margin-left:-6px; border:6px solid transparent;border-top-color:#FFE4CA;}
&amp;lt;/style&amp;gt;
&amp;lt;span class="triangle_contianer"&amp;gt;
Fatkun,这是提示的内容啊&amp;lt;span class="triangle_border"&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class="triangle"&amp;gt;&amp;lt;/span&amp;gt;
&amp;lt;/span&amp;gt;&lt;/pre>
&lt;p>其实这里用了一个span假装作为了三角形边框(triangle_border)，其实也是一个三角形border。
另外里面的边框宽度改变的话，还要相应的改变margin-left等一些值。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/css/">Css</category><category domain="https://fatkun.github.io/tags/%E4%B8%89%E8%A7%92%E5%BD%A2/">三角形</category></item><item><title>安装VS2008失败，Microsoft Visual Studio Web创作组件安装失败</title><link>https://fatkun.github.io/2011/04/vs2008-microsoft-visual-studio-web.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/04/vs2008-microsoft-visual-studio-web.html</guid><pubDate>Sat, 02 Apr 2011 06:45:05 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>我的计算机系统是vista家庭版的，已经安装了Office 2007，在安装VS2008的过程中出现安装失败的窗口。
先把vs2008镜像文件下的\WCU\WebDesignerCore\WebDesignerCore.EXE 手动解压(Winrar)，然后找一个office2007光盘或光盘镜像，找到Office.zh-cn文件夹，把该文件夹复制，覆盖WebDesignerCore.EXE 解压后的office.zh-cn文件夹，再点击里面的setup.exe。最后就可以点击根目录下的setup.exe计科安装成功。如果不先执行覆盖操作，就会提示找不到“Office.zh-cn\OfficeMUI.msi文件”文件。
原文：http://blog.csdn.net/shilmey/archive/2010/03/04/5347447.aspx&lt;br>
更多：http://blogs.itecn.net/blogs/wbpluto/archive/2008/02/17/visual-studio-2008-web.aspx&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/microsoft-visual-studio-web%E5%88%9B%E4%BD%9C%E7%BB%84%E4%BB%B6/">Microsoft Visual Studio Web创作组件</category><category domain="https://fatkun.github.io/tags/vs2008/">VS2008</category></item><item><title>org.hibernate.NonUniqueObjectException的原因与解决方法</title><link>https://fatkun.github.io/2011/04/org-hibernate-nonuniqueobjectexception.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/04/org-hibernate-nonuniqueobjectexception.html</guid><pubDate>Fri, 01 Apr 2011 09:42:12 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>使用hibernate更新对象时，出现如下错误：&lt;br>
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session:[com.fatkun.dao.hibernate.User#12]&lt;/p>
&lt;h2 id="原因">原因&lt;/h2>
&lt;p>在同一个session内，如果已经有一个对象已经是持久化状态(load进来等)，现在构造一个新的PO，和前一个持久化对象拥有相同的持久化标识(identifier)，在update的时候，就会抛这个错误。&lt;br>
举个例子（伪代码）：&lt;/p>
&lt;pre escaped="true" lang="java">User user1 = session.load(1);
User user2 = new User();
user2.setId(1);//此时ID和user1一样
user2.setUsername("fatkun");
session.update(user2);//这里会抛出错误&lt;/pre>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>1.不要重新new一个对象，使用load的对象对他进行更改值。&lt;br>
例如上面例子直接对user1操作，最后更新user1&lt;br>
2.如果是hibernate3以上，可以使用session.merge()方法&lt;br>
3.把session中同标识的对象移出(session.evict(user1))，使他成为脱管的状态，然后user2就可以update了。&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/hibernate/">Hibernate</category><category domain="https://fatkun.github.io/tags/nonuniqueobjectexception/">NonUniqueObjectException</category></item><item><title>Outlook自定义窗体自动发布</title><link>https://fatkun.github.io/2011/03/outlook-forms-publish.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/03/outlook-forms-publish.html</guid><pubDate>Wed, 16 Mar 2011 01:20:42 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>一般来说，我们都是把窗体“另存为”一个.oft的文件，然后如果要发布给很多人，一个是发布到exchange server上大家共用，一个是只发布到自己。
通常是使用“工具-&amp;gt;窗体-&amp;gt;发布窗体”来进行发布，但是如果窗体很多。。而且每个人都要发布。。那就挺麻烦的。&lt;/p>
&lt;h2 id="实现代码">实现代码&lt;/h2>
&lt;p>把下面的代码保存为xxx.vbs文件，放到.oft同一个目录就可以自动发布了。当然，你可以要相应修改一下&lt;/p>
&lt;pre escaped="true" lang="vbs">Sub PublishForm(objOL, olns, strPath, trueName, displayName, folderId)
Dim objItem ' As Outlook.ContactItem
Dim objFD ' As Outlook.FormDescription
Dim MyFolder
Const olPersonalRegistry = 2
Const olFolderRegistry = 3
Const olDiscard = 1
Set objItem = objOL.CreateItemFromTemplate(strPath)
Set objFD = objItem.FormDescription
Set MyFolder = olns.GetDefaultFolder(folderId)
With objFD
.Name = trueName
.DisplayName = displayName
.PublishForm olFolderRegistry, MyFolder '请参考msdn，olPersonalRegistry 是发布到personal文件夹
End With
objItem.Close olDiscard
Set objFD = Nothing
Set objItem = Nothing
End Sub
Const olFolderCalendar = 9
Const olFolderTasks = 13
Dim path
'取得当前位置
path = createobject("Scripting.FileSystemObject").GetFolder(".").Path+"\"
Dim objOL,olns
Set objOL = CreateObject("Outlook.Application")
Set olns = objOL.GetNameSpace("MAPI")
Call PublishForm(objOL, olns, path+"Activity.oft","命名","显示名称",olFolderTasks)
Set objOL = Nothing
Set olns = Nothing&lt;/pre>
&lt;h2 id="参考文章">参考文章&lt;/h2>
&lt;p>&lt;a href="http://www.outlookcode.com/article.aspx?id=27">To distribute Microsoft Outlook forms to other users&lt;/a>
&lt;span style="font-family: Verdana, Arial, Helvetica; font-size: small;">&lt;a href="http://www.outlookexchange.com/articles/home/wisniewski01.asp">Automating the Installation of Outlook Forms for off-line users&lt;/a>&lt;/span>
&lt;span style="font-family: Verdana, Arial, Helvetica; font-size: small;">&lt;a href="http://www.txsz.net/xs/delphi/3/Outlook%20TypeLib%28MSOUTL9.OLB%29.htm">&lt;a href="http://www.txsz.net/xs/delphi/3/Outlook%20TypeLib%28MSOUTL9.OLB%29.htm">http://www.txsz.net/xs/delphi/3/Outlook%20TypeLib%28MSOUTL9.OLB%29.htm&lt;/a>&lt;/a>&lt;br /> &lt;/span>&lt;br>
&lt;a href="http://msdn.microsoft.com/zh-cn/library/microsoft.office.interop.outlook.formdescription.publishform.aspx">FormDescription.PublishForm Method&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/forms/">Forms</category><category domain="https://fatkun.github.io/tags/outlook/">Outlook</category><category domain="https://fatkun.github.io/tags/%E7%AA%97%E4%BD%93/">窗体</category><category domain="https://fatkun.github.io/tags/%E8%87%AA%E5%AE%9A%E4%B9%89%E7%AA%97%E4%BD%93/">自定义窗体</category></item><item><title>VSTO获取邮件联系人邮箱</title><link>https://fatkun.github.io/2011/03/vsto-get-mail-recipient.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/03/vsto-get-mail-recipient.html</guid><pubDate>Tue, 15 Mar 2011 01:23:56 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>C# VSTO获取邮件联系人邮箱，包括获取To,CC等&lt;br>
直接从mailItem.Recipients取得所有这封邮件的联系人，然后在根据Type来判断是属于哪个的。&lt;/p>
&lt;pre escaped="true" lang="csharp">public enum OlMailRecipientType
{
olOriginator = 0,
olTo = 1,
olCC = 2,
olBCC = 3,
}&lt;/pre>
&lt;h2 id="举例取得cc的联系人邮箱">举例，取得CC的联系人邮箱：&lt;/h2>
&lt;pre escaped="true" lang="csharp">public static List&amp;lt;string&amp;gt; GetCCAddress(Microsoft.Office.Interop.Outlook.MailItem mailItem)
{
List&amp;lt;string&amp;gt; addressList = new List&amp;lt;string&amp;gt;();
Outlook.Recipients recipients = mailItem.Recipients;
foreach (Outlook.Recipient recipient in recipients)
{
if (recipient.Type != 2)//OlMailRecipientType.olCC=2
{
continue;
}
if (recipient.Address != null)
{
string addType = recipient.AddressEntry.Type;
if ("SMTP".Equals(addType))
{
addressList.Add(recipient.Address);
}
else if ("EX".Equals(addType))
{
addressList.AddRange(GetEmailAddressForExchangeServer(mailItem.Application, recipient.Name));
}
}
}
return addressList;
}&lt;/pre>
&lt;p>参考网址：
&lt;a href="http://msdn.microsoft.com/en-us/library/aa210995%28v=office.11%29.aspx">http://msdn.microsoft.com/en-us/library/aa210995%28v=office.11%29.aspx&lt;/a>
&lt;a href="http://msdn.microsoft.com/en-us/library/aa219371%28v=office.11%29.aspx">http://msdn.microsoft.com/en-us/library/aa219371%28v=office.11%29.aspx&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/asp.net/">ASP.NET</category><category domain="https://fatkun.github.io/tags/vsto/">VSTO</category><category domain="https://fatkun.github.io/tags/%E8%81%94%E7%B3%BB%E4%BA%BA/">联系人</category></item><item><title>JDK源码分析：java.lang.String</title><link>https://fatkun.github.io/2011/03/jdk-source-java-lang-string.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/03/jdk-source-java-lang-string.html</guid><pubDate>Thu, 10 Mar 2011 15:24:57 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>最近开始看JDK源码，不能太懒了&lt;del>注释非常详细（虽然是英文），而且部分代码也不算很复杂。先挑的简单的看看。。为了坚持下去，所以在博客写些记录，一是为了记忆，二是给自己一个坚持的理由&lt;/del>哇咔咔，英文不算很好，那就对着中文API一起看吧。。&lt;/p>
&lt;h2 id="string结构">String结构&lt;/h2>
&lt;p>这个类结构很简单。。&lt;/p>
&lt;pre escaped="true" lang="java">/** The value is used for character storage. */
private final char value[];
/** The offset is the first index of the storage that is used. */
private final int offset;
/** The count is the number of characters in the String. */
private final int count;&lt;/pre>
&lt;p>用了一个char数组来存储字符，然后offset是偏移（这个我还搞不懂有啥用），count是String的长度。&lt;br>
注意到String类是final的，不可以被继承，而且private final char value[];，只能赋值一次，赋值后就不能变了，只有从新生成一个String对象。&lt;/p>
&lt;h2 id="public-string-concatstring-str">public String concat(String str)&lt;/h2>
&lt;pre escaped="true" lang="java">public String concat(String str) {
int otherLen = str.length();
if (otherLen == 0) {
return this;
}
char buf[] = new char[count + otherLen];
getChars(0, count, buf, 0);
str.getChars(0, otherLen, buf, count);
return new String(0, count + otherLen, buf);
}&lt;/pre>
&lt;p>这段代码是连接两个String的，先拿个char数组当容器，从this和str分别取出char放入buf内，注意getChars方法的第四个参数，这个是说buf从count个开始拷贝。也就是说把两个string的char放在了一个char数组内，再返回一个新的String对象。(因为之前的String已经不可以改变)&lt;/p>
&lt;h2 id="public-int-indexofstring-str-int-fromindex">public int indexOf(String str, int fromIndex)&lt;/h2>
&lt;pre escaped="true" lang="java">public int indexOf(String str, int fromIndex) {
return indexOf(value, offset, count,
str.value, str.offset, str.count, fromIndex);
}
//source源字符，sourceOffset源偏移，sourceCount源长度
//target查找的字符 ...
static int indexOf(char[] source, int sourceOffset, int sourceCount,
char[] target, int targetOffset, int targetCount,
int fromIndex) {
//如果fromIndex比源字符还长(从0算起)，并且查找的字符长度为0，那就返回源字符的长度，否则返回-1
if (fromIndex >= sourceCount) {
return (targetCount == 0 ? sourceCount : -1);
}
if (fromIndex &amp;lt; 0) {
fromIndex = 0;
}
//如果fromIndex比源字符短，查找的字符长度为0，直接返回fromIndex
if (targetCount == 0) {
return fromIndex;
}
//先取出第一个字符
char first = target[targetOffset];
int max = sourceOffset + (sourceCount - targetCount);
//循环每一个字符
for (int i = sourceOffset + fromIndex; i &amp;lt;= max; i++) {
/* 直到找到第一个字符 */
if (source[i] != first) {
while (++i &amp;lt;= max &amp;#038;&amp;#038; source[i] != first);
}
/* 找到第一个字符后，比较剩下的字符 */
if (i &amp;lt;= max) {
int j = i + 1;
int end = j + targetCount - 1;
for (int k = targetOffset + 1; j &amp;lt; end &amp;#038;&amp;#038; source[j] ==
target[k]; j++, k++);
if (j == end) {
/* 如果j能到end，那就说明找到整个字符串啦，返回偏移 */
return i - sourceOffset;
}
}
}
return -1;
}
&lt;/pre>
&lt;p>indexOf只要看它的查找方法，先找到第一个，然后再匹配剩下的。&lt;/p>
&lt;h2 id="public-boolean-equalsobject-anobject">public boolean equals(Object anObject)&lt;/h2>
&lt;pre escaped="true" lang="java">public boolean equals(Object anObject) {
if (this == anObject) {
return true;
}
if (anObject instanceof String) {
String anotherString = (String)anObject;
int n = count;
if (n == anotherString.count) {
char v1[] = value;
char v2[] = anotherString.value;
int i = offset;
int j = anotherString.offset;
while (n-- != 0) {
if (v1[i++] != v2[j++])
return false;
}
return true;
}
}
return false;
}&lt;/pre>
&lt;p>比较char~~&lt;/p>
&lt;h2 id="replace与replaceall">replace与replaceAll&lt;/h2>
&lt;pre escaped="true" lang="java">public String replace(CharSequence target, CharSequence replacement) {
return Pattern.compile(target.toString(), Pattern.LITERAL).matcher(
this).replaceAll(Matcher.quoteReplacement(replacement.toString()));
}
public String replaceAll(String regex, String replacement) {
return Pattern.compile(regex).matcher(this).replaceAll(replacement);
}&lt;/pre>
&lt;p>这两句真短啊。。用正则表达式来替换的。可以看出他们的区别。&lt;br>
replace只支持普通字符的替换哦，Pattern.LITERAL是指启用模式的字面值解析。Matcher.quoteReplacement(str)返回指定 String 的字面值替换 String。这个方法也就是替换\为\\(四个反斜杠)，$换为\$。这样，它就不能用正则表达式了，但是看到依然是replaceAll，替换所有。&lt;br>
replaceAll很简单的一个正则表达式使用~~&lt;br>
要注意的是源字符串替换后内容并没有发生变化。&lt;br>
举例如下: &lt;a href="http://satellite.javaeye.com/blog/224820">来源&lt;/a>&lt;br>
String src = new String(&amp;quot;ab43a2c43d&amp;quot;);&lt;br>
System.out.println(src.replace(&amp;quot;3&amp;quot;,&amp;quot;f&amp;quot;));=&amp;gt;ab4f2c4fd.&lt;br>
System.out.println(src.replace('3','f'));=&amp;gt;ab4f2c4fd.&lt;br>
System.out.println(src.replaceAll(&amp;quot;\d&amp;quot;,&amp;quot;f&amp;quot;));=&amp;gt;abffafcffd.&lt;br>
System.out.println(src.replaceAll(&amp;quot;a&amp;quot;,&amp;quot;f&amp;quot;));=&amp;gt;fb43fc23d.&lt;br>
System.out.println(src.replaceFirst(&amp;quot;\d,&amp;quot;f&amp;quot;));=&amp;gt;abf32c43d&lt;br>
System.out.println(src.replaceFirst(&amp;quot;4&amp;quot;,&amp;quot;h&amp;quot;));=&amp;gt;abh32c43d.&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java/">JAVA</category><category domain="https://fatkun.github.io/tags/jdk%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/">JDK源码分析</category><category domain="https://fatkun.github.io/tags/string/">String</category></item><item><title>安装.net framework 3.5错误</title><link>https://fatkun.github.io/2011/03/this-application-has-requested-the-runtime-to-terminate-it-in-an-unusual-way.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/03/this-application-has-requested-the-runtime-to-terminate-it-in-an-unusual-way.html</guid><pubDate>Wed, 09 Mar 2011 05:20:13 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="问题">问题&lt;/h2>
&lt;p>我在官方下了一个.net framework 3.5,可是安装的时候说&lt;br>
Visual C++ Runtime Library runtime error.&lt;br>
This application has requested the runtime to terminate it in an unusual way.Please contact the application’s support team for more information.
后面来弹出一个错误是：printfilterpipelinesve.exe 应用程序错误&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>在我的电脑-》右键-》管理-》服务和应用程序-》服务-》启用Print Spooler服务&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/printfilterpipelinesve.exe/">Printfilterpipelinesve.exe</category><category domain="https://fatkun.github.io/tags/runtime-error/">Runtime Error</category></item><item><title>谷歌浏览器扩展:Fatkun图片批量下载0.4版出来了</title><link>https://fatkun.github.io/2011/03/batch-image-download-0-4.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/03/batch-image-download-0-4.html</guid><pubDate>Sat, 05 Mar 2011 16:31:30 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这次改动很少。。
0.4版update:2011-03-06&lt;/p>
&lt;ol>
&lt;li>添加选项选择使用标题保存还是固定名字目录
下载地址：0.4版插件地址：&lt;a href="http://bath-image-download.googlecode.com/files/batch0_4.crx">http://bath-image-download.googlecode.com/files/batch0_4.crx&lt;/a>
更多信息看这里:&lt;a href="http://fatkun.com/2010/09/batch-image-download.html">http://fatkun.com/2010/09/batch-image-download.html&lt;/a>&lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/chrome/">Chrome</category><category domain="https://fatkun.github.io/tags/chrome-extensions/">Chrome Extensions</category><category domain="https://fatkun.github.io/tags/%E6%89%B9%E9%87%8F%E4%B8%8B%E8%BD%BD%E5%9B%BE%E7%89%87/">批量下载图片</category></item><item><title>HTML Canvas 鼠标画图</title><link>https://fatkun.github.io/2011/02/html5-canvas-paint.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/02/html5-canvas-paint.html</guid><pubDate>Sun, 20 Feb 2011 07:32:27 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>原文来自:&lt;a href="http://www.williammalone.com/articles/create-html5-canvas-javascript-drawing-app">http://www.williammalone.com/articles/create-html5-canvas-javascript-drawing-app&lt;/a>(已被墙)
译文: &lt;a href="http://fatkun.com/2011/02/html5-canvas-paint.html">http://fatkun.com/2011/02/html5-canvas-paint.html&lt;/a>
我也不打算全部翻译了…大部分也看的懂,就算看不懂,代码也能看懂….o(╯□╰)o原谅我非常懒…很久没写博客了.&lt;br>
&lt;img src="http://wah88w.blu.livefilestore.com/y1pIqIdhuRNQzBo5xMVKTT97SV5E_bTIEr-ocWYMiE0iCXldxf0rIUXOiclvrtlhCChQc2zC9xFUClmwEgJS6t6NKiM_hE3flJ5/canvas.png?psid=1" alt="">&lt;/p>
&lt;p>——————-以下是一个简单的例子————————————-&lt;/p>
&lt;h2 id="html容器">html容器&lt;/h2>
&lt;p>首先，准备个容器,也就是画板了。&lt;/p>
&lt;pre escaped="true" lang="html">&amp;lt;canvas id="canvasInAPerfectWorld" width="490" height="220"&amp;gt;&amp;lt;/canvas&amp;gt;&lt;/pre>
&lt;p>但是，由于IE部分版本还是不支持HTML5，那我们可以借用exCanvas兼容IE..&lt;/p>
&lt;pre escaped="true" lang="html">&amp;lt;div id="canvasDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;/pre>
&lt;h2 id="初始化js代码">初始化js代码&lt;/h2>
&lt;p>如果你不管IE使用第一种方法&lt;/p>
&lt;pre escaped="true" lang="js">context = document.getElementById('canvasInAPerfectWorld').getContext("2d");&lt;/pre>
&lt;p>为了兼容IE，不得不使用下面这个方法，创建一个canvas，然后使用excanvas初始化。当然，为了IE兼容，你需要针对IE加上&lt;a href="http://code.google.com/p/explorercanvas/">exCanvas.js&lt;/a>&lt;/p>
&lt;pre escaped="true" lang="js">var canvasDiv = document.getElementById('canvasDiv');
canvas = document.createElement('canvas');
canvas.setAttribute('width', canvasWidth);
canvas.setAttribute('height', canvasHeight);
canvas.setAttribute('id', 'canvas');
canvasDiv.appendChild(canvas);
if(typeof G_vmlCanvasManager != 'undefined') {
canvas = G_vmlCanvasManager.initElement(canvas);
}
context = canvas.getContext("2d");&lt;/pre>
&lt;h2 id="开始一个简单的画板">开始一个简单的画板&lt;/h2>
&lt;p>在开始之前，说说怎么做先。它包含了四个鼠标事件和两个方法。addClick是为了记录鼠标的移动点，redraw是把记录的数据画出来。 (提一下，由于原作者使用了jquery，所以你也要把jquery引用进来。)&lt;/p>
&lt;h3 id="鼠标按下事件mouse-down-event">鼠标按下事件(Mouse Down Event)&lt;/h3>
&lt;p>当鼠标按下时，把paint设为true，表示正在画，鼠标没松开。把鼠标点记录下来。&lt;/p>
&lt;pre escaped="true" lang="js">$('#canvas').mousedown(function(e){
var mouseX = e.pageX - this.offsetLeft;
var mouseY = e.pageY - this.offsetTop;
paint = true;
addClick(e.pageX - this.offsetLeft, e.pageY - this.offsetTop);
redraw();
});&lt;/pre>
&lt;h3 id="鼠标移动事件mouse-move-event">鼠标移动事件(Mouse Move Event)&lt;/h3>
&lt;p>当按下鼠标的时候，鼠标移动就把点记录下来并画出来。&lt;/p>
&lt;pre escaped="true" lang="js">$('#canvas').mousemove(function(e){
if(paint){//是不是按下了鼠标
addClick(e.pageX - this.offsetLeft, e.pageY - this.offsetTop, true);
redraw();
}
});&lt;/pre>
&lt;h3 id="鼠标松开事件mouse-up-event">鼠标松开事件(Mouse Up Event)&lt;/h3>
&lt;pre escaped="true" lang="js">$('#canvas').mouseup(function(e){
paint = false;
});&lt;/pre>
&lt;h3 id="鼠标移开事件mouse-leave-event">鼠标移开事件(Mouse Leave Event)&lt;/h3>
&lt;pre escaped="true" lang="js">$('#canvas').mouseleave(function(e){
paint = false;
});&lt;/pre>
&lt;h3 id="addclick方法">addClick方法&lt;/h3>
&lt;p>记录鼠标坐标点&lt;/p>
&lt;pre escaped="true" lang="js">var clickX = new Array();
var clickY = new Array();
var clickDrag = new Array();
var paint;
function addClick(x, y, dragging)
{
clickX.push(x);
clickY.push(y);
clickDrag.push(dragging);
}&lt;/pre>
&lt;h3 id="redraw方法">redraw方法&lt;/h3>
&lt;p>目前这个redraw方法是每次都清空画板，然后重新把所有的点都画过，虽然效率不高，但是这样看起来还是挺简单的。&lt;/p>
&lt;pre escaped="true" lang="js">function redraw(){
canvas.width = canvas.width; // Clears the canvas
context.strokeStyle = "#df4b26";
context.lineJoin = "round";
context.lineWidth = 5;
for(var i=0; i &amp;lt; clickX.length; i++)
{
context.beginPath();
if(clickDrag[i] &amp;&amp; i){//当是拖动而且i!=0时，从上一个点开始画线。
context.moveTo(clickX[i-1], clickY[i-1]);
}else{
context.moveTo(clickX[i]-1, clickY[i]);
}
context.lineTo(clickX[i], clickY[i]);
context.closePath();
context.stroke();
}
}&lt;/pre>
&lt;h2 id="最终效果">最终效果&lt;/h2>
&lt;p>&lt;a href="http://fatkun.googlecode.com/hg/javascript/canvas.html">点我看效果，赶紧点我&lt;/a>&lt;/p>
&lt;h2 id="最后">最后&lt;/h2>
&lt;p>这上面的只是个简单的例子啦。。。原作者还在上面代码的基础上加了颜色，大小，橡皮擦等功能呢~~想看的翻墙去看作者博客吧。。这年头不会翻墙还真不好意思见人。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/canvas/">Canvas</category><category domain="https://fatkun.github.io/tags/html5/">Html5</category><category domain="https://fatkun.github.io/tags/%E6%89%8B%E5%86%99/">手写</category><category domain="https://fatkun.github.io/tags/%E7%94%BB%E5%9B%BE/">画图</category></item><item><title>SQL Server JDBC Driver 2.0编译失败</title><link>https://fatkun.github.io/2011/01/sql-server-jdbc-driver-2-0%E7%BC%96%E8%AF%91%E5%A4%B1%E8%B4%A5.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/01/sql-server-jdbc-driver-2-0%E7%BC%96%E8%AF%91%E5%A4%B1%E8%B4%A5.html</guid><pubDate>Thu, 27 Jan 2011 04:46:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> &lt;/p>
&lt;p align="left"> Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file&lt;/p>
&lt;p align="left"> 这个错误是因为JDK的版本不对，请检查你的JDK版本。然后检查你的包是不是都用低版本JDK编译的。&lt;/p>
&lt;p align="left"> 如果你在使用JDK1.5的话，一定要使用sqljdbc.jar包，sqljdbc4.jar是在JDK1.6的环境下才能使用的。&lt;/p>
&lt;p align="left"> &amp;nbsp;&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/jdk/">Jdk</category><category domain="https://fatkun.github.io/tags/%E7%89%88%E6%9C%AC%E9%94%99%E8%AF%AF/">版本错误</category></item><item><title>改变CHM字体大小</title><link>https://fatkun.github.io/2011/01/change-chm-font-size.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/01/change-chm-font-size.html</guid><pubDate>Wed, 26 Jan 2011 05:53:16 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>看CHM文档太郁闷了，字体太小还调整不了o(╯□╰)o
还恨不得用放大镜看呢。。囧。。&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>启动IE，单击“工具→Internet选项”，出现“Internet选项”对话框，在“常规”标签中单击右下方的“辅助功能”按钮，在出现的“辅助功能”对话框中把“不使用网页中指定的字体大小”(IE8中是忽略网页上指定的字号)选项选上，按“确定”退出就可以了！现在，你再试试 点击CHM上面的字体按钮或IE Menu Bar上的“查看→文字大小”命令，改变字体大小后，Chm字体的大小也随之改变了。
 
看完了文档最好改回来，嘿嘿。。。不然有些网页字体很大。。。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/chm/">Chm</category><category domain="https://fatkun.github.io/tags/%E6%94%B9%E5%8F%98%E5%AD%97%E4%BD%93/">改变字体</category></item><item><title>正则表达式-非捕获组</title><link>https://fatkun.github.io/2011/01/regex-ncap.html</link><guid isPermaLink="true">https://fatkun.github.io/2011/01/regex-ncap.html</guid><pubDate>Sun, 23 Jan 2011 05:59:32 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> &lt;/p>
&lt;h2 id="非捕获组-xxx">非捕获组 (?:xxx)&lt;/h2>
&lt;p style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun, 'MS Gothic', 'New Gulim'; font-size: 12px; line-height: 16px; "> 使用 (?: ) 包含其他表达式，可使被包含的表达式组成一个整体，在被修饰匹配次数时，可作为整体被修饰。&lt;/p>
&lt;p style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun, 'MS Gothic', 'New Gulim'; font-size: 12px; line-height: 16px; "> &amp;nbsp;&lt;/p>
## 说明
&lt;p style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun, 'MS Gothic', 'New Gulim'; font-size: 12px; line-height: 16px; "> 与普通分组不同的是，非捕获组不记录所匹配的内容，比普通分组更节约内存资源。&lt;/p>
&lt;p style="font-family: Verdana, Arial, Helvetica, sans-serif, SimSun, 'MS Gothic', 'New Gulim'; font-size: 12px; line-height: 16px; "> 通过格式 (?ismg-ismg:xxx) 可对匹配模式进行修改，修改后的模式只对当前非捕获组内部起作用。&lt;/p>
## 举例
&lt;p>匹配一个URL链接,当中可以有端口或者没有端口号,如下&lt;/p>
&lt;blockquote>
&lt;p>url1 = &amp;quot;http://fatkun.com:8080&amp;quot;
url2 = &amp;quot;http://fatkun.com&amp;quot;
如果有端口号需要匹配端口号,如果没则忽略它
正则表达式:/{0,2}([0-9.-A-Za-z]+)(?::(\d+))?$
url1匹配结果
$0 = //fatkun.com
$1 = fatkun.com
$2 = 8080
url2匹配的$2结果为空&lt;/p>
&lt;/blockquote>
&lt;h2 id="解释">解释&lt;/h2>
&lt;p>/{0,2} 匹配//
([0-9.-A-Za-z]+) 匹配fatkun.com
(?::(\d+))? 注意这里的(?:),这里是非捕获分组,判断是不是有:开头的数字,把匹配的数字取出
 &lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category></item><item><title>JFreeChart核心类库介绍</title><link>https://fatkun.github.io/2010/12/jfreechart%E6%A0%B8%E5%BF%83%E7%B1%BB%E5%BA%93.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/jfreechart%E6%A0%B8%E5%BF%83%E7%B1%BB%E5%BA%93.html</guid><pubDate>Fri, 31 Dec 2010 05:54:44 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>以下内容包括了如何调整XY轴数值间隔
原文来自：&lt;a href="http://hi.baidu.com/baileyfu/blog/item/8e75b212b47fea54f819b808.html">http://hi.baidu.com/baileyfu/blog/item/8e75b212b47fea54f819b808.html&lt;/a>&lt;/p>
&lt;p>jfreechart主要由两个大的包组成：org.jfree.chart,org.jfree.data。其中前者主要与图形&lt;/p>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 本身有关，后者与图形显示的数据有关。&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
## 核心类主要有：
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> org.jfree.chart.JFreeChart：图表对象，任何类型的图表的最终表现形式都是在该对象进行一些属性的定制。JFreeChart引擎本身提供了一个工厂类用于创建不同类型的图表对象&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> org.jfree.data.category.XXXDataSet:数据集对象，用于提供显示图表所用的数据。根据不同类型的图表对应着很多类型的数据集对象类&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> org.jfree.chart.plot.XXXPlot：图表区域对象，基本上这个对象决定着什么样式的图表，创建该对象的时候需要Axis、Renderer以及数据集对象的支持&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> org.jfree.chart.axis.XXXAxis：用于处理图表的两个轴：纵轴和横轴&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> org.jfree.chart.render.XXXRender：负责如何显示一个图表对象&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> org.jfree.chart.urls.XXXURLGenerator:用于生成Web图表中每个项目的鼠标点击链接&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> XXXXXToolTipGenerator:用于生成图象的帮助提示，不同类型图表对应不同类型的工具提示类&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 对于常用的饼图阖柱状图，比较简单而且网上有很多的文章介绍，在这里就不再一一复述了，&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 主要说明下另一种常见的报表，时序图，首先声明一个曲线数据集合对象和曲线对象&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> TimePeriodValuesCollection timeseriescollection = new TimePeriodValuesCollection();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //声明具体是曲线对象，(可根据实际情况在同一张图中显示多条曲线进行数据比对，根据实际应用情况当超过4条曲线时，就会有些乱。)&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> TimePeriodValues timeperiod1 = new TimePeriodValues("服务器A在线用户数量");&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> TimePeriodValues timeperiod2 = new TimePeriodValues("服务器B在线用户数量");&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 我在使用TimeSeriesCollection tsc = new TimeSeriesCollection();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> TimeSeries ts = new TimeSeries();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 在生成数据集时（ts.add(new Day(day, month, year),10))）只能生成最小单位为天的横轴所以改用了TimePeriodValuesCollection&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //根据当前时间取得横轴坐标，时间间隔为1小时&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> Calendar cal = Calendar.getInstance();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> int year = cal.get(Calendar.YEAR);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> int month = cal.get(Calendar.MONTH) + 1;&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> int day = cal.get(Calendar.DAY_OF_MONTH);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //这里改为根据自己程序得到的需要显示的时间点和对应的数据的集合;&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> List objectList1 = dao.getList1();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> List objectList2 = dao.getList2();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //使用循环，把x轴，y轴的值赋给timeseries1&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> for (int i =0;i&lt;objecthash1.size();i++) {&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> &amp;nbsp;&amp;nbsp; &amp;nbsp; int hour = objecthash1[i].getHours();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> &amp;nbsp;&amp;nbsp; &amp;nbsp; int count = objecthash1[i].getCount();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //将每一对数据（时间，数值）添加到数据集合1(曲线对象1)中&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> &amp;nbsp;&amp;nbsp; &amp;nbsp; timeseries1.add(new Hour(hour, day, month, year),count);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> }&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> for (int i =0;i&lt;objecthash2.size();i++) {&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> &amp;nbsp;&amp;nbsp; &amp;nbsp; int hour = objecthash2[i].getHours();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> &amp;nbsp;&amp;nbsp; &amp;nbsp; int count = objecthash2[i].getCount();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //将每一对数据（时间，数值）添加到数据集合2(曲线对象2)中&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> &amp;nbsp;&amp;nbsp; &amp;nbsp; timeseries2.add(new Hour(hour, day, month, year),count);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> }&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //将曲线对象添加到曲线数据集合对象中&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> timeseriescollection.addSeries(timeseries1);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> timeseriescollection.addSeries(timeseries2);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //绘制报表&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> String title = "日在线用户统计"; //报表标题&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> String domain = "时间"; &amp;nbsp; &amp;nbsp; //x轴&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> String range = "用户在线数量"; &amp;nbsp; &amp;nbsp;//y轴&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //创建时间序列图对象&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> JFreeChart chart = ChartFactory.createTimeSeriesChart(&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> title, &amp;nbsp; //报表标题&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> domain, //报表横轴标签&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> range, &amp;nbsp; //报表纵轴标签&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> timeseriescollection, //数据集合&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> true, &amp;nbsp; //是否显示图例,在这里如果为true则会在图表的下方显示各条数据曲线的名称和颜色&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> false, // 是否生成工具&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> false &amp;nbsp; &amp;nbsp;// 是否生成URL链接);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //将报表保存为jpg文件&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> ChartUtilities.saveChartAsJPEG(file, //文件保存物理路径包括路径和文件名&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 100, &amp;nbsp; &amp;nbsp;//图片质量&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> chart, //图表对象&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 1024, &amp;nbsp; //图像宽度&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 768, &amp;nbsp; &amp;nbsp;//图像高度&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> null); //显示信息&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //将报表直接在页面输出&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> ChartUtilities.writeChartAsJPEG(res.getOutputStream(),100,chart,1024,768,null);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> String title="月在线用户统计"; &amp;nbsp; //标题&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> String domain="时间(天)";//x轴&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> String range="用户在线数量";//y轴&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> TimePeriodValuesCollection &amp;nbsp; &amp;nbsp;timeseriescollection &amp;nbsp; &amp;nbsp;= &amp;nbsp; &amp;nbsp;new &amp;nbsp; &amp;nbsp;TimePeriodValuesCollection();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> TimePeriodValues timeseries = new TimePeriodValues( "用户数量");&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> timeseries.add(new Minute(0, 1, 1, 1, 2006), 100);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> timeseries.add(new Minute(10, 1, 1, 1, 2006), 500);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> timeseries.add(new Minute(20, 1, 1, 1, 2006), 300);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> timeseries.add(new Minute(30, 1, 1, 1, 2006), 800);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> JFreeChart chart =ChartFactory.createTimeSeriesChart(title,domain,range,timeseriescollection,true,false,false);&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 当我们生成了一个报表对象时，可能需要根据实际情况来决定报表的横轴和纵轴的数值间隔，显示方式等。&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 可以用XYPlot xyplot = (XYPlot)chart.getPlot();来得到所有数据点的集合。（其它形状图表得到的数据集对象根据实际情况造型）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 得到数据点集合后，我们就可以设置各条曲线的颜色，和坐标轴的距离，x轴、y轴的显示方式等等属性&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> xyplot.setBackgroundPaint(Color.lightGray); //设定图表数据显示部分背景色&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> xyplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D)); //设定坐标轴与图表数据显示部分距离&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> xyplot.setDomainGridlinePaint(Color.white); //网格线纵向颜色&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> xyplot.setRangeGridlinePaint(Color.white); //网格线横向颜色&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
## 数据点的调整
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer)xyplot.getRenderer();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> xylineandshaperenderer.setDefaultShapesVisible(true); &amp;nbsp; //数据点可见&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> xylineandshaperenderer.setSeriesFillPaint(0, Color.red); &amp;nbsp; //设置第一条曲线数据点填充为红色，如果一个图表有多条曲线可分别设置&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> xylineandshaperenderer.setUseFillPaint(true); &amp;nbsp; &amp;nbsp; //应用&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 使用xyplot.getRangeAxis()得到纵轴，xyplot.getDomainAxis()得到横轴，得到后可以根据实际情况造型为自己所需要的类型。&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 我的图表纵轴为数值类型，横轴为时间类型，使用如下方式&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> NumberAxis numAxis = (NumberAxis)xyplot.getRangeAxis();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> DateAxis &amp;nbsp; dateaxis = &amp;nbsp; &amp;nbsp;(DateAxis)xyplot.getDomainAxis();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //设置y显示方式&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> numAxis.setAutoTickUnitSelection(false);//数据轴的数据标签是否自动确定&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> double &amp;nbsp; rangetick = 0.1D;&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> numAxis.setTickUnit(new NumberTickUnit(rangetick)); &amp;nbsp; //y轴单位间隔为0.1&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> //设置x轴显示方式&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> dateaxis.setAutoTickUnitSelection(false);//数据轴的数据标签是否自动确定&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> dateaxis.setTickUnit(new DateTickUnit(DateTickUnit.DAY,1));//x轴单位间隔为1天&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 我们还可以是将数据格式化以后显示，比如y轴显示百分比（10%～100%）,x轴显示为&amp;times;月&amp;times;日&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> NumberFormat nf =NumberFormat.getPercentInstance();&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> numAxis.setNumberFormatOverride(nf);//设置y轴以百分比方式显示&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> SimpleDateFormat format = new SimpleDateFormat("MM月dd");&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> dateaxis.setDateFormatOverride(format);//设置x轴数据单位以&amp;times;月&amp;times;日方式显示&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 时序图中还有一个很重要的方法&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> timeseriescollection.setDomainIsPointsInTime(true); //x轴上的刻度点代表的是时间点而不是时间段&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 最开始我没有设置这个属性,结果画出来的图，老是差半格不能在这个刻度的时候准确显示，往后移了半格，就是因为JFreeChart默认这个刻度是&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 一个时间段，它把这个刻度和下个刻度的中间点认为是显示数据点最佳位置。&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> 其他一些关于AXIS类的方法：&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
## Axis类：
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setVisible(boolean flag)坐标轴是否可见&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setAxisLinePaint(Paint paint)坐标轴线条颜色（3D轴无效）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setAxisLineStroke(Stroke stroke)坐标轴线条笔触（3D轴无效）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setAxisLineVisible(boolean visible)坐标轴线条是否可见（3D轴无效）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setFixedDimension(double dimension)（用于复合表中对多坐标轴的设置）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setLabel(String label)坐标轴标题&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setLabelFont(Font font)坐标轴标题字体&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setLabelPaint(Paint paint)坐标轴标题颜色&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setLabelAngle(double angle)`坐标轴标题旋转角度（纵坐标可以旋转）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setTickLabelFont(Font font)坐标轴标尺值字体&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setTickLabelPaint(Paint paint)坐标轴标尺值颜色&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setTickLabelsVisible(boolean flag)坐标轴标尺值是否显示&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setTickMarkPaint(Paint paint)坐标轴标尺颜色&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setTickMarkStroke(Stroke stroke)坐标轴标尺笔触&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setTickMarksVisible(boolean flag)坐标轴标尺是否显示&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> ValueAxis(Axis)类：&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setAutoRange(boolean auto)自动设置数据轴数据范围&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setAutoRangeMinimumSize(double size)自动设置数据轴数据范围时数据范围的最小跨度&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setAutoTickUnitSelection(boolean flag)数据轴的数据标签是否自动确定（默认为true）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setFixedAutoRange(double length)数据轴固定数据范围（设置100的话就是显示MAXVALUE到MAXVALUE-100那段数据范围）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setInverted(boolean flag)数据轴是否反向（默认为false）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setLowerMargin(double margin)数据轴下（左）边距&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setUpperMargin(double margin)数据轴上（右）边距&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setLowerBound(double min)数据轴上的显示最小值&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setUpperBound(double max)数据轴上的显示最大值&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setPositiveArrowVisible(boolean visible)是否显示正向箭头（3D轴无效）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setNegativeArrowVisible(boolean visible)是否显示反向箭头（3D轴无效）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setVerticalTickLabels(boolean flag)数据轴数据标签是否旋转到垂直&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setStandardTickUnits(TickUnitSource source)数据轴的数据标签（可以只显示整数标签，需要将AutoTickUnitSelection设false）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> NumberAxis(ValueAxis)类：&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setAutoRangeIncludesZero(boolean flag)是否强制在自动选择的数据范围中包含0&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setAutoRangeStickyZero(boolean flag)是否强制在整个数据轴中包含0，即使0不在数据范围中&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setNumberFormatOverride(NumberFormat formatter)数据轴数据标签的显示格式&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setTickUnit(NumberTickUnit unit)数据轴的数据标签（需要将AutoTickUnitSelection设false）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> DateAxis(ValueAxis)类：&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setMaximumDate(Date maximumDate)日期轴上的最小日期&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setMinimumDate(Date minimumDate)日期轴上的最大日期&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setRange(Date lower,Date upper)日期轴范围&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setDateFormatOverride(DateFormat formatter)日期轴日期标签的显示格式&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setTickUnit(DateTickUnit unit)日期轴的日期标签（需要将AutoTickUnitSelection设false）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setTickMarkPosition(DateTickMarkPosition position)日期标签位置（参数常量在org.jfree.chart.axis.DateTickMarkPosition类中定义）&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> CategoryAxis(Axis)类：&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setCategoryMargin(double margin)分类轴边距&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setLowerMargin(double margin)分类轴下（左）边距&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setUpperMargin(double margin)分类轴上（右）边距&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setVerticalCategoryLabels(boolean flag)分类轴标题是否旋转到垂直&lt;/div>
&lt;div> &amp;nbsp;&lt;/div>
&lt;div> void setMaxCategoryLabelWidthRatio(float ratio)分类轴分类标签的最大宽度&lt;/div></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/jfreechart/">Jfreechart</category><category domain="https://fatkun.github.io/tags/xy%E8%BD%B4/">XY轴</category></item><item><title>JFreeChart使用方法(代码备忘)</title><link>https://fatkun.github.io/2010/12/jfreechart.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/jfreechart.html</guid><pubDate>Fri, 31 Dec 2010 05:50:31 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>以下文章介绍JFreeChart的使用方法。&lt;br>
文章来源：http://hi.baidu.com/baileyfu/blog/item/8e75b212b47fea54f819b808.html&lt;/p>
&lt;p>一：jfreechart介绍&lt;br>
jfreechart是一个免费创建图片的java工具.可以创建如下图形：&lt;br>
饼图(pie charts;)&lt;br>
曲线图(line charts )&lt;br>
柱状图(horizontal/vertical bar charts)&lt;br>
甘特图(Gantt charts; )&lt;br>
XY plots and scatter plots;&lt;br>
time series, high/low/open/close charts and candle stick charts;&lt;br>
combination charts;&lt;br>
Pareto charts;&lt;br>
bubble charts;&lt;br>
wind plots, meter charts and symbol charts;&lt;br>
从以下地址可以看到jfreechart可以创建的图形类型&lt;br>
&lt;a href="http://www.jfree.org/jfreechart/samples.html">http://www.jfree.org/jfreechart/samples.html&lt;/a>&lt;br>
sourceforge有一个基于jfreechart的项目Cewolf可以很方便的在jsp/servlet中创建图片&lt;br>
jfreechart目前(2003-05-08)版本为0.98&lt;br>
希望得到详细的信息或下载jfreechart请访问如下站点:&lt;br>
&lt;a href="http://www.jfree.org/jfreechart/">http://www.jfree.org/jfreechart/&lt;/a>
二：特别说明:&lt;br>
jfreechart是一个开源项目，但是文档是需要40美金去购买的。&lt;br>
还有一个很重要的问题,jfreechart如果使用中文，他使用的默认字体&lt;br>
显示出来的中文会很模糊，你可能需要修改源代码。&lt;br>
下面我就举几个简单的例子说明一下如何使用jfreechart创建图片&lt;br>
在开发中有可能会导入以下的类&lt;br>
import com.jrefinery.chart.ChartFactory;&lt;br>
import com.jrefinery.chart.ChartUtilities;&lt;br>
import com.jrefinery.chart.JFreeChart;&lt;br>
import com.jrefinery.chart.TextTitle;&lt;br>
import com.jrefinery.chart.axis.NumberAxis;&lt;br>
import com.jrefinery.chart.plot.CategoryPlot;&lt;br>
import com.jrefinery.chart.plot.PiePlot;&lt;br>
import com.jrefinery.data.Day;&lt;br>
import com.jrefinery.data.DefaultCategoryDataset;&lt;br>
import com.jrefinery.data.DefaultPieDataset;&lt;br>
import com.jrefinery.data.TimeSeries;&lt;br>
import com.jrefinery.data.TimeSeriesCollection;&lt;br>
import com.jrefinery.data.TimeSeriesDataPair;&lt;br>
在0.98以后包由com.jrefinery.*改变为:org.jfree
三：创建饼图&lt;/p>
&lt;pre escaped="true" lang="java">//图片标题
String title = "空调2002年市场占有率";
//设定数据源
DefaultPieDataset piedata = new DefaultPieDataset();
//第一个参数为名称，第二个参数是double数
piedata.setValue("联想", 27.3);
piedata.setValue("长城", 12.2);
piedata.setValue("海尔", 5.5);
piedata.setValue("美的", 17.1);
piedata.setValue("松下", 9.0);
piedata.setValue("科龙", 19.0);
//创建JFreeChart，都使用ChartFactory来创建JFreeChart,很标准的工厂设计模式
JFreeChart chart =
ChartFactory.createPieChart(title, piedata, true, true, true);
//设定图片标题
chart.setTitle(new TextTitle(title, new Font("隶书", Font.ITALIC, 15)));
//chart.addSubtitle(new TextTitle("2002财年分析", new Font("隶书", Font.ITALIC, 12)));
//设定背景
chart.setBackgroundPaint(Color.white);
//chart.s
//饼图使用一个PiePlot
PiePlot pie = (PiePlot)chart.getPlot();
//pie.setSectionLabelType(PiePlot.NAME_AND_PERCENT_LABELS);
pie.setSectionLabelType(PiePlot.NAME_AND_VALUE_LABELS);
//设定显示格式(名称加百分比或数值)
pie.setPercentFormatString("#,###0.0#%");
//设定百分比显示格式
pie.setBackgroundPaint(Color.white);
pie.setSectionLabelFont(new Font("黑体", Font.TRUETYPE_FONT, 12));
//设定背景透明度（0-1.0之间）
pie.setBackgroundAlpha(0.6f);
//设定前景透明度（0-1.0之间）
pie.setForegroundAlpha(0.90f);
//输出文件到指定目录
String rfname = MathUtil.getRoundCode(12) + ".jpeg";
String fileName = "d:/test/" + rfname;
try {
//可以保存文件为jpg或png格式。
ChartUtilities.saveChartAsJPEG(new File(fileName), 100, chart, 600, 600);
//第一个参数为文件名
//第二个参数质量
//第三个参数为哪个chart创建图片
//第四个宽度
//第五个高度
} catch (IOException exz) {
System.out.print("....Cant't Create image File");
}
&lt;/pre>
&lt;p>其实使用JFreeChart创建图片很简单，不同的的图片类型区别在于设置数据集
四：创建曲线图&lt;/p>
&lt;pre escaped="true" lang="java">// create a default chart based on some sample data...
//曲线图标题
String title = "趋势分析";
//曲线图X轴提示
String domain = "月份走势";
//曲线图Y轴提示
String range = "应收余额";
//曲线图自标题
String subtitleStr = "2003财年分析";
//创建时间数据源
//每一个TimeSeries在图上是一条曲线
TimeSeries ca = new TimeSeries("用友");
for (int i = 1999; i &amp;lt; 2005; i++) {
for (int mon = 0; mon &amp;lt; 12; mon++) {
//ca.add(new Month(mon + 1, i), new Double(500 + Math.random() * 100));
//TimeSeriesDataPair是一个时间点的数值体现
ca.add(
new TimeSeriesDataPair(
new Day(1, mon + 1, i),
new Double(500 + Math.random() * 100)));
}
}
TimeSeries ibm = new TimeSeries("金碟");
for (int i = 1999; i &amp;lt; 2005; i++) {
for (int mon = 0; mon &amp;lt; 12; mon++) {
//ibm.add(new Month(mon+1,i),new Double(400-Math.random()*100));
ibm.add(
new TimeSeriesDataPair(
new Day(1, mon + 1, i),
new Double(400 - Math.random() * 100)));
}
}
TimeSeries king = new TimeSeries("东软");
for (int i = 1999; i &amp;lt; 2005; i++) {
for (int mon = 0; mon &amp;lt; 12; mon++) {
//ibm.add(new Month(mon+1,i),new Double(400-Math.random()*100));
king.add(
new TimeSeriesDataPair(
new Day(1, mon + 1, i),
new Double(300 - Math.random() * 100)));
}
}
//时间曲线数据集合
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(ca);
dataset.addSeries(ibm);
dataset.addSeries(king);
//dataset.addSeries(jpy);
//dataset.addSeries(mav);
//时间曲线元素
JFreeChart chart =
ChartFactory.createTimeSeriesChart(
title,
domain,
range,
dataset,
true,
true,
false);
// then customise it a little...
TextTitle subtitle =
new TextTitle(subtitleStr, new Font("黑体", Font.BOLD, 12));
chart.addSubtitle(subtitle);
chart.setTitle(new TextTitle(title, new Font("隶书", Font.ITALIC, 15)));
//pie.setSeriesLabelFont(new Font("黑体", Font.BOLD, 15));
chart.setBackgroundPaint(
new GradientPaint(0, 0, Color.white, 0, 1000, Color.blue));
//sysout
//输出文件到指定目录
String rfname = MathUtil.getRoundCode(22) + ".jpeg";
String fileName = "d:/test/" + rfname;
try {
//for
//System.out.println();
ChartUtilities.saveChartAsJPEG(new File(fileName), 100, chart, 600, 600);
// log.info("....Create image File:" + fileName);
} catch (IOException exz) {
System.out.print("....Cant't Create image File");
}&lt;/pre>
&lt;p>五：创建柱状图&lt;/p>
&lt;pre escaped="true" lang="java">String title = "柱状图测试";
String domain = "单位比较";
String range = "数值";
//CategoryDataset data = DemoDatasetFactory.createCategoryDataset();
DefaultCategoryDataset data = new DefaultCategoryDataset();
for (int r = 0; r &amp;lt; 5; r++) {
String rowKey = "单位 [" + (r + 1)+"]" ;
//第一层循环：分析对象
for (int c = 0; c &amp;lt; 6; c++) {
//第二层循环：分析对象在时间点上的数据
String columnKey = "2001年" + (c + 1) + "月";
data.addValue(new Double(r * c + 5), rowKey, columnKey);
}
}
JFreeChart chart =
ChartFactory.createVerticalBarChart(
title,
domain,
range,
data,
true,
true,
false);
// then customise it a little...
chart.setBackgroundPaint(
new GradientPaint(0, 0, Color.white, 1000, 0, Color.red));
chart.setTitle(new TextTitle(title, new Font("隶书", Font.ITALIC, 15)));
CategoryPlot plot = (CategoryPlot)chart.getPlot();
plot.setForegroundAlpha(0.9f);
plot.setValueLabelFont(new Font("黑体", Font.TRUETYPE_FONT, 12));
//plot.setSectionLabelFont(new Font("黑体", Font.TRUETYPE_FONT, 12));
//注意以下代码
NumberAxis verticalAxis = (NumberAxis)plot.getRangeAxis();
verticalAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
// 输出文件到指定目录
String rfname = MathUtil.getRoundCode(22) + "b.jpeg";
String fileName = "d:/test/" + rfname;
try {
ChartUtilities.saveChartAsJPEG(new File(fileName), 100, chart, 600, 600);
// log.info("....Create image File:" + fileName);
} catch (IOException exz) {
System.out.print("....Cant't Create image File");
}
&lt;/pre>
&lt;p>六：结束语&lt;br>
个人感觉JFreeChart可以满足大部分图片创建的需要，美中不足的是：对字体的设置做的&lt;br>
不 够好，特别是使用中文的时候字体很不清晰。因为这个原因建议你自己去修改他的源代码,最好使用properties文件去设置字体.还有就是文档要钱所以 要多花点时间去看源代码。或多上社区.因为时间等原因我只介绍了三种图片的创建，其他类型的图片可以参考jfreechart提供的例子。&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/jfreechart/">Jfreechart</category></item><item><title>盛大EverBox网盘邀请码（还有5个名额）</title><link>https://fatkun.github.io/2010/12/everbox-invite.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/everbox-invite.html</guid><pubDate>Thu, 30 Dec 2010 06:34:53 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>EverBox邀请码，盛大网盘邀请码&lt;/p>
&lt;h3 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; color: rgb(51, 51, 51); "> 网址:&lt;a href="http://www.everbox.com/">http://www.everbox.com&lt;/a>&lt;/h3>
这是盛大推出的网盘，刚开始有2G空间，完成一些简单的任务**至少可以有5G空间**！（在圣诞期间激活有2G送），类似于dropbox。
如果需要邀请码，请在下面的评论上邮箱的输入位置**留下你的邮箱**并且明确你需要它：）
update 2011-02-10:直接把邀请码贴出来好了。。有些人发了却没去激活o(╯□╰)o
http://account.everbox.com/invite/N5R42ch4S7Md63rpVHZT30kYVyU1xzkiofF00UWf
http://account.everbox.com/invite/cKNG46fmRQsSioFYTV6f5cSaLoe653Un2S2KDVGu
http://account.everbox.com/invite/aHg9dvFo5kpscYcOFe0SNtouvLJ2CLOkH1e454jH
http://account.everbox.com/invite/HtnFEjDOsgzemfhurMVkndxX0w6GoFoEUvEDJpR7
http://account.everbox.com/invite/RoFlin0P6OaJh7LV6nOjWgzKwrqhLxvLj1USsG0s
http://account.everbox.com/invite/RtMtzntLxAbdFsM39DoACPU8ewMInkm76qwUFfbX
&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8211;
以下是官方介绍内容
&lt;h3 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; color: rgb(51, 51, 51); "> EverBox 功能特性&lt;/h3>
&lt;ol style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; "> &lt;p class="q" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: rgb(51, 51, 51); "> 10GB 超大免费空间 &lt;/p>
&lt;div class="a" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 24px; "> &lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; "> 成功注册 EverBox 即可获得 2GB 免费空间，完成指定任务可升级空间到 10GB！EverBox 在随后的版本中将会有更多的奖励措施，赠送活跃用户更多空间，敬请期待！ &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; text-align: center; "> &lt;img src="http://www.everbox.com/images/features/feature_pic_1.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /> &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>&lt;/p> &lt;/div> &lt;/li>
&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; "> &lt;p class="q" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: rgb(51, 51, 51); "> 支持数据同步客户端 &lt;/p>
&lt;div class="a" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 24px; "> &lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; "> 您是不是经常遇到以下的情况？&amp;ldquo;我喜欢在外出时用 iPhone 听歌，但是我需要从 PC 下载歌曲再用数据线将 MP3 导到 iPhone&amp;rdquo;；&amp;ldquo;我经常出差，但是程序和文件都在笨重的 PC 上，而我只带着笔记本&amp;rdquo;；&amp;ldquo;我到 XX 会议做演讲，但是保存 PPT 的 U 盘坏掉了&amp;rdquo;。 &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; "> 现在有了 EverBox，这些问题将迎刃而解！只需安装 EverBox，您所需的文件都将自动同步到设备上，您就可以随时、随地的使用手边的任意一款设备访问文件了。当然，使用浏览器一样可以访问到您需要的文件。 &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; text-align: center; "> &lt;img src="http://www.everbox.com/images/features/feature_pic_2.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /> &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>&lt;/p> &lt;/div> &lt;/li>
&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; "> &lt;p class="q" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: rgb(51, 51, 51); "> 容灾备份服务 &lt;/p>
&lt;div class="a" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 24px; "> &lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; "> 硬盘损坏？数据无法访问？笔记本电脑被盗？完了，重要的数据丢失了！ &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; "> 不用担心，有了 EverBox，这一切都不会再是问题。EverBox 会自动的、实时的备份文件数据到 EverBox 安全服务器，因此，当您本地的设备坏损或丢失时，不必担心由于数据丢失造成的损失，恢复数据易如反掌！ &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; text-align: center; "> &lt;img src="http://www.everbox.com/images/features/feature_pic_3.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /> &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>&lt;/p> &lt;/div> &lt;/li>
&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; "> &lt;p class="q" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: rgb(51, 51, 51); "> 在线音乐播放 &lt;/p>
&lt;div class="a" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 24px; "> &lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; "> EverBox 支持在线音乐播放功能，几乎支持所有常用的音频格式，使用简单、便捷，无需操作即可连续播放 EverBox 当前目录中的歌曲，很适于一边使用电脑一边听歌时使用。 &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; text-align: center; "> &lt;img src="http://www.everbox.com/images/features/feature_pic_4.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /> &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>&lt;/p> &lt;/div> &lt;/li>
&lt;li style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 15px; padding-left: 0px; "> &lt;p class="q" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: rgb(51, 51, 51); "> 在线浏览图片 &lt;/p>
&lt;div class="a" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 24px; "> &lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; "> EverBox 支持在线浏览图片功能，几乎支持所有常用的图片格式，操作简单、便捷，并支持自动播放 EverBox 当前目录中的图片文件。 &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; text-align: center; "> &lt;img src="http://www.everbox.com/images/features/feature_pic_5.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " /> &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>&lt;/p> &lt;/div> &lt;/li>&lt;/ol>
&amp;nbsp;</description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/everbox%E9%82%80%E8%AF%B7%E7%A0%81/">EverBox邀请码</category><category domain="https://fatkun.github.io/tags/%E7%9B%9B%E5%A4%A7%E7%BD%91%E7%9B%98%E9%82%80%E8%AF%B7%E7%A0%81/">盛大网盘邀请码</category><category domain="https://fatkun.github.io/tags/%E7%BD%91%E7%9B%98%E9%82%80%E8%AF%B7%E7%A0%81/">网盘邀请码</category></item><item><title>数据库并发问题</title><link>https://fatkun.github.io/2010/12/database-transaction-concurrency-problem.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/database-transaction-concurrency-problem.html</guid><pubDate>Sun, 26 Dec 2010 06:40:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>以下内容为在数据库并发中出现的各种问题。&lt;/p>
&lt;h2 id="脏读dirty-readnbsp">脏读（dirty read） &lt;/h2>
&lt;p>A事务读到B事务刚修改的值，但是B事务撤销了，也A事务读到的值就是假的了。&lt;/p>
&lt;table border="1" cellpadding="0" cellspacing="0" style="font-size: 12px; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; clear: both; "> &lt;tr style="font-size: 12px; "> &lt;th style="font-size: 12px; " width="79"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 时间 &lt;/div> &lt;/th>
&lt;th style="font-size: 12px; " width="204"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 转账事务A &lt;/div> &lt;/th>
&lt;th style="font-size: 12px; " width="285"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 取款事务B &lt;/div> &lt;/th> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T1 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 开始事务 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T2 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 开始事务 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T3 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 查询账户余额为1000元&lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T4 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 取出500元把余额改为500元 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T5 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>查询账户余额为500&lt;/strong>&lt;strong>元（脏读）&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T6 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 撤销事务余额恢复为1000元 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T7 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 汇入100元把余额改为600元 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T8 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 提交事务 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>&lt;/table>
## 不可重复读（unrepeatable read）&amp;nbsp;
&lt;p>   不可重复读是指A事务读取了B事务已经提交的更改数据。假设A在取款事务的过程中，B往该账户转账100元，A两次读取账户的余额发生不一致：&lt;/p>
&lt;table border="1" cellpadding="0" cellspacing="0" style="font-size: 12px; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; clear: both; "> &lt;tr style="font-size: 12px; "> &lt;th style="font-size: 12px; " width="79"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 时间 &lt;/div> &lt;/th>
&lt;th style="font-size: 12px; " width="204"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 取款事务A &lt;/div> &lt;/th>
&lt;th style="font-size: 12px; " width="285"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 转账事务B &lt;/div> &lt;/th> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T1 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>开始事务&lt;/strong> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T2 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>开始事务&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T3 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 查询账户余额为1000元&lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T4 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 查询账户余额为1000元 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T5 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 取出100元把余额改为900元 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T6 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>提交事务&lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span>&lt;/strong> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T7 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>查询账户余额为900&lt;/strong>&lt;strong>元（和T4&lt;/strong>&lt;strong>读取的不一致）&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>&lt;/table>
## 幻象读（phantom read）&amp;nbsp;
&lt;p>&lt;strong>幻象读与不可重复读的区分是，前者是新增时出现，后者是更改或删除出现。&lt;/strong>
    A事务读取B事务提交的新增数据，这时A事务将出现幻象读的问题。幻象读一般发生在计算统计数据的事务中，举一个例子，假设银行系统在同一个事务中，两次统计存款账户的总金额，在两次统计过程中，刚好新增了一个存款账户，并存入100元，这时，两次统计的总金额将不一致：  &lt;/p>
&lt;table border="1" cellpadding="0" cellspacing="0" style="font-size: 12px; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; clear: both; "> &lt;tr style="font-size: 12px; "> &lt;th style="font-size: 12px; " width="79"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 时间 &lt;/div> &lt;/th>
&lt;th style="font-size: 12px; " width="204"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 统计金额事务A &lt;/div> &lt;/th>
&lt;th style="font-size: 12px; " width="285"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 转账事务B &lt;/div> &lt;/th> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T1 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>开始事务&lt;/strong> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T2 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>开始事务&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T3 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 统计总存款数为10000元 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T4 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 新增一个存款账户，存款为100元 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T5 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>提交事务&lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span>&lt;/strong> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T6 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>再次统计总存款数为10100&lt;/strong>&lt;strong>元（幻象读）&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>&lt;/table>
&amp;nbsp;&amp;nbsp;&amp;nbsp; 如果新增数据刚好满足事务的查询条件，这个新数据就进入了事务的视野，因而产生了两个统计不一致的情况。&amp;nbsp;
**幻象读和不可重复读是两个容易混淆的概念**，前者是指读到了其它已经提交事务的新增数据，而后者是指读到了已经提交事务的更改数据（更改或删除），为了避免这两种情况，采取的对策是不同的，防止读取到更改数据，只需要对操作的数据添加行级锁，阻止操作中的数据发生变化，而防止读取到新增数据，则往往需要添加表级锁&amp;mdash;&amp;mdash;将整个表锁定，防止新增数据（Oracle使用多版本数据的方式实现）。&amp;nbsp;
## 第一类丢失更新&amp;nbsp;
&lt;p>    A事务撤销时，把已经提交的B事务的更新数据覆盖了。这种错误可能造成很严重的问题，通过下面的账户取款转账就可以看出来： &lt;/p>
&lt;table border="1" cellpadding="0" cellspacing="0" style="font-size: 12px; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; clear: both; "> &lt;tr style="font-size: 12px; "> &lt;th style="font-size: 12px; " width="79"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 时间 &lt;/div> &lt;/th>
&lt;th style="font-size: 12px; " width="204"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 取款事务A &lt;/div> &lt;/th>
&lt;th style="font-size: 12px; " width="285"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 转账事务B &lt;/div> &lt;/th> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T1 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>开始事务&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>&amp;nbsp;&lt;/strong> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T2 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>开始事务&lt;/strong> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T3 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 查询账户余额为1000元&lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T4 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 查询账户余额为1000元 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T5 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 汇入100元把余额改为1100元 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T6 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>提交事务&lt;/strong> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T7 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 取出100元把余额改为900元 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T8 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>撤销事务&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T9 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>余额恢复为1000&lt;/strong>&lt;strong>元（丢失更新）&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>&lt;/table>
A事务在撤销时，&amp;ldquo;不小心&amp;rdquo;将B事务已经转入账户的金额给抹去了。&amp;nbsp;
## &amp;nbsp;第二类丢失更新&amp;nbsp;
&lt;p>A事务覆盖B事务已经提交的数据，造成B事务所做操作丢失：  &lt;/p>
&lt;table border="1" cellpadding="0" cellspacing="0" style="font-size: 12px; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; clear: both; "> &lt;tr style="font-size: 12px; "> &lt;th style="font-size: 12px; " width="79"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 时间 &lt;/div> &lt;/th>
&lt;th style="font-size: 12px; " width="204"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 转账事务A &lt;/div> &lt;/th>
&lt;th style="font-size: 12px; " width="285"> &lt;div align="center" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 取款事务B &lt;/div> &lt;/th> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T1 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>&amp;nbsp;&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>开始事务&lt;/strong> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T2 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>开始事务&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T3 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 查询账户余额为1000元&lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T4 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 查询账户余额为1000元 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T5 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 取出100元把余额改为900元 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T6 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>提交事务&lt;span>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span>&lt;/strong> &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T7 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> 汇入100元 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T8 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>提交事务&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>
&lt;tr style="font-size: 12px; "> &lt;td style="font-size: 12px; " valign="top" width="79"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> T9 &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="204"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &lt;strong>把余额改为1100&lt;/strong>&lt;strong>元（丢失更新）&lt;/strong> &lt;/div> &lt;/td>
&lt;td style="font-size: 12px; " valign="top" width="285"> &lt;div style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; color: rgb(51, 51, 51); text-align: left; font-size: 14px; line-height: 21px; "> &amp;nbsp; &lt;/div> &lt;/td> &lt;/tr>&lt;/table>
&amp;nbsp;&amp;nbsp;&amp;nbsp; 上面的例子里由于支票转账事务覆盖了取款事务对存款余额所做的更新，导致银行最后损失了100元，相反如果转账事务先提交，那么用户账户将损失100元。
**第一类丢失更新和第二类丢失更新的差别**：前者是由于撤销事务导致丢失更新，后者是因为更新被覆盖。
内容参考来源：&lt;http://tech.it168.com/db/t/2007-05-30/200705300938078_1.shtml></description><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category></item><item><title>hibernate事务管理</title><link>https://fatkun.github.io/2010/12/hibernate-transaction.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/hibernate-transaction.html</guid><pubDate>Sat, 25 Dec 2010 10:16:03 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="1介绍数据库事务事务隔离级别悲观锁乐观锁等概念">1. 介绍数据库事务、事务隔离级别、悲观锁、乐观锁等概念。&lt;/h2>
&lt;h2 id="2数据库acid特征">2.数据库ACID特征：&lt;/h2>
&lt;blockquote>
&lt;p>Atomic（原子性）：指整个数据库事务是不可分割的工作单元。
Consistency（一致性）：指数据库事务不能破坏关系数据的完整性以及业务逻辑上的一致性。
Isolation（隔离性）：指的是在并发环境中，当不同的事务同时操纵相同的数据时，每个事务都有各自的完整数据空间。
Durability（持久性）：指的是只要事务成功结束，它对数据库所作的更新就必须永久保存下来。&lt;/p>
&lt;/blockquote>
&lt;h2 id="3数据库系统支持两种事务模式">3.数据库系统支持两种事务模式：&lt;/h2>
&lt;p style="padding-left: 30px;"> 自动提交模式：每个SQL语句都是一个独立的事务，当数据库系统执行完一个SQL语句后，会自动提交事务。&lt;/p>
&lt;p style="padding-left: 30px;"> 手动提交模式：必须由数据库客户程序显示指定事务开始边界和结束边界。&lt;/p>
## 4.MySQL中数据库表分为3种类型：
&lt;p style="padding-left: 30px;"> INNODB、BDB和MyISAM，其中MyISAM不支持数据库事务。MySQL中create table 语句默认为MyISAM类型。&lt;/p>
## 5.并发问题
&lt;p>对于同时运行的多个事务，当这些事务访问数据库中相同的数据时，如果没有采取必要的隔离机制，就会导致各种并发问题，这些并发问题可归纳为以下几类：&lt;/p>
&lt;blockquote>
&lt;p>A.第一类丢失更新：撤销一个事务时，把其他事务已提交的更新数据覆盖。
B.脏读：一个事务读到另一个事务为提交的更新数据。
C.幻读：一个事务读到另一个事务已提交的新插入的数据。
D.不可重复读：一个事务读到另一个事务已提交的更新数据。
E.第二类丢失更新：这是不可重复读中的特例，一个事务覆盖另一个事务已提交的更新数据。&lt;/p>
&lt;/blockquote>
&lt;h2 id="6数据库系统四种事务隔离级别">6.数据库系统四种事务隔离级别&lt;/h2>
&lt;p style="padding-left: 30px;"> A.Serializable（串行化）：一个事务在执行过程中完全看不到其他事务对数据库所做的更新。&lt;/p>
&lt;p style="padding-left: 30px;"> B.Repeatable Read（可重复读）：一个事务在执行过程中可以看到其他事务已经提交的新插入的记录，但是不能看到其他其他事务对已有记录的更新。&lt;/p>
&lt;p style="padding-left: 30px;"> C.Read Commited（读已提交数据）：一个事务在执行过程中可以看到其他事务已经提交的新插入的记录，而且能看到其他事务已经提交的对已有记录的更新。&lt;/p>
&lt;p style="padding-left: 30px;"> D.Read Uncommitted（读未提交数据）：一个事务在执行过程中可以拷打其他事务没有提交的新插入的记录，而且能看到其他事务没有提交的对已有记录的更新。&lt;/p>
&lt;table border="1" cellspacing="0" cellpadding="0" width="576"> &lt;tr> &lt;td width="164"> &lt;div> 隔离级别 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 脏读 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不可 &lt;/div>
&lt;div> 重复读 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 幻象读 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 第一类丢失更新 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 第二类丢失更新 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="164" valign="top"> &lt;div> READ UNCOMMITED &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 允许 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="164" valign="top"> &lt;div> READ COMMITTED &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 允许 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="164" valign="top"> &lt;div> REPEATABLE READ &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="164" valign="top"> &lt;div> SERIALIZABLE &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td>
&lt;td width="82"> &lt;div> 不允许 &lt;/div> &lt;/td> &lt;/tr>&lt;/table>
&lt;p style="padding-left: 30px;"> 隔离级别越高，越能保证数据的完整性和一致性，但是对并发性能的影响也越大。对于多数应用程序，可以有优先考虑把数据库系统的隔离级别设为Read Commited，它能够避免脏读，而且具有较好的并发性能。尽管它会导致不可重复读、幻读和第二类丢失更新这些并发问题，在可能出现这类问题的个别场合，可以由应用程序采用悲观锁或乐观锁来控制。&lt;/p>
## 7.当数据库系统采用read Commited隔离级别时
&lt;p>会导致不可重复读喝第二类丢失更新的并发问题，可以在应用程序中采用悲观锁或乐观锁来避免这类问题。从应用程序的角度，锁可以分为以下几类：&lt;/p>
&lt;p style="padding-left: 30px;"> A.悲观锁：指在应用程序中显示的为数据资源加锁。尽管能防止丢失更新和不可重复读这类并发问题，但是它会影响并发性能，因此应该谨慎地使用。&lt;/p>
&lt;p style="padding-left: 30px;"> B.乐观锁：乐观锁假定当前事务操作数据资源时，不回有其他事务同时访问该数据资源，因此完全依靠数据库的隔离级别来自动管理锁的工作。应用程序采用版本控制手段来避免可能出现的并发问题。&lt;/p>
## 8.悲观锁有两种实现方式：
&lt;p style="padding-left: 30px;"> A.在应用程序中显示指定采用数据库系统的独占所来锁定数据资源。SQL语句：select &amp;#8230; for update，在Hibernate中使用get，load时如session.get(Account.class,new Long(1),LockMode,UPGRADE)&lt;/p>
&lt;p style="padding-left: 30px;"> B.在数据库表中增加一个表明记录状态的LOCK字段，当它取值为“Y”时，表示该记录已经被某个事务锁定，如果为“N”，表明该记录处于空闲状态，事务可以访问它。增加锁标记字段就可以实现。&lt;/p>
## 9.利用Hibernate的版本控制来实现乐观锁
&lt;p style="padding-left: 30px;"> 乐观锁是由程序提供的一种机制，这种机制既能保证多个事务并发访问数据，又能防止第二类丢失更新问题。&lt;/p>
&lt;p style="padding-left: 30px;"> 在应用程序中可以利用Hibernate提供的版本控制功能来视线乐观锁，OR映射文件中的&lt;version>元素和&lt;timestamp>都具有版本控制的功能，一般推荐采用&lt;version>&lt;/p>
本文来源：&lt;http://blog.csdn.net/yueguangyuan/archive/2006/09/20/1253229.aspx></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category><category domain="https://fatkun.github.io/tags/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category><category domain="https://fatkun.github.io/tags/%E6%95%B0%E6%8D%AE%E5%BA%93%E4%BA%8B%E5%8A%A1/">数据库事务</category><category domain="https://fatkun.github.io/tags/%E9%9A%94%E7%A6%BB%E7%BA%A7%E5%88%AB/">隔离级别</category></item><item><title>List中的remove使用注意</title><link>https://fatkun.github.io/2010/12/list-remove.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/list-remove.html</guid><pubDate>Tue, 21 Dec 2010 05:09:50 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>先来看API是怎样写的。&lt;/p>
&lt;blockquote>
&lt;dl>
&lt;dt>boolean &lt;strong>remove&lt;/strong>(&lt;a title="java.lang 中的类">Object&lt;/a> o)&lt;/dt>
&lt;dd>从此列表中移除第一次出现的指定元素（如果存在）（可选操作）。如果列表不包含元素，则不更改列表。更确切地讲，移除满足 &lt;tt>(o==null ? get(i)==null : o.equals(get(i)))&lt;/tt> 的最低索引 &lt;tt>i&lt;/tt> 的元素（如果存在这样的元素）。如果此列表已包含指定元素（或者此列表由于调用而发生更改），则返回 &lt;tt>true&lt;/tt>。&lt;/dd>
&lt;/dl>
&lt;/blockquote>
&lt;p>可以看到是用o.equals来判断是否删除的，在一般情况下使用都没有问题。但我有一次犯了一个错误。
有一个List&amp;lt;子类&amp;gt; list，我用 list.remve(父类对象);这样很明显是不行的，equals不了，所以就删除不了。
解决方法：1，是remove同一类对象
2，在父类覆盖equals方法，用instanceof来判断是不是子类，然后判断相等。
方法2较为麻烦。还是建议方法1。&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java%E5%9F%BA%E7%A1%80/">Java基础</category><category domain="https://fatkun.github.io/tags/list/">List</category></item><item><title>Beautyleg Jellyfish高清无码丝袜美腿无水印大图下载</title><link>https://fatkun.github.io/2010/12/beautyleg-jellyfish.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/beautyleg-jellyfish.html</guid><pubDate>Mon, 20 Dec 2010 05:04:37 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>最近不怎么学习，为了证明自己还没死，还是发一篇博客。&lt;br>
Beautyleg Jellyfish，一位美腿模特，图片是高清无码的，没有水印的，部分可以拿来做壁纸，上传到115U盘&lt;br>
下载地址：&lt;a href="http://u.115.com/file/f9c1738591">http://u.115.com/file/f9c1738591&lt;/a>
&lt;a href="http://u.115.com/file/f9c1738591">&lt;/a>部分预览图：&lt;br>
&lt;img src="http://public.blu.livefilestore.com/y1pnsyD02f4S3p1DcVSa03HryZq4CgXtMC3duv5xmWkWcxl24BL7JLtbpQb7HHpQKg3zpgUvV8cMKJjO4uxZ7yfjw/90930875.jpg?psid=1" alt="">&lt;/p>
&lt;p>&lt;img src="http://public.blu.livefilestore.com/y1pnsyD02f4S3r4uia6Gs4lqjXzOPWf0N2gWJVumnxtDlWoYU89SFb60lCKMEiZOyoR3_7ybJZ7wnjii3rOxyv-Ew/28230424.jpg?psid=1" alt="">&lt;br>
&lt;img src="http://public.blu.livefilestore.com/y1ppPnX9l8WIut2FDaAU4n2BNdNOmN5esiHYtmvJRq6PRGWwCyqDcc8Gz_Sx6tZ6zs9_yP4FkOgTCKh1q8yt45I2Q/0017n.jpg?psid=1" alt="">&lt;br>
&lt;img src="http://public.blu.livefilestore.com/y1pLUVM2yt_cvVj5rvfIFdKz_3zKiICOy0AufXnHKUlBrnt6Ilw3dWuDPihXeRPF43GsFP5OTLlQdeDo7Lgcx2jSQ/97137159.jpg?psid=1" alt="">&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/beautyleg/">Beautyleg</category><category domain="https://fatkun.github.io/tags/jellyfish/">Jellyfish</category><category domain="https://fatkun.github.io/tags/%E4%B8%9D%E8%A2%9C/">丝袜</category><category domain="https://fatkun.github.io/tags/%E7%BE%8E%E5%A5%B3/">美女</category><category domain="https://fatkun.github.io/tags/%E7%BE%8E%E8%85%BF/">美腿</category></item><item><title>选择排序算法(JAVA版)</title><link>https://fatkun.github.io/2010/12/select-sort-java.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/select-sort-java.html</guid><pubDate>Sat, 04 Dec 2010 15:24:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>选择排序和插入排序差不多，交换的次数减少。平均/最好/最坏时间复杂度是O(n&lt;sup>2&lt;/sup>)，是不稳定的排序算法。（插入排序是稳定排序算法）
update:以前写错了一个地方，应该每次要把最小值找出来，记下来，每次和最小值去比较，目的就是为了从后面找到最小的值。&lt;/p>
&lt;pre escaped="true" lang="java">public class Test {
/*
* 选择排序：选择最小/大的放在前面，每一趟前几个按序排列
*/
static int[] selectSort(int[] arr) {
for (int i = 0; i &amp;lt; arr.length - 1; i++) {
int k = i;
int min = arr[i];
// 和i后面的每一个比较，如果有比i小的记下下标k
for (int j = i + 1; j &amp;lt; arr.length; j++) {
if (arr[j] &amp;lt; min) {
k = j;
min = arr[j];
}
}
if (k != i) {// 交换
int temp = arr[i];
arr[i] = arr[k];
arr[k] = temp;
}
}
return arr;
}
public static void main(String[] args) {
int arr[] = new int[] { 1, 5, 7, 2, 6, 0 };
int newarr[] = selectSort(arr);
System.out.println("----------------------");
for (int i : newarr) {
System.out.println(i);
}
}
}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95/">排序算法</category><category domain="https://fatkun.github.io/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">数据结构</category><category domain="https://fatkun.github.io/tags/%E7%AE%97%E6%B3%95/">算法</category><category domain="https://fatkun.github.io/tags/%E9%80%89%E6%8B%A9%E6%8E%92%E5%BA%8F/">选择排序</category></item><item><title>快速排序算法(JAVA版)</title><link>https://fatkun.github.io/2010/12/quick-sort-java.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/quick-sort-java.html</guid><pubDate>Sat, 04 Dec 2010 02:57:47 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>快速排序是不稳定的排序方法，平均时间复杂度为O(nlogn)，空间复杂度为O(logn)，最差时是有序或基本有序时，算法退化为冒泡排序，时间复杂度是O(n&lt;sup>2&lt;/sup>)&lt;/p>
&lt;pre escaped="true" lang="java" line="1">/*
* 快速排序：选一个值pivokey(一般是第一个),小于pivokey放在左边，大于pivokey放在右边，分成两个序列，递归直到low &amp;gt;= high
* 步骤：
* 1，设定两个指针low,high。初值是0和数组长度-1，指定关键字pivokey
* 2，从high所指的位置向前找，找到一个比pivokey小的，和关键字交换值(arr[low] = arr[high])
* 3，从low所指的位置向后找，找到一个比pivokey大的，和关键字交换值
* 4，直到low&amp;gt;=high，把关键字赋值arr[low]=pivokey
* 5，递归分出的两个序列[lowStart,low-1] [low+1,highEnd]
* */
int[] quickSort(int[] arr, int low, int high) {
//为后面的递归使用
int lowStart = low;
int highEnd = high;
if (low &amp;lt; high) {
int pivokey = arr[low];
while (low &amp;lt; high) {
//如果都是大于pivokey，high指针往前移
while (low &amp;lt; high &amp;&amp; arr[high] &amp;gt; pivokey) {
high--;
}
//这里low++是先把arr[low]赋值为arr[high]，再low+=1，因为这个值是比pivokey小的，下一次不用比较了
if (low &amp;lt; high)
arr[low++] = arr[high];
//如果都是小于pivokey，low指针往后移
while (low &amp;lt; high &amp;&amp; arr[low] &amp;lt; pivokey) {
low++;
}
//这里的high--和上面同理
if (low &amp;lt; high)
arr[high--] = arr[low];
}
arr[low] = pivokey;
quickSort(arr, lowStart, low - 1);
quickSort(arr, low + 1, highEnd);
}
return arr;
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/%E5%BF%AB%E9%80%9F%E6%8E%92%E5%BA%8F/">快速排序</category><category domain="https://fatkun.github.io/tags/%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95/">排序算法</category><category domain="https://fatkun.github.io/tags/%E7%AE%97%E6%B3%95/">算法</category></item><item><title>冒泡排序算法(JAVA)</title><link>https://fatkun.github.io/2010/12/bubble-sort.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/bubble-sort.html</guid><pubDate>Fri, 03 Dec 2010 16:00:18 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>冒泡排序：和每一个比较，如果比后面大则交换，最终每一趟结果是最大值会沉到后面。&lt;br>
时间复杂度O(n&lt;sup>2&lt;/sup>)，最佳情况是已排好序只比较n-1次，不用交换。&lt;/p>
&lt;pre escaped="true" lang="java">int[] bubbleSort(int[] a) {
//每个都进行冒泡(一个一个来)
for (int i = 0; i &amp;lt; a.length; i++) {
//和前n-i个比较，把最大的数沉下去
int temp;
for (int j = 0; j &amp;lt; a.length - i - 1; j++) {
if (a[j] &amp;gt; a[j + 1]) {
//交换
temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
}
}
}
return a;
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/%E5%86%92%E6%B3%A1%E6%8E%92%E5%BA%8F/">冒泡排序</category><category domain="https://fatkun.github.io/tags/%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95/">排序算法</category><category domain="https://fatkun.github.io/tags/%E7%AE%97%E6%B3%95/">算法</category></item><item><title>直接插入排序算法（JAVA版）</title><link>https://fatkun.github.io/2010/12/insert-sort.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/insert-sort.html</guid><pubDate>Fri, 03 Dec 2010 02:23:31 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>时间复杂度：O(n*n)
直接插入排序：遍历第二个到最后一个，找到每一个值的最佳位置，插进去：）&lt;br>
1.a[i]和前一个值a[i-1]比较，如果小于前一个值&lt;br>
2.设此值为temp，把a[i-1]向后移一位a[i]=a[i-1]&lt;br>
3.检查前面的a[&amp;lt;=i-2]是否有比temp大的，如果比temp大，后移一位&lt;br>
4.直到一个比temp小的或者j=-1，此时把temp赋值到j+1即可
举例子：&lt;br>
&lt;strong>原序列&lt;/strong>：8 4 5 3&lt;br>
&lt;strong>第一次&lt;/strong> 4 8 5 3&lt;br>
&lt;strong>第二次&lt;/strong> 5&amp;lt;8，所以temp = 5, 序列变成 4 8 8 3,然后和i-2=0前面的4比较大小，5&amp;gt;4，所以5应该在1的位置上，把temp赋值到1位置上，4 5 8 3&lt;br>
&lt;strong>第三次&lt;/strong> 3&amp;lt;8，所以temp = 3, 序列变成 4 5 8 8,然后和i-2=2前面的5比较大小，3&amp;gt;5，序列变成 4 5 5 8,再比较3&amp;gt;4，序列变成 4 4 5 8，此时j=-1，那temp肯定在0位上，最终序列3 4 5 8&lt;/p>
&lt;pre lang="java" escaped="true">public class Paixu {
/**
* @param args
*/
public static void main(String[] args) {
int[] a = {8,4,5,3};
int[] insertSorta = new Paixu().insertSort(a);
pw(insertSorta);
}
/*
http://fatkun.com
直接插入排序：遍历第二个到最后一个，找到每一个值的最佳位置，插入进去
1.a[i]和前一个值a[i-1]比较，如果小于前一个值
2.设此值为temp，把a[i-1]向后移一位a[i]=a[i-1]
3.检查前面的a[&amp;lt;=i-2]是否有比temp大的，如果比temp大，后移一位
4.直到一个比temp小的或者j=-1，此时把temp赋值到j+1即可
初始序列：8 4 5 3
4 8 5 3
4 5 8 3
3 4 5 8
*/
int[] insertSort(int[] arr) {
int temp;
for (int i = 1; i &amp;lt; arr.length; i++) {
pw(arr);
if (arr[i] &amp;lt; arr[i - 1]) {//如果当前值小于前一个
temp = arr[i]; //设定岗哨
arr[i] = arr[i - 1]; //把前一个值移到后一位
//继续和前面的进行比较，如果比temp大，则后移一位
//这里j从前两个开始，因为前一个知道必定比temp大了，无需再比较
int j = i - 2;
while (j&amp;gt;=0 &amp;&amp; temp &amp;lt; arr[j]){
arr[j + 1] = arr[j];
j--;
}
//上一个循环结束后，j在最后一个比temp小的位置或者-1，所以j+1，把当前值放在这里
arr[j + 1] = temp;
}
}
return arr;
}
//打印数组
private static void pw(int[] arr){
for (int i : arr)
System.out.print(i+" ");
System.out.println("");
}
}&lt;/pre>
&lt;p>&lt;strong>简化一些，去掉一些注释，代码基本一样&lt;/strong>&lt;/p>
&lt;pre lang="java" escaped="true">int[] insertSort(int[] arr) {
int temp;
for (int i = 1; i &amp;lt; arr.length; i++) {
pw(arr);
if (arr[i] &amp;lt; arr[i - 1]) {
temp = arr[i];
//这里和前面不太一样，从i的前一个就开始比较，也就是判断前面所有元素（多判断了一次arr[i]和arr[i-1]）
int j = i - 1;
while (j&amp;gt;=0 &amp;&amp; temp &amp;lt; arr[j]){
arr[j + 1] = arr[j];
j--;
}
arr[j + 1] = temp;
}
}
return arr;
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95/">排序算法</category><category domain="https://fatkun.github.io/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/">数据结构</category><category domain="https://fatkun.github.io/tags/%E7%9B%B4%E6%8E%A5%E6%8F%92%E5%85%A5/">直接插入</category><category domain="https://fatkun.github.io/tags/%E7%AE%97%E6%B3%95/">算法</category></item><item><title>Jquery的ajax在IE提交数据乱码解决方法</title><link>https://fatkun.github.io/2010/12/jquery-ajax.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/12/jquery-ajax.html</guid><pubDate>Thu, 02 Dec 2010 06:14:09 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>乱码是因为编码不同而造成的。在ajax post 或 get时都有可能出现乱码。
为了避免乱码，可以做到以下几步&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;h3 id="1保持编码的统一包括文件编码数据库编码网页content-type编码">1，保持编码的统一，包括文件编码，数据库编码，网页content-type编码&lt;/h3>
&lt;p>检查一下&lt;meta http-equiv=&amp;#8221;content-type&amp;#8221; content=&amp;#8221;text/html; charset=UTF-8&amp;#8243; />
建议中文都是用UTF-8，使用gbk/gb2312有可能会出现乱码&lt;/p>
&lt;h3 id="2使用post来发送而不是get">2，使用post来发送而不是get&lt;/h3>
&lt;p>get方法是会通过链接来传递参数，而且会自动urlEncode(编码)，而各个浏览器编码的方式可能不太一样。使用post可以避免这种情况。&lt;/p>
&lt;h3 id="3通过在js前端escape编码再发送然后后台解码取得数据">3，通过在js前端escape编码再发送，然后后台解码取得数据&lt;/h3>
&lt;p>这些可以在网上搜索&lt;/p>
&lt;h3 id="4在全局设定contenttype指定编码">4，在全局设定contentType，指定编码&lt;/h3>
&lt;p>因为jquery ajax是使用utf-8来编码发送数据的，ie在发送时却没加上&lt;span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">charset=utf-8，从而导致乱码(IE默认使用iso-8859-1编码)&lt;/span>&lt;/p>
&lt;pre escaped="true" lang="js">$.ajaxSetup({
contentType: "application/x-www-form-urlencoded; charset=utf-8"
});&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/ajax/">Ajax</category><category domain="https://fatkun.github.io/tags/get/">Get</category><category domain="https://fatkun.github.io/tags/jquery/">Jquery</category><category domain="https://fatkun.github.io/tags/post/">Post</category><category domain="https://fatkun.github.io/tags/%E4%B9%B1%E7%A0%81/">乱码</category></item><item><title>try finally中return的执行顺序</title><link>https://fatkun.github.io/2010/11/try-catch-finally-return.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/try-catch-finally-return.html</guid><pubDate>Fri, 26 Nov 2010 14:25:40 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>看代码吧，容易懂点。&lt;/p>
&lt;pre escaped="true" lang="java">public class Try {
public static void main(String[] args) {
System.out.println("最终结果:" + aa());
}
public static int aa() {
int a = 1;
try {
System.out.println("try:" + a);
throw new Exception();
//return a;
} catch (Exception e) {
a = 2;
System.out.println("catch:" + a);
return a;
} finally {
a = 3;
System.out.println("finally:" + a);
//return编辑器会提示finally block does not complete normally
return a;
}
}
}
//运行结果:
/*
try:1
catch:2
finally:3
最终结果:3
*/&lt;/pre>
&lt;p>可以把上面的代码注释一部分。试试注释掉抛出的错误。以及各个return。&lt;/p>
&lt;h2 id="结论">结论&lt;/h2>
&lt;ol>
&lt;li>finally始终执行，如果在finally中有return，始终返回这个值&lt;/li>
&lt;li>当不抛错和在try中return a ，finally中没有return语句时， try 的 return 方法会先执行，finally的方法最后执行，然后再返回到主方法。此时最终结果是1&lt;/li>
&lt;li>finally中的return优先级最高，最终结果是3&lt;/li>
&lt;li>return的值会保存下来，不受到后面finally的影响&lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/finally/">Finally</category><category domain="https://fatkun.github.io/tags/return/">Return</category></item><item><title>二叉树遍历（先序，中序，后序）</title><link>https://fatkun.github.io/2010/11/binary-tree-traversal.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/binary-tree-traversal.html</guid><pubDate>Wed, 24 Nov 2010 11:31:08 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>先序遍历：根结点-》左节点-》右节点&lt;br>
中序遍历：左节点-》根结点-》右节点&lt;br>
后续遍历：左节点-》右节点-》根结点&lt;br>
&lt;img src="http://wah88w.blu.livefilestore.com/y1p2Ldn6_KhW1NuY9TuY8eX71yxR7bPzGcORcwu4Bu2rzNo4DycZl6MgOcQE2xYEGfW0fuOndYKyJrm2cdR0DwxD45hybQW6CA1/2x.png?psid=1" alt="">&lt;br>
上图的先序遍历为：ABDECF&lt;br>
中序遍历：DBEAFC&lt;br>
后序遍历：DEBFCA
原文来自&lt;a href="http://baike.baidu.com/view/1455146.htm">百度百科&lt;/a>
&lt;a href="http://www.cppblog.com/ngaut/archive/2006/01/01/2351.aspx">代码可以看这里&lt;/a>，结合代码看算法更容易理解。
当你知道先序和中序时，要推出后序。 还是这道题，可以根据先序序列知道根节点是A，则可以知道DBE在左子树，FC在右子树。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E4%BA%8C%E5%8F%89%E6%A0%91/">二叉树</category></item><item><title>SQL的连接（JOIN，左连接，右连接，全连接，内连接）</title><link>https://fatkun.github.io/2010/11/sql-join.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/sql-join.html</guid><pubDate>Tue, 23 Nov 2010 06:33:25 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>下图中，有两个表，T1,T2
自然连接时的语句是 SELECT * FROM T1 JOIN T2，把表1,2的值全显示出来
等值连接（内连接），按照某个条件，只返回符合条件的值
左连接（LEFT JOIN）与左外连接一样，返回的结果包括左边的全部行，右边没有的用null填充，当右表有重复的key时，总行数会变多，比左表还要多。
右连接（RIGHT JOIN）与右外连接一样，返回的结果包括右边的全部行，左边没有的用null填充
全连接(FULL JOIN) 相当于左右连接的并集，包含左右表为空的数据
&lt;img src="http://wah88w.blu.livefilestore.com/y1pOdX-NjvbC1vBQc4wNWr_fbQkM8wirtpcnrzdpURauuWLblQsoA_t_EWImst3JMf5ifUopwS5bR14u06aCH4mi_SDAmFogJtA/JOIN.png?psid=1" alt="">&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category><category domain="https://fatkun.github.io/tags/left-join/">Left Join</category><category domain="https://fatkun.github.io/tags/right-join/">Right Join</category><category domain="https://fatkun.github.io/tags/%E5%A4%96%E8%BF%9E%E6%8E%A5/">外连接</category></item><item><title>数据库存储过程的优缺点</title><link>https://fatkun.github.io/2010/11/database-procedure.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/database-procedure.html</guid><pubDate>Mon, 22 Nov 2010 05:37:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="优点">优点&lt;/h2>
&lt;p>（1） 存储过程允许标准组件式编程&lt;br>
存储过程在被创建以后可以在程序中被多次调用，而不必重新编写该存储过程的SQL语句。而且数据库专业人员可随时对存储过程进行修改，但对应用程序源代码毫无影响（因为应用程序源代码只包含存储过程的调用语句），从而极大地提高了程序的可移植性。&lt;br>
（2） 存储过程能够实现较快的执行速度&lt;br>
如果某一操作包含大量的Transaction-SQL 代码或分别被多次执行，那么存储过程要比批处理的执行速度快很多。因为存储过程是预编译的，在首次运行一个存储过程时，查询优化器对其进行分析、优化，并给出最终被存在系统表中的执行计划。而批处理的Transaction-SQL 语句在每次运行时都要进行编译和优化，因此速度相对要慢一些。
（3） 存储过程能够减少网络流量&lt;br>
对于同一个针对数据数据库对象的操作（如查询、修改），如果这一操作所涉及到的Transaction-SQL 语句被组织成一存储过程，那么当在客户计算机上调用该存储过程时，网络中传送的只是该调用语句，否则将是多条SQL 语句，从而大大增加了网络流量，降低网络负载。
（4） 存储过程可被作为一种安全机制来充分利用&lt;br>
系统管理员通过对执行某一存储过程的权限进行限制，从而能够实现对相应的数据访问权限的限制，避免非授权用户对数据的访问，保证数据的安全&lt;/p>
&lt;h2 id="缺点">缺点:&lt;/h2>
&lt;p>1,依赖于数据库厂商,难以移植(当一个小系统发展到大系统时,对数据库的要求也会发生改变)&lt;br>
2,业务逻辑大的时候,封装性不够,难调试难以维护&lt;br>
3,复杂的应用用存储过程来实现，就把业务处理的负担压在数据库服务器上了。没有办法通过中间层来灵活分担负载和压力.均衡负载等
参考：
&lt;a href="http://www.javaeye.com/topic/734702">http://www.javaeye.com/topic/734702&lt;/a>
&lt;a href="http://blog.csdn.net/fsclc/archive/2007/01/16/1484264.aspx">http://blog.csdn.net/fsclc/archive/2007/01/16/1484264.aspx&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category><category domain="https://fatkun.github.io/tags/%E4%BC%98%E7%82%B9%E4%B8%8E%E7%BC%BA%E7%82%B9/">优点与缺点</category><category domain="https://fatkun.github.io/tags/%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B/">存储过程</category></item><item><title>数据库UNION和UNION ALL比较</title><link>https://fatkun.github.io/2010/11/union-and-union-all.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/union-and-union-all.html</guid><pubDate>Mon, 22 Nov 2010 05:22:08 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>UNION能够把结果集合并&lt;/p>
&lt;pre escaped="true" lang="sql">select * from A union select * from B&lt;/pre>
&lt;p>如果能确定没有重复行，建议使用UNION ALL，不用排序。&lt;/p>
&lt;ol>
&lt;li>order by子句必须写在最后一个结果集里，并且其排序规则将改变操作后的排序结果。对于Union、Union All、Intersect、Minus都有效。&lt;/li>
&lt;li>Union可以对字段名不同但数据类型相同的结果集进行合并；&lt;/li>
&lt;li>如果字段名不同的结果集进行Union，那么对此字段的Order by子句将失效。&lt;/li>
&lt;li>Union，对两个结果集进行并集操作，不包括重复行，同时进行默认规则的排序；&lt;/li>
&lt;li>Union All，对两个结果集进行并集操作，包括重复行，不进行排序；&lt;/li>
&lt;li>Intersect，对两个结果集进行交集操作，不包括重复行，同时进行默认规则的排序；&lt;/li>
&lt;li>Minus，对两个结果集进行差操作，不包括重复行，同时进行默认规则的排序。&lt;/li>
&lt;li>可以在最后一个结果集中指定Order by子句改变排序方式。&lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category><category domain="https://fatkun.github.io/tags/union/">UNION</category><category domain="https://fatkun.github.io/tags/union-all/">UNION ALL</category></item><item><title>JAVA的==与Equals</title><link>https://fatkun.github.io/2010/11/java-equals.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/java-equals.html</guid><pubDate>Sun, 21 Nov 2010 03:38:21 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>以下是我的理解，可能有误
Java中的“==”用来判断是否是同一个对象（对象的引用是不是一样），equals方法一般会被覆盖，主要是比较值，而且一般只和同一类对象比较。&lt;/p>
&lt;h2 id="string的比较">String的比较&lt;/h2>
&lt;pre escaped="true" lang="java">public class TestEqual {
public static void main(String[] args) {
String a = "abc";
String b = "abc";
String c = new String("abc");//新建了一个对象
String d = new String("abc");
String e = "ab"+"c";//使用常量池中的对象
String f = "ab";
String g = f + "c";//string是固定字符，需要新建对象
System.out.println(a == b);//true，第一次a把字符串放在常量池，那b继续用这个常量，e也一样
System.out.println(a.equals(b));//true
System.out.println("a == c?"+(a == c));//false
System.out.println(a.equals(c));//true
System.out.println(c==d);//false
System.out.println(a==e);//true
System.out.println(a==g);//false
}
}
&lt;/pre>
&lt;p>还有个String.intern()不太理解&lt;br>
更多的信息可以看这里：&lt;a href="http://developer.51cto.com/art/200602/21445.htm">http://developer.51cto.com/art/200602/21445.htm&lt;/a>&lt;/p>
&lt;h2 id="数字的比较">数字的比较&lt;/h2>
&lt;p>需要理解autoBoxing的概念！&lt;/p>
&lt;pre escaped="true" lang="java">public class TestEqual {
public static void main(String[] args) {
Integer i1 = new Integer(9);
Integer i2 = new Integer(9);
int i3 = 9;
int i4 = 9;
Integer i5 = 9;//自动装箱(box)操作，基本类型int 9可以自动box成对象Integer
Integer i6 = 9;
Long long1 = new Long(9);
System.out.println(i1==i2);//false
System.out.println(i1==i3);//true
System.out.println("i3==i4?"+(i3==i4));//true，常量池
System.out.println("i1==i3?"+(i1==i3));//true
System.out.println("i5==i6?"+(i5==i6));//true，当-128&amp;lt;i5&amp;lt;127时为true，其他为false
//http://blog.csdn.net/newsonglin/archive/2008/10/15/3079865.aspx
// If the value p being boxed is true, false, a byte, a char in the range \u0000 to \u007f, or an int or short number between -128 and 127, then let r1 and r2 be the results of any two boxing conversions of p. It is always the case that r1 == r2.
System.out.println("i3==i5?"+(i3==i5));//false
System.out.println("i1==i5?"+(i1==i5));//false
System.out.println(i1.equals(i2));//true，同类型比较值
System.out.println(i1.equals(long1));//false，不同类型不进行比较
}
}
&lt;/pre>
&lt;p>更多的信息可以参考这篇文章:&lt;a href="http://blog.csdn.net/newsonglin/archive/2008/10/15/3079865.aspx">http://blog.csdn.net/newsonglin/archive/2008/10/15/3079865.aspx&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/equal/">Equal</category><category domain="https://fatkun.github.io/tags/java%E5%9F%BA%E7%A1%80/">Java基础</category></item><item><title>在IE下动态创建canvas使用excanvas时失效解决方法</title><link>https://fatkun.github.io/2010/11/excanvas.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/excanvas.html</guid><pubDate>Sat, 20 Nov 2010 15:21:17 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>excanvas用来支持ie6使用canvas画布。(现在叫&lt;a href="http://code.google.com/p/explorercanvas/">explorercanvas&lt;/a>)
引入excanvas.js以后，在ie下，文档中的canvas就可以用了，但是如果是通过createElement方法创建的就不行了&lt;/p>
&lt;pre escaped="true" lang="js">var canvas=document.createElement(”canvas”);
if(canvas.getContext){
alert(”support getContext()”);
}&lt;/pre>
&lt;p>因为加载并执行excanvas.js这个脚本代码的时候，G_vmlCanvasManager_.init();这句语句遍历了页面中所有的canvas元素，然后初始化这些元素。&lt;br>
由于js的函数中，如果一个变量不通过var来定义，那么就会把这个变量当作一个全局变量。&lt;/p>
&lt;h2 id="网上找到的方法一">网上找到的方法一&lt;/h2>
&lt;p>这个方法单独对某个canvas初始化，注意是文档加载完成后才操作。&lt;/p>
&lt;pre escaped="true" lang="js">$(function(){
var canvas=document.createElement(”canvas”);
document.body.appendChild(canvas);
if($.browser.msie){
canvas=window.G_vmlCanvasManager.initElement(canvas);
}
if(canvas.getContext){alert(”support”);}
});&lt;/pre>
&lt;h2 id="方法二">方法二&lt;/h2>
&lt;p>第二种方法对整个document再初始化一次。&lt;/p>
&lt;pre escaped="true" lang="js">var canvas=document.createElement(”canvas”);
document.body.appendChild(canvas);
if($.browser.msie){
G_vmlCanvasManager.init_(document);
}
if(canvas.getContext){alert(”support”);}
});&lt;/pre>
&lt;p>另外发现Canvas这玩意挺好玩的~~推荐一个中文教程：&lt;a href="https://developer.mozilla.org/cn/Canvas_tutorial">canvas中文教程&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/excanvas/">Excanvas</category><category domain="https://fatkun.github.io/tags/explorercanvas/">Explorercanvas</category></item><item><title>EL表达式</title><link>https://fatkun.github.io/2010/11/el-expression.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/el-expression.html</guid><pubDate>Fri, 19 Nov 2010 15:14:26 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>期待已久的日子即将到来: 最新版&lt;a href="http://java.sun.com/products/jsp/">JavaServer Pages (JSP)&lt;/a>2.0 规范即将和其他的J2EE 1.4一同发布。新的JSP版本有一个新的飞跃，采用了新的方式：由于新的语言表达式（Expression Language，以下简称为EL）和JSP标准标签库（JSP Standard Tag Library ,以下简称为JSTL）这两种新的方式，在页面中不需要用java,对于开发一般的应用来说，重用代码变得更加容易。更具体来说，JSP 2.0带来了以下的优点：&lt;/p>
&lt;ul>
&lt;li>首次被JSTL 1.0引入的EL现在被合并到JSP规范中，就像应用template text一样地使用所有的标准的和定制的组件。&lt;/li>
&lt;li>新的EL已经被扩展，具备一个函数调用机制，JSTL1.1整合了一系列经常需要使用的函数。&lt;/li>
&lt;li>新增加的变量和servlet 规范定义的错误处理机制被更好地组织起来。通过新增加的变量，JSP error pages 现在可以提供更多的错误信息。&lt;/li>
&lt;li>容器因为更加严格的语法检查可以更容易地找出发生的错误。&lt;/li>
&lt;li>所有的J2EE 1.4规范（包括JSP 2.0 和 Servlet 2.4），为了声明部署的规则描述而应用了XML schema。这样的好处之一是你现在可以通过任何顺序列出web.xml文件中的描述。JSP 2.0也增加了一些新的配置选项用于部署描述，允许通过全局的配置来代替基于每页的配置。&lt;/li>
&lt;li>由于更具伸缩性的规则和新的自定义action element，现在就像编写XML文件一样，编写JSP页面变得更加容易。&lt;/li>
&lt;li>定制的标签库现在可以开发成一系列的标签文件（具有JSP元素的文本文件），标签处理器可以使用新的、简化的标签处理器的API。与此同时，新规范加入了一些新的特性，比如：支持在jsp页面上显示动态属性列表和可执行片断属性。
在众多的书籍中，这是头一个讲解JSP 2.0新特性的文章。在这一部分，我们将看到和EL相关的信息，其他的新特性留到后面。在这里我假定读者已经熟悉JSP 1.2，而且至少听说过JSTL。
你可能对这本第三版的《JavaServer Pages》感兴趣。这本书中，我尽可能在细节上讲述所有的内容，而且并不认为你对JSP或者JSTL了解一切。这本书预计在2003年12月 出版，但是你现在可以在&lt;a href="http://www.amazon.com/">http://www.amazon.com&lt;/a>、Barnes&amp;amp;Noble，或者其他在线书店预订。
EL(The Expression Language)
如果过去使用过JSTL，那么你可能已经熟悉 了EL。EL在JSTL 1.0规范中被引入，用来在运行期间对Java表达式中action element属性赋值提供另一种选择。当JSTL EL已经非常迅速的流行起来情况下，还是存在一个问题： JSTL EL 表达式仅仅可以与JSTL和custom action一起使用，怎样才能使用非标准API对EL表达式求值？
JSP 2.0中,JSP容器自己可以理解EL表达式。这使你在所有过去只能应用Java表达式的地方应用EL表达式成为可能，比如：标准和定制action的属性值，模板文本。
在我们看具体的例子前，让我们更进一步的看看 什么是EL。EL是从JavaScript中获得启发的一种语言，XPath(一种用来访问XML文档的语言)，但是EL在对变量的null值和执行更多 数据类型的自动类型转换的处理上更加宽松。这些新特性对于web应用非常重要，在这些应用中输入通常通过html表单的request parameter来得到。这些参数可能仅仅在某些请求下才能体现出来，而且浏览器经常将request parameter作为文本发送，然而应用程序经常需要把他们作为数字类型、布尔类型（true 或者 false）来使用。通过EL，你根本就很少需要关心缺少某些参数的值或者类型转换。
一个EL表达式包含变量和操作符。任何存储在某个JSP作用范围(如：page、 request、session、application)的bean能被作为一个EL变量来使用。另外，EL支持以下预定义的变量：&lt;/li>
&lt;/ul>
&lt;table border="1" cellspacing="0" cellpadding="0"> &lt;tr> &lt;td> 变量名称 &lt;/td>
&lt;td> 说明 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> pageScope &lt;/td>
&lt;td> 一个包含所有page scope范围的变量集合 (a java.util.Map) &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> requestScope &lt;/td>
&lt;td> 一个包含所有request scope范围的变量集合 (a java.util.Map) &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> sessionScope &lt;/td>
&lt;td> 一个包含所有session scope范围的变量集合 (a java.util.Map) &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> applicationScope &lt;/td>
&lt;td> 一个包含所有application scope范围的变量集合 (a java.util.Map) &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> param &lt;/td>
&lt;td> 一个包含所有请求参数的集合 (a java.util.Map)，通过每个参数对应一个String值的方式赋值 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> paramValues &lt;/td>
&lt;td> 一个包含所有请求参数的集合 (a java.util.Map)，通过每个参数对应一个String数组的方式赋值 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> header &lt;/td>
&lt;td> 一个包含所有请求的头信息的集合， (a java.util.Map) ,通过每个头信息对应一个String值的方式赋值 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> headerValues &lt;/td>
&lt;td> 一个包含所有请求的头信息的集合 (a java.util.Map) ，通过每个头信息的值都保存在一个String数组的方式赋值 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> cookie &lt;/td>
&lt;td> 一个包含所有请求的 cookie集合 (a java.util.Map)，    通过每一个cookie（javax.servlet.http.Cookie）对应一个cookie值的方式赋值 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> initParam &lt;/td>
&lt;td> 一个包含所有应用程序初始化参数的集合(a java.util.Map) ，通过每个参数分别对应一个String值的方式赋值 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> pageContext &lt;/td>
&lt;td> 一个javax.servlet.jsp.PageContext类的实例, 用来提供访问不同的请求数据 &lt;/td> &lt;/tr>&lt;/table>
操作符描述了你对变量所期望的操作。如果你之前曾经使用过任何编程语言的话，在EL表达式中所使用的操作符对你来说可能看起来很熟悉。因为它们和那些在大多数语言中所支持的操作符一样。
&lt;table border="1" cellspacing="0" cellpadding="0"> &lt;tr> &lt;td> Operator &lt;/td>
&lt;td> Description &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> . &lt;/td>
&lt;td> 访问一个bean属性或者 Map entry &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> [] &lt;/td>
&lt;td> 访问一个数组或者链表元素 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> () &lt;/td>
&lt;td> 对子表达式分组，用来改变赋值顺序 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> ? : &lt;/td>
&lt;td> 条件语句，比如: 条件 ? ifTrue : ifFalse.如果条件为真，表达式值为前者，反之为后者 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> + &lt;/td>
&lt;td> 数学运算符，加操作 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> &amp;#8211; &lt;/td>
&lt;td> 数学运算符，减操作或者对一个值取反 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> * &lt;/td>
&lt;td> 数学运算符，乘操作 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> / or div &lt;/td>
&lt;td> 数学运算符，除操作 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> % or mod &lt;/td>
&lt;td> 数学运算符，模操作(取余) &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> == or eq &lt;/td>
&lt;td> 逻辑运算符，判断符号左右两端是否相等，如果相等返回true，否则返回false &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> != or ne &lt;/td>
&lt;td> 逻辑运算符，判断符号左右两端是否不相等，如果不相等返回true，否则返回false &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> &lt; or lt &lt;/td>
&lt;td> 逻辑运算符，判断符号左边是否小于右边，如果小于返回true，否则返回false &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> > or gt &lt;/td>
&lt;td> 逻辑运算符，判断符号左边是否大于右边，如果大于返回true，否则返回false &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> &lt;= or le &lt;/td>
&lt;td> 逻辑运算符，判断符号左边是否小于或者等于右边，如果小于或者等于返回true，否则返回false &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> >= or ge &lt;/td>
&lt;td> 逻辑运算符，判断符号左边是否大于或者等于右边，如果大于或者等于返回true，否则返回false &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> &amp;&amp; or and &lt;/td>
&lt;td> 逻辑运算符，与操作赋。如果左右两边同为true返回true，否则返回false &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> || or or &lt;/td>
&lt;td> 逻辑运算符，或操作赋。如果左右两边有任何一边为true返回true，否则返回false &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> ! or not &lt;/td>
&lt;td> 逻辑运算符，非操作赋。如果对true取运算返回false，否则返回true &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> empty &lt;/td>
&lt;td> 用来对一个空变量值进行判断: null、一个空String、空数组、 空Map、没有条目的Collection集合 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> func(args) &lt;/td>
&lt;td> 调用方法, func是方法名，args是参数，可以没有，或者有一个、多个参数.参数间用逗号隔开 &lt;/td> &lt;/tr>&lt;/table>
一个EL表达式可以包含：数字、文本（在单引号或者双引号之间）、布尔值、null值。
因为一个EL表达式可以出现在静态文本出现的 地方，因此你必须告诉JSP容器它应该被当作一个EL表达式来处理。你可以通过使用定界符来做到这一点。一个EL表达式总是以”${ }”来标记（一个“$”符号和一个左花括号,右花括号）。这里有一个EL表达式，它将一个命名为amount的变量加5：
${amount + 5}
如果你想要将5加到一个bean的property上，可以使用property访问操作符：
${order.amount + 5}
在当前这个指定的bean或者collection集合中，Property访问操作符（一个“.“符号）告诉EL去寻找名字为amount的property。
${order[&amp;#8216;amount&amp;#8217;] + 5}
在[]之间的值必须是一个property的名字（就像上面的例子中那样）或者是一个保存property名字的变量（或者是一个完整的EL子表达式）。
EL表达式可以被用来赋值给任何标准的或者定制的JSP行为属性（action attribute），这些行为属性被标记为可以接受动态值（或者请求期间的属性值，就象它被正式调用一样）：
&lt;c:out value=&amp;#8221;${order.amount + 5}&amp;#8221;/>
在JSP 2.0之前，你不得不使用Java表达式去给一个属性动态赋值。在过去的很多年中，这已经成为语法混乱的一个普遍根源。
最后，EL表达式可以在页面中和模板直接混合使用。当你生成HTML并且需要设置一个动态值给一个属性的时候，这非常方便：
&lt;input name=&amp;#8221;firstName&amp;#8221; value=&amp;#8221;${customer.firstName}&amp;#8221;>
JSP 1.2中，你不得不使用JSTL的&lt;c:out>来实现同样的事情，最后把各种不同类型的元素混合起来，这导致程序理解起来非常的困难：
&lt;input name=&amp;#8221;firstName&amp;#8221;
value=&amp;#8221;&lt;c:out value=&amp;#8221;${customer.firstName}&amp;#8221;/>&amp;#8221; >
新JSTL 1.1 Tag Library 标识符
JSTL1.1发布的是一个初级的版本，主要 目的是用来整合JSTL和JSP2.0 。最明显的变化是JSTL1.0 “孪生函数库”（一组库用来接受EL表达式，另外一组用来接受JAVA表达式），而它们已经被一组既可以用于EL表达式也可以用于JAVA表达式的函数库 所代替。
在JSTL 1.1中使用以下标识符:
&lt;table border="1" cellspacing="0" cellpadding="0"> &lt;tr> &lt;td> 库 &lt;/td>
&lt;td> URI &lt;/td>
&lt;td> 前缀 &lt;/td> &lt;/tr>
&lt;tr> &lt;td> Core &lt;/td>
&lt;td> http://java.sun.com/jsp/jstl/core &lt;/td>
&lt;td> c &lt;/td> &lt;/tr>
&lt;tr> &lt;td> XML processing &lt;/td>
&lt;td> http://java.sun.com/jsp/jstl/xml &lt;/td>
&lt;td> x &lt;/td> &lt;/tr>
&lt;tr> &lt;td> I18N formatting &lt;/td>
&lt;td> http://java.sun.com/jsp/jstl/fmt &lt;/td>
&lt;td> fmt &lt;/td> &lt;/tr>
&lt;tr> &lt;td> Database access &lt;/td>
&lt;td> http://java.sun.com/jsp/jstl/sql &lt;/td>
&lt;td> sql &lt;/td> &lt;/tr>
&lt;tr> &lt;td> Functions &lt;/td>
&lt;td> http://java.sun.com/jsp/jstl/functions &lt;/td>
&lt;td> fn &lt;/td> &lt;/tr>&lt;/table>
如果你曾经使用过JSTL1.0，你可能会注意到新的标识符和旧的EL库标试符一模一样，除了加入了“/jsp path” element。你也可能注意到在JSTL1.1中有一个库，包含了EL的函数。我们稍后就会看到。
一个新的EL操作符
在JSP页面中一个非常普遍的需求就是：当某 个条件为真时，要在网页中包含一些文字。在JSP1.2和JSTL1.1中，用具有代表性的&lt;c:if>来实现，但是这样做非常繁琐。 JSP2.0增加了一个新的条件操作符用于EL，以更加优雅的方式来处理这样的情况。这个条件操作符存在于很多编程语言中（比 如：Java,C,JavaScript）,因此你可能以前就见过它。它判断一个布尔的条件，当条件为真或者假时，分别取不同的结果。
一个能清楚说明它如何工作的例子：
&lt;select name=&amp;#8221;artist&amp;#8221;>
&lt;option value=&amp;#8221;1&amp;#8243; ${param.artist == 1 ? &amp;#8216;selected&amp;#8217; : &amp;#8221;}>
Vesica Pisces
&lt;option value=&amp;#8221;2&amp;#8243; ${param.artist == 2 ? &amp;#8216;selected&amp;#8217; : &amp;#8221;}>
Cortical Control
&lt;option value=&amp;#8221;3&amp;#8243; ${param.artist == 3 ? &amp;#8216;selected&amp;#8217; : &amp;#8221;}>
Vida Vierra
&lt;/select>
在这里，我使用了EL表达式和条件操作符来选 择是否包含 html 中的 “selected”属性，只有符合条件的 “option” 才被添加 “selected” 属性。如果条件（param.artist==1）为真时，前面的“selected” 才被添加到网页中；否则就添加后面的（在这里是空字符串 ‘’）到页面中。
EL函数
当EL从JSTL规范中移到JSP规范中，它使用了一个如何进行函数调用的技巧。这个EL函数语法非常简单：方法名，紧接着在圆括号中有一组参数：&lt;%@ taglib prefix=&amp;#8221;fn&amp;#8221;
uri=&amp;#8221;http://java.sun.com/jsp/jstl/functions&amp;#8221; %>
${fn:length(myCollection)}
这是一个属于标签库中的函数,并且函数名字在页面中所包含的前缀要指定taglib库。在这个例子中，我使用了前缀fn,这是JSTL function库默认的前缀。
标签库描述符（Tag Library Descriptor,TLD）将函数名称映射到一个由JAVA实现的静态方法中：&lt;function>
&lt;description>
Returns the number of items in a collection or the number of characters in a string.
&lt;/description>
&lt;name>length&lt;/name>
&lt;function-class>
org.apache.taglibs.standard.functions.Functions
&lt;/function-class>
&lt;function-signature>
int length(java.lang.Object)
&lt;/function-signature>
&lt;/function>
在这里最有趣的element 是&lt;function-signature>。它包含一个函数返回类型的声明，静态的方法的名字，在圆括号中声明该方法所有参数的类型（可以 没有参数或者有多个，参数间用逗号间隔开）。返回值类型和参数类型必须是java的原始类型（Object）或者是其他合法类型。
这个静态方法 length()在Jakarta Taglibs标准库中用类似于下面的代码实现的：
&lt;pre escaped="true" lang="java" line="1">public static int length(Object obj)
&lt;p>throws JspTagException {&lt;/p>
&lt;p>if (obj == null)&lt;/p>
&lt;p>return 0;&lt;/p>
&lt;p>if (obj instanceof String)&lt;/p>
&lt;p>return ((String)obj).length();&lt;/p>
&lt;p>if (obj instanceof Collection)&lt;/p>
&lt;p>return ((Collection)obj).size();&lt;/p>
&lt;p>if (obj instanceof Map)&lt;/p>
&lt;p>return ((Map)obj).size();&lt;/p>
&lt;p>int count = 0;&lt;/p>
&lt;p>if (obj instanceof Iterator) {&lt;/p>
&lt;p>Iterator iter = (Iterator) obj;&lt;/p>
&lt;p>count = 0;&lt;/p>
&lt;p>while (iter.hasNext()) {&lt;/p>
&lt;p>count++;&lt;/p>
&lt;p>iter.next();&lt;/p>
&lt;p>}&lt;/p>
&lt;p>return count;&lt;/p>
&lt;p>}&lt;/p>
&lt;p>if (obj instanceof Enumeration) {&lt;/p>
&lt;p>Enumeration enum = (Enumeration) obj;&lt;/p>
&lt;p>count = 0;&lt;/p>
&lt;p>while (enum.hasMoreElements()) {&lt;/p>
&lt;p>count++;&lt;/p>
&lt;p>enum.nextElement();&lt;/p>
&lt;p>}&lt;/p>
&lt;p>return count;&lt;/p>
&lt;p>}&lt;/p>
&lt;p>try {&lt;/p>
&lt;p>count = Array.getLength(obj);&lt;/p>
&lt;p>return count;&lt;/p>
&lt;p>} catch (IllegalArgumentException ex) {}&lt;/p>
&lt;p>throw new JspTagException(&amp;quot;Unsupported type&amp;quot;));&lt;/p>
&lt;p>}&lt;/pre>
就像你所看到的，在那里没有什么出奇的地方。它是一个常规的静态方法，这个函数中通过对运行期中的参数类别的判断，找出参数的长度。
除了在这个方法中使用的length()方法，JSTL1.1标签库还包含了许多其它经常使用的函数：&lt;/p>
&lt;table border="1" cellspacing="0" cellpadding="0"> &lt;tr> &lt;td> 函数 &lt;/td>
&lt;td> 描述 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:contains(string, substring) &lt;/td>
&lt;td> 如果参数string中包含参数substring，返回true &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:containsIgnoreCase(string, substring) &lt;/td>
&lt;td> 如果参数string中包含参数substring（忽略大小写），返回true &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:endsWith(string, suffix) &lt;/td>
&lt;td> 如果参数 string 以参数suffix结尾，返回true &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:escapeXml(string) &lt;/td>
&lt;td> 将有特殊意义的XML (和HTML)转换为对应的XML character entity code，并返回 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:indexOf(string, substring) &lt;/td>
&lt;td> 返回参数substring在参数string中第一次出现的位置 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:join(array, separator) &lt;/td>
&lt;td> 将一个给定的数组array用给定的间隔符separator串在一起，组成一个新的字符串并返回。 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:length(item) &lt;/td>
&lt;td> 返回参数item中包含元素的数量。参数Item类型是数组、collection或者String。如果是String类型,返回值是String中的字符数。 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:replace(string, before, after) &lt;/td>
&lt;td valign="top"> 返回一个String对象。用参数after字符串替换参数string中所有出现参数before字符串的地方，并返回替换后的结果 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:split(string, separator) &lt;/td>
&lt;td> 返回一个数组，以参数separator 为分割符分割参数string，分割后的每一部分就是数组的一个元素 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:startsWith(string, prefix) &lt;/td>
&lt;td> 如果参数string以参数prefix开头，返回true &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:substring(string, begin, end) &lt;/td>
&lt;td> 返回参数string部分字符串, 从参数begin开始到参数end位置，包括end位置的字符 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:substringAfter(string, substring) &lt;/td>
&lt;td> 返回参数substring在参数string中后面的那一部分字符串 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:substringBefore(string, substring) &lt;/td>
&lt;td> 返回参数substring在参数string中前面的那一部分字符串 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:toLowerCase(string) &lt;/td>
&lt;td> 将参数string所有的字符变为小写，并将其返回 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:toUpperCase(string) &lt;/td>
&lt;td> 将参数string所有的字符变为大写，并将其返回 &lt;/td> &lt;/tr>
&lt;tr> &lt;td valign="top"> fn:trim(string) &lt;/td>
&lt;td> 去除参数string 首尾的空格，并将其返回 &lt;/td> &lt;/tr>&lt;/table>
结束语：
在这篇文章中，我从EL讲到JSTL1.1规 范、EL新特色和JSTL 1.1函数库。接下来的部分我将要告诉你：关于JSP error-page的改进和增强； jsp:id 属性带来的益处；新的配置属性描述符；JSP2.0如何使JSP操作XML变得更加容易；自定义标签库的新特性。
如果你想要尝试JSP2.0的新特性，我建议 你使用Apache Tomcat 5。它是最早实现了JSP新规范的容器之一。在公布最终版本的JSP 2.0规范之前，一个被标记为“stable”版本的Tomcat是不能被发布的。但是最新的beta版已经被证实是非常稳定的，不要理会beta版的标 记。Tomcat 5在[the Jakarta Project site][3]可以下载。
[Hans Bergsten][4] is the founder of Gefion Software and author of O&amp;#8217;Reilly&amp;#8217;s [JavaServer Pages, 3rd Edition][5].
Return to [ONJava.com][6].
原文来自：&lt;http://blog.163.com/hbxiaoman_yang/blog/static/916313442009227115939767/></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/el/">El</category><category domain="https://fatkun.github.io/tags/java/">JAVA</category><category domain="https://fatkun.github.io/tags/jstl/">JSTL</category></item><item><title>在Dreamweaver使用正则表达式替换</title><link>https://fatkun.github.io/2010/11/dreamweaver-with-regex-replace.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/dreamweaver-with-regex-replace.html</guid><pubDate>Mon, 15 Nov 2010 13:12:18 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>有时我们需要比较复杂的替换文本，这时要用到正则表达式来进行替换。你可以使用其他可以使用正则表达式的替换工具，这里以Dreamweaver为例子。&lt;/p>
&lt;h2 id="应用场景">应用场景&lt;/h2>
&lt;p>例如有个场景，这里有一段html&lt;/p>
&lt;pre escaped="true" lang="html">&amp;lt;body&amp;gt;
&amp;lt;td style=" background:#ccc;"&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td class="td" style=" background:#ccc; color:#ccc;"&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td style=" width:100%;"&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/body&amp;gt;&lt;/pre>
&lt;p>需要在style属性内加入一个值height:20px;&lt;br>
（当然这个例子有点奇怪，暂时不过，我只是想说明要在某个属性加入某值）&lt;/p>
&lt;h2 id="实现方法">实现方法&lt;/h2>
&lt;p>记得勾上“&lt;strong>使用正则表达式&lt;/strong>”查找
在查找框输入**&amp;lt;td([\s\S]*?)style=”([\s\S]*?)”**
在替换框输入**&amp;lt;td$1style=”$2height:20px;”**
试试查找看看，能否正常匹配？如果能匹配，一个个替换\全部替换即可。&lt;/p>
&lt;ol>
&lt;li>查找框中的()括号，和替换框中的$1，$2一一对应，表示引用括号匹配的内容&lt;/li>
&lt;li>[\s\S]*?表示任意字符，？问号是指匹配模式是非贪婪的，尽量少的匹配字符
更多的正则表达式内容你可以搜索一下，相信聪明的你很容易就能找到的！&lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/dreamweaver/">Dreamweaver</category><category domain="https://fatkun.github.io/tags/regex/">Regex</category><category domain="https://fatkun.github.io/tags/%E6%9B%BF%E6%8D%A2/">替换</category><category domain="https://fatkun.github.io/tags/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F/">正则表达式</category></item><item><title>Fatkun图片批量下载谷歌浏览器扩展0.3版已更新</title><link>https://fatkun.github.io/2010/11/batch-image-download-0-3.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/batch-image-download-0-3.html</guid><pubDate>Sun, 14 Nov 2010 11:18:13 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>图片批量下载，可以找出当前页面的所有图片（Img标签）,提供按分辨率筛选图片，用另存为页面就可以把所有图片下载下来。
&lt;strong>0.3版update:2010-11-14&lt;/strong>&lt;/p>
&lt;ol>
&lt;li>添加过滤链接&lt;/li>
&lt;li>保存输入的分辨率（在点“应用”按钮时自动保存，也可以在选项中保存）&lt;/li>
&lt;li>在筛选的输入框中按回车相当于点“应用”按钮
0.3版插件地址：&lt;a href="http://bath-image-download.googlecode.com/files/batch.crx">http://bath-image-download.googlecode.com/files/batch.crx&lt;/a>
最新版可以留意此页面：&lt;a href="http://fatkun.com/2010/09/batch-image-download.html">http://fatkun.com/2010/09/batch-image-download.html&lt;/a>&lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/chrome-extensions/">Chrome Extensions</category><category domain="https://fatkun.github.io/tags/google/">Google</category><category domain="https://fatkun.github.io/tags/%E5%9B%BE%E7%89%87%E6%89%B9%E9%87%8F%E4%B8%8B%E8%BD%BD/">图片批量下载</category><category domain="https://fatkun.github.io/tags/%E8%B0%B7%E6%AD%8C%E6%89%A9%E5%B1%95/">谷歌扩展</category></item><item><title>FreeMarker简单入门</title><link>https://fatkun.github.io/2010/11/freemarker-getting-start.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/freemarker-getting-start.html</guid><pubDate>Tue, 09 Nov 2010 16:48:30 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>freemarker是用来根据模板生成代码的，有强大的模板语言。
项目地址：&lt;a href="http://freemarker.sourceforge.net/">http://freemarker.sourceforge.net&lt;/a>
TestFM.java 文件，放在com.fatkun目录下&lt;/p>
&lt;pre escaped="true" lang="java">package com.fatkun;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
import freemarker.cache.ClassTemplateLoader;
import freemarker.template.Configuration;
import freemarker.template.DefaultObjectWrapper;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;
public class TestFM {
/**
* @param args
*/
public static void main(String[] args) {
try {
Configuration cfg = new Configuration();
//相对于TestFM类目录下的templates目录，
cfg.setTemplateLoader(new ClassTemplateLoader(TestFM.class,"templates"));
//cfg.setDirectoryForTemplateLoading(new File("绝对路径"));
cfg.setObjectWrapper(new DefaultObjectWrapper());
//设置异常处理器
cfg.setTemplateExceptionHandler(TemplateExceptionHandler.IGNORE_HANDLER);
Template temp = cfg.getTemplate("test.ftl");
/* Create a data-model */
Map root = new HashMap();
root.put("user", "Fatkun");
Map latest = new HashMap();
latest.put("url", "products/greenmouse.html");
latest.put("name", "green mouse");
root.put("latestProduct", latest);
/* Merge data-model with template */
Writer out = new OutputStreamWriter(System.out);
temp.process(root, out);
out.flush();
} catch (IOException e) {
e.printStackTrace();
} catch (TemplateException e) {
e.printStackTrace();
}
}
}&lt;/pre>
&lt;p>模板文件，放在com.fatkun.templates目录下&lt;/p>
&lt;pre escaped="true" lang="html">&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;欢迎!&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;h1&amp;gt;
欢迎 ${user}&amp;lt;#if user == "Fatkun"&amp;gt;, 你是肥坤啊！&amp;lt;/#if&amp;gt;!
&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;我们的最新产品：
&amp;lt;a href="${latestProduct.url}"&amp;gt;${latestProduct.name}&amp;lt;/a&amp;gt;!
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/freemarker/">FreeMarker</category><category domain="https://fatkun.github.io/tags/%E6%A8%A1%E6%9D%BF/">模板</category></item><item><title>Comparator和Comparable的区别使用</title><link>https://fatkun.github.io/2010/11/comparator-and-comparable.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/11/comparator-and-comparable.html</guid><pubDate>Sat, 06 Nov 2010 15:47:58 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="camparable与comparator的区别">Camparable与Comparator的区别&lt;/h2>
&lt;p>简单说：&lt;/p>
&lt;ul>
&lt;li>实现Camparable接口可以直接使用sort方法Collections.sort(List list)排序&lt;/li>
&lt;li>实现Comparator接口的可以用Collections.sort(List list, Comparator c)排序
一个类实现了Camparable接口则表明这个类的对象之间是可以相互比较的，这个类对象组成的集合就可以&lt;strong>直接使用sort方法&lt;/strong>排序。&lt;br>
Comparator可以看成一种算法的实现，将算法和数据分离，Comparator也可以在下面两种环境下使用：&lt;br>
1、类的设计师没有考虑到比较问题而没有实现Comparable，可以通过Comparator来实现排序而不必改变对象本身&lt;br>
2、可以使用多种排序标准，比如升序、降序等&lt;/li>
&lt;/ul>
&lt;h2 id="camparable实例">Camparable实例&lt;/h2>
&lt;pre escaped="true" lang="java" line="1">import java.util.Arrays;
public class User implements Comparable {
private String id;
private int age;
public User(String id, int age) {
this.id = id;
this.age = age;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public int compareTo(Object o) {
return this.age - ((User) o).getAge();
}
/**
* 测试方法
*/
public static void main(String[] args) {
User[] users = new User[] { new User("a", 30), new User("b", 20) };
Arrays.sort(users);
for (int i = 0; i &amp;lt; users.length; i++) {
User user = users[i];
System.out.println(user.getId() + " " + user.getAge());
}
}
}&lt;/pre>
&lt;h2 id="comparator实例">Comparator实例&lt;/h2>
&lt;pre escaped="true" lang="java" line="1">import java.util.Arrays;
import java.util.Comparator;
public class SampleComparator implements Comparator {
public int compare(Object o1, Object o2) {
return toInt(o1) - toInt(o2);
}
private int toInt(Object o) {
String str = (String) o;
str = str.replaceAll("一", "1");
str = str.replaceAll("二", "2");
str = str.replaceAll("三", "3");
//
return Integer.parseInt(str);
}
/**
* 测试方法
*/
public static void main(String[] args) {
String[] array = new String[] { "一二", "三", "二" };
Arrays.sort(array, new SampleComparator());
for (int i = 0; i &amp;lt; array.length; i++) {
System.out.println(array[i]);
}
}
}&lt;/pre>
&lt;p>原文来自：&lt;a href="http://blog.csdn.net/turkeyzhou/archive/2009/09/16/4558392.aspx">Comparator和Comparable的区别&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/comparable/">Comparable</category><category domain="https://fatkun.github.io/tags/comparator/">Comparator</category><category domain="https://fatkun.github.io/tags/java%E5%9F%BA%E7%A1%80/">Java基础</category></item><item><title>宣传一下小邪的博客</title><link>https://fatkun.github.io/2010/10/evlos.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/10/evlos.html</guid><pubDate>Sun, 24 Oct 2010 06:37:36 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>最近都挺忙的，博客也没怎么更新了，也没学到什么东西·~
一直想做个图片帮小邪的博客宣传一下（虽然我的博客也没有多少人看：）），他免费提供空间给我搭建这个博客&lt;del>人也很好的说&lt;/del>
今天终于把图弄好了，把它放在侧栏的最上方：）&lt;br>
&lt;a href="http://evlos.org" target="_blank">&lt;img src="http://fatkun.com/evlosad.png" alt="null" />&lt;/a>
&lt;a href="http://evlos.org" target="_blank">&lt;a href="http://evlos.org">http://evlos.org&lt;/a>&lt;/a> 小邪的博客
博客内容最多的是一些PHP的东西，包括一些Wordpress插件哦，另外还有一些荷兰生活的照片：）嗯，就这样子~最主要的是小邪人很好= =！
上图背景图片来源&lt;a href="http://www.zcool.com.cn/work/ZNDI3NjM2/1.html">http://www.zcool.com.cn/work/ZNDI3NjM2/1.html&lt;/a>，
没找到好的背景，找个美女好了：）&lt;br>
&lt;img src="http://image.zcool.com.cn/47/13/m_1287802171156.jpg" alt="">&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E5%B0%8F%E9%82%AA/">小邪</category></item><item><title>Mercurial(HG)版本控制服务用户名验证</title><link>https://fatkun.github.io/2010/10/mercurial-authentication.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/10/mercurial-authentication.html</guid><pubDate>Sun, 17 Oct 2010 03:22:18 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在之前的文章中，&lt;strong>&lt;a rel="bookmark" href="http://fatkun.com/2010/08/mercurial-server-with-apache.html">在Windows使用apache搭建Mercurial版本控制服务&lt;/a>&lt;span style="font-weight: normal;">，并没有说到如何验证用户，而是允许所有人都提交。当时还不会怎么配置。&lt;/span>&lt;/strong>
&lt;span style="font-size: medium;">&lt;span>以下就是配置方法：&lt;/span>&lt;/span>&lt;/p>
&lt;h2 id="span-stylefont-size-medium1用htpasswdexe建立用户密码文件span">&lt;span style="font-size: medium;">1，用htpasswd.exe建立用户密码文件&lt;/span>&lt;/h2>
&lt;p>&lt;span style="font-size: medium;">htpasswd.exe在apache的bin目录可以找到，使用方法主要有&lt;/span>
&lt;span style="font-size: small;">htpasswd -c 文件名 用户名               //参数-c创建密码文件，输入后会提示你输入密码&lt;/span>
&lt;span style="font-size: small;">htpasswd 文件名 用户名                 //如果用户名一样会更新密码&lt;/span>
&lt;span style="font-size: small;">举个例子，我现在要建两个用户&lt;/span>&lt;/p>
&lt;pre escaped="true" lang="java">htpasswd -c hguser fatkun.com
htpasswd hguser aaaa&lt;/pre>
&lt;p>这时会得到一个hguser的文件，把它拷贝到conf目录下&lt;/p>
&lt;h2 id="2修改httpdconf配置">2,修改httpd.conf配置&lt;/h2>
&lt;p>在httpd.conf配置最末尾加入，注意路径改为你的&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;Location /hg&amp;gt;
AuthType Basic
AuthName "Mercurial repositories"
AuthUserFile "D:/Program Files/Apache2.2/conf/hguser"
&amp;lt;LimitExcept GET&amp;gt;
Require valid-user
&amp;lt;/LimitExcept&amp;gt;
&amp;lt;/Location&amp;gt;&lt;/pre>
&lt;p>这样就可以了，重启apache服务以后，试试从浏览器访问hg的网页？会提示你输入用户名和密码。&lt;/p>
&lt;h2 id="3针对某些项目的权限设置">3，针对某些项目的权限设置&lt;/h2>
&lt;p>在服务器存放项目的文件中，在.hg目录新建一个hgrc文件，里面可以配置为&lt;br>
这里是配置单个项目的，如果需要对所有项目配置，可以修改hgweb.config文件&lt;/p>
&lt;pre escaped="true" lang="xml">[web]
allowpull = false //不允许所有人下载该项目
allow_read = "John Doe, PhD", fatkun//允许哪些人可以下载，如果有空格或特殊字符用引号""括起来
//还有deny_read，allow_push 等等&lt;/pre>
&lt;p>更多的配置可以查看这里&lt;a href="http://www.selenic.com/mercurial/hgrc.5.html">http://www.selenic.com/mercurial/hgrc.5.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/hg/">Hg</category><category domain="https://fatkun.github.io/tags/htpasswd/">Htpasswd</category><category domain="https://fatkun.github.io/tags/%E6%9D%83%E9%99%90%E8%AE%BE%E7%BD%AE/">权限设置</category><category domain="https://fatkun.github.io/tags/%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6/">版本控制</category></item><item><title>删除Lucene索引</title><link>https://fatkun.github.io/2010/10/delete-lucene-index.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/10/delete-lucene-index.html</guid><pubDate>Sat, 09 Oct 2010 08:35:19 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>若需要从索引中删除某一个或者某一类文档，IndexReader提供了两种方法：
reader.DeleteDocument(int docNum)
reader.DeleteDocuments(Term term)。
前者是根据文档的编号来删除该文档，docNum是该文档进入索引时Lucene的编号，是按照顺序编的；后者是删除满足某一个条件的多个文档。
在执行了DeleteDocument或者DeleteDocuments方法后，系统会生成一个*.del的文件，该文件中记录了删除的文档，但并未从物理上删除这些文档。indexWriter.Optimize();才会真正的删除。&lt;/p>
&lt;pre escaped="true" lang="java">String indexDirStr = "d:\\index";
Directory indexDir = FSDirectory.getDirectory(new File(indexDirStr));
IndexReader reader = IndexReader.open(indexDir);
reader.deleteDocuments(new Term("id", String.valueOf(id)));
reader.flush();
reader.close();&lt;/pre>
&lt;p>注意new Term()中的id必须是Field.Index.TOKENIZED，不然无法搜索到就删除不了了。
另外注意一个问题是，我的lucene2.2版本删除后会在IndexReader.open时会出错！！换用新版的lucene2.9问题解决！&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/lucene/">Lucene</category><category domain="https://fatkun.github.io/tags/%E5%88%A0%E9%99%A4%E7%B4%A2%E5%BC%95/">删除索引</category></item><item><title>关机时提示“正在关闭网络连接”解决方法</title><link>https://fatkun.github.io/2010/10/network-is-closing.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/10/network-is-closing.html</guid><pubDate>Sun, 03 Oct 2010 02:53:19 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="症状">症状&lt;/h2>
&lt;p>关机时提示“正在关闭网络连接”，有点慢&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>设置workstation服务为“自动”运行并启用该服务。如果你是因为workstation启动慢才关闭次服务，可以看这篇文章：&lt;a rel="bookmark" href="http://fatkun.com/2010/10/workstation-service.html">XP下系统服务workstation启动很慢解决方法&lt;/a>
PS:设置关机时的声效为空，也可以加快关机速度（因为关机时要等关机声播完= =!）&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/%E5%85%B3%E6%9C%BA/">关机</category><category domain="https://fatkun.github.io/tags/%E7%BD%91%E7%BB%9C%E8%BF%9E%E6%8E%A5/">网络连接</category><category domain="https://fatkun.github.io/tags/%E7%BD%91%E7%BB%9C%E8%BF%9E%E6%8E%A5%E5%85%B3%E9%97%AD/">网络连接关闭</category></item><item><title>XP下系统服务workstation启动很慢解决方法</title><link>https://fatkun.github.io/2010/10/workstation-service.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/10/workstation-service.html</guid><pubDate>Sat, 02 Oct 2010 02:51:18 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="症状">症状&lt;/h2>
&lt;p>系统进入桌面之后，要等上1-2分钟才能完全操作，在这期间，发现很多自动运行的服务依然没有启动。设置workstation服务为手动或者禁止则开机正常。&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;ol>
&lt;li>设置workstation服务为手动或禁止运行。（不过有个后遗症是关机时会提示“正在关闭网络连接”）&lt;/li>
&lt;li>检查网卡自动获取IP是不是很慢，把网卡的IP设置为固定IP（我的电脑是因为这个原因，通过宽带拨号，本地连接可以设置为任何一个ip：如192.168.1.33，没影响的）&lt;/li>
&lt;/ol>
&lt;h2 id="其他解决方法">其他解决方法&lt;/h2>
&lt;ol>
&lt;li> 由于安装各种插件(雅虎助手等)导致网络服务出问题或EXPLORER负载过大,同时还会引起WORKSTATION服务启动慢,有时候要20分钟左右才能启动机器.建议使用360安全卫士处理下流氓软件.这样情况会有好转&lt;/li>
&lt;li>在本地连接的网络组件里,多余的组件会给WORKSTATION很大负荷,XP专业版的情况下基本只有4个是必需的,那就是MICROSOFT网络客户端,MICROSOFT网络文件和打印机的共享,QOS数据包计划程序和TIP/IP,其他的一律删掉.&lt;/li>
&lt;li>因为安装VMware变慢，可以把VMware的三个服务(VMware Authorization Service,VMware NAT Service,VMware DHCP Service)设为手动，有需要再开启&lt;/li>
&lt;/ol>
&lt;h2 id="额外知识">额外知识&lt;/h2>
&lt;p>Workstation(即lanmanworkstation)服务，如果启动慢，将导致：&lt;br>
在该服务启动后启动的各类服务组的服务延迟启动，包括&lt;br>
RemoteValidation（包含NetLogon服务）&lt;br>
NetDDEGroup（包含NetDDE服务）&lt;br>
Parallel arbitrator（包含Parport并口服务）&lt;br>
Extended Base（各类硬件管理服务如USB、串口等，音视频解码等）&lt;br>
PCI Configuration（包含PCIDump服务）&lt;br>
MS Transactions（包含MSDTC服务）&lt;br>
　　而这些启动延迟，将导致网络登录延迟、网络管理功能延迟加载、音频启动延迟（开机声音延迟播出）、USB设备延迟加载等问题，直接导致系统的可用性。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/vmware/">Vmware</category><category domain="https://fatkun.github.io/tags/workstation/">Workstation</category><category domain="https://fatkun.github.io/tags/xp/">Xp</category><category domain="https://fatkun.github.io/tags/%E5%90%AF%E5%8A%A8%E6%85%A2/">启动慢</category><category domain="https://fatkun.github.io/tags/%E6%9C%8D%E5%8A%A1/">服务</category><category domain="https://fatkun.github.io/tags/%E7%B3%BB%E7%BB%9F/">系统</category></item><item><title>PSD:折角橙色标题栏</title><link>https://fatkun.github.io/2010/09/psd-nav.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/09/psd-nav.html</guid><pubDate>Wed, 22 Sep 2010 11:59:58 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;img src="http://wah88w.blu.livefilestore.com/y1p-s4GBQ0VaYGg77MAwaCIx7z6K1lfHM7bMN7GpdRbHSDG8GPRtyULefu9ubwMWGrZ3q2tsJLSP0tvPDLRr08tl5H52PSZ8M18/2010-09-22_nav.jpg?psid=1" alt="">
上图是我自己做的。比较简单，主要注意的是黄条阴影的方向是向上的，那个折角的三角形我是用钢笔画的，一样是同样的渐变颜色。有这个折角感觉立体化多了，不过我做的这个貌似不太漂亮？
原文是英文的，我就不翻译不转载了，也不算太难。照着图做即可。
教程地址：&lt;a href="http://psdvibe.com/2008/12/03/content-box-with-orange-banner-heading/">http://psdvibe.com/2008/12/03/content-box-with-orange-banner-heading/&lt;/a>
PSD下载地址：&lt;a href="http://psdvibe.com/tutorials/dark_box_banner_head/psd.zip">http://psdvibe.com/tutorials/dark_box_banner_head/psd.zip&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/ps/">Ps</category><category domain="https://fatkun.github.io/tags/psd/">PSD</category><category domain="https://fatkun.github.io/tags/%E6%A9%99%E8%89%B2%E6%8A%98%E8%A7%92/">橙色折角</category></item><item><title>CSS中的部分缩写</title><link>https://fatkun.github.io/2010/09/css-shortcut.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/09/css-shortcut.html</guid><pubDate>Wed, 22 Sep 2010 03:21:23 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>对于想学习好CSS的话，缩写的顺序必须是正确的（虽然有些不正确的浏览器能自动修正），既能看懂别人的缩写，也能省点敲键盘的时间~~&lt;/p>
&lt;h2 id="边距margin与padding">边距（margin与padding）&lt;/h2>
&lt;p>margin和padding的缩写方法相同&lt;/p>
&lt;pre escaped="true" lang="css">/*按“上右下左”顺时针的方向填写*/
margin:1px 1px 1px 1px;
margin:1px;/*四个方向的边距相同，等同于margin:1px 1px 1px 1px;*/
margin:1px 2px;/*上下边距都为1px，左右边距均为2px，等同于margin:1px 2px 1px 2px*/
margin:1px 2px 3px;/*右边距和左边距相同，等同于margin:1px 2px 3px 2px;*/
margin:1px 2px 1px 3px;/*注意，这里虽然上下边距都为1px，但是这里不能缩写。*/&lt;/pre>
&lt;h2 id="边框border与outline">边框(border与outline)&lt;/h2>
&lt;pre escaped="true" lang="css">/*宽度 样式 样色*/
border:5px solid #369;
/*border的缩写中border-style是必须的。*/&lt;/pre>
&lt;h2 id="背景background">背景(background)&lt;/h2>
&lt;p>background是最常用的简写之一，它包含以下属性：&lt;/p>
&lt;pre escaped="true" lang="css">background-color: color || #hex || RGB(% || 0-255) || RGBa;
background-image:url();
background-repeat: repeat || repeat-x || repeat-y || no-repeat;
background-attachment: scroll || fixed;
background-position: X Y || (top||bottom||center) (left||right||center);&lt;/pre>
&lt;pre escaped="true" lang="css">/*按照上面的顺序写即可，各个属性都可以省略*/
background:#ccc url("xxx.png") repeat scroll top left ;
/*默认值是*/
background:transparent none repeat scroll top left ;&lt;/pre>
&lt;h2 id="字体font">字体（font）&lt;/h2>
&lt;p>&lt;strong>很多人并不赞成使用font缩写&lt;/strong>&lt;br>
包含的属性有&lt;/p>
&lt;pre escaped="true" lang="css">font-style: normal || italic || oblique;
font-variant:normal || small-caps;
font-weight: normal || bold || bolder || || lighter || (100-900);
font-size: (number+unit) || (xx-small - xx-large);
line-height: normal || (number+unit);
font-family:name,"more names";&lt;/pre>
&lt;img src="http://www.woaicss.com/attachments/month_1007/w201077162243.jpg" alt="" width="500" height="360" />
## 列表样式
&lt;pre escaped="true" lang="css">list-style:disc outside none
/*如果list-tyle中定义了图片，那么图片的优先级要比list-style-type高*/
list-style:circle inside url(../img.gif)&lt;/pre>
&lt;h2 id="圆角border-radius">圆角（border-radius）&lt;/h2>
&lt;pre escaped="true" lang="css">/*按 左上 右上 右下 左下 顺时针方向*/
border-radius:10px 20px 30px 40px;
/*大致与边距的缩写相同，也可以省略某个值*/&lt;/pre>
&lt;p>文章来自&lt;span style="font-weight: normal;">&lt;a title="Permanent Link: CSS简写指南" rel="bookmark" href="http://www.qianduan.net/css-font-shorthand-attribute-handbook.html">CSS简写指南&lt;/a>，部分有删改，更多内容可以看原文&lt;/span>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/css%E7%AE%80%E5%86%99/">Css简写</category><category domain="https://fatkun.github.io/tags/css%E7%BC%A9%E5%86%99/">Css缩写</category></item><item><title>用一个Tomcat建立多个Server</title><link>https://fatkun.github.io/2010/09/tomcat-with-multiple-server.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/09/tomcat-with-multiple-server.html</guid><pubDate>Thu, 16 Sep 2010 12:41:37 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="1通过配置多个context元素不同目录">1.通过配置多个&lt;Context>元素（不同目录）&lt;/h2>
&lt;p>(fatkun:这个和直接放在webapps不用配置差不多)
在&lt;Host>下配置多个&lt;Context>元素&lt;/p>
&lt;pre escaped="true" lang="xml" line="1">&amp;lt;Context path="app1" docBase="E:/workspace/app1/WebRoot" debug="0" reloadable="true"&amp;gt;&amp;lt;/Context&amp;gt;
&amp;lt;Context path="app2" docBase="E:/workspace/app2/WebRoot" debug="0" reloadable="true"&amp;gt;&amp;lt;/Context&amp;gt;&lt;/pre>
&lt;p>然后通过 主机名:端口/应用名 访问,如: http://localhost:8080/app1 或 http://localhost:8080/app2&lt;/p>
&lt;h2 id="2通过配置多个host元素不同域名">2.通过配置多个&lt;Host>元素（不同域名）&lt;/h2>
&lt;pre escaped="true" lang="xml" line="1">&amp;lt;Host appBase="webapps" name="192.168.1.110"&amp;gt;
&amp;lt;Context path="" docBase="E:/workspace/app1/WebRoot" debug="0" reloadable="true"&amp;gt;&amp;lt;/Context&amp;gt;
&amp;lt;/Host&amp;gt;
&amp;lt;Host appBase="webapps" name="192.168.1.114"&amp;gt;
&amp;lt;Context path="" docBase="E:/workspace/app2/WebRoot" debug="0" reloadable="true"&amp;gt;&amp;lt;/Context&amp;gt;
&amp;lt;/Host&amp;gt;&lt;/pre>
&lt;p>然后通过 主机名:端口 访问,如: http://192.168.1.110:8080 或 http://192.168.1.114:8080&lt;br>
name中的192.168.1.110可以是你的域名或者需要绑定的IP&lt;/p>
&lt;h2 id="3通过配置多个service元素不同端口">3.通过配置多个&lt;Service>元素(不同端口)&lt;/h2>
&lt;p>在&lt;Server>下配置多个&lt;Service>元素&lt;/p>
&lt;pre escaped="true" lang="xml" line="1">&amp;lt;Service name="Catalina1"&amp;gt;
&amp;lt;Connector port="90" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="gbk" /&amp;gt;
&amp;lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /&amp;gt;
&amp;lt;Engine name="Catalina2" defaultHost="localhost"&amp;gt;
&amp;lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/&amp;gt;
&amp;lt;Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"&amp;gt;
&amp;lt;Context path="" docBase="F:/workspace/app1/WebRoot" debug="0" reloadable="true"&amp;gt;&amp;lt;/Context&amp;gt;
&amp;lt;/Host&amp;gt;
&amp;lt;/Engine&amp;gt;
&amp;lt;/Service&amp;gt;
&amp;lt;Service name="Catalina2"&amp;gt;
&amp;lt;Connector port="91" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="gbk" /&amp;gt;
&amp;lt;Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /&amp;gt;
&amp;lt;Engine name="Catalina2" defaultHost="localhost"&amp;gt;
&amp;lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/&amp;gt;
&amp;lt;Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"&amp;gt;
&amp;lt;Context path="" docBase="F:/workspace/app2/WebRoot" debug="0" reloadable="true"&amp;gt;&amp;lt;/Context&amp;gt;
&amp;lt;/Host&amp;gt;
&amp;lt;/Engine&amp;gt;
&amp;lt;/Service&amp;gt;&lt;/pre>
&lt;p>定义了两个Service分别是Catalina和Catalina2,侦听的端口分别是90和91&lt;br>
然后通过 主机名:端口 访问,如: http://localhost:90 或 http://localhost:91
原文来自：&lt;a href="http://www.blogjava.net/siyn/archive/2008/07/07/213133.html">http://www.blogjava.net/siyn/archive/2008/07/07/213133.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/tomcat%E5%88%86%E4%BA%ABjvm/">Tomcat分享JVM</category><category domain="https://fatkun.github.io/tags/tomcat%E7%BB%91%E5%AE%9A%E5%9F%9F%E5%90%8D/">Tomcat绑定域名</category></item><item><title>Hibernate状态transient、persistent、detached的转换</title><link>https://fatkun.github.io/2010/09/transient-persistent-detached.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/09/transient-persistent-detached.html</guid><pubDate>Wed, 15 Sep 2010 13:48:25 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>transient、persistent、detached状态关系图如下：
&lt;img src="http://img.ddvip.com/2008_10_10/1223608862_ddvip_5325.png" alt="系统学习hibernate之三：transient、persistent、detached状态">
1、transient状态的特征：&lt;/p>
&lt;ul>
&lt;li>在数据库中没有与之匹配的数据&lt;/li>
&lt;li>没有纳入session的管理
2、persistent状态的特征：&lt;/li>
&lt;li>persistent状态的对象在数据库中有与之匹配的数据&lt;/li>
&lt;li>纳入了session的管理&lt;/li>
&lt;li>在清理缓存（脏数据检查）的时候,会和数据库同步
3、detached状态的特征：&lt;/li>
&lt;li>在数据库中有与之匹配的数据&lt;/li>
&lt;li>没有纳入session的管理
PS：了解这几种状态对深入使用hibernate有比较大的意义，开发过程中减少很多不必要的错误。
来源：&lt;a href="http://www.cnblogs.com/sunwei2012/archive/2010/01/02/1637967.html">系统学习hibernate之三：transient、persistent、detached状态&lt;/a>{#ctl04_TitleUrl}&lt;/li>
&lt;/ul></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/hibernate/">Hibernate</category></item><item><title>XDoclet – discriminator标签（子类，同一个表）</title><link>https://fatkun.github.io/2010/09/xdoclet-discriminator.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/09/xdoclet-discriminator.html</guid><pubDate>Mon, 13 Sep 2010 12:11:29 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>使用XDoclet生成子类映射配置， 简单说一下，只当自己记录了。&lt;br>
这是一个“每棵继承树映射成一张表”的方法，也就是在这个表里加一个字段来区分子类&lt;br>
在父类加入&lt;/p>
&lt;pre escaped="true" lang="java">@hibernate.class
@hibernate.discriminator column="ftype" type="string" length="50"&lt;/pre>
&lt;p>在子类中加入&lt;/p>
&lt;pre escaped="true" lang="java">@hibernate.subclass discriminator-value = "AAA"&lt;/pre>
&lt;p>更多的你可以参考以下网址：&lt;/p>
&lt;h3 id="span-stylefont-weight-normalxdoclet-8211-discriminator标签span1">&lt;a href="http://conkeyn.javaeye.com/blog/349258">&lt;span style="font-weight: normal;">XDoclet – discriminator标签&lt;/span>&lt;/a>&lt;/h3>
&lt;p>&lt;a href="http://blog.csdn.net/chenjyuj/archive/2007/04/11/1561342.aspx">XDoclet –hibernate标签 简单介绍&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/discriminator/">Discriminator</category><category domain="https://fatkun.github.io/tags/hibernate/">Hibernate</category><category domain="https://fatkun.github.io/tags/xdoclet/">XDoclet</category></item><item><title>Fatkun图片批量下载谷歌浏览器扩展（Chrome Extensions）(1.8版)（已不再维护）</title><link>https://fatkun.github.io/2010/09/batch-image-download.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/09/batch-image-download.html</guid><pubDate>Sun, 12 Sep 2010 03:29:53 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h1 style="font-size: 40px;"> &lt;span style="color: #ff0000;">已卖给其他人，之后我不再维护。&lt;/span>&lt;/h1>
&amp;nbsp;
图片批量下载，可以找出当前页面的所有图片,提供按分辨率筛选图片，用另存为页面就可以把所有图片下载下来。
只为做一个**简单好用的**批量下图扩展。
## 推荐
&lt;p>&lt;span style="color: #0000ff;">新写了一个安卓手机应用，如果你爱美女，可以试试这个应用：&lt;a title="安卓应用：爱美女1.3 için Kalıcı Bağlantı" href="http://fatkun.com/2013/08/pretty-girl.html" rel="bookmark">爱美女&lt;/a>&lt;/span>&lt;/p>
&lt;h2 id="声明">声明&lt;/h2>
&lt;p>在参考和借鉴小乐图客源代码过程中，未严格按照相关源代码协议，&lt;wbr />擅自恶意抄袭部分核心源代码，&lt;wbr />给原创作者小乐zzllrr造成伤害和不必要的损失，&lt;wbr />属于个人行为，与其他组织或个人无关。&lt;wbr />在此本人表示对小乐图客诚挚的正式道歉。
Fatkun图片批量下载（下称本软件）使用了基于MIT协议的&lt;a href="http://chrome.google.com/webstore/detail/gfjhimhkjmipphnaminnnnjpnlneeplk?hl=zh_cn" target="_blank">《小乐图客》&lt;/a>源码，《小乐图客》的作者是zzllrr(&lt;a href="http://weibo.com/zzllrr">http://weibo.com/zzllrr&lt;/a>)，在此声明。本软件不继承MIT协议发布。
隐私声明：本扩展会获取域名（非完整URL）等信息用于分析用户使用情况改进扩展，不会传输个人隐私信息。&lt;/p>
&lt;h2 id="下载">下载&lt;/h2>
&lt;p>chrome store下载（推荐）：&lt;a href="https://chrome.google.com/webstore/detail/nnjjahlikiabnchcpehcpkdeckfgnohf" target="_blank">点我下载，赶紧的&lt;/a>
 &lt;/p>
&lt;h2 id="我用不了这个扩展">我用不了这个扩展&lt;/h2>
&lt;p>目前此扩展只保证谷歌浏览器稳定版本能正常使用，其他浏览器可能有问题。&lt;br>
如果有其他问题，可以用你的浏览器打开这个网页 &lt;a href="https://aboutmybrowser.com" target="_blank">&lt;a href="https://aboutmybrowser.com">https://aboutmybrowser.com&lt;/a>&lt;/a>获取你的浏览器版本信息，把地址栏拷贝出来+问题留言给我。&lt;/p>
&lt;h2 id="更新说明">更新说明&lt;/h2>
&lt;p>&lt;strong>1.8版 update：2014-04-13&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;span style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;">图片可以保存到文件夹内了（仅限于下载目录内的子目录）&lt;/span>&lt;/li>
&lt;li>&lt;span style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px;">修正QQ空间的大图识别，增加thumbr,printrest大图识别&lt;/span>
 &lt;/li>
&lt;/ul>
&lt;h2 id="使用方法">使用方法：&lt;/h2>
&lt;p>&lt;strong>最好等页面加载完成后再点击批量下载图片&lt;/strong>
在有图片的网页点击扩展的图标，然后可以输入扩展条件，可以点击图片删除单张图片。&lt;br>
Q：点击“保存图片”时，为什么弹出很多个保存框？
A：要在浏览器的设置中，把&lt;strong>下载前询问每个文件的保存位置&lt;/strong>的勾_去掉_！
Q：可以点击“保存图片”选择目录保存吗？
A：不可以，受限于保存文件的方法，目前只能保存在下载目录中。可以用Ctrl+S保存网页的方式指定目录。
Q：如何同时下载多页的图片？
A：在点击图标后，有个“打开多个页面？”，可以输入多个页面的链接地址；可以用[1-5]表示1到5页，[001-010]表示001到010页；可以用逗号分隔，如[1-5,8-9]
Q: 为什么顺序不对？
A:目前是按图片下载完成后，才会对所有图片作一次排序。
 
 &lt;/p>
&lt;h2 id="捐赠">捐赠：&lt;/h2>
&lt;p>&lt;strong>感谢所有捐赠的朋友，谢谢你们的鼓励！这是我人生中第一次收到的捐赠，非常感谢你们！&lt;/strong>
点此查看&lt;a href="http://fatkun.com/2012/03/batch-download-image-donate.html" title="图片批量下载扩展捐赠名单">捐赠名单&lt;/a>
做这个扩展，刚开始是因为当时的扩展并不好用，自己写了一个简单的自己用着爽。现在还花时间更新这个扩展，一是想通过做学习多一点js，二是这个扩展也还不算完善。如果你喜欢这个扩展并愿意捐赠作者，给一点点鼓励也好。。。&lt;a href="https://me.alipay.com/fatkun" target="_blank">点此给我买瓶汽水&lt;/a>（支付宝）。
&lt;a href="http://image.fatkun.com/blog/mmfuli2.jpg">&lt;img src="http://image.fatkun.com/blog/mmfuli2.jpg" alt="" title="mmfuli">&lt;/a>
&lt;a href="http://image.fatkun.com/blog/mmfuli.jpg">&lt;img class="alignnone wp-image-1051" title="mmfuli" src="http://image.fatkun.com/blog/mmfuli.jpg" alt="" />&lt;/a>
 
 
&lt;span style="color: #ff0000;">删除网页会把文件夹也一起删除解决方法：&lt;/span>
在WIN7：在文件管理器上面的工具栏- 组织》文件夹和搜索选项》查看》在管理网页和文件夹对那里选择 “显示两部分并分别进行管理”
XP也有类似的选项，在菜单栏有一个“文件夹选项”的菜单。
如果找不到这个选项，请看&lt;a href="http://fatkun.com/2012/01/manager-web-page.html" title="找不到管理网页和文件夹对处理方法">找不到管理网页和文件夹对处理方法&lt;/a>
 
&lt;del datetime="2012-02-02T16:09:29+00:00">之前在官方页面找到一个图片批量下载的扩展，居然是要一个一个点的，不知道作者是怎样想的= =！&lt;/del>
&lt;del>再PS：这么久都不出一个版本，主要原因是我懒，而且最近刚开始进入工作的生活，还不是很适应。还有一个原因是直接点击保存我尝试过，我的实现方法很烂，而且很慢，所以不在0.4版加入。也没有什么好的方法，也许这个插件也不会有很多的更新了。&lt;/del>
 
 &lt;/p>
&lt;h2 id="更新信息">更新信息&lt;/h2>
&lt;p>&lt;strong>1.7.5版 update:2013-09-14&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>加入反选功能&lt;/li>
&lt;li>修正大图规则的一些问题&lt;/li>
&lt;li>简化界面
&lt;strong>1.6版 update:2012-11-27&lt;/strong>&lt;/li>
&lt;li>国际化，加上英文&lt;/li>
&lt;li>取大图规则加入 迅雷方舟、google+、flickr&lt;/li>
&lt;li>添加了新的权限webRequest，用于获取百度相册图片（实验性，只能在图片墙页面使用）&lt;/li>
&lt;li>导出链接
&lt;strong>1.5版 update:2012-09-16&lt;/strong>&lt;/li>
&lt;li>支持打开多个页面&lt;/li>
&lt;li>兼容chrome v17版本（会导致在chrome21扩展界面上有个错误提示，但不会影响功能）&lt;/li>
&lt;li>支持排序（在下载完成后会排序一次）&lt;/li>
&lt;li>可以点击页面按钮保存图片，当然还可以继续使用Ctrl+S保存网页的方式保存&lt;/li>
&lt;li>支持图片重命名
&lt;strong>1.4.2版update:2012-07-22&lt;/strong>&lt;/li>
&lt;li>尝试修复某些版本使用的问题，请通过评论反馈给我&lt;/li>
&lt;li>允许每次把图片汇集到一个输出页面（在【选项】可以关闭）&lt;/li>
&lt;li>增加花瓣网取大图（所有支持的网站可以在【选项】看到）&lt;/li>
&lt;li>增加了一个改扩展名的脚本，在输出页面可以下载下来放到图片文件夹双击运行
这次支持了多个相册取图，QQ空间也可以取图了，快去试试吧！
&lt;strong>1.4版&lt;/strong>update:2012-07-08****&lt;/li>
&lt;li>支持多标签获取图片&lt;/li>
&lt;li>支持快捷键&lt;strong>Alt + Z&lt;/strong>&lt;/li>
&lt;li>增加特定网站获取大图片：QQ空间、QQ相册、百度相册、豆瓣相册&lt;/li>
&lt;li>修正新浪微博相册取不了大图的问题&lt;/li>
&lt;li>改了脚本加载方式，可能要重启浏览器才生效&lt;/li>
&lt;li>Ctrl + S保存网页的时候要注意保存类型是：网页/全部
&lt;strong>1.3版&lt;/strong>update:2012-05-01****&lt;/li>
&lt;/ul>
&lt;ol>
&lt;li>支持特定网站取大图，添加新浪微博和新浪轻博客的支持&lt;/li>
&lt;li>支持input图片&lt;/li>
&lt;li>添加视图切换
&lt;strong>1.2版&lt;/strong>update:2012-03-04****&lt;/li>
&lt;li>支持特定网站取大图，目前支持&lt;a href="http://topit.me" target="_blank">topit.me&lt;/a>和&lt;a href="http://mmfuli.com" target="_blank">mmfuli.com&lt;/a>，可以去试试&lt;/li>
&lt;li>图片分批次获取图片大小，避免多个图片同时下载导致的失败&lt;/li>
&lt;li>添加新浪微博分享，向朋友分享你的美图吧！
&lt;strong>1.0版&lt;/strong>update:2012-02-03****&lt;/li>
&lt;li>完全重构了一次代码，以前的代码写的很乱，趁春节在家重写一遍代码&lt;/li>
&lt;li>支持框架网页获取图片（例如猫扑）&lt;/li>
&lt;li>支持直接链接是图片的文本链接图片
&lt;strong>0.5版&lt;/strong>update:2011-12-15****&lt;/li>
&lt;li>修复CHROMEV15点击图片不删除的问题&lt;/li>
&lt;li>图片居中显示
&lt;strong>0.4版&lt;/strong>update:2011-03-06****&lt;/li>
&lt;li>添加选项选择使用标题保存还是固定名字目录
&lt;strong>0.3版&lt;/strong>update:2010-11-14****&lt;/li>
&lt;li>添加过滤链接&lt;/li>
&lt;li>保存输入的分辨率（在点“应用”按钮时自动保存，也可以在选项中保存）&lt;/li>
&lt;li>在筛选的输入框中按回车相当于点“应用”按钮&lt;/li>
&lt;/ol>
&lt;div> &lt;strong>0.2版 update:2010-09-18&lt;/strong>&lt;/div>
1. 添加删除单张图片
2. 修正图片分辨率
&lt;div> &lt;strong>0.1版&lt;/strong>&lt;/div>
0.1版完成了基本功能。还存在的问题 1.当图片太多时，筛选的速度有点慢。 2.缺少根据链接筛选 3.缺少去掉单个图片
&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-
&lt;del>PS:由于放在官方插件页面现在第一次居然要收5$的注册费！严重打击我写扩展的欲望！！！尽管Google有指导如何在自己打包自行在自己服务器上发布，但还是狠狠的鄙视一下Google!!&lt;/del>
&amp;nbsp;
&lt;del>Google已经严重打击我的热情了~至于这个扩展更新与否看心情了。。&lt;/del></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/batch-image-download/">Batch Image Download</category><category domain="https://fatkun.github.io/tags/chrome-extensions/">Chrome Extensions</category><category domain="https://fatkun.github.io/tags/%E6%89%B9%E9%87%8F%E4%B8%8B%E8%BD%BD%E5%9B%BE%E7%89%87/">批量下载图片</category><category domain="https://fatkun.github.io/tags/%E8%B0%B7%E6%AD%8C/">谷歌</category><category domain="https://fatkun.github.io/tags/%E8%B0%B7%E6%AD%8C%E6%89%A9%E5%B1%95/">谷歌扩展</category><category domain="https://fatkun.github.io/tags/%E8%B0%B7%E6%AD%8C%E6%B5%8F%E8%A7%88%E5%99%A8/">谷歌浏览器</category></item><item><title>Javascript正则表达式在线验证工具</title><link>https://fatkun.github.io/2010/09/javascript-regexpal.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/09/javascript-regexpal.html</guid><pubDate>Sat, 11 Sep 2010 06:21:48 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;img src="http://wah88w.blu.livefilestore.com/y1peBAaP-CY-yXWNrrAKh9hFlHzG7sje5LJJzK1ezMQK4lslINKLxDQaRElVwJMsQR6K5qoEGZAhe2flwPbfryEDKGUdCDH_coc/2010-09-11_regexp.png?psid=1" alt="">&lt;br>
regexpal用起来感觉还不错，可以高亮匹配的文字出来。想弄一个Chrome的扩展出来批量下载图片，感觉Chrome扩展还是蛮好学的，一个早上基本明白流程，如果你有点js基础~~&lt;br>
网址:&lt;a href="http://regexpal.com/">http://regexpal.com/&lt;/a>
附送一个简单的教程：&lt;a href="http://www.w3school.com.cn/js/jsref_obj_regexp.asp">http://www.w3school.com.cn/js/jsref_obj_regexp.asp&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/regex/">Regex</category><category domain="https://fatkun.github.io/tags/%E6%AD%A3%E5%88%99%E6%B5%8B%E8%AF%95/">正则测试</category></item><item><title>在MyEclipse Tomcat配置JNDI(mysql)</title><link>https://fatkun.github.io/2010/09/myeclipse-tomcat-jndi.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/09/myeclipse-tomcat-jndi.html</guid><pubDate>Sun, 05 Sep 2010 14:16:36 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在&amp;lt;workspace目录&amp;gt;.metadata.me_tcat\conf目录下找到context.xml文件&lt;br>
加入以下内容，按照需要进行更改&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;Resource name="jdbc/xxxx" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="1000" username="root" password="123"
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://127.0.0.1:3306/xxxxxxxxxx"
removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"/&amp;gt;&lt;/pre>
&lt;p>在Myeclipse安装目录找到类似下面的路径，可能你的和我不太一样&lt;br>
&amp;lt;Myeclipse安装目录&amp;gt;\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_8.5.0.me201003121946\tomcat\lib
复制mysql的驱动包进这个目录&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/jndi/">Jndi</category><category domain="https://fatkun.github.io/tags/myeclipse/">MyEclipse</category><category domain="https://fatkun.github.io/tags/mysql/">Mysql</category><category domain="https://fatkun.github.io/tags/tomcat/">Tomcat</category></item><item><title>Photoshop的自由变换（Ctrl+T）使用方法</title><link>https://fatkun.github.io/2010/09/photoshop-ctrl-t.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/09/photoshop-ctrl-t.html</guid><pubDate>Sat, 04 Sep 2010 09:05:58 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;img src="http://wah88w.blu.livefilestore.com/y1paVtBIieeAJhffeqXJReXM3M6BZZXHeIKLdqAISj6k5DqfK1k3ngf390IuU2JZ-mkd5Y6FwOJ6B-0_w1c3fUlXZunkEmpHo0M/ctrlt.png?psid=1" alt="">&lt;br>
感觉还是挺容易使用的。变换一下可以让上图中的字母贴近那里&lt;del>原来这么简单。&lt;br>
当图像处于自由变换的状态时（快捷键Ctrl+T），我们仅仅拖动鼠标可以改变图像形状。&lt;br>
可以用Ctrl或Shift或Alt+鼠标有其他效果&lt;/del>试试就知道了，文字上不好说~&lt;strong>不用注意到下面的文字这么麻烦，自己试试其实很简单的&lt;/strong>。&lt;/p>
&lt;p>————-摘录一篇文章—————–
来源：&lt;a href="http://photoshop.abang.com/od/gongju/a/ziyoubianhuan.htm">http://photoshop.abang.com/od/gongju/a/ziyoubianhuan.htm&lt;/a>
&lt;strong>一、按下Ctrl键加鼠标左键&lt;/strong>
1、拖动变形框四角任一角点时，图像为其它三点不动自由扭曲四边形；
2、拖动变形框四边任一中间点时，图像为对边不变的自由平行四边形。
&lt;strong>二、按下Shift键加鼠标左键&lt;/strong>
1、拖动变形框四角任一角点时，对角点位置不变，图像等比例放大或缩小，也可翻转图形；
2、鼠标左键在变形框外弧形拖动时，图像可作15°增量旋转角度，可作90°、180°顺逆旋转。
&lt;strong>三、按下Alt键加鼠标左键&lt;/strong>
1、拖动变形框四角任一角点时，图像中心位置不变，放大或缩小自由矩形，也可翻转图形；
2、拖动变形框四边任一中间点时，图像中心位置不变，等高或等宽自由矩形。
&lt;strong>四、按下Ctrl + Shift键加鼠标左键&lt;/strong>
1、拖动变形框四角任一角点时，图像可变为直角梯形，角点只可在坐标轴方向上移动；
2、拖动变形框四边任一中间点时，图像可变为等高或等宽的自由平行四边形，中间点只可在坐标轴方向上移动。
&lt;strong>五、按下Ctrl + Alt键加鼠标左键&lt;/strong>
1、拖动变形框四角任一角点时，图像相邻两角位置不变的菱形；
2、拖动变形框四边任一中间点时，图像相邻两边中间点位置不变的菱形。
&lt;strong>六、按下Shift + Alt键加鼠标左键&lt;/strong>
1、拖动变形框四角任一角点时，图像中心位置不变，等比例放大或缩小的矩形；
2、拖动变形框四边任一中间点时，图像中心位置不变，等高或等宽自由矩形。（作用同Alt键的第2点）
&lt;strong>七、按下Ctrl + Shift + Alt键加鼠标左键&lt;/strong>
1、拖动变形框四角任一角点时，图像可变为等腰梯形、三角形或相对等腰三角形；
2、拖动变形框四边任一中间点时，图像可变为中心位置不变，等高或等宽的自由平行四边形。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/photoshop/">Photoshop</category><category domain="https://fatkun.github.io/tags/ps/">Ps</category><category domain="https://fatkun.github.io/tags/%E8%87%AA%E7%94%B1%E5%8F%98%E6%8D%A2/">自由变换</category></item><item><title>在Windows使用apache搭建Mercurial版本控制服务</title><link>https://fatkun.github.io/2010/08/mercurial-server-with-apache.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/08/mercurial-server-with-apache.html</guid><pubDate>Sun, 29 Aug 2010 07:40:28 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>最近工作需要，建立一个本地版本控制服务，用来共享代码。搭建简单的SVN服务可以使用VisualSVN，但Mercurial有没有类似的工具呢？
&lt;span style="font-weight: normal;">权限控制可以看这篇文章 &lt;/span>&lt;a rel="bookmark" href="http://fatkun.com/2010/10/mercurial-authentication.html">&lt;span style="font-weight: normal;">Mercurial(HG)版本控制服务用户名验证&lt;/span>&lt;/a> &lt;span style="font-weight: normal;">&lt;/span>&lt;/p>
&lt;h2 id="使用serve">使用Serve&lt;/h2>
&lt;p>如果你需要简单的共享代码，可以直接使用TortoiseHG的Serve，可以push，pull，clone，不过没有什么验证。安全性不高，当然在内部网络这就可以了，但是同时只能提供一个项目的使用。&lt;br>
使用serve时push默认是不启用的，需要把Push require SSL设为False和Allow Push设为*&lt;/p>
&lt;h2 id="使用apache搭建">使用Apache搭建&lt;/h2>
&lt;p>如果你英文不错，可以到官方wiki这里看看~ 俺英文太菜了。。&lt;a href="http://mercurial.selenic.com/wiki/PublishingRepositories">http://mercurial.selenic.com/wiki/PublishingRepositories&lt;/a> ，
搜索了一下，再找到一篇文章，跟着这里做 &lt;a href="http://makinggames.ca/dev/version-control-mercurial-apache-tortoisehg/">http://makinggames.ca/dev/version-control-mercurial-apache-tortoisehg/&lt;/a>（依然是英文）&lt;/p>
&lt;h3 id="1准备工作">1.准备工作&lt;/h3>
&lt;p>下载&lt;a href="http://tortoisehg.bitbucket.org/" target="_blank">TortoiseHG&lt;/a>，&lt;a href="http://mercurial.selenic.com/" target="_blank">Mercurial v1.6&lt;/a>，&lt;a href="http://www.python.org/" target="_blank">Python v2.6&lt;/a>(建议使用此版本),&lt;a href="http://www.apachefriends.org/en/xampp.html" target="_blank">XAMPP v1.7.3&lt;/a>(比较简单的apache服务)，把上面的软件都安装了。&lt;/p>
&lt;h3 id="2注意事项">2.注意事项&lt;/h3>
&lt;ul>
&lt;li>最好是使用没有空格的路径！例如c:\Program Files这样的路径最好不要用，不然可能出现乱七八糟的错误。&lt;/li>
&lt;li>在配置文件中路径使用“/” 或者使用”\”，例如 “D:\xampp\htdocs”&lt;/li>
&lt;/ul>
&lt;h3 id="3创建repositories">3.创建&lt;strong>repositories&lt;/strong>&lt;/h3>
&lt;p>使用TortoiseHG在某个目录创建&lt;strong>repositorie，我的目录是F:\workspace\hg&lt;/strong>&lt;/p>
&lt;h3 id="4配置">&lt;strong>4.配置&lt;/strong>&lt;/h3>
&lt;p>从Mercurial中找到library.zip(注意是Mercurial里的，不是TortoiseHG的library.zip，不然会出错！！)，解压到一个目录，我这里是解压到&lt;span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">&lt;strong>D:\xampplite\mlib&lt;/strong>目录，把Mercurial中templates目录同样复制到此目录下。&lt;/span>
在xampp安装目录htdocs下，建立一个hg文件夹&lt;br>
&lt;xampp install>\htdocs\hg&lt;br>
在hg目录下，建立一个&lt;strong>hgwebdir.cgi&lt;/strong>文件，把下面的内容拷贝进去&lt;/p>
&lt;pre escaped="true" lang="python" line="1">#!C:/Python26/python.exe
#
# An example CGI script to export multiple hgweb repos, edit as necessary
# 配置为你的library.zip解压的目录:
import sys
sys.path.insert(0, "D:\\xampplite\\mlib")
from mercurial import demandimport;
demandimport.enable()
import cgitb
cgitb.enable()
#import os
#os.environ["HGENCODING"] = "UTF-8"
from mercurial.hgweb.hgwebdir_mod import hgwebdir
import mercurial.hgweb.wsgicgi as wsgicgi
application = hgwebdir('hgweb.config')
wsgicgi.launch(application)&lt;/pre>
&lt;p>注意第一行中的#!C:/Python26/python.exe改为你python.exe所在的路径&lt;br>
sys.path.insert(0, “D:\xampplite\mlib”)这句中的D:\xampplite\mlib是上面把library.zip解压的目录&lt;br>
再建立一个&lt;strong>hgweb.config&lt;/strong>文件&lt;/p>
&lt;pre escaped="true" lang="xml" line="1">[collections]
F:/workspace/hg = F:/workspace/hg
[web]
allow_push =*
push_ssl = false
style = gitweb&lt;/pre>
&lt;p>上面的&lt;strong>F:/workspace/hg&lt;/strong>请换为你自己的项目的存放目录
最后一步
打开ampp/apache/conf/httpd.conf文件，在最末尾加入&lt;/p>
&lt;pre escaped="true" lang="xml" line="1"># 版本管理
ScriptAliasMatch ^/hg(.*) D:/xampplite/htdocs/hg/hgwebdir.cgi$1
&amp;lt;Directory "D:/xampplite/htdocs/hg"&amp;gt;
Options ExecCGI FollowSymLinks
#去掉SSLRequireSSL的#号就强迫使用ssl来访问
#SSLRequireSSL
&amp;lt;/Directory&amp;gt;&lt;/pre>
&lt;p>现在试试重启你的apache服务吧，重启后，通过_&lt;a href="https://localhost/hg/" target="_blank">https://localhost/hg/&lt;/a>&lt;span style="font-style: normal;">访问&lt;/span>_&lt;/p>
&lt;h2 id="_span-stylefont-style-normal错误处理span_">&lt;em>&lt;span style="font-style: normal;">错误处理&lt;/span>&lt;/em>&lt;/h2>
&lt;p>Premature end of script headers: hgwebdir.cgi
如果遇到这个问题，建议把它改为hgwebdir.py，用python运行检查一下出现什么错误，注意路径中有空格要用双引号括起来，路径用”/”来隔开。最终会有个SCRIPT的错误，没关系，把它改回hgwebdir.cgi就可以从网页上浏览了。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/apache/">Apache</category><category domain="https://fatkun.github.io/tags/mercurial/">Mercurial</category><category domain="https://fatkun.github.io/tags/%E6%90%AD%E5%BB%BA%E6%9C%8D%E5%8A%A1/">搭建服务</category><category domain="https://fatkun.github.io/tags/%E6%9C%8D%E5%8A%A1%E5%99%A8/">服务器</category><category domain="https://fatkun.github.io/tags/%E7%89%88%E6%9C%AC%E6%9C%8D%E5%8A%A1/">版本服务</category></item><item><title>Windows平台Apache2.x配置SSL</title><link>https://fatkun.github.io/2010/08/win32-apache-ssl.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/08/win32-apache-ssl.html</guid><pubDate>Sat, 28 Aug 2010 06:32:39 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>需要在apache配置SSL，所以找了几篇文章，摘录如下：&lt;br>
参考网址：&lt;br>
&lt;a href="http://mdjhaitao.blog.163.com/blog/static/10143121200772333432345/">Windows平台下Apache2.2.4的SSL配置过程(及错误整理)&lt;/a>&lt;br>
&lt;a href="http://wangxiaojs.javaeye.com/blog/294328">Windows环境下配置Apache 2.2.x + SSL&lt;/a>
——————-摘录部分By fatkun，部分有删改简化————————&lt;/p>
&lt;h2 id="安装apache">安装Apache&lt;/h2>
&lt;p>下载带有SSL的Apache，&lt;a href="http://httpd.apache.org/download.cgi">http://httpd.apache.org/download.cgi&lt;/a>（Win32 Binary including OpenSSL 0.9.8o (MSI Installer)）&lt;br>
安装以后，需要配置SSL。
打开conf/httpd.conf文件&lt;br>
默认目录为：C:\Program Files\Apache Software Foundation\Apache2.2\conf
将下面两行前面的#号去掉：&lt;br>
LoadModule ssl_module modules/mod_ssl.so&lt;br>
Include conf/extra/httpd-ssl.conf&lt;/p>
&lt;h2 id="生成ssl证书">生成SSL证书&lt;/h2>
&lt;p>到这一步，剩下的就是如何生成SSL配置所需要的两个文件了：&lt;br>
server.crt&lt;br>
server.key
打开CMD，cd切换到C:\Program Files\Apache Software Foundation\Apache2.2\bin目录下运行以下命令&lt;br>
首先需要建立证书签名请求和私钥文件：&lt;/p>
&lt;pre lang="bash" escaped="true">openssl req -config ..\conf\openssl.cnf -new -out server.csr&lt;/pre>
&lt;p>它会问一系列的问题，第一个是密码，要记住，下一步要用到&lt;br>
然后RSA签名：&lt;/p>
&lt;pre lang="bash" escaped="true">openssl rsa -in privkey.pem -out server.key&lt;/pre>
&lt;p>最后创建自签证书：&lt;/p>
&lt;pre lang="bash" escaped="true">openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 4000&lt;/pre>
&lt;p>完成之后，将生成的server.crt和server.key这两个文件拷贝到apache的conf目录下。
现在使用https://www.yourdomain.com，应该就可以看到It works了。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/apache/">Apache</category><category domain="https://fatkun.github.io/tags/ssl/">SSL</category><category domain="https://fatkun.github.io/tags/win32/">Win32</category></item><item><title>推荐印度电影《三个白痴》(3 Idiots)</title><link>https://fatkun.github.io/2010/08/3-idiots.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/08/3-idiots.html</guid><pubDate>Wed, 18 Aug 2010 14:58:03 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这部电影讲述一个教育的问题，指出填鸭式的教育并不恰当，应该跟随自己的心~真的很值得看一下，是很开心很感动的片子，并不会沉闷！Fatkun诚意推荐！
IMDB的评分为8.1分，而且国内对此片的评价也不错~附上Verycd下载地址：&lt;a href="http://www.verycd.com/topics/2837224/">http://www.verycd.com/topics/2837224/&lt;/a>&lt;br>
&lt;img src="http://img2.douban.com/view/photo/photo/public/p579722647.jpg" alt="">&lt;br>
&lt;img src="http://img2.douban.com/view/photo/photo/public/p579724286.jpg" alt="">&lt;/p>
&lt;h2 id="经典语录">经典语录&lt;/h2>
&lt;ul>
&lt;li>All Is Well&lt;/li>
&lt;li>一切为了分数，一切为了工作！&lt;/li>
&lt;li>为什么一生下来父母就帮我们决定我们长大要做什么，从来没人问我们想做什么。&lt;/li>
&lt;li>爸爸，如果我是一个摄影师，我可能赚更少，车会更小，房子会更小，但我会幸福，我真的会幸福！&lt;/li>
&lt;li>如果迈克尔·杰克逊的爸爸逼他成为拳击手，拳王阿里的爸爸非要他去唱歌，想想后果会有多恐怖！&lt;/li>
&lt;li>他们不是自杀，而是被谋杀。&lt;/li>
&lt;/ul>
&lt;h2 id="预告片">预告片&lt;/h2></description><category domain="https://fatkun.github.io/categories/%E6%90%9E%E7%AC%91%E5%A8%B1%E4%B9%90/">搞笑娱乐</category><category domain="https://fatkun.github.io/tags/%E4%B8%89%E4%B8%AA%E7%99%BD%E7%97%B4/">三个白痴</category><category domain="https://fatkun.github.io/tags/%E4%B8%89%E5%82%BB%E5%A4%A7%E9%97%B9%E5%AE%9D%E8%8E%B1%E5%9D%9E/">三傻大闹宝莱坞</category><category domain="https://fatkun.github.io/tags/%E6%90%9E%E7%AC%91/">搞笑</category><category domain="https://fatkun.github.io/tags/%E6%95%99%E8%82%B2%E7%89%87/">教育片</category></item><item><title>纯粹试试SkyDriver图床</title><link>https://fatkun.github.io/2010/08/skydriver-picture.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/08/skydriver-picture.html</guid><pubDate>Mon, 16 Aug 2010 16:16:37 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>微软提供的25G空间，听说图片的地址是可以外链的，测试一下。
&lt;img class="alignnone" title="mm" src="http://wahq8w.blu.livefilestore.com/y1pZ2Rj5TrsoAbUctPYgx8FJ73rhvnhFm7xevnVbaihkk9Ff0NaLCAsP8RxCzDVYrdvJYMPgRc7YhtVSdzM9jNahhdzRCxj-Gds/20090413_3c2cb5521c364c9c83eeu3CndOklaKtc.jpg?psid=1" alt="" width="450" height="600" />&lt;br>
除了上面那张MM，fatkun还附带壁纸一张，绝对有惊喜，嘿嘿，你懂的，点进来看看预览图吧~~&lt;/p>
&lt;p>&lt;a href="http://wahq8w.blu.livefilestore.com/y1pZhfnewqkveF_udVtHo0ltsHF-I4MgugQEC4C1PJIkgtgCuzXf0uHopm-xCTJ5F7JURQvondJna0FGdQ1c1ESpohNQFrTJBGU/01.jpg?psid=1">点我下载&lt;/a>&lt;br>
&lt;img src="http://wahq8w.blu.livefilestore.com/y1pZhfnewqkveF_udVtHo0ltsHF-I4MgugQEC4C1PJIkgtgCuzXf0uHopm-xCTJ5F7JURQvondJna0FGdQ1c1ESpohNQFrTJBGU/01.jpg?psid=1" alt="">&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/skydriver%E5%9B%BE%E5%BA%8A/">SkyDriver图床</category><category domain="https://fatkun.github.io/tags/skydriver%E5%A4%96%E9%93%BE/">SkyDriver外链</category></item><item><title>最近有点忙</title><link>https://fatkun.github.io/2010/08/busy.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/08/busy.html</guid><pubDate>Sun, 15 Aug 2010 15:51:07 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>1、有机会出去实习，明天又要上班了&lt;del>每天8点起床坐着公交，到了实习地点，基本坐一天，写代码，晚上5点回宿舍~回到宿舍基本啥都不想干&lt;/del>电脑都不想开，前一个星期比较忙，接下来应该不用太忙了，一切进度都还好。
2、前段时间看完Thinking in java的想法又因为实习没能坚持下去~不知道要到什么时候才能接着看下去呢~
3、博客空间终于有着落了，非常好人的&lt;a href="http://evlos.org">小邪&lt;/a>赞助了我空间，在此灰常感谢小邪~ 小邪的博客里面有很多关于php的文章，还有一些wordpress方面的插件与技巧，有兴趣的可以&lt;a href="http://evlos.org">点这里&lt;/a>前去围观~
虽然博客人气依然很少，但作为自己的一个技术记录&amp;amp;收集，能帮到自己和别人还是挺好的。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>美国保镖面试，逗死了，老大</title><link>https://fatkun.github.io/2010/08/bodyguard.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/08/bodyguard.html</guid><pubDate>Mon, 09 Aug 2010 16:41:00 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>挺搞笑的。。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%90%9E%E7%AC%91%E5%A8%B1%E4%B9%90/">搞笑娱乐</category><category domain="https://fatkun.github.io/tags/%E4%BF%9D%E9%95%96/">保镖</category></item><item><title>韩国动画《闹钟》</title><link>https://fatkun.github.io/2010/08/alarm-clock.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/08/alarm-clock.html</guid><pubDate>Sat, 07 Aug 2010 10:47:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>画面很有质感，中国的动画比较少做到这么细致的。。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%90%9E%E7%AC%91%E5%A8%B1%E4%B9%90/">搞笑娱乐</category><category domain="https://fatkun.github.io/tags/%E9%97%B9%E9%92%9F/">闹钟</category><category domain="https://fatkun.github.io/tags/%E9%9F%A9%E5%9B%BD%E5%8A%A8%E7%94%BB/">韩国动画</category></item><item><title>国外wordpress主题-alltuts</title><link>https://fatkun.github.io/2010/08/alltuts.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/08/alltuts.html</guid><pubDate>Thu, 05 Aug 2010 16:56:48 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>一个不错的Wordpress主题&lt;br>
Demo:&lt;a href="http://wordpress.site5.net/alltuts/">http://wordpress.site5.net/alltuts/&lt;/a>
点此下载 – 》&lt;a href="http://www.site5.com/wordpress-themes/download.php?file=alltuts_files_and_plugins.zip">官方下载&lt;/a>
由于主题集成了twitter，国内使用需打开sidebar.php，删除下面的代码，否则会一直显示加载中．&lt;/p>
&lt;script type=&amp;#8221;text/javascript&amp;#8221; src=&amp;#8221;http://twitter.com/javascripts/blogger.js&amp;#8221;>&lt;/script>
&lt;script type=&amp;#8221;text/javascript&amp;#8221; src=&amp;#8221;http://twitter.com/statuses/user\_timeline/&lt;?php echo get\_option(&amp;#8216;alltuts\_twitter\_user&amp;#8217;); ?>.json?callback=twitterCallback2&amp;count=&lt;?php
if(get\_option(&amp;#8216;alltuts\_number_tweets&amp;#8217;)!=&amp;#8221;&amp;#8221;){
echo get\_option(&amp;#8216;alltuts\_number_tweets&amp;#8217;);
}else{
echo &amp;#8220;1&amp;#8221;;
} ?>&amp;#8221;>&lt;/script>
&lt;p>首页缩略图设置：编辑文章页面，右下特色图片－＞设置特色图片，上传图片，然后选择＂用作特色图片＂。
&lt;a href="http://www.flickr.com/photos/fatkun/4863086081/" title="alltutorials">&lt;img src="http://farm5.static.flickr.com/4098/4863086081_cf8cdba28c_z.jpg" alt="alltutorials">&lt;/a>{.flickr-image.alignnone}&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/wordpress%E4%B8%BB%E9%A2%98/">Wordpress主题</category></item><item><title>暑期大学生博客分享大赛 – 2010 Android 篇</title><link>https://fatkun.github.io/2010/08/google-andorid-share.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/08/google-andorid-share.html</guid><pubDate>Thu, 05 Aug 2010 03:44:10 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>很久之前就有看到这个了，直到今天才提交&lt;del>为了混一件android T-shirt，决定还是提交上去了。。喔呵呵。。。如果你也有同样的意愿，不如写篇文章，也许能拿大奖~android手机一台啊&lt;/del>
—————————–
&lt;a href="http://www.google.com/intl/zh-CN/daxue/blog2010/index.html">http://www.google.com/intl/zh-CN/daxue/blog2010/index.html&lt;/a>&lt;/p>
&lt;h2 id="2010-年首届-google-暑期大学生博客分享大赛开赛啦今年的主题是-android">2010 年，首届 Google 暑期大学生博客分享大赛开赛啦——今年的主题是 Android！&lt;/h2>
&lt;div> &lt;div> &lt;a href="https://www.google.com/appserve/fb/forms/cndaxueblog2010/">立即报名&lt;/a> &lt;/div>&lt;/div>
Android 是 Google 2007 年推出的基于 Linux 的开源手机操作系统。我们相信 Android 的未来关键取决于能为手机用户带来惊喜而有趣的各种应用。无论你在尝试 Android应用开发，有 Android 应用的好创意、好点子，或者有使用 Android 手机的精彩故事，即使没有亲自用过 Android 手机，也可以畅想一下你心目中的 Android 手机。赶快来参加我们首届博客分享大赛。以博客形式分享，就有机会赢得 Android 智能手机！
我们期待大家的参与！
## 参赛对象
&lt;p>全日制在校大学生，包括大专生、本科生、硕士生、博士生。&lt;/p>
&lt;h2 id="博客要求">博客要求&lt;/h2>
&lt;ol id="requirement"> &lt;li id="requirement-1"> &lt;h3> 主题明确 &lt;/h3>
&lt;p> 请围绕Android手机应用分享你自己的精彩故事或者创意点子，请围绕以下主题，动手写博文分享吧！ &lt;/p>
&lt;ul> &lt;li> 主题 1：&lt;strong>分享开发 Android 手机应用的开发经验&lt;/strong>。比如晒一下你是如何在 Android 平台上一步一步开发应用程序的；比如分享一下你开发过程中，有哪些捷径或者又走过哪些弯路等等。 &lt;/li>
&lt;li> 主题 2：&lt;strong>分享 Android 手机应用创意或点子&lt;/strong>。如果你不具备开发能力也不要紧，只需要创意的点子也可以。比如秀一下您心目中在 Android 手机上应该有哪些实用的或者好玩的小应用；比如说一说你觉得大学生都喜欢什么样的 Android 手机应用等等。 &lt;/li>
&lt;li> 主题 3：&lt;strong>体验 Android 手机的精彩小故事或者憧憬一下你心目中的 Android 手机&lt;/strong>。讲一下你在生活中使用 Android 手机一些不同寻常的小故事；没用过 Android 手机也没关系，可以畅想一下您心目中的 Android 手机应该是个什么样子。:) &lt;/li> &lt;/ul>
&lt;p> 注意：请大家在博文中加入“首届 Google 暑期大学生博客分享大赛——2010 Andriod 篇”作为本次大赛的参赛标识，谢谢！&lt;/li>
&lt;pre>&lt;code> &amp;lt;li id=&amp;quot;requirement-2&amp;quot;&amp;gt; &amp;lt;h3&amp;gt; 形式多样 &amp;lt;/h3&amp;gt;
&amp;lt;p&amp;gt; 文字、图片或视频形式均可，我们鼓励大家采用多种形式&amp;lt;/li&amp;gt;
&amp;lt;li id=&amp;quot;requirement-3&amp;quot;&amp;gt; &amp;lt;h3&amp;gt; 篇幅适当 &amp;lt;/h3&amp;gt; &amp;lt;/li&amp;gt;
&amp;lt;li id=&amp;quot;requirement-4&amp;quot;&amp;gt; &amp;lt;h3&amp;gt; 博文能够被其他同学们正常访问 &amp;lt;/h3&amp;gt; &amp;lt;/li&amp;gt;
&amp;lt;li id=&amp;quot;requirement-5&amp;quot;&amp;gt; &amp;lt;h3&amp;gt; 若能记录访问量、浏览量等信息，请设置此功能 &amp;lt;/h3&amp;gt; &amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;
&amp;lt;h2&amp;gt; 大赛日程 &amp;lt;/h2&amp;gt;
&amp;lt;table id=&amp;quot;keydates&amp;quot;&amp;gt; &amp;lt;tr&amp;gt; &amp;lt;th&amp;gt; 7月5日 &amp;lt;/th&amp;gt;
&amp;lt;td&amp;gt; 大赛启动 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;th&amp;gt; 7月5日～8月15日 &amp;lt;/th&amp;gt;
&amp;lt;td&amp;gt; 参赛者提交参赛作品 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;th&amp;gt; 8月16日～8月30日 &amp;lt;/th&amp;gt;
&amp;lt;td&amp;gt; 大赛评委评选优秀参赛作品 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;th&amp;gt; 9月1日～9月15日 &amp;lt;/th&amp;gt;
&amp;lt;td&amp;gt; 优秀参赛作品的网络公投 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;th&amp;gt; 9月20日 &amp;lt;/th&amp;gt;
&amp;lt;td&amp;gt; 公布获奖名单 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt; &amp;lt;th&amp;gt; 9月21日 &amp;lt;/th&amp;gt;
&amp;lt;td&amp;gt; 开始派发奖品 &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt; &amp;lt;/table&amp;gt;
&amp;lt;h2&amp;gt; 奖项设置 &amp;lt;/h2&amp;gt;
&amp;lt;ul&amp;gt; &amp;lt;li&amp;gt; 一等奖（3个）： &amp;lt;ul&amp;gt; &amp;lt;li&amp;gt; Android应用最佳开发经验分享奖（1个）：Android高端智能手机1部 &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt; Android应用最佳创意点子分享奖（1个）：Android高端智能手机1部 &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt; Android最佳体验或憧憬分享奖（1个）：Android高端智能手机1部 &amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt; &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt; 优胜奖（100个）：Android双肩背包1个 &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt; 参与奖（按参赛要求成功提交参赛博客链接 ）：Android T-shirt &amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;
&amp;lt;h2&amp;gt; 评审标准 &amp;lt;/h2&amp;gt;
&amp;lt;ul&amp;gt; &amp;lt;li&amp;gt; 切合主题明确 &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt; 流览次数 &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt; 原创性 &amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt; 创造性、新颖性 &amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;
&amp;lt;h2&amp;gt; 如何参赛 &amp;lt;/h2&amp;gt;
&amp;lt;p&amp;gt; 你可以将博文发表在自己的网站上或者任何一家博客网站，你只要提交该博文的固定引用链接，并做到你的博文自提交日起一年内可以被正常访问，即可参赛。请&amp;lt;a href=&amp;quot;https://www.google.com/appserve/fb/forms/cndaxueblog2010/&amp;quot;&amp;gt;点击这里&amp;lt;/a&amp;gt;参赛，加油！ &amp;lt;/p&amp;gt;&lt;/code>&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>更换新的免费空间</title><link>https://fatkun.github.io/2010/08/new-web-host.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/08/new-web-host.html</guid><pubDate>Sun, 01 Aug 2010 16:00:05 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>000webhost.com实在是忍受不了了，老是不能访问。。这次换一个新的空间，x10hosting.com的。不知道效果怎样，依然是免费空间~~初步发现不支持gzip，其他一切还好。顺便把博客升级到3.01，使用了非官方的中文版wordpress，不知道官方中文版的人是不是还没过完年呢。。
update(2010-08-05):使用&lt;strong>cos-html-cache&lt;/strong>插件变成文章静态化了，这样应该不会那么容易断线了吧。。不用读数据库。。。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E5%85%8D%E8%B4%B9%E7%A9%BA%E9%97%B4/">免费空间</category></item><item><title>Java的访问控制</title><link>https://fatkun.github.io/2010/07/java-access.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/java-access.html</guid><pubDate>Fri, 30 Jul 2010 09:00:55 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="包package">包（Package）&lt;/h2>
&lt;ol>
&lt;li>创建自己的包时，要求 package语句必须是文件中的第一个“非注释”代码。&lt;/li>
&lt;li>如果类名冲突时，可这样写java.util.Vector v = new java.util.Vector();&lt;/li>
&lt;li>可能（但并常见）有一个编译单元根本没有任何公共类。此时，可按自己的意愿任意指定文件名。&lt;/li>
&lt;/ol>
&lt;h2 id="访问控制">访问控制&lt;/h2>
&lt;table border="0" cellspacing="0" cellpadding="0" width="584"> &lt;tr> &lt;td width="105"> &lt;p align="center"> &lt;strong>修饰符&lt;/strong> &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> &lt;strong>类内部&lt;/strong> &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> &lt;strong>同一个包&lt;/strong> &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> &lt;strong>子类&lt;/strong> &lt;/p> &lt;/td>
&lt;td width="149"> &lt;p align="center"> &lt;strong>任何地方&lt;/strong> &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="105"> &lt;p align="center"> private &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> √ &lt;/p> &lt;/td>
&lt;td width="87"> &lt;/td>
&lt;td width="104"> &lt;/td>
&lt;td width="149"> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="105"> &lt;p align="center"> default &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> √ &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> √ &lt;/p> &lt;/td>
&lt;td width="104"> &lt;/td>
&lt;td width="149"> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="105"> &lt;p align="center"> protected &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> √ &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> √ &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> √ &lt;/p> &lt;/td>
&lt;td width="149"> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="105"> &lt;p align="center"> public &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> √ &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> √ &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> √ &lt;/p> &lt;/td>
&lt;td width="149"> &lt;p align="center"> √ &lt;/p> &lt;/td> &lt;/tr>&lt;/table>
类的修饰符只有public 和 default，默认时只能被同一个文件或包内访问。
&lt;p>&lt;strong>下面是代码解释&lt;/strong>&lt;/p>
&lt;pre escaped="true" lang="java" line="1">//PackageClass.java
package com.fatkun.util;
/**
* 在包com.fatkun.util内，分别有a,b,c,d四个变量，它们的修饰符都不一样。
* @author fatkun
*
*/
public class PackageClass {
private int a;
int b;
protected int c;
public int d;
public static void main(String[] args) {
PackageClass p = new PackageClass();
System.out.println(p.a);
System.out.println(p.b);
System.out.println(p.c);
System.out.println(p.d);
new InsideClass();
}
}
class InsideClass {
}&lt;/pre>
&lt;pre escaped="true" lang="java" line="1">//AnotherPackageClass.java
package com.fatkun.util;
/**
* 同一个包内的类，private的不能访问
* @author fatkun
*
*/
public class AnotherPackageClass {
public static void main(String[] args){
PackageClass p = new PackageClass();
System.out.println(p.a);//private只能在类内部访问
System.out.println(p.b);
System.out.println(p.c);
System.out.println(p.d);
//内部类在同一个包内可以访问
new InsideClass();
}
}&lt;/pre>
&lt;pre escaped="true" lang="java" line="1">//ExtendClass.java
import com.fatkun.util.*;
/**
* PackageClass的子类
* @author fatkun
*
*/
public class ExtendClass extends PackageClass {
public static void main(String[] args) {
ExtendClass e = new ExtendClass();
System.out.println(e.a);//private只能在类内部访问
System.out.println(e.b);//default只能在类内部和同一个包内访问
System.out.println(e.c);//protect能在子类访问
System.out.println(e.d);
//内部类在子类不可以访问
new InsideClass();
}
}&lt;/pre>
&lt;pre escaped="true" lang="java" line="1">//DefaultClass.java
import com.fatkun.util.*;
/**
* 不同包内
* @author fatkun
*
*/
public class DefaultClass {
public static void main(String[] args) {
PackageClass p = new PackageClass();
System.out.println(p.a);//private只能在类内部访问
System.out.println(p.b);//default只能在类内部和同一个包内访问
System.out.println(p.c);//protect只能在类内部、同一个包、子类访问
System.out.println(p.d);//public能在任何地方访问
//内部类在不同包内不可以访问
new InsideClass();
}
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java%E5%9F%BA%E7%A1%80/">Java基础</category><category domain="https://fatkun.github.io/tags/thinking-in-java-%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">Thinking in Java 读书笔记</category><category domain="https://fatkun.github.io/tags/%E6%9D%83%E9%99%90/">权限</category></item><item><title>Java运算符优先级(表格)</title><link>https://fatkun.github.io/2010/07/java-operator-priority.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/java-operator-priority.html</guid><pubDate>Wed, 28 Jul 2010 14:45:18 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Java运算符优先级参考图表
本文来源 &lt;a href="http://blog.csdn.net/xiaoli_feng/archive/2009/09/18/4567184.aspx">http://blog.csdn.net/xiaoli_feng/archive/2009/09/18/4567184.aspx&lt;/a>&lt;/p>
&lt;table border="1" cellspacing="0" cellpadding="0"> &lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 优先级 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> 运算符 &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 结合性 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 1 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> () [] . &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从左到右 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 2 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> ! +(正)  -(负) ~ ++ &amp;#8212; &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从右向左 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 3 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> * / % &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从左向右 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 4 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> +(加) -(减) &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从左向右 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 5 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> &lt;&lt; >> >>> &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从左向右 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 6 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> &lt; &lt;= > >= instanceof &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从左向右 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 7 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> ==   != &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从左向右 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 8 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> &amp;(按位与) &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从左向右 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 9 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> ^ &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从左向右 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 10 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> | &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从左向右 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 11 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> &amp;&amp; &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从左向右 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 12 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> || &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从左向右 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 13 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> ?: &lt;/p> &lt;/td>
&lt;td width="85" valign="top"> &lt;p align="left"> 从右向左 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="73" valign="top"> &lt;p align="left"> 14 &lt;/p> &lt;/td>
&lt;td width="462" valign="top"> &lt;p align="left"> = += -= *= /= %= &amp;= |= ^=  ~=  &lt;&lt;= >>= >>>= &lt;/p> &lt;/td>
&lt;td width="85"> &lt;p align="left"> 从右向左 &lt;/p> &lt;/td> &lt;/tr>&lt;/table>
说明：
1、 该表中优先级按照从高到低的顺序书写，也就是优先级为1的优先级最高，优先级14的优先级最低。
2、 结合性是指运算符结合的顺序，通常都是从左到右。从右向左的运算符最典型的就是负号，例如3+-4，则意义为3加-4，符号首先和运算符右侧的内容结合。
3、 instanceof作用是判断对象是否为某个类或接口类型。
4、 注意区分正负号和加减号，以及按位与和逻辑与的区别
其实在实际的开发中，不需要去记忆运算符的优先级别，也不要刻意的使用运算符的优先级别，对于不清楚优先级的地方使用小括号去进行替代，示例代码：
int m = 12;
int n = m &lt;&lt; 1 + 2;
int n = m &lt;&lt; (1 + 2); //这样更直观
这样书写代码，更方便编写代码，也便于代码的阅读和维护。</description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java%E5%9F%BA%E7%A1%80/">Java基础</category><category domain="https://fatkun.github.io/tags/thinking-in-java-%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">Thinking in Java 读书笔记</category></item><item><title>Java的重载(Overload)与重写(Override)</title><link>https://fatkun.github.io/2010/07/java-overload-and-overrid.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/java-overload-and-overrid.html</guid><pubDate>Wed, 28 Jul 2010 14:10:25 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="重载与重写之间的差别">重载与重写之间的差别&lt;/h2>
&lt;table border="0" cellspacing="0" cellpadding="0" width="492"> &lt;tr> &lt;td width="72"> &lt;p align="left"> &lt;strong>区别点&lt;/strong> &lt;/p> &lt;/td>
&lt;td width="80"> &lt;p align="left"> &lt;strong>重载方法&lt;/strong> &lt;strong> &lt;/strong> &lt;/p> &lt;/td>
&lt;td width="340"> &lt;p align="left"> &lt;strong>重写方法&lt;/strong> &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="72"> &lt;p align="left"> 参数列表 &lt;/p> &lt;/td>
&lt;td width="80"> &lt;p align="left"> 必须修改 &lt;/p> &lt;/td>
&lt;td width="340"> &lt;p align="left"> 一定不能修改 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="72"> &lt;p align="left"> 返回类型 &lt;/p> &lt;/td>
&lt;td width="80"> &lt;p align="left"> 可以修改 &lt;/p> &lt;/td>
&lt;td width="340"> &lt;p align="left"> 一定不能修改 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="72"> &lt;p align="left"> 异常 &lt;/p> &lt;/td>
&lt;td width="80"> &lt;p align="left"> 可以修改 &lt;/p> &lt;/td>
&lt;td width="340"> &lt;p align="left"> 可以减少或删除，一定不能抛出新的或者更广的异常 &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="72"> &lt;p align="left"> 访问 &lt;/p> &lt;/td>
&lt;td width="80"> &lt;p align="left"> 可以修改 &lt;/p> &lt;/td>
&lt;td width="340"> &lt;p align="left"> 一定不能做更严格的限制（可以降低限制） &lt;/p> &lt;/td> &lt;/tr>&lt;/table>
## 重载（Overload）
&lt;p align="left"> 每个重载的方法（或者构造函数）都必须有一个独一无二的参数类型列表。&lt;br /> 只能重载构造函数&lt;br /> 规则&lt;/p>
* 被重载的方法**&lt;span style="text-decoration: underline;">必须&lt;/span>**改变参数列表；
* 被重载的方法**可以**改变返回类型；
* 被重载的方法**可以**改变访问修饰符；
* 被重载的方法**可以**声明新的或更广的检查异常；
* 方法能够在同一个类中或者在一个子类中被重载。
&lt;pre escaped="true" lang="java" line="1">package com.fatkun;
&lt;p>/**&lt;/p>
&lt;ul>
&lt;li>Overloading（重载，过载）&lt;/li>
&lt;li>方法名相同，参数类型不同或者参数类型顺序不同&lt;/li>
&lt;li>返回值，访问修饰符，异常可以不一样&lt;/li>
&lt;li>@author fatkun&lt;/li>
&lt;li>&lt;/li>
&lt;/ul>
&lt;p>*/
public class Overloading {&lt;/p>
&lt;pre>&lt;code>public int test(){
System.out.println(&amp;quot;test1&amp;quot;);
return 1;
}
public void test(int a){
System.out.println(&amp;quot;test2&amp;quot;);
}
//以下两个参数类型顺序不同
public String test(int a,String s){
System.out.println(&amp;quot;test3&amp;quot;);
return &amp;quot;returntest3&amp;quot;;
}
public String test(String s,int a){
System.out.println(&amp;quot;test4&amp;quot;);
return &amp;quot;returntest4&amp;quot;;
}
public static void main(String[] args){
Overloading o = new Overloading();
System.out.println(o.test());
o.test(1);
System.out.println(o.test(1,&amp;quot;test3&amp;quot;));
System.out.println(o.test(&amp;quot;test4&amp;quot;,1));
}&amp;lt;/pre&amp;gt;
&lt;/code>&lt;/pre>
&lt;h2 id="重写override">重写（Override）&lt;/h2>
&lt;p align="left"> 能够在需要新的子类特有行为时重新在子类中定义方法。&lt;br /> 规则&lt;/p>
* 参数列表**&lt;span style="text-decoration: underline;">必须完全&lt;/span>**与被重写方法的相同；
* 返回类型**&lt;span style="text-decoration: underline;">必须完全&lt;/span>**与被重写方法的返回类型相同；
* 访问级别的限制性**一定不能**比被重写方法的强；
* 访问级别的限制性可以比被重写方法的弱；
* 重写方法**一定不能抛出新的检查异常或比被重写的方法声明的检查异常更广泛**的检查异常
* 重写的方法能够抛出更少或更有限的异常（也就是说，被重写的方法声明了异常，但重写的方法可以什么也不声明）
* **不能重写被标示为****final****的方法**；
* 如果不能继承一个方法，则不能重写这个方法。
&lt;pre escaped="true" lang="java" line="1">package com.fatkun;
&lt;p>/**&lt;/p>
&lt;ul>
&lt;li>Overriding(重写，覆盖)&lt;/li>
&lt;li>重写是子类继承父类对父类的方法进行修改。方法名，参数，返回值必须一样。&lt;/li>
&lt;li>访问级别的限制性和异常不能比被重写的方法强&lt;/li>
&lt;li>@author fatkun&lt;/li>
&lt;li>&lt;/li>
&lt;/ul>
&lt;p>*/
class TestClass {
public void test(){
System.out.println(&amp;quot;这是TestClass的test方法&amp;quot;);
}
}&lt;/p>
&lt;p>public class Overriding extends TestClass {&lt;/p>
&lt;pre>&lt;code>public static void main(String[] args) {
new Overriding().test();
}
@Override
public void test() {
System.out.println(&amp;quot;这是Overriding的test方法，重写了TestClass中的方法&amp;quot;);
}
&lt;/code>&lt;/pre>
&lt;p>}&lt;/pre>&lt;/p>
&lt;h2 id="调用">调用&lt;/h2>
&lt;p>重载方法：&lt;br>
参数类型决定选择哪个重载版本（根据声明的参数类型），这发生在编译时。被调用的实际方法仍是发生在运行时期的虚拟方法调用。但是编译器已经知道所调用的方法的签名。因此，在运行时期，参数匹配已经明确，只是还不知道该方法所在的实际类。&lt;br>
重写方法：&lt;br>
对象类型（即：堆上实际实例的类型决定调用选择哪个方法，这发生在运行时期）
文章来源:&lt;a href="http://chen1984.javaeye.com/blog/353342">http://chen1984.javaeye.com/blog/353342&lt;/a> 代码来源:fatkun&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%9C%AA%E5%88%86%E7%B1%BB/">未分类</category><category domain="https://fatkun.github.io/tags/java%E5%9F%BA%E7%A1%80/">Java基础</category><category domain="https://fatkun.github.io/tags/thinking-in-java-%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">Thinking in Java 读书笔记</category></item><item><title>Java数据类型转换</title><link>https://fatkun.github.io/2010/07/data-type-conversion.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/data-type-conversion.html</guid><pubDate>Wed, 28 Jul 2010 13:39:04 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>1.在Java中看到象“1.39e-47f”这样的表达式时，它真正的含义是“1.39×10 的-47次方”。
2.注意如果编译器能够正确地识别类型，就不必使用尾随字符。对于下述语句：
long n3 = 200;
它并不存在含混不清的地方，所以 200后面的一个 L大可省去。然而，对于下述语句：
float f4 = 1e-47f; //10的幂数
编译器通常会将指数作为双精度数（double）处理，所以假如没有这个尾随的 f，就会收到一条出错提示，告诉我们须用一个“造型”将double 转换成 float。
3.通常，表达式中最大的数据类型是决定了表达式最终结果大小的那个类型。若将一个float 值与一个double值相乘，结果就是 double；如将一个 int和一个 long 值相加，则结果为long。
4.将一个 float或double 值造型成整数值后，总是将小数部分“砍掉”，不作任何进位处理。
5.Math.random()的输出值范围是[0,1) 返回带正号的 &lt;code>double&lt;/code> 值，该值大于等于 &lt;code>0.0&lt;/code> 且小于 &lt;code>1.0&lt;/code>。
6.小数据类型转换成大数据类型可以自动转换，不会丢失精度。大数据类型转换为小数据类型必须显式的转换，可能丢失精度。&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java%E5%9F%BA%E7%A1%80/">Java基础</category><category domain="https://fatkun.github.io/tags/thinking-in-java-%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">Thinking in Java 读书笔记</category></item><item><title>Java的运算符号（逻辑与、或、非、移位运算）</title><link>https://fatkun.github.io/2010/07/java-operator.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/java-operator.html</guid><pubDate>Wed, 28 Jul 2010 03:45:53 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>1.只可将AND，OR 或NOT 应用于布尔值。与在C 及C++中不同，不可将一个非布尔值当作布尔值在逻辑表达式中使用。&lt;br>
2.在AND（&amp;amp;&amp;amp;）运算中a()&amp;amp;&amp;amp;b()&amp;amp;&amp;amp;c()，当a为false时，b与c都不再执行，因为整个表达式都是false了，没必要再执行下去，OR（||）也是一样，当有一个为true时就结束。&lt;/p>
&lt;pre escaped="true" lang="java" line="1">public class CalClass {
static Boolean test(int num){
System.out.println(num+"&amp;gt;2"+(num&amp;gt;2));
return num&amp;gt;2;
}
public static void main(String[] args){
int i = 1, j =3 , k = 4;
System.out.println(test(i)||test(j)||test(k));
System.out.println("end");
}
}&lt;/pre>
&lt;p>3.对于布尔值，按位运算符（如&amp;amp;）具有与逻辑运算符(如&amp;amp;&amp;amp;)相同的效果，只是它们不会中途“短路”。&lt;/p>
&lt;h2 id="移位运算符">移位运算符&lt;/h2>
&lt;p>左移位运算符（&amp;lt;&amp;lt;）能将运算符左边的运算对象向左移动运算符右侧指定的位数（在低位补 0）。“有符号”右移位运算符（&amp;gt;&amp;gt;）则将运算符左边的运算对象向右移动运算符右侧指定的位数。“有符号”右移位运算符使用了“符号扩展”：若值为正，则在高位插入0；若值为负，则在高位插入1。Java 也添加了一种“无符号”右移位运算符（&amp;gt;&amp;gt;&amp;gt;），它使用了“零扩展”：无论正负，都在高位插入0。&lt;br>
若对char，byte 或者short 进行移位处理，那么在移位进行之前，它们会自动转换成一个int。只有右侧的5个低位才会用到。这样可防止我们在一个 int数里移动不切实际的位数。若对一个long 值进行处理，最后得到的结果也是long。此时只会用到右侧的 6个低位，防止移动超过 long 值里现成的位数。但在进行“无符号”右移位时，也可能遇到一个问题。若对 byte 或short 值进行右移位运算，得到的可能不是正确的结果（Java 1.0 和Java 1.1 特别突出）。它们会自动转换成int 类型，并进行右移位。但“零扩展”不会发生。&lt;br>
&lt;a href="http://www.blogjava.net/rosen/archive/2005/08/12/9955.html">http://www.blogjava.net/rosen/archive/2005/08/12/9955.html&lt;/a>&lt;br>
“&amp;gt;&amp;gt; 右移”；“&amp;lt;&amp;lt; 左移”；“&amp;gt;&amp;gt;&amp;gt; 无符号右移”&lt;br>
例子：
例子：&lt;br>
-5&amp;gt;&amp;gt;3=-1&lt;br>
1111 1111 1111 1111 1111 1111 1111 1011&lt;br>
1111 1111 1111 1111 1111 1111 1111 1111&lt;br>
其结果与 Math.floor((double)-5/(2*2*2)) 完全相同。
-5&amp;lt;&amp;lt;3=-40&lt;br>
1111 1111 1111 1111 1111 1111 1111 1011&lt;br>
1111 1111 1111 1111 1111 1111 1101 1000&lt;br>
其结果与 -5*2*2*2 完全相同。
-5&amp;gt;&amp;gt;&amp;gt;3=536870911&lt;br>
1111 1111 1111 1111 1111 1111 1111 1011&lt;br>
0001 1111 1111 1111 1111 1111 1111 1111&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java%E5%9F%BA%E7%A1%80/">Java基础</category><category domain="https://fatkun.github.io/tags/thinking-in-java-%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">Thinking in Java 读书笔记</category></item><item><title>java变量的作用域</title><link>https://fatkun.github.io/2010/07/the-scope-of-variables.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/the-scope-of-variables.html</guid><pubDate>Tue, 27 Jul 2010 06:37:38 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;pre escaped="true" lang="java" line="1">public class OneClass {
static int x;//会赋值默认值0
public static void main(String[] args){
//int x = 2;
//不能在同一个方法内定义同一个变量，不然会报错 Duplicate local variable x
System.out.println("第一个x:"+x);
{
int x = 5;//在方法内的变量必须初始化，否则x会是随机值而不是0
//如果不赋值会报错The local variable x may not have been initialized
System.out.println("第二个x:"+x);
}
}
}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java%E5%9F%BA%E7%A1%80/">Java基础</category></item><item><title>Java的主要类型及它们的取值范围</title><link>https://fatkun.github.io/2010/07/java-data-type.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/java-data-type.html</guid><pubDate>Mon, 26 Jul 2010 17:11:29 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="java的主要类型">Java的主要类型&lt;/h2>
&lt;table border="0" cellspacing="0" cellpadding="0" width="651"> &lt;tr> &lt;td width="75"> &lt;p align="center"> &lt;strong>主类型 &lt;/strong> &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> &lt;strong>默认值 &lt;/strong> &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> &lt;strong>大小（位）&lt;/strong> &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> &lt;strong>最小值&lt;/strong> &lt;/p> &lt;/td>
&lt;td width="149"> &lt;p align="center"> &lt;strong>最大值&lt;/strong> &lt;/p> &lt;/td>
&lt;td width="97"> &lt;p align="center"> &lt;strong>封装器类型&lt;/strong> &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="75"> &lt;p align="center"> boolean &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> false &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> 1 &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> &amp;#8211; &lt;/p> &lt;/td>
&lt;td width="149"> &lt;p align="center"> &amp;#8211; &lt;/p> &lt;/td>
&lt;td width="97"> &lt;p align="center"> Boolean &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="75"> &lt;p align="center"> char &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> &amp;#8216;\u0000&amp;#8242;(null) &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> 16 &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> Unicode 0 &lt;/p> &lt;/td>
&lt;td width="149"> &lt;p align="center"> Unicode 2^16-1 &lt;/p> &lt;/td>
&lt;td width="97"> &lt;p align="center"> Character &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="75"> &lt;p align="center"> byte &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> (byte)0 &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> 8 &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> -128 &lt;/p> &lt;/td>
&lt;td width="149"> &lt;p align="center"> 127 &lt;/p> &lt;/td>
&lt;td width="97"> &lt;p align="center"> Byte &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="75"> &lt;p align="center"> short &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> (short)0 &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> 16 &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> -2^15 &lt;/p> &lt;/td>
&lt;td width="149"> &lt;p align="center"> +2^15-1 &lt;/p> &lt;/td>
&lt;td width="97"> &lt;p align="center"> Short &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="75"> &lt;p align="center"> int &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> 32 &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> -2^31 &lt;/p> &lt;/td>
&lt;td width="149"> &lt;p align="center"> +2^31-1 &lt;/p> &lt;/td>
&lt;td width="97"> &lt;p align="center"> Integer &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="75"> &lt;p align="center"> long &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> 0L &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> 64 &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> -2^63 &lt;/p> &lt;/td>
&lt;td width="149"> &lt;p align="center"> -2^63-1 &lt;/p> &lt;/td>
&lt;td width="97"> &lt;p align="center"> Long &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="75"> &lt;p align="center"> float &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> 0.0f &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> 32 &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> IEEE754 &lt;/p> &lt;/td>
&lt;td width="149"> &lt;p align="center"> IEEE754 &lt;/p> &lt;/td>
&lt;td width="97"> &lt;p align="center"> Float &lt;/p> &lt;/td> &lt;/tr>
&lt;tr> &lt;td width="75"> &lt;p align="center"> double &lt;/p> &lt;/td>
&lt;td width="139"> &lt;p align="center"> 0.0d &lt;/p> &lt;/td>
&lt;td width="87"> &lt;p align="center"> 64 &lt;/p> &lt;/td>
&lt;td width="104"> &lt;p align="center"> IEEE754 &lt;/p> &lt;/td>
&lt;td width="149"> &lt;p align="center"> IEEE754 &lt;/p> &lt;/td>
&lt;td width="97"> &lt;p align="center"> Double &lt;/p> &lt;/td> &lt;/tr>&lt;/table>
对于float:共32个bits，Bit 31是MSB（Most Significant Bit），Bit 0是LSB（Least Significant Bit），则
Bit 31是符号位，接下来的8位是指数位，指数位被视为一个无符号的数，它与127的差就是以2为底的指数的部分。 最后的23位是小数部分。
## 在byte(8位)中的取值范围为-128 到 127的问题
&lt;p>在电脑用是使用补码来存储数字的，我搜索了很多，还不是很明白。以前的反码之类的没认真学习。。。
因为 -0 和 +0 在补码中是不一样的，把 1000 0000 作为-128(补)  ，127(补)=0111 1111，0(补) = 0000 0000， -127(补) = 1111 1111， -128在9位中表示应该为 1 1000 0000，取低八位就变成了  1000 0000
摘录一篇文章如下，更详细可以点链接查看
&lt;a href="http://topic.csdn.net/t/20050828/10/4235813.html">http://topic.csdn.net/t/20050828/10/4235813.html&lt;/a>
在机器中&lt;br>
负数的补码是这样算的:&lt;br>
先将该负数取绝对值,再用二进制表示出这个绝对值&lt;br>
对该二进制数进行取反加一操作就得到负数的补码了&lt;br>
-128   绝对值是   128&lt;br>
128的二进制表示为:&lt;br>
1000   0000&lt;br>
取反&lt;br>
0111   1111&lt;br>
加1&lt;br>
1000   0000&lt;br>
这就是-128的补码&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/byte%E5%8F%96%E5%80%BC%E8%8C%83%E5%9B%B4/">Byte取值范围</category><category domain="https://fatkun.github.io/tags/java%E5%9F%BA%E7%A1%80/">Java基础</category><category domain="https://fatkun.github.io/tags/%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B/">数据类型</category></item><item><title>重新学习Java基础</title><link>https://fatkun.github.io/2010/07/learning-java.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/learning-java.html</guid><pubDate>Mon, 26 Jul 2010 03:18:18 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>想要重新学习Java基础，因为基础实在是太差了，很多概念都搞不清楚，而笔试题中大部分是基础题，加强基础还是很有必要的，苦于没有学习的条目，所以上网搜索到下面的文章，吓死我了，这位同学看了N本书，应该还写了N多的读书笔记~哎，学习没有捷径，唯有苦功夫。大概按照这来看着，看来我要买本《Thinking in Java》，看电子书不太舒服。
以下原文地址：&lt;a href="http://hi.baidu.com/guoerguoerguoer/blog/item/326f275117822568853524c0.html">学习java的步骤和一些必看的书籍&lt;/a>&lt;/p>
&lt;p>—————转载原文————&lt;/p>
&lt;p>**1.**&lt;strong>Java语言基础&lt;/strong>
谈到Java语言基础学习的书籍，大家肯定会推荐Bruce Eckel的《Thinking in Java》。它是一本写的相当深刻的技术书籍，Java语言基础部分基本没有其它任何一本书可以超越它。该书的作者BruceEckel在网络上被称为天才的投机者，作者的《Thinking in C++》在1995年曾获SoftwareDevelopmentJoltAward最佳书籍大奖，《Thinking inJava》被评为1999年JavaWorld“最爱读者欢迎图书”，并且赢得了编辑首选图书奖。作者从1986年至今，已经发表了超过150篇计算机技术文章，出版了6本书（其中4本是关于C++的），并且在全世界做了数百次演讲。他是《Thinking in Java》、《Thinking inC++》、《C++ Inside&amp;amp; Out》《Using C++》和《Thinking inPatterns》的作者，同时还是《BlackBeltC++》文集的编辑。他的书被读者称为“最好的Java参考书……绝对让人震惊”；“购买Java参考书最明智的选择”；“我见过的最棒的编程指南”。作者的非凡才华，极其跨越语言的能力，使作者被选为Java发展10年间与Java关系最密切的10个人物之一。
《Thinking in Java》讲述了Java语言的方方面面，很多Java语言的老手都评价“这是一本将Java语言讲得相当丑陋的书”。该书谈及了java语言的很多细节，每一个方面都是相当深刻的。通过本书你可以看到“丑陋的”java语言。
网络上关于java语言讲解的视频很多很多，其中不凡有垃圾。《翁恺—JAVA语言》可能是你学习java语言基础的唯一选择，该讲座基本按照《ThinkinginJava》这本书讲解，其中不凡有翁老师的很多有意思的笑话。我很幸运学习就是从此视频开始的。内容包括30讲，我总共看了3遍。
不过，对于初学者我不太推荐使用《Thinking in Java》，我比较推荐Prentice Hall PTR 的《CoreJava2》国内称为《Java 2 核心技术》，目前是第七版。网络上大家都可以下载到电子版。Oreilly的《Java inanutshell》也是一个不错的选择。读完以上两本后，你可以看看翁恺老师的视频，接着可以研究《Thinking in Java》了。
&lt;strong>2. Java数据结构&lt;/strong>&lt;br>
市面上关于Java数据结构的书本身就很少很少。大致有APress 的《Java Collections》，Jones和Bartlett的《Data Structures in Java》、《Object-oriented Data StructuresUsingJava》以及Prentice Hall 出版的《Data Structures and Algorithms in Java》(Dec19, 2005)还有一本就是《Data Structures And Algorithms WithObject-orientedDesign Patterns In Java》。很幸运我的第一本英文书就是APress的《JavaCollections》（本书在国内可能根本就没有中文版――只能下载英文版了），很不错，讲得很有条例、很简单，是一本完完全全JavaCollectionsAPI介绍的书籍，其中不凡有扩展API的例子。这是我推荐你学习java数据结构的唯一一本好书。其它的Jones和Bartlett的那两本国内好像有一本中文版，想看你也可以看看。
在学习完API后，你可以看看java.util包中对应的类了。不过只有在学习过设计模式后你才有可能完全理解整个Java CollectionsFramework。JavaCollectionsFramework使用了很多著名的设计模式如：迭代器（Iterator）模式，工厂方法模式、装饰器模式、适配器模式等等。通过研究java.util包中数据结构的源代码，你可以知道臭名昭著的Properties类的设计了，同时可能基本具备设计简单的数据结构的能力了。
所谓学习无止境，学习完Sun提供了Java Collections Framework后，你可以研究Apche的另一个Java Collections Framework，很有意思哦。互为补充的两个Framework。
在大家学习、研究Java Collections之前，我提示一下Java Collections主要包括以下三部分：接口（Interface）、实现（Implemention）和算法（Algorithm）。&lt;/p>
&lt;ol>
&lt;li>接口主要有List、Set、Queue和 Map。List 、Se t和Queue是 Collection接口的子接口。
2.实现主要是实现这些接口的具体类。如实现List接口的ArrayList、LinkedList、Stack和Vector；实现Set接口的HashSet、TreeSet和LinkedHashSet；实现Queue接口的PriorityQueue、SynchronousQueue等等；实现Map接口的HashMap、TreeMap、Hashtable、Properties、WeakHashMap等等。&lt;/li>
&lt;li>算法主要是由Arrays类和Collections类提供的，它是整个Java Collection Framework算法的核心。支持各种类型的排序，查找等常用操作。
Java Collections中包含两个版本的数据结构，主要是原先的支持同步的数据结构和后来不支持同步的数据结构。
Java Collection Framework在使用Comparator和Comparable接口支持排序。同时提供新旧两个版本的迭代器Iterator和Enumeraton，以及它们如何转换等等。
在java.util包中的Obserable接口和Observer类是考察者模式的核心。
……
&lt;strong>3. Java IO&lt;/strong>&lt;br>
市面上关于IO的书籍也仅仅只有Oreilly出版社的两本，都是ElliotteRustyHarold的著作。两本书的风格基本一致，推荐阅读是第一版的《JvavaI/O》，讲得比较浅显，内容相对比较集中，实例也很多。第二版今年5月国外才出版，很有幸我在网络上下载了第二版，讲得极其详细――726页的大块头（我化了两个星期），这次将NIO和IO和在一起，还包括J2ME部分的，不过串口、并口通信部分好像类库支持不够，自己不能实际操作。
与第一版的《Jvava I/O》一起的Oreilly还有一本《Jvava NIO》，也是很不错的哦。
大家在依次阅读完《Jvava I/O》以及《Jvava NIO》后，可以研究java.io包中的源代码了。在大家研究源代码前我给点提示：
Java的io包主要包括：&lt;/li>
&lt;li>两种流：字节流（byte Stream）和字符流（character stream），这两种流不存在所谓的谁代替谁、谁比谁高级之说，它们互为补充，只是侧重点不同而已。&lt;/li>
&lt;li>两种对称：1.字节流、字符流的对称；2.输入、输出的对称。&lt;/li>
&lt;li>一个桥梁：将字节流转变为字符流的InputStreamReader和OutputStreamWriter。
其中必须注意：&lt;/li>
&lt;li>PipedInputStream和PipedOutputStrem是两个比较有趣的类。&lt;/li>
&lt;li>支持Buffered的流是我们经常使用的类。&lt;/li>
&lt;li>装饰器（Decorator）模式在java最著名的应用就是用于io的设计。仔细研究各个Filter流与具体流的关系，多看设计模式的书籍。相信你会有所所获。&lt;/li>
&lt;li>学习好io包，是研究net包，rmi包……的基础哦！
&lt;strong>4 . Java数据库&lt;/strong>&lt;br>
数据库的书籍太多太多了，也是太烂太烂了！这方面的书我基本都研究过，推荐的你就看看Apress的《JDBC Recipes AProblemSolutionApproach》很不错，国外2005年底才出版，（国内好像没有中文版，不过出了中文版也不一定值得看――国内经常将国外的书翻译得一塌糊涂、不堪入目）不过我们真的很幸运，网络上有电子版的。值得一看。推荐我看的第一本比较满意的――Wiley出版的《JavaDatabaseBible》，讲得很不错！Sun公司自己的关于JDBC API介绍的那一本《JDBC APITutorialandRefernece》也不错。我第二本JDBC的就是研究的这套API。
不过目前这些书都是一些相对比较浮浅的API应用的书籍。有机会我会给大家带来介绍JDBC API以及JDBC实现内部细节的书！我尽快努力，同时希望得到大家的支持！
顺便给学习JDBC的朋友一点提示：
JDBC的学习和使用主要是这套API，其使用过程也是极其简单，下面是使用JDBC的一般流程：&lt;/li>
&lt;li>加载某个数据库的驱动（Driver类），通常使用Class.forName(“驱动的类名“);&lt;/li>
&lt;li>连接数据库――
Connection con = DriverManager.getConnection(url,username,password)；&lt;/li>
&lt;li>得到会话――Statement stmt = con.createStatement();&lt;/li>
&lt;li>执行操作――Result rs = stmt.executeQuery(“SQL查询语句”)；&lt;/li>
&lt;li>处理结果――
while(rs.next()){
String col1 = rs.getString(1);
……
}
简单吧！整个JDBC中可以变化的一般是：&lt;/li>
&lt;li>可以由Connection对象创建Statement、PreparedStatement和CallableStatement创建三种类型的Statement。&lt;/li>
&lt;li>可以创建多种类型的ResultSet：支持单向移动和个自由移动；可更新的和不可更新的；支持不同等级的交易的…..&lt;/li>
&lt;li>数据输入的批处理。&lt;/li>
&lt;li>结果集中特殊类型（Blob、Clob、Arrary和Ref、Struct）列的操作。&lt;/li>
&lt;li>这些特殊类型的录入数据库。&lt;/li>
&lt;li>javax.sql包中特殊结果集（CachedRowSet、JdbcRowSet、WebRowSet）的操作。&lt;/li>
&lt;li>其它的就是一个DataSource了，也很简单！一个J2EE中的被管理对象
简单吧！相信大家很快就会征服JDBC。
&lt;strong>5. Java 网络编程&lt;/strong>&lt;br>
网络编程――一个神秘的、充满挑战的方向。不过在谈Java网络编程之前首先感谢Sun公司的开发人员，因为它们天才的设想，充满智慧的架构，使广大java程序员学习java网络编程变得异常简单。
Java网络编程方面的书，我推荐O’Reilly的《JavaNetworkProgramming》，目前已经第三版了，以前的版本市面上肯定有！网络上早有第三版的电子版，国外2004年出版，706页哦！讲得很全，比较深入，太深入的可能由于Sun有些东西没有完全公开，所以也就不好讲了，有兴趣的可以下载看看！第二本还是O’Reilly1998年出版的《Javadistributed computing 》，基础部分写得比较详细，后面的实例还是值得研究的。
在大家阅读这些书之前，给大家一点提示：
java网络编程其实相对比较简单，入门也很快很快。java网络编程主要包括两个部分：1.Socket；2.URL部分。不过第二部分也完全建立在第一部分的基础上。&lt;/li>
&lt;li>Socket包括客户端的Socket和服务器端的ServerSocket。还有就是DatagramSocket和DatagramPacket，它对应于UDP通信协议。 总之，Socket部分是建立其它高级协议的基础。
2.URL类是一个网络资源定位器，通常和具体的网络协议如HTTP，FTP，Telnet……相关。通过该类可以连接网络上的资源，通过其openStream可以以io包中的流（InputStream）的形式读取网络资源；通过其OpenConnection方法，可以打开一个连接，在此连接上可以不仅可以完成读的操作，还可以完成写的操作。
Java的网络编程大体包括以上两部分。网络编程和IO以及多线程部分非常密切，在学习此部分前大家一定对这两部分了解比较透彻。
学习了以上部分你可以研究java.net包中的与此相关的源代码了！研究所有的源代码还为时尚早。在整个net包中包含：ContentHandlerFactory、URLStreamHandlerFactory、URLStreamHandler、URLClassLoader等辅助类，它们构成了java.net网络编程的框架，通过研究其源代码，你不仅可以快速理解java.net包，还可以为以后扩展该包打下基础，甚至可以将此思维方式运用到自己的项目中。
到此为止你对java.net包应该才了解60％，还有一部分你可以使用JDecompiler之类的反编译软件打开你JDK安装目录下\jdkxxx\jre\lib目录中的rt.jar，用WinRAR之类的软件打开它的sun.net包，反编译所有的文件，它是URL类工作的细节。当研究完该sun.net包，你就会对整个网络编程很熟悉很熟悉了。
一切看起来我们已经对网络编程很精通了。其实不然，刚刚开始而已，要想深入，请继续吧！网络上很多优秀的网络编程库甚至软件可以为我们“添加功力”。如Apache的HttpCore和HTTPConnection是两个和HTTP协议相关库；JGroups是研究分布式通信、群组通信的必读库；接着我们可以研究P2P的软件包，如Sun公司的JXTA，它可能是java平台点对点通信未来的标准哦！接着你可以研究成熟得不得了，使用极其广泛得P2P软件Azureus！www.sourceforge.net可以下载到！
千里之行始于足下！Just doit！（目前我也只研究了net包，其它的会在不久的将来继续深入。Sun公司因为某些原因没有公开net的其它实现细节，在其允许将其源代码以文字的形式加以研究，以及允许将其没有公开的实现写入书中时，我很希望能出一本java网络编程的书籍，以飧广大读者！！）
&lt;strong>6. Servlet和JSP&lt;/strong>&lt;br>
Servlet、JSP的书也是满地都是！值得推荐的也仅仅两三本。实推Addison Wiley的《Servlets andJavaServer pages：The J2EE TechnologyWebTier》，又是一本很厚的哦！国外2003年出版、784页，讲得比较全，例子也很多，特别是第八章Filter，举了几个不错的例子。其它所有我看到的关于Servlet和JSP的书都没有如此深入的！（可能有我没有看到而已）。O’reilly的《JavaServletProgramming》和《Java Server Pages》相对比较好懂一些，可以读读！
在大家学习Servlet和Jsp之前我还是要提醒一下：
本质上说Servlet就是一个实现Servlet接口的、部署于服务器端的服务器端的程序罢了！它可以象写其它任何java应用程序一样编写，它可以操作数据库、可以操作本地文件、可以连接本地EJB……编写Servlet程序的一般流程为：&lt;/li>
&lt;li>继承一个HttpServlet类；&lt;/li>
&lt;li>覆盖其doGet、doPost方法；&lt;/li>
&lt;li>在覆盖方法的内部操作方法参数HttpServletRequest和HttpServletResponse。
4.读取请求利用HttpServletRequest。利用HttpServletRequest你可以操作Http协议的协议头、可以得到请求的操作方法、可以得到请求的路径、可以得到请求的字符串、以及和请求客户相关的信息，更主要的你可以得到Cookie和HttpSession这两个对象。&lt;/li>
&lt;li>利用Cookie你可以操作“甜心”对象或者将其写入HttpServletResponse中。&lt;/li>
&lt;li>向客户输出信息可以使用HttpServletResponse。使用HttpServletResponse可以写入各种类型的协议头、可以增加Cookie、可以重定向其它URL、可以向客户发送Http协议的状态码。&lt;/li>
&lt;li>利用HttpSession在会话内完成你想实现的任何功能。
同时Servlet还提供了一些事件和事件**（简单的观察者模式而已）。还有就是过滤器（Filter）和包装器（ServletRequestWrapper、ServletResponseWrapper）――简单的流的使用和装饰器模式的使用。
学习Sevlet、JSP必然要部署到服务器中，记住通常文件部署的步骤和参数的设置以及在程序中如何使用就可以了。
完全理解Servlet后，学习jsp相对比较容易了！Jsp完全建立在Servlet的基础上，它是为了迎合那些喜欢在Html文档中嵌入脚本（如：PHP之类的网页编程语言）的程序员的需要罢了！学起来也相当的容易！
一切看起来似乎那么的风平浪静，简单好学！简单的表象背后有其复杂的机理。要想对Servlet和Jsp彻底研究，你得研究Tomcat等开源软件的具体实现。它无非就是一个服务器，在客户利用网页通过HTTP协议向服务器发送请求后，服务器将此HTTP请求转化为相应的HttpServletRequest对象，调用你编写的Servlet罢了，在你的Servlet中你肯定操作了此HttpServletRequest了吧，同时操作了HttpServletResponse了吧，服务器就将此HttpServletResponse按照HTTP协议的要求利用HTTP协议发送给你的浏览器了！在服务器端的Jsp网页在被客户请求后，Tomcat会利用编译软件，使用javax.servlet.jsp包中的模板，编译此jsp文件，编译后就是一个Servlet！以后的操作和Servlet完全一样哦！
在Servlet和Jsp的基础上出现了，所谓的高级技术：JSTL，Struts……无非就是一些标签和MVC模式的使用。
继续前进吧！胜利就在前方！！
&lt;strong>7. 多线程&lt;/strong>&lt;br>
一个看起来很神秘，却很容易上手、很难精通的方向！
我推荐两本我感觉很好的书籍。首先是我第一本能上手看的这方面的书，Sams 1998年出版的《JavaThreadProgramming》，写得暴好，很容易读懂，我有空还时常看当时的笔记！要知道怎么好你自己看吧！第二本OReilly三次出版的《JavaThreads》，最新是2004版，国内好像有中文版，推荐你还是看英文版的吧！书中谈到了与多线程相关的N个方向，如IO、Swing、Collection等等。
给大家一点提示吧！java类库中与多线程相关的类不是很多，主要有：Thread、ThreadGroup以及ThreadLocal和InheritableThreadLocal四个类和一个Runnable接口；关键字synchronize、volatile；以及Object对象的wait、notify、notifyAll方法！
1 Thread是多线程的核心类，提供了一系列创建和操作多线程的方法。
2 ThreadGroup是一个管理Thread的工具类。
3 ThreadLocal和InheritableThreadLocal为Thread提供了一个类似保险箱功能的存储线程对象的类！
4 Runnable不用说了吧！
5synchronize是同步方法和同步块的核心哦！多个线程调用此方法时，只有一个线程可以使用此方法，其它方法阻塞，从而保证被操作对象内部状态完整性。某个线程调用带有synchronize的方法或块时会得到该对象的对象锁，完成块中的操作后释放此对象锁，从而其它对象可以继续操作。
6wait、notify、notifyAll提供了有效的等待/通知机制。Java语言中每一个对象都有一个休息室，任何线程在其操作的对象的状态不满足的情况下，在该对象的休息室中休息，释放对象锁；当其它线程操作该对象后，唤醒休息室中的线程，它们再检查条件，当条件满足后，执行相应的操作。
多线程大致就这么多基础的！简单吗！这对于一个真正的程序员应该是不够的，真正对多线程要有所掌握，请您研究java.util.concurrent包吧！大师DougLea的作品，原先是一个开源的一致性编程的库，后来被Sun公司并入java类库。作者的网站上也有另外一个版本的该类库！值得研究的好东西!Hibernation、OpenJMS等开源软件都使用了此包！
&lt;strong>8. 设计模式&lt;/strong>&lt;br>
谈到设计模式很多人多会推荐GOF的那本，该书在Amzon上是五星级的推荐书籍。不过对于学习java没多久的、特别是java初学者，我很不推荐这本书。主要是该书的例子基本都是C++的，很多细节没有讲述得足够清楚。
我给大家推荐的第一本是阎宏博士的《Java 与模式》，它是第一本中国人自己写的关于设计模式的书籍，写的比较有趣，融合了很多中华民族的文化和观念，例子、类图都比较多，且相对简单！非常不错的入门书籍――又是大块头哦！
其次我推荐Wiley出版社出版的《Pattern In Java》一套三本，我才看了第一本，好像第二本不怎么样，第三本还不错！
第三本是中文翻译版的关于多线程模式的（很难得的中文翻译版）中国铁道出版社2003年出版的《Java多线程设计模式》，将多线程模式讲得非常浅显，配有大量的图例，每章都有习题，最后有答案！我研究多线程模式就是由它开始的！
第四本，今年出版的Head First系列的《Head First Design Pattern》，秉承Head First系列图书的优点，大量的类图、丰富的实例、有趣的注解，值得购买！
其次在J2EE方向你可以研究阅读Addison Wesley 2002年出版的《Patterns ofEnterpriseApplication Architecture》，众多大腕的作品，讲企业消息集成的！Sun提供的《J2EEPATTERNSSL500》也很好！晚了推荐那一本Amzon 4星半的《Holubonpatterns》，大师的作品，提供了，很值得研究的例子，不过对上面四本不是很熟悉的读者，最好不要读它！可能会让你比较累！
我学习设计模式经过一段很曲折的路线，前前后后大约看了20本，阎宏博士的《Java与模式》我看了4遍，还排除我第一次基本没看懂的看！记得研一时老师给我们讲了GOF的那本，作为选修课，我和它们计算机系的硕士、博士们一起，到最后一个班40－50个人，不超过3个人明白，我也没有明白任何一点（基础差吧――主要我对C++语言一点都不了解），凭我不伏输的性格，我认为我对java语言理解还可以，我就借了《Java与模式》，结果还是基本没看懂。很有幸的是读研三时，听过了上交大饶若楠老师关于JavaOOP语言的讲座，我懂了组合书籍模式等三种设计模式后，对其它模式有了强烈的兴趣和要征服它的愿望！工作后我买的第一本就是《Java与模式》，第一遍花了2个月研究了这个1000多页的大块头，后来第三遍15天左右就可以搞定，笔记记了一大本！从此一发不可收拾。
选对书、埋头研究。相信很快就会入门的！
学习Java语言8个简单的部分，这只是我们研究Java语言的开始！这些都懂了充其量一个java程序员而已，后面的路很长很长！我们可以继续研究数据库实现的源代码、Servlet服务器的源代码、RMI、EJB、JNDI、面向方面编程、重构、ANT工具、Eclipse工具、Spring工具、JBoss、JOnAS、ApacheGeronimo等J2EE服务器！研究了这些你可能会成为一个出色的J2EEArchitecture！你可以继续研究剖析器、编译器、JNODE（java写的操作系统）……&lt;/li>
&lt;/ol></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java%E5%9F%BA%E7%A1%80/">Java基础</category><category domain="https://fatkun.github.io/tags/java%E5%AD%A6%E4%B9%A0%E6%AD%A5%E9%AA%A4/">Java学习步骤</category></item><item><title>使用json-lib遍历数组与对象（JSONArray与JSONObject）</title><link>https://fatkun.github.io/2010/07/jsonarray-jsonobject-array.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/jsonarray-jsonobject-array.html</guid><pubDate>Sun, 18 Jul 2010 06:55:31 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p style="padding: 0px; margin: 0px;"> 使用json-lib遍历数组与对象&lt;/p>
&lt;pre escaped="true" lang="java">//遍历json数组
String json1 = "{data:[{name:'Wallace'},{name:'Grommit'}]}";
jsonObjSplit = new JSONObject(json1);
JSONArray ja = jsonObjSplit.getJSONArray("data");
for (int i = 0; i &amp;lt; ja.length(); i++) {
JSONObject jo = (JSONObject) ja.get(i);
System.out.println(jo.get("name"));
}
&lt;p>//JSONObject遍历json对象
String json2 = &amp;quot;{name:'Wallace',age:15}&amp;quot;;
jsonObj = new JSONObject(json2);&lt;/p>
&lt;p>for (Iterator iter = jsonObj.keys(); iter.hasNext();) {
String key = (String)iter.next();
System.out.println(jsonObj .getString(Key));
｝&lt;/pre>&lt;/p>
&lt;p style="padding: 0px; margin: 0px;"></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/jsonarray/">JSONArray</category><category domain="https://fatkun.github.io/tags/jsonobject/">JSONObject</category><category domain="https://fatkun.github.io/tags/%E9%81%8D%E5%8E%86%E6%95%B0%E7%BB%84/">遍历数组</category></item><item><title>30个优秀的网站导航例子</title><link>https://fatkun.github.io/2010/07/30-examples-of-excellent-website-navigation.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/30-examples-of-excellent-website-navigation.html</guid><pubDate>Sat, 17 Jul 2010 11:04:16 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 一个网站的导航能使访问者一页一页的找到内容。所以把它弄漂亮点是非常重要滴~~然而，一些设计者想要把导航设计得更好一点，但是当一个网站变成一个迷题时，访问者一般会带着挫败离去的。一个网站导航或菜单应该看起来像一个导航。它应该突出并且符合整体风格，并且出现在用户期望出现的地方（译者注：通常在头部右上角）。这里有30个优秀的网站导航例子，希望能给你带来灵感。&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 原文：&lt;a href="http://webdesignledger.com/inspiration/30-examples-of-excellent-website-navigation" target="_blank">30 Examples of Excellent Website Navigation&lt;/a>&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 翻译：&lt;a href="http://fatkun.com/2010/07/30-examples-of-excellent-website-navigation/" target="_blank">http://fatkun.com/2010/07/30-examples-of-excellent-website-navigation/&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://theidealists.com/home" target="_blank">The Idea Lists&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://theidealists.com/home" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_1.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;">
&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://collisionlabs.com/" target="_blank">Collision&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://collisionlabs.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_2.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://tobiasahlin.com/" target="_blank">Tobias Ahlin&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://tobiasahlin.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_3.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://carbonmade.com/" target="_blank">Carbonmade&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://carbonmade.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_4.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://2010.dconstruct.org/" target="_blank">dConstruct 2010&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://2010.dconstruct.org/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_5.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.jeroenhoman.com/" target="_blank">Jeroen Homan&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.jeroenhoman.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_6.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.brizk.com/" target="_blank">Brizk Design&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.brizk.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_7.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.dribbble.com/" target="_blank">Dribbble&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.dribbble.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_8.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.builtbybuffalo.com/" target="_blank">Buffalo&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.builtbybuffalo.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_9.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://tedxtoronto.com/" target="_blank">TedxToronto&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://tedxtoronto.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_10.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.molanphydesign.com/" target="_blank">David A. Molanphy&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.molanphydesign.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_11.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.fullyillustrated.com/" target="_blank">Fully Illustrated&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.fullyillustrated.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_12.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.livebooks.com/" target="_blank">Live Books&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.livebooks.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_13.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.richbrown.info/" target="_blank">Rich Brown&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.richbrown.info/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_14.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://ilovedust.com/" target="_blank">I Love Dust&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://ilovedust.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_15.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.blueskyresumes.com/" target="_blank">Blue Sky Resumes&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.blueskyresumes.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_16.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.sohtanaka.com/" target="_blank">Soh Tanaka&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.sohtanaka.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_17.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://meyerkyle.com/" target="_blank">Kyle Myer&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://meyerkyle.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_18.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://yaronschoen.com/blog/my_friend_yaron_schoen/" target="_blank">Yaron Schoen&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://yaronschoen.com/blog/my_friend_yaron_schoen/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_19.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.unconventionalguides.com/" target="_blank">Unconventional Guides&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.unconventionalguides.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_20.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.madeinhaus.com/" target="_blank">HAUS&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.madeinhaus.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_21.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://christophermeeks.com/" target="_blank">Christopher Meeks&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://christophermeeks.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_22.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://danwiersema.com/" target="_blank">Dan Wiersema&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://danwiersema.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_23.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://williamsoncountycasa.org/" target="_blank">Williamson County Casa&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://williamsoncountycasa.org/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_24.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.mariecatribs.com/" target="_blank">Marie Catrib’s&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.mariecatribs.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_25.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.thedesigncubicle.com/" target="_blank">The Design Cubicle&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.thedesigncubicle.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_26.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.exclusivereels.com/" target="_blank">Exclusive Reels&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.exclusivereels.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_27.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://all-for-design.com/portfolio/" target="_blank">AFD Folio&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://all-for-design.com/portfolio/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_28.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://veerle.duoh.com/" target="_blank">Veerle’s Blog&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://veerle.duoh.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_29.jpg" alt="website navigation" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://drxlr.com/" target="_blank">Drexler&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://drxlr.com/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2010/07/web_navs_30.jpg" alt="website navigation" />&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/%E7%BD%91%E7%AB%99%E5%AF%BC%E8%88%AA/">网站导航</category><category domain="https://fatkun.github.io/tags/%E8%AE%BE%E8%AE%A1/">设计</category></item><item><title>使用cookie获取QQ头像（JSP版）</title><link>https://fatkun.github.io/2010/07/get-qq-avatar-with-cookie.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/get-qq-avatar-with-cookie.html</guid><pubDate>Sun, 11 Jul 2010 16:21:00 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>由于腾讯现在QQ头像必须要登录才能看到原头像，所以以前直接获取头像已经失效了（如这篇文章&lt;a rel="bookmark" href="http://fatkun.com/2010/01/get-qq-avatar-url/">获取QQ头像地址&lt;/a>），既然直接获取不行，那来个曲线救国吧~&lt;/span>
PS:写完代码后才发现腾讯的头像隐私保护得挺好的，只有自己的好友或群友能获取全头像，非好友只能获取QQ内置头像。悲剧啊。。。
直接贴代码,以下代码是通过带cookie访问头像的链接，其实其他PHP等也可以实现的：&lt;/p>
&lt;pre escaped="true" lang="java">&amp;lt;%@ page language="java" contentType="image/bmp" pageEncoding="UTF-8"%&amp;gt;&amp;lt;%@ page import="java.net.*,java.util.*,java.io.*"%&amp;gt;&amp;lt;%
String qqnum = request.getParameter("qq");
URL url = new URL("http://face6.qun.qq.com/cgi/svr/face/getface?type=1&amp;uin="+qqnum);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
//设置Header
http.setRequestProperty("User-Agent", "Mozilla/5.0 (compatible; MSIE 6.0; Windows NT)");
http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
//设置Cookie，登陆WebQQ或者QQ空间可以查看cookie得到下面的值，请替换过来
//还不知道skey这个值会不会定期变化,QQ号码不够10位前面补0
http.setRequestProperty("Cookie", "uin=oQQ号码; skey=@安全码;");
http.setRequestMethod("GET");
http.setDoInput(true);
InputStream is = http.getInputStream();
//得到输出流，注意out是Writer类的对象，这里要用字节流
OutputStream os = response.getOutputStream();
//输出头像
while (is.available() &amp;gt; 0) {
os.write(is.read());
}
//在后台打印Header信息,不是必须
System.out.println(http.getResponseCode());
Map&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt; header = new HashMap&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt;();
header = http.getHeaderFields();
for (String str : header.keySet()) {
System.out.println(str + "" + header.get(str));
}
%&amp;gt;&lt;/pre>
&lt;p>可是只能获取自己好友的自定义头像，其他非好友只能获取QQ内置头像（一般不是那只企鹅），所以就懒得上传到服务器了，JSP可以上传到Google app engine^_^&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/%E5%BE%97%E5%88%B0qq%E5%A4%B4%E5%83%8F/">得到QQ头像</category><category domain="https://fatkun.github.io/tags/%E6%9C%80%E6%96%B0%E8%8E%B7%E5%8F%96qq%E5%A4%B4%E5%83%8F/">最新获取QQ头像</category></item><item><title>免费JSP空间-JHost邀请码(2011更新)</title><link>https://fatkun.github.io/2010/07/free-jsp-host-of-jhost-cn.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/free-jsp-host-of-jhost-cn.html</guid><pubDate>Fri, 09 Jul 2010 04:28:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;strong>最新JHOST邀请码：20110228120512_459048，有效期至2011-02-28 12:05:12。&lt;/strong>
无论在国内和国外，免费的JSP空间是很少的，因为运行JSP的环境需要消耗很多资源，不像PHP那样一个服务器可以承载很多很多人。
当然，作为免费空间，特别是国内的免费空间，大家都明白的，不会永久免费，有可能因为不可抗拒的因素或者无力继续下去而停止。这个空间我用了&lt;strong>两个月&lt;/strong>,用来玩玩就好，当然也不是很稳定，有过几次的维护（用户实在太多），感觉还好吧，这个不是软文~~(不要把免费空间当收费空间用就行~╮(╯_╰)╭)
示例：&lt;a href="http://co.jhost.cn/fly/showcase.action" target="_blank">&lt;a href="http://co.jhost.cn/fly/showcase.action">http://co.jhost.cn/fly/showcase.action&lt;/a>&lt;/a>
网站：&lt;a href="http://www.jhost.cn" target="_blank">&lt;a href="http://www.jhost.cn">http://www.jhost.cn&lt;/a>&lt;/a>&lt;/p>
&lt;h2 id="jhost的配置">jhost的配置&lt;/h2>
&lt;p>100MB的存储空间，数据库不知道多大（反正用来测试的够用了），支持JSP和PHP，可以用FTP管理，用phpmyadmin管理数据库，想要用PHP的不要申请这个了，还有很多比这个好的空间。&lt;/p>
&lt;h2 style="font-size: 1.5em;"> jhost邀请码&lt;/h2>
jhost需要在后台用邀请码激活，**&lt;span style="color: #ff0000;">而且需要手机短信认证&lt;span style="font-weight: normal;">!&amp;nbsp;&lt;span style="color: #000000;">需要每3天续期一次，相比国内外免费JSP空间需要每天某个时间停止几次tomcat来说还是挺好的！&lt;/span>&lt;/span>&lt;/span>**
&lt;div id="_mcePaste"> &lt;div id="_mcePaste"> &lt;font class="Apple-style-span" color="#000000">&lt;b>&lt;strong>JHOST邀请码：&lt;span style="background-color:#ff8c00;">20110228120512_459048&lt;/span>，有效期至2011-02-28 12:05:12。&lt;/strong>&lt;/b>&lt;/font> &lt;/div>&lt;/div>
## jhost.cn的关于说明
&lt;blockquote>
&lt;p>本站是一个专门提供网络存储及动态网站空间的服务型网站，主要目地是为广大网络用户提供一个学习与交流的平台。在本站注册的用户可以将常用的数据资料存放在本站提供的网络空间，并可将文件共享以方便与其它用户进行交流。也可以将PHP或JSP编写的网页程序放在本站提供的空间上，并通过本站提供的二级域名进行访问。为了方便大家开发自己的网站，本站还提供MYSQL数据，用户也可以使用FTP方式对网站空间的文件进行管理。&lt;br style="padding: 0px; margin: 0px;" />&lt;br>
因为网上无法找到其它免费JSP空间，本站也是首次尝试，所以很多事情都是在不断的摸索与改进，争取为大家提供更加适合的空间服务。&lt;br style="padding: 0px; margin: 0px;" />&lt;br>
由于JSP服务器的维护成本，以及系统资源的占用都很高，这也是JSP空间价格高，免费少的原因。为了保证本站服务器的运行效率，以及用户空间的稳定使用，本站将限制网站空间用户的注册数量，&lt;span style="color: #0000ff; padding: 0px; margin: 0px;">&lt;span style="padding: 0px; margin: 0px;">当本站的有效用户达到600时，将停止新空间的申请，直到有用户空间过期后不再续期。&lt;/span>&lt;/span>&lt;br style="padding: 0px; margin: 0px;" />&lt;br>
为了保证空间的充分利用，本站将采取邀请码及身份认证的方式开通免费空间。免费空间默认有效期为3天，用户可在有效期内登录后台延长空间有效期，同时可以使用本站积分自动延长空间的有效期。年用户（网站空间有效期超过一年）可使用积分开通域名绑定等高级功能&lt;/p>
&lt;/blockquote></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/jhost%E9%82%80%E8%AF%B7%E7%A0%81/">Jhost邀请码</category><category domain="https://fatkun.github.io/tags/%E5%85%8D%E8%B4%B9jsp%E7%A9%BA%E9%97%B4/">免费JSP空间</category><category domain="https://fatkun.github.io/tags/%E5%85%8D%E8%B4%B9%E7%A9%BA%E9%97%B4/">免费空间</category><category domain="https://fatkun.github.io/tags/%E6%9C%80%E6%96%B0jhost%E9%82%80%E8%AF%B7%E7%A0%81/">最新jhost邀请码</category><category domain="https://fatkun.github.io/tags/%E7%9B%AE%E5%89%8D%E6%9C%80%E5%A5%BD%E7%9A%84jsp%E7%A9%BA%E9%97%B4/">目前最好的JSP空间</category></item><item><title>Struts2校验框架(validation)</title><link>https://fatkun.github.io/2010/07/struts2-validation.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/struts2-validation.html</guid><pubDate>Wed, 07 Jul 2010 07:16:39 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Struts2的校验方法也是挺常用的，找到了一篇挺全面的文章,主要包括以下内容：&lt;/p>
&lt;ol>
&lt;li>使用Annotation（注解）进行校验&lt;/li>
&lt;li>使用xml配置校验&lt;/li>
&lt;li>使用覆盖validate方法校验
文章出处：&lt;a href="http://blog.csdn.net/struts2/archive/2007/08/02/1721989.aspx">http://blog.csdn.net/struts2/archive/2007/08/02/1721989.aspx&lt;/a> 作者:马召&lt;/li>
&lt;/ol>
&lt;h2 id="51节校验类型和配置方法说明">5.1节：校验类型和配置方法说明&lt;/h2>
&lt;p>从Struts2 校验框架在验证的场所上可以分为：客户端校验和服务端校验。&lt;br>
客户端校验是指，在HTML画面上自动生成JavaScript校验代码，在用户提交到服务器之前在客户端浏览器中进行校验。默认位客户端校验。&lt;br>
服务端校验是指，在数据提交到服务器上之后，在Action处理之前，对客户但提交的数据进行校验。
从Struts2校验框架的配置上可以分为：Java Annotation配置和XML配置文件配置&lt;br>
Java Annotation配置是指，使用Java Annotation语法，在Java源代码上标记需要校验的内容，和校验的方式。&lt;br>
XML配置文件配置是指，使用XML配置文件配置需要校验的内容和校验方式。&lt;/p>
&lt;h2 id="52节validator与validation">5.2节：Validator与Validation&lt;/h2>
&lt;p>Validation指校验，Validator指谁来校验。&lt;br>
在Struts2框架中Validator必须在系统中注册，如果没有注册，系统使用默认的注册，这些validator注册文件在xwork的jar文件中，内容如下：&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;validators&amp;gt;
&amp;lt;validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/&amp;gt;
&amp;lt;validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/&amp;gt;
&amp;lt;validator name="int" class="com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator"/&amp;gt;
&amp;lt;validator name="double" class="com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator"/&amp;gt;
&amp;lt;validator name="date" class="com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator"/&amp;gt;
&amp;lt;validator name="expression" class="com.opensymphony.xwork2.validator.validators.ExpressionValidator"/&amp;gt;
&amp;lt;validator name="fieldexpression" class="com.opensymphony.xwork2.validator.validators.FieldExpressionValidator"/&amp;gt;
&amp;lt;validator name="email" class="com.opensymphony.xwork2.validator.validators.EmailValidator"/&amp;gt;
&amp;lt;validator name="url" class="com.opensymphony.xwork2.validator.validators.URLValidator"/&amp;gt;
&amp;lt;validator name="visitor" class="com.opensymphony.xwork2.validator.validators.VisitorFieldValidator"/&amp;gt;
&amp;lt;validator name="conversion" class="com.opensymphony.xwork2.validator.validators.ConversionErrorFieldValidator"/&amp;gt;
&amp;lt;validator name="stringlength" class="com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator"/&amp;gt;
&amp;lt;validator name="regex" class="com.opensymphony.xwork2.validator.validators.RegexFieldValidator"/&amp;gt;
&amp;lt;/validators&amp;gt;&lt;/pre>
&lt;p>自己需要注册自己的Validator时，可以使用上述相似的内容，这个文件需要放在WEB-INF/classes目录下，文件的名字叫validators.xml。
一旦自己定义了validators.xml文件，系统就不会在加载默认的Validators文件，所以在Validators.xml中需要拷贝默认的内容。&lt;/p>
&lt;h2 id="53节validation与intercepter">5.3节：Validation与Intercepter&lt;/h2>
&lt;p>Validation使用名字叫做validator的Intercepter，在默认情况下，struts2已经定义了这个Intercepter，我们在不加声明的情况下就可以使用Validation了。&lt;/p>
&lt;h2 id="54节使用java-annotation配置校验">5.4节：使用Java Annotation配置校验&lt;/h2>
&lt;p>import com.opensymphony.xwork2.validator.annotations包提供了一些必要的Annotation用来配置校验信息。&lt;br>
这些内容包括：&lt;br>
枚举类型&lt;br>
ValidatorType&lt;br>
Field 校验字段&lt;br>
Simple 校验其他&lt;br>
Annotation（标注）类型&lt;br>
Validation&lt;br>
用来标记一个类需要被校验&lt;br>
ConversionErrorFieldValidator&lt;br>
字段转换出错&lt;br>
DateRangeFieldValidator&lt;br>
日期范围校验&lt;br>
DoubleRangeFieldValidator&lt;br>
Double类型范围校验&lt;br>
EmailValidator&lt;br>
Email地址校验&lt;br>
ExpressionValidator&lt;br>
使用一个OGNL表达式的校验，功能非常强大&lt;br>
FieldExpressionValidator&lt;br>
针对一个字段的使用OGNL表达式的校验&lt;br>
IntRangeFieldValidator&lt;br>
Int类型范围校验&lt;br>
RegexFieldValidator&lt;br>
正则表达式校验&lt;br>
RequiredFieldValidator&lt;br>
必填字段校验&lt;br>
RequiredStringValidator&lt;br>
必填String校验，&lt;br>
StringLengthFieldValidator&lt;br>
字符串长度校验&lt;br>
UrlValidator&lt;br>
URL校验&lt;br>
Validations&lt;br>
可以组合上述的各种校验类型以满足更多的需求。&lt;br>
VisitorFieldValidator&lt;br>
可以将Action中的对象的属性的校验方法定位到已经定义的对象原有的校验方法
CustomValidator&lt;br>
ValidationParameter&lt;br>
两个类一起完成自定义的校验&lt;/p>
&lt;h2 id="示例">示例&lt;/h2>
&lt;pre escaped="true" lang="java" line="1">package com.jpleasure;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator;
import com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator;
import com.opensymphony.xwork2.validator.annotations.Validation;
import com.opensymphony.xwork2.validator.annotations.ValidatorType;
@Validation()
public class RegisterAction extends ActionSupport {
private String name;
private String password;
private String rePassword;
private String mail;
private String description;
public String getName() {
return name;
}
@RequiredFieldValidator(type = ValidatorType.FIELD,
shortCircuit = true, message = "name is required")
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
@RequiredFieldValidator(type = ValidatorType.FIELD,
shortCircuit = true, message = "password is required")
@StringLengthFieldValidator(type = ValidatorType.FIELD,
shortCircuit = true, message = "password must has proper legnth",
minLength = "5", maxLength = "12")
public void setPassword(String password) {
this.password = password;
}
public String getRePassword() {
return rePassword;
}
@RequiredFieldValidator(type = ValidatorType.FIELD,
shortCircuit = true,
message = "input password again please!")
@StringLengthFieldValidator(type = ValidatorType.FIELD,
shortCircuit = true, message = "password must has proper legnth",
minLength = "5", maxLength = "12")
@FieldExpressionValidator(expression = "password eq rePassword",
message = "two password must match")
public void setRePassword(String rePassword) {
this.rePassword = rePassword;
}
public String getMail() {
return mail;
}
@RequiredFieldValidator(type = ValidatorType.FIELD,
shortCircuit = true, message = "mail is required")
public void setMail(String mail) {
this.mail = mail;
}
public String getDescription() {
return description;
}
@RequiredFieldValidator(type = ValidatorType.FIELD,
shortCircuit = true, message = "description is required")
public void setDescription(String description) {
this.description = description;
}
public String execute() throws Exception {
return SUCCESS;
}
}&lt;/pre>
&lt;h2 id="55节使用xml配置validation">5.5节：使用XML配置Validation&lt;/h2>
&lt;p>Xml配置文件与Action的关系为：&lt;br>
SomeAction.java – SomeAction-validation.xml&lt;br>
且与SomeAction.class处在相同的目录中。&lt;br>
SimpleAction-validation.xml文件示例：&lt;/p>
&lt;pre escaped="true" lang="xml" line="1">&amp;lt;!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"&amp;gt;
&amp;lt;validators&amp;gt;
&amp;lt;field name="bar"&amp;gt;
&amp;lt;field-validator type="required"&amp;gt;
&amp;lt;message&amp;gt;You must enter a value for bar.&amp;lt;/message&amp;gt;
&amp;lt;/field-validator&amp;gt;
&amp;lt;field-validator type="int"&amp;gt;
&amp;lt;param name="min"&amp;gt;6&amp;lt;/param&amp;gt;
&amp;lt;param name="max"&amp;gt;10&amp;lt;/param&amp;gt;
&amp;lt;message&amp;gt;
bar must be between ${min} and ${max}, current value is ${bar}.
&amp;lt;/message&amp;gt;
&amp;lt;/field-validator&amp;gt;
&amp;lt;/field&amp;gt;
&amp;lt;field name="bar2"&amp;gt;
&amp;lt;field-validator type="regex"&amp;gt;
&amp;lt;param name="regex"&amp;gt;[0-9],[0-9]&amp;lt;/param&amp;gt;
&amp;lt;message&amp;gt;
The value of bar2 must be in the format "x, y", where x and y are between 0 and 9
&amp;lt;/message&amp;gt;
&amp;lt;/field-validator&amp;gt;
&amp;lt;/field&amp;gt;
&amp;lt;field name="date"&amp;gt;
&amp;lt;field-validator type="date"&amp;gt;
&amp;lt;param name="min"&amp;gt;12/22/2002&amp;lt;/param&amp;gt;
&amp;lt;param name="max"&amp;gt;12/25/2002&amp;lt;/param&amp;gt;
&amp;lt;message&amp;gt;The date must be between 12-22-2002 and 12-25-2002.&amp;lt;/message&amp;gt;
&amp;lt;/field-validator&amp;gt;
&amp;lt;/field&amp;gt;
&amp;lt;field name="foo"&amp;gt;
&amp;lt;field-validator type="int"&amp;gt;
&amp;lt;param name="min"&amp;gt;0&amp;lt;/param&amp;gt;
&amp;lt;param name="max"&amp;gt;100&amp;lt;/param&amp;gt;
&amp;lt;message key="foo.range"&amp;gt;Could not find foo.range!&amp;lt;/message&amp;gt;
&amp;lt;/field-validator&amp;gt;
&amp;lt;/field&amp;gt;
&amp;lt;validator type="expression"&amp;gt;
&amp;lt;param name="expression"&amp;gt;foo lt bar &amp;lt;/param&amp;gt;
&amp;lt;message&amp;gt;Foo must be greater than Bar. Foo = ${foo}, Bar = ${bar}.&amp;lt;/message&amp;gt;
&amp;lt;/validator&amp;gt;
&amp;lt;/validators&amp;gt;&lt;/pre>
&lt;p>我们看看上面的配置文件，首先每一个validatior都必须有一个type属性，type属性的值为我们前面定义的validator的name。&lt;br>
Message提供了校验出错的信息，message有一个属性key，通过可以可以找到i18n文件定义的内容，但是key并不是必须的。Message体内部的消息为默认消息，当i18n文件中不存在时表示该消息。消息中可以使用${}来引用被校验的对象例如：${foo}，${bar}&lt;/p>
&lt;h2 id="56节validator和field-validator">5.6节：Validator和Field Validator&lt;/h2>
&lt;p>Field Validator用来校验一个字段，例如：&lt;/p>
&lt;pre escaped="true" lang="xml" line="1">&amp;lt;field name="email_address"&amp;gt;
&amp;lt;field-validator type="required"&amp;gt;
&amp;lt;message&amp;gt;You cannot leave the email address field empty.&amp;lt;/message&amp;gt;
&amp;lt;/field-validator&amp;gt;
&amp;lt;field-validator type="email"&amp;gt;
&amp;lt;message&amp;gt;The email address you entered is not valid.&amp;lt;/message&amp;gt;
&amp;lt;/field-validator&amp;gt;
&amp;lt;/field&amp;gt;&lt;/pre>
&lt;p>Filed validator可以从filed集成字段名字，这样可以将摸个Field的所有的校验局限在一定的范围内。
使用Validator可以校验多个字段之间的关系，例如：&lt;/p>
&lt;pre escaped="true" lang="xml" line="1">&amp;lt;validator type="expression&amp;gt;
&amp;lt;param name="expression"&amp;gt;foo gt bar&amp;lt;/param&amp;gt;
&amp;lt;message&amp;gt;foo must be great than bar.&amp;lt;/message&amp;gt;
&amp;lt;/validator&amp;gt;&lt;/pre>
&lt;p>Validator也可以校验一个字段，例如：&lt;/p>
&lt;pre escaped="true" lang="xml" line="1">&amp;lt;validator type="required"&amp;gt;
&amp;lt;param name="fieldName"&amp;gt;bar&amp;lt;/param&amp;gt;
&amp;lt;message&amp;gt;You must enter a value for bar.&amp;lt;/message&amp;gt;
&amp;lt;/validator&amp;gt;&lt;/pre>
&lt;p>但是为了将一个字段的所有校验放在一起，我们倾向于尽量使用field validator&lt;/p>
&lt;h2 id="57节短路short-circuiting">5.7节：短路（Short-Circuiting）&lt;/h2>
&lt;p>参看如下例子：&lt;/p>
&lt;pre escaped="true" lang="xml" line="1">&amp;lt;!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"&amp;gt;
&amp;lt;validators&amp;gt;
&amp;lt;!-- Field Validators for email field --&amp;gt;
&amp;lt;field name="email"&amp;gt;
&amp;lt;field-validator type="required" short-circuit="true"&amp;gt;
&amp;lt;message&amp;gt;You must enter a value for email.&amp;lt;/message&amp;gt;
&amp;lt;/field-validator&amp;gt;
&amp;lt;field-validator type="email" short-circuit="true"&amp;gt;
&amp;lt;message&amp;gt;Not a valid e-mail.&amp;lt;/message&amp;gt;
&amp;lt;/field-validator&amp;gt;
&amp;lt;/field&amp;gt;
&amp;lt;!-- Field Validators for email2 field --&amp;gt;
&amp;lt;field name="email2"&amp;gt;
&amp;lt;field-validator type="required"&amp;gt;
&amp;lt;message&amp;gt;You must enter a value for email2.&amp;lt;/message&amp;gt;
&amp;lt;/field-validator&amp;gt;
&amp;lt;field-validator type="email"&amp;gt;
&amp;lt;message&amp;gt;Not a valid e-mail2.&amp;lt;/message&amp;gt;
&amp;lt;/field-validator&amp;gt;
&amp;lt;/field&amp;gt;
&amp;lt;!-- Plain Validator 1 --&amp;gt;
&amp;lt;validator type="expression"&amp;gt;
&amp;lt;param name="expression"&amp;gt;email.equals(email2)&amp;lt;/param&amp;gt;
&amp;lt;message&amp;gt;Email not the same as email2&amp;lt;/message&amp;gt;
&amp;lt;/validator&amp;gt;
&amp;lt;!-- Plain Validator 2 --&amp;gt;
&amp;lt;validator type="expression" short-circuit="true"&amp;gt;
&amp;lt;param name="expression"&amp;gt;email.startsWith('mark')&amp;lt;/param&amp;gt;
&amp;lt;message&amp;gt;Email does not start with mark&amp;lt;/message&amp;gt;
&amp;lt;/validator&amp;gt;
&amp;lt;/validators&amp;gt;&lt;/pre>
&lt;p>校验的顺序：首先Validator，其次Field Validator，但是在Validator或者Field Validator执行的过程中，顺序按照xml文件中的定义。短路的意思是，一旦一个短路的校验出错，其余后续的校验将不再进行。例如上述的顺序是：
1）Plain Validator 1&lt;br>
2）Plain Validator 2&lt;br>
3）Field Validators for email field&lt;br>
4）Field Validators for email2 field
由于Validator 2是短路的，一旦Validator 2校验出错，则email和email2都不会进入校验过程。&lt;/p>
&lt;h2 id="58节validate方法">5.8节：validate方法&lt;/h2>
&lt;p>ActionSupport实现了Validatable接口，这个接口中定义了一个validate方法，通过重写validate方法可以完成更详细的校验，例如：&lt;/p>
&lt;pre escaped="true" lang="java" line="1">public void validate() {
User user = getUser();
if (StringUtils.isBlank(user.getName())) {
addActionError(getText("user.name.empty"));
}
if (StringUtils.isBlank(user.getAddress())) {
addActionError(getText("user.address.empty"));
}
}&lt;/pre>
&lt;p>ActionSupport同时也实现了ValidationAware接口，该接口提供了addActionError等输出错误消息的方法。&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/struts2/">Struts2</category><category domain="https://fatkun.github.io/tags/validate/">Validate</category><category domain="https://fatkun.github.io/tags/validation/">Validation</category><category domain="https://fatkun.github.io/tags/validation.xml/">Validation.xml</category></item><item><title>win7放着音乐，QQ来消息声音变小解决方法</title><link>https://fatkun.github.io/2010/07/qq-sound.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/qq-sound.html</guid><pubDate>Tue, 06 Jul 2010 11:33:37 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>QQ来消息声音就减低了，很不爽，一首歌都被打扰。。按图中的方法设置即可。&lt;br>
在控制面板或鼠标右键单击系统托盘上的喇叭图标 ，弹出菜单中选择“ 声音(Sound)”，打开“声音”窗口，切换到“通信”标签，将“当Windows检测到通信活动时”设置为“不执行任何操作”。
&lt;a href="http://www.flickr.com/photos/fatkun/4767697746/" title="sy">&lt;img src="http://farm5.static.flickr.com/4098/4767697746_ab8e699459_b.jpg" alt="sy">&lt;/a>{.flickr-image.alignnone}&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/qq%E9%9F%B3%E4%B9%90/">Qq音乐</category><category domain="https://fatkun.github.io/tags/window7/">Window7</category><category domain="https://fatkun.github.io/tags/%E5%81%9C%E6%AD%A2/">停止</category><category domain="https://fatkun.github.io/tags/%E5%A3%B0%E9%9F%B3/">声音</category></item><item><title>000webhost开启gzip压缩(使用htaccess开启gzip)</title><link>https://fatkun.github.io/2010/07/000webhost-htaccess-gzip.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/000webhost-htaccess-gzip.html</guid><pubDate>Tue, 06 Jul 2010 04:35:17 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>对于&lt;a style="text-decoration: none; color: #3d1466;" href="http://www.000webhost.com/">000webhost&lt;/a>空间，开启Gzip压缩功能会有网页打不开的现象，不管是通过插件开启还是其他方法，网页打不开，后台打不开始终是个大问题。&lt;/p>
&lt;p style="margin-top: 0px; margin-bottom: 15px;"> 首先，看看你的根目录下有没有.htaccess文件，如果没有请在本地建立x.htaccess然后上传到你的根目录下，重命名为.htaccess。请注意，.htaccess文件的位置是在根目录下，比如我的是public_html/.htaccess。&lt;/p>
&lt;p style="margin-top: 0px; margin-bottom: 15px;"> 其次，打开.htaccess文件，添加以下语句&lt;/p>
&lt;pre escaped="true" lang="html">php_flag zlib.output_compression On
php_value zlib.output_compression_level 8&lt;/pre>
检测你的博客，看看是否开启了Gzip压缩功能。
&lt;a href="http://tool.chinaz.com/Gzips/" target="_blank">http://tool.chinaz.com/Gzips/&lt;/a>
&lt;a href="http://gzip.zzbaike.com/" target="_blank">http://gzip.zzbaike.com/&lt;/a>
上文来源：&lt;http://www.indear.net/274.html>
&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;-
我的首页压缩后的大小
&lt;table style="border-collapse: collapse; font-size: 14px; line-height: 25px; color: #666666; width: 430px; font-family: Simsun; padding: 0px; margin: 0px;" border="0"> &lt;tr style="background-color: #6fbee7; padding: 0px; margin: 0px;"> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; height: 25px; margin: 0px; border: 1px solid #6fbee7;" colspan="2"> &lt;h2 style="font-size: 16px; font-weight: bold; color: #ffffff; padding: 0px; margin: 0px;"> 检测结果 &lt;/h2> &lt;/td> &lt;/tr>
&lt;tr style="padding: 0px; margin: 0px;"> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; height: 25px; margin: 0px; border: 1px solid #6fbee7;"> 是否压缩？ &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; height: 25px; margin: 0px; border: 1px solid #6fbee7;"> &lt;span style="font-weight: bold; color: #009900; padding: 0px; margin: 0px;">是&lt;/span> &lt;/td> &lt;/tr>
&lt;tr style="padding: 0px; margin: 0px;"> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; height: 25px; margin: 0px; border: 1px solid #6fbee7;"> 压缩类型： &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; height: 25px; margin: 0px; border: 1px solid #6fbee7;"> &lt;span style="font-weight: bold; color: #0000ff; padding: 0px; margin: 0px;">gzip&lt;/span> &lt;/td> &lt;/tr>
&lt;tr style="padding: 0px; margin: 0px;"> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; height: 25px; margin: 0px; border: 1px solid #6fbee7;"> 源文件大小： &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; height: 25px; margin: 0px; border: 1px solid #6fbee7;"> &lt;span style="font-weight: bold; padding: 0px; margin: 0px;">40.64KB&lt;/span> &lt;/td> &lt;/tr>
&lt;tr style="padding: 0px; margin: 0px;"> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; height: 25px; margin: 0px; border: 1px solid #6fbee7;"> 压缩后大小： &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; height: 25px; margin: 0px; border: 1px solid #6fbee7;"> &lt;span style="font-weight: bold; padding: 0px; margin: 0px;">9.98KB&lt;/span> &lt;/td> &lt;/tr>
&lt;tr style="padding: 0px; margin: 0px;"> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; height: 25px; margin: 0px; border: 1px solid #6fbee7;"> 压缩率： &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; height: 25px; margin: 0px; border: 1px solid #6fbee7;"> &lt;span style="font-weight: bold; padding: 0px; margin: 0px;">75.4%&lt;/span> &lt;/td> &lt;/tr>&lt;/table>
压缩得还不小吧，以前一直以为装了&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; word-wrap: break-word; display: block; background-position: initial initial; background-repeat: initial initial; padding: 0px; border: 0px initial initial;">&lt;strong>WP Super Cache&lt;/strong>，并且启用了gzip就可以了，发现根本没有启用到，可能是000webhost本身的缘故吧，使用上文所写的方法就可以启用了。&lt;/span>
&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; word-wrap: break-word; display: block; background-position: initial initial; background-repeat: initial initial; padding: 0px; border: 0px initial initial;">开启后super cache会提示&lt;/span>
> &lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; word-wrap: break-word; display: block; background-position: initial initial; background-repeat: initial initial; padding: 0px; border: 0px initial initial;">PHP 正在压缩发送给您网站访客的数据。建议停用此功能，因为插件会压缩一遍页面，而不是一遍又一遍压缩相同的页面。&lt;/span>
应该是说它已经一次性帮你压缩缓存成文件了，不需要每次都压缩页面（在htaccess改每访问一次都会压缩），可是插件根本没压缩啊。。没办法，只能这样了，反正效率差不了多少。</description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/gzip/">Gzip</category><category domain="https://fatkun.github.io/tags/htaccess/">Htaccess</category></item><item><title>最难的《超级马里奥》关卡</title><link>https://fatkun.github.io/2010/07/super-mario.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/super-mario.html</guid><pubDate>Sat, 03 Jul 2010 14:29:57 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>真牛B啊。。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%90%9E%E7%AC%91%E5%A8%B1%E4%B9%90/">搞笑娱乐</category><category domain="https://fatkun.github.io/tags/%E8%B6%85%E7%BA%A7%E9%A9%AC%E9%87%8C%E5%A5%A5/">超级马里奥</category></item><item><title>如何在SQL中先排序后分组</title><link>https://fatkun.github.io/2010/07/group-by-and-order-by.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/group-by-and-order-by.html</guid><pubDate>Sat, 03 Jul 2010 13:50:44 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>标题说的有点奇怪，换句话说是让order by比group by先执行。还不明白对吧？&lt;br>
举个例子：实现场景，要实现QQ空间的动态消息，首先要按最新的消息查到QQ好友排序，然后再按好友分别查询他们的动态消息
有如下的Feed表&lt;/p>
&lt;pre>id userid type msg who time
1 2 add_twitter hahah 1 2010-04-27 19:12:38
2 2 add_twitter 怎么啦 2 2010-04-27 19:12:44
3 4 add_twitter asddas 3 2010-04-27 19:20:26
4 2 reply_twitter 放大法 4 2010-04-27 19:24:09
5 5 reply_twitter 噶 5 2010-04-27 19:24:13
6 3 add_twitter saf 6 2010-04-27 19:35:48
7 2 add_twitter 先谢谢谢谢谢谢 7 2010-04-27 19:54:44&lt;/pre>
&lt;p>现在想要，按时间先后，把用户的id查询出来，每个id只出现一次。
当然，第一时间就想到用group by语句来分组嘛&lt;/p>
&lt;pre escaped="true" lang="sql">select * from feed group by userid order by time&lt;/pre>
&lt;p>可是，得到的结果并不是自己想要的，group by比order by先解析了，结果就是得到最旧的那一条。&lt;/p>
&lt;h2 id="正确的方法">正确的方法&lt;/h2>
&lt;p>使用子查询&lt;/p>
&lt;pre escaped="true" lang="sql">select * from
(select * from feed order by time) as T
group by T.userid order by T.time&lt;/pre>
&lt;p>上面这句在mysql可以正常取值，但是在hibernate不能使用from 后面的子查询，杯具。。&lt;br>
换个折中的方法，以下方法只是为了取得userid而已&lt;/p>
&lt;pre escaped="true" lang="sql">select * from feed group by userid order by max(time)&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category><category domain="https://fatkun.github.io/tags/group-by/">Group By</category><category domain="https://fatkun.github.io/tags/hibernate%E5%AD%90%E6%9F%A5%E8%AF%A2/">Hibernate子查询</category><category domain="https://fatkun.github.io/tags/order-by/">Order By</category></item><item><title>使用JavaBean操作数据库的例子(JSP)</title><link>https://fatkun.github.io/2010/07/javabean-database.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/javabean-database.html</guid><pubDate>Sat, 03 Jul 2010 06:58:23 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这个只是一个登陆的 页面，只做了查询和增加。非常简洁，适合新手。&lt;br>
1.使用前先创建一个数据库，然后用“查询”，用记事本打开user.sql内容，复制到SQL查询窗口运行，就会帮你建立一个user表和插入几条数据。&lt;br>
2.Eclipse 中导入该项目即可，(菜单File-&amp;gt;Import-&amp;gt;General-&amp;gt;Existing Projects into Workspace)&lt;br>
3.src\DB\Conn.java为数据库连接代码，请修改为你本机对应的参数&lt;br>
private String db = “test”; // 数据库名&lt;br>
private String user = “root”; // 数据库用户名&lt;br>
private String pass = “”; // 数据库密码&lt;/p>
&lt;pre escaped="true" lang="java" line="1">package DB;
import java.sql.*;
public class Conn {
private String db = "test"; // 数据库名
private String user = "root"; // 数据库用户名
private String pass = ""; // 数据库密码
private String drivername = "com.mysql.jdbc.Driver"; // mysql driver
private String URL = "jdbc:mysql://localhost:3306/" + db
+ "?useUnicode=true&amp;characterEncoding=UTF8&amp;user=" + user
+ "&amp;password=" + pass;
private Connection conn = null;
public Conn(){
conn = this.getConn();
}
public Connection getConn() { // get database connection
Connection aconn = null;
try {
Class.forName(drivername).newInstance(); // 载入驱动器
aconn = DriverManager.getConnection(URL); // 连接到数据库
} catch (Exception e) {
e.printStackTrace();
}
return aconn;
}
public ResultSet executeQuery(String str) {
ResultSet rs = null;
try {
Statement stmt = conn.createStatement(); // 语句接口
rs = stmt.executeQuery(str); // 获得结果集
} catch (Exception e) {
e.printStackTrace();
}
return rs;
}
public int executeUpdate(String str) {
int ret = 0;
try {
Statement stmt = conn.createStatement();
ret = stmt.executeUpdate(str);//执行sql语句，返回影响行数
} catch (SQLException e) {
e.printStackTrace();
}
return ret;
}
}
&lt;/pre>
&lt;p>下载地址:&lt;a href="http://cid-48ca6ece8e801d64.office.live.com/self.aspx/.Public/Demo%5E_JavaBean.rar" target="_blank">&lt;a href="http://cid-48ca6ece8e801d64.office.live.com/self.aspx/.Public/Demo%5E_JavaBean.rar">http://cid-48ca6ece8e801d64.office.live.com/self.aspx/.Public/Demo%5E_JavaBean.rar&lt;/a>&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/javabean/">Javabean</category><category domain="https://fatkun.github.io/tags/jsp/">Jsp</category></item><item><title>卖火柴的小女孩1-16【超扯童話血多】</title><link>https://fatkun.github.io/2010/07/sell-match-girl.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/07/sell-match-girl.html</guid><pubDate>Fri, 02 Jul 2010 04:38:18 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>我是卖火柴的小女孩这样。本来很悲剧的一个童话居然。。。自己看吧。。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%90%9E%E7%AC%91%E5%A8%B1%E4%B9%90/">搞笑娱乐</category><category domain="https://fatkun.github.io/tags/%E5%B0%8F%E7%81%AB%E6%9F%B4/">小火柴</category></item><item><title>WIN7的菜单栏无法隐藏解决方法（QtTabBar）</title><link>https://fatkun.github.io/2010/06/win7-menu-can-not-hide.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/win7-menu-can-not-hide.html</guid><pubDate>Tue, 29 Jun 2010 07:10:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="问题">问题&lt;/h2>
&lt;ol>
&lt;li>不能隐藏菜单栏&lt;/li>
&lt;li>已经不选菜单栏了，可它还是显示“File，Edit….”这一列，在文件夹选项里设置也无效。今天装了个QTTabBar之后，就一直这样菜单栏隐藏不了了，把QTTabBar卸了也还是这样。&lt;/li>
&lt;li>按照网上说的修改组策略的方法依然不可以隐藏&lt;/li>
&lt;/ol>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>按“WIN+R”（也就是键盘左下角的徽标键+R），输入gpedit.msg 打开组策略编辑器（也可以在控制面板中搜索“策略”找到），依次展开“用户配置→管理模版→Windows组件→Windows资源管理器”，然后在右侧窗口中双击“在Windows资源管理器中显示菜单栏”，设置为“已禁用”。
&lt;a href="http://www.flickr.com/photos/fatkun/4744639019/" title="组策略">&lt;img src="http://farm5.static.flickr.com/4117/4744639019_573812d9b9_b.jpg" alt="组策略">&lt;/a>{.flickr-image.alignnone}
&lt;a href="http://www.flickr.com/photos/fatkun/4744639019/" title="组策略">&lt;/a>{.flickr-image.alignnone}然后现在试试能不能把菜单隐藏掉？如果不行，再看下面。
&lt;a href="http://www.flickr.com/photos/fatkun/4744647861/" title="phpvnSF2r">&lt;img src="http://farm5.static.flickr.com/4073/4744647861_4cf606668c.jpg" alt="phpvnSF2r">&lt;/a>{.flickr-image.alignnone}
如果依然不行，把下面的内容保存为1.bat，然后双击它运行。&lt;/p>
&lt;pre>reg delete "HKCU\Software\Microsoft\Internet Explorer\Toolbar\WebBrowser" /v ITBar7Layout /f
reg delete "HKCU\Software\Microsoft\Internet Explorer\Toolbar\WebBrowser" /v ITBar7Height /f
reg delete "HKCU\Software\Microsoft\Internet Explorer\Toolbar\ShellBrowser" /v ITBar7Layout /f
reg delete "HKCU\Software\Microsoft\Internet Explorer\Toolbar\ShellBrowser" /v ITBar7Height /f&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/qttabbar/">QTTabBar</category><category domain="https://fatkun.github.io/tags/win7/">Win7</category><category domain="https://fatkun.github.io/tags/%E6%97%A0%E6%B3%95%E9%9A%90%E8%97%8F/">无法隐藏</category><category domain="https://fatkun.github.io/tags/%E8%8F%9C%E5%8D%95%E6%A0%8F/">菜单栏</category></item><item><title>《小胖妞》- 广美学生何伟锋毕业作品</title><link>https://fatkun.github.io/2010/06/xiao-pan-niu.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/xiao-pan-niu.html</guid><pubDate>Mon, 28 Jun 2010 11:09:58 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这种实景加漫画的方式挺好看的·~真的很牛B&lt;del>牙签筒当武器&lt;/del>小胖妞，当她的样子变丑了，你还会爱她吗？&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%90%9E%E7%AC%91%E5%A8%B1%E4%B9%90/">搞笑娱乐</category><category domain="https://fatkun.github.io/tags/%E5%B0%8F%E8%83%96%E5%A6%9E/">小胖妞</category><category domain="https://fatkun.github.io/tags/%E5%B9%BF%E7%BE%8E/">广美</category><category domain="https://fatkun.github.io/tags/%E6%BC%AB%E7%94%BB/">漫画</category></item><item><title>Eclipse3.6正式版的下载地址</title><link>https://fatkun.github.io/2010/06/eclipse3-6-download.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/eclipse3-6-download.html</guid><pubDate>Thu, 24 Jun 2010 05:27:50 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Eclipse3.6正式版官方的下载地址还没有放出，不过捐赠Eclipse就可以成为Friends，可以提前从官网下载到3.6正式版。。。其实Eclipse也挺好用的~
官方的下载地址是(今天还不可以下载):&lt;/p>
&lt;table style="word-wrap: break-word; empty-cells: show; border-collapse: collapse; line-height: normal; width: 600px; table-layout: fixed; margin-left: 1px;" border="0" cellspacing="0" cellpadding="0"> &lt;tr style="word-wrap: break-word; line-height: normal;"> &lt;td id="postmessage_938" style="word-wrap: break-word; color: #444444; font: normal normal normal 12px/1.6em Verdana, Helvetica, Arial, sans-serif; line-height: 1.6em; font-size: 14px;"> &lt;a href="http://www.eclipse.org/helios/">http://www.eclipse.org/helios/&lt;/a>&lt;/p>
&lt;pre>&lt;code> &amp;lt;p&amp;gt; 网上流传的下载地址是在这里：&amp;lt;a href=&amp;quot;http://mirror.cc.vt.edu/pub/eclipse/technology/epp/downloads/release/helios/R/&amp;quot;&amp;gt;http://mirror.cc.vt.edu/pub/eclipse/technology/epp/downloads/release/helios/R/&amp;lt;/a&amp;gt; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; 有兴趣尝新的试试~~ &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;lt;span style=&amp;quot;line-height: normal; white-space: nowrap;&amp;quot;&amp;gt;&amp;lt;a class=&amp;quot;flickr-image alignnone&amp;quot; title=&amp;quot;eclipse3.6&amp;quot; href=&amp;quot;http://www.flickr.com/photos/fatkun/4729007575/&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;http://farm2.static.flickr.com/1253/4729007575_b9af417d4e_b.jpg&amp;quot; alt=&amp;quot;eclipse3.6&amp;quot; /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt; &amp;lt;/tbody&amp;gt; &amp;lt;/table&amp;gt;&lt;/code>&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/eclipse3.6/">Eclipse3.6</category><category domain="https://fatkun.github.io/tags/%E4%B8%8B%E8%BD%BD%E5%9C%B0%E5%9D%80/">下载地址</category><category domain="https://fatkun.github.io/tags/%E6%AD%A3%E5%BC%8F%E7%89%88/">正式版</category><category domain="https://fatkun.github.io/tags/%E9%95%9C%E5%83%8F/">镜像</category></item><item><title>橡皮泥象棋变形金刚</title><link>https://fatkun.github.io/2010/06/chinese-chess-war.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/chinese-chess-war.html</guid><pubDate>Thu, 24 Jun 2010 05:10:36 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>那象棋变形得还不错&lt;del>依然是个花费时间拍的东西&lt;/del>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%90%9E%E7%AC%91%E5%A8%B1%E4%B9%90/">搞笑娱乐</category><category domain="https://fatkun.github.io/tags/%E4%B8%AD%E5%9B%BD%E8%B1%A1%E6%A3%8B/">中国象棋</category><category domain="https://fatkun.github.io/tags/%E6%91%86%E6%8B%8D/">摆拍</category></item><item><title>Mysql指定编码创建数据库</title><link>https://fatkun.github.io/2010/06/mysql-charset.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/mysql-charset.html</guid><pubDate>Mon, 21 Jun 2010 06:42:23 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>mysql 创建数据库时指定编码很重要，一般都指定为统一的UTF-8编码，如果不指定编码，默认编码为lan1，插入中文时是会提示错误的，类似”\x22\x34″&lt;/p>
&lt;pre escaped="true" lang="sql">CREATE DATABASE `test2` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category></item><item><title>蜡烛表演-蜡烛版俄罗斯方块</title><link>https://fatkun.github.io/2010/06/lazhu.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/lazhu.html</guid><pubDate>Fri, 18 Jun 2010 17:05:34 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>蜡烛表演-蜡烛版俄罗斯方块，挺牛B的。。要拍挺久吧。。。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%90%9E%E7%AC%91%E5%A8%B1%E4%B9%90/">搞笑娱乐</category></item><item><title>Flash游戏-叠叠乐（Super stacker2），挺好玩的</title><link>https://fatkun.github.io/2010/06/super-stacker2.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/super-stacker2.html</guid><pubDate>Thu, 17 Jun 2010 16:04:04 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p style="padding: 0px; margin: 0px;"> 叠叠乐，我自己起的名字= =！非常之好玩，很奇特。用你自己的方法。每个人玩的结果都不同。&lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> 好过瘾啊.哇哈哈哈哈哈!!!!!&lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> 要有耐心先嘚噶.&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%90%9E%E7%AC%91%E5%A8%B1%E4%B9%90/">搞笑娱乐</category><category domain="https://fatkun.github.io/tags/flash/">Flash</category><category domain="https://fatkun.github.io/tags/%E6%B8%B8%E6%88%8F/">游戏</category></item><item><title>Android选项卡(TabWidget)例子</title><link>https://fatkun.github.io/2010/06/android-tabwidget.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/android-tabwidget.html</guid><pubDate>Thu, 17 Jun 2010 02:10:52 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>首届Google暑期大学生博客分享大赛——2010 Andriod篇
Android选项卡的一个例子，这个例子是照着SDK 文档做的（resources/tutorials/views/hello-tabwidget.html），为了省事少做了一些图标类的东西。
&lt;a href="http://www.flickr.com/photos/fatkun/4706942050/" title="tab">&lt;img src="http://farm5.static.flickr.com/4008/4706942050_b50ddd0478_b.jpg" alt="tab">&lt;/a>{.flickr-image.alignnone}&lt;/p>
&lt;h2 id="heading">&lt;/h2>
&lt;p>步骤&lt;/p>
&lt;h3 id="1建立两个activity作为tab内容-我这里是oneactivitytestactivity">1.建立两个Activity，作为tab内容 （我这里是OneActivity、TestActivity)&lt;/h3>
&lt;pre escaped="true" lang="java">public class OneActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView textview = new TextView(this);
textview.setText("This is the Artists tab");
setContentView(textview);
}
}&lt;/pre>
&lt;h3 id="2在layout文件夹中建立tabxml用于怎样显示tab页面">2.在layout文件夹中建立tab.xml用于怎样显示tab页面&lt;/h3>
&lt;p>&lt;span style="color: #ff0000;">注意：TabHost ，TabWidget ，FrameLayout的ID必须分别为@android:id/tabhost，@android:id/tabs，@android:id/tabcontent&lt;/span>&lt;br>
另外还要注意一下android:layout_width宽度和android:layout_height高度的取值，还要LinearLayout的android:orientation=”vertical”（LinearLayout默认是横向的）当你看到布局和我不一样时你就要考虑一下这里是不是错了。（= =！因为我错过）&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;TabHost android:id="@android:id/tabhost" android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"&amp;gt;
&amp;lt;LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
&amp;gt;
&amp;lt;TabWidget android:id="@android:id/tabs"
android:layout_width="fill_parent" android:layout_height="wrap_content"&amp;gt;&amp;lt;/TabWidget&amp;gt;
&amp;lt;FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" /&amp;gt;
&amp;lt;/LinearLayout&amp;gt;
&amp;lt;/TabHost&amp;gt;&lt;/pre>
&lt;h2 id="3新建一个类tabwidgetjava继承tabactivity类">3.新建一个类TabWidget.java，继承TabActivity类&lt;/h2>
&lt;pre escaped="true" lang="java">package com.fatkun;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
public class TabWidget extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tab);//这里使用了上面创建的xml文件（Tab页面的布局）
Resources res = getResources(); // Resource object to get Drawables
TabHost tabHost = getTabHost(); // The activity TabHost
TabSpec spec;
Intent intent; // Reusable Intent for each tab
//第一个TAB
intent = new Intent(this,OneActivity.class);//新建一个Intent用作Tab1显示的内容
spec = tabHost.newTabSpec("tab1")//新建一个 Tab
.setIndicator("Tab1", res.getDrawable(android.R.drawable.ic_media_play))//设置名称以及图标
.setContent(intent);//设置显示的intent，这里的参数也可以是R.id.xxx
tabHost.addTab(spec);//添加进tabHost
//第二个TAB
intent = new Intent(this,TestActivity.class);//第二个Intent用作Tab1显示的内容
spec = tabHost.newTabSpec("tab2")//新建一个 Tab
.setIndicator("Tab2", res.getDrawable(android.R.drawable.ic_menu_camera))//设置名称以及图标
.setContent(intent);//设置显示的intent，这里的参数也可以是R.id.xxx
tabHost.addTab(spec);//添加进tabHost
tabHost.setCurrentTab(1);
}
}&lt;/pre>
&lt;h2 id="4最后一步在androidmanifestxml加入你的activity">4.最后一步，在AndroidManifest.xml加入你的Activity&lt;/h2>
&lt;p>android:theme=”@android:style/Theme.NoTitleBar”是可以使得TabWidget窗口没有标题，多点空间显示&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;activity android:name="TabWidget" android:theme="@android:style/Theme.NoTitleBar"&amp;gt;&amp;lt;/activity&amp;gt;
&amp;lt;activity android:name="OneActivity"&amp;gt;&amp;lt;/activity&amp;gt;
&amp;lt;activity android:name="TestActivity"&amp;gt;&amp;lt;/activity&amp;gt;&lt;/pre></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/tags/android/">Android</category></item><item><title>flash游戏-射断绳子救人</title><link>https://fatkun.github.io/2010/06/flash-help-people.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/flash-help-people.html</guid><pubDate>Wed, 16 Jun 2010 16:01:38 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>玩法：射断绳子，救下这些上吊的人，千万小心，别射中他们了.会很惨的啊。。 /yy&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%90%9E%E7%AC%91%E5%A8%B1%E4%B9%90/">搞笑娱乐</category><category domain="https://fatkun.github.io/tags/flash/">Flash</category><category domain="https://fatkun.github.io/tags/%E6%90%9E%E7%AC%91/">搞笑</category></item><item><title>Android下拉列表(Spinner)例子</title><link>https://fatkun.github.io/2010/06/android-spinner.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/android-spinner.html</guid><pubDate>Tue, 15 Jun 2010 11:32:06 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>下拉列表(Spinner)的例子，首先要在layout中拖放一个Spinner，例子中的ID为Spinner01&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;Spinner android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_y="132dip" android:layout_x="97dip" android:id="@+id/Spinner01"&amp;gt;&amp;lt;/Spinner&amp;gt;&lt;/pre>
&lt;p>代码：&lt;/p>
&lt;pre escaped="true" lang="java">/*
ArrayAdapter.createFromResource参数解析：
第一个是Context，
第二个(R.array.colors)是数据来源，在values.xml，内容为
&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;resources&amp;gt;
&amp;lt;string-array name="colors"&amp;gt;
&amp;lt;item&amp;gt;red&amp;lt;/item&amp;gt;
&amp;lt;item&amp;gt;blue&amp;lt;/item&amp;gt;
&amp;lt;item&amp;gt;green&amp;lt;/item&amp;gt;
&amp;lt;item&amp;gt;yellow&amp;lt;/item&amp;gt;
&amp;lt;item&amp;gt;black&amp;lt;/item&amp;gt;
&amp;lt;/string-array&amp;gt;
&amp;lt;/resources&amp;gt;
第三个（android.R.layout.simple_spinner_item）为显示的样式
*/
Spinner spinner = (Spinner) findViewById(R.id.Spinner01);
//建立方法有两种
//方法一,从xml读取
//ArrayAdapter&amp;lt;CharSequence&amp;gt; adapter = ArrayAdapter.createFromResource(this, R.array.colors, android.R.layout.simple_spinner_item);
//方法二,使用数组
CharSequence[] seq = {"test11","test12","test13","test14","test15"};
ArrayAdapter&amp;lt;CharSequence&amp;gt; adapter = new ArrayAdapter&amp;lt;CharSequence&amp;gt;(this, android.R.layout.simple_spinner_item, seq);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView&amp;lt;?&amp;gt; parent, View view, int position, long id) {
//showToast("Spinner1: position=" + position + " id=" + id);
//选择后
}
public void onNothingSelected(AdapterView&amp;lt;?&amp;gt; arg0) {
//showToast("没有选择");
//没有选择
}
});&lt;/pre></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/android/">Android</category><category domain="https://fatkun.github.io/tags/%E7%95%8C%E9%9D%A2/">界面</category></item><item><title>Android-AlertDialog(警告窗口)例子</title><link>https://fatkun.github.io/2010/06/android-alertdialog.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/android-alertdialog.html</guid><pubDate>Tue, 15 Jun 2010 11:14:29 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Android-AlertDialog(警告窗口)的一个例子&lt;br>
&lt;a href="http://www.flickr.com/photos/fatkun/4702425695/" title="php1DUUrR">&lt;img src="http://farm5.static.flickr.com/4021/4702425695_95c2d9a5cc.jpg" alt="php1DUUrR">&lt;/a>{.flickr-image.alignnone}&lt;/p>
&lt;pre escaped="true" lang="java">new AlertDialog.Builder(TestActivity.this)//Context
.setTitle("标题啊")
.setIcon(android.R.drawable.ic_dialog_alert)//图标
.setMessage("内容")
.setNegativeButton("取消",new DialogInterface.OnClickListener() {//按钮1
public void onClick(DialogInterface arg0, int arg1) {
}
})
.setPositiveButton("确定", new DialogInterface.OnClickListener() {//按钮2
public void onClick(DialogInterface arg0, int arg1) {
finish();
}
}).show();//显示&lt;/pre></description><category domain="https://fatkun.github.io/categories/android/">Android</category><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/android/">Android</category></item><item><title>联想乐Phone，你想拥有吗？</title><link>https://fatkun.github.io/2010/06/lephone.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/lephone.html</guid><pubDate>Thu, 10 Jun 2010 09:46:23 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>联想&lt;a href="http://www.holaba.com.cn/lenovo/mobile-phones/lenovo-lephone" target="_blank">乐phone&lt;/a>虽然不能给人耳目一新的感觉，但是它的成功在于细节，它的手机正面没有任何按钮，甚至比苹果iPhone做得还过火。它的月牙形外放喇叭体现了“乐”的内涵；磁吸式的数据线接口没有一个老牌的硬件厂商的技术底蕴支撑也不敢贸然采用；哪怕连手机电池盖背面也加上马赛克贴片来美化一番，这些都说明了联想乐phone的优秀工业设计。
感觉上配置还是挺不错的，相对于HTC的G3来说。。价格也算符合国内国情~你想要这么一部Android手机乐phone吗？
**&lt;a href="http://www.flickr.com/photos/fatkun/4687322663/" title="phpKwqU12">&lt;img src="http://farm5.static.flickr.com/4062/4687322663_f0f7d73859.jpg" alt="phpKwqU12">&lt;/a>{.flickr-image.alignnone}&lt;a href="http://www.flickr.com/photos/fatkun/4687957770/" title="phpwzX5Vq">&lt;img src="http://farm5.static.flickr.com/4052/4687957770_8c3a6f8b71.jpg" alt="phpwzX5Vq">&lt;/a>{.flickr-image.alignnone}**&lt;/p>
&lt;h2 id="基本参数">基本参数&lt;/h2>
&lt;table style="font-family: 宋体; padding: 0px; margin: 0px; border: 0px initial initial;" border="0" cellspacing="0"> &lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e0f0fd; background-position: initial initial; background-repeat: initial initial; margin: 0px;"> &lt;a style="text-decoration: none; color: #000099;" href="http://club.tech.sina.com.cn/mobile/thread-65732-1-2.html" target="_blank">手机类型&lt;/a> &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eef8ff; background-position: initial initial; background-repeat: initial initial; margin: 0px; border: 0px initial initial;"> 智能手机,轻薄手机,GPS手机 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; margin: 0px;"> &lt;a style="text-decoration: none; color: #000099;" href="http://club.tech.sina.com.cn/mobile/thread-65740-1-2.html" target="_blank">上市时间&lt;/a> &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; margin: 0px; border: 0px initial initial;"> 2010年05月 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e0f0fd; background-position: initial initial; background-repeat: initial initial; margin: 0px;"> &lt;a style="text-decoration: none; color: #000099;" href="http://club.tech.sina.com.cn/mobile/thread-65741-1-2.html" target="_blank">手机频段&lt;/a> &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eef8ff; background-position: initial initial; background-repeat: initial initial; margin: 0px; border: 0px initial initial;"> GSM 850/900/1800/1900Mhz，支持 WCDMA，支持 GPRS/EDGE &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; margin: 0px;"> &lt;a style="text-decoration: none; color: #000099;" href="http://club.tech.sina.com.cn/mobile/thread-65747-1-2.html" target="_blank">手机外形&lt;/a> &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; margin: 0px; border: 0px initial initial;"> 直板 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e0f0fd; background-position: initial initial; background-repeat: initial initial; margin: 0px;"> &lt;a style="text-decoration: none; color: #000099;" href="http://club.tech.sina.com.cn/mobile/thread-65785-1-2.html" target="_blank">外壳颜色&lt;/a> &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eef8ff; background-position: initial initial; background-repeat: initial initial; margin: 0px; border: 0px initial initial;"> 黑色，珍珠红 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; margin: 0px;"> &lt;a style="text-decoration: none; color: #000099;" href="http://club.tech.sina.com.cn/mobile/thread-68723-1-1.html" target="_blank">体积&lt;/a> &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; margin: 0px; border: 0px initial initial;"> 120×61×12mm,体积：87cm&lt;sup>3&lt;/sup> &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e0f0fd; background-position: initial initial; background-repeat: initial initial; margin: 0px;"> 重量 &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eef8ff; background-position: initial initial; background-repeat: initial initial; margin: 0px; border: 0px initial initial;"> 165g &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; margin: 0px;"> &lt;a style="text-decoration: none; color: #000099;" href="http://club.tech.sina.com.cn/mobile/thread-65812-1-2.html" target="_blank">主屏参数&lt;/a> &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; margin: 0px; border: 0px initial initial;"> AMOLED彩色屏幕；480×800像素(WVGA)，3.7英寸； &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e0f0fd; background-position: initial initial; background-repeat: initial initial; margin: 0px;"> &lt;a style="text-decoration: none; color: #000099;" href="http://club.tech.sina.com.cn/mobile/thread-65838-1-2.html" target="_blank">操作系统&lt;/a> &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eef8ff; background-position: initial initial; background-repeat: initial initial; margin: 0px; border: 0px initial initial;"> Andriod Android 1.6 &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; margin: 0px;"> 处理器类型 &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; margin: 0px; border: 0px initial initial;"> 高通 snapdragon QSD8250，CPU频率 1024MHz &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e0f0fd; background-position: initial initial; background-repeat: initial initial; margin: 0px;"> &lt;a style="text-decoration: none; color: #000099;" href="http://club.tech.sina.com.cn/mobile/thread-65848-1-2.html" target="_blank">内存&lt;/a> &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eef8ff; background-position: initial initial; background-repeat: initial initial; margin: 0px; border: 0px initial initial;"> 512MB RAM,512MB ROM &lt;/td> &lt;/tr>
&lt;tr> &lt;td style="padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-family: 宋体; width: 90px; height: 24px; text-align: right; border-right-style: solid; border-right-color: #ffffff; margin: 0px;"> &lt;a style="text-decoration: none; color: #000099;" href="http://club.tech.sina.com.cn/mobile/thread-65865-1-1.html" target="_blank">标准配置&lt;/a> &lt;/td>
&lt;td style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; font-family: 宋体; width: 606px; margin: 0px; border: 0px initial initial;"> 锂电池（1500mAh），电源适配器，座充，耳机，数据线，光盘，手机保护套，用户手册，保修卡，服务指南，合格证，宣传彩页，MicroSD卡 &lt;/td> &lt;/tr>&lt;/table></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E4%B9%90phone/">乐Phone</category></item><item><title>Willin Kan的小牆与WordPress Thread Comment有冲突</title><link>https://fatkun.github.io/2010/06/willin-kan%E7%9A%84%E5%B0%8F%E7%89%86%E4%B8%8Ewordpress-thread-comment%E6%9C%89%E5%86%B2%E7%AA%81.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/willin-kan%E7%9A%84%E5%B0%8F%E7%89%86%E4%B8%8Ewordpress-thread-comment%E6%9C%89%E5%86%B2%E7%AA%81.html</guid><pubDate>Fri, 04 Jun 2010 16:55:20 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>还是先把它撤下来。。。刚写了一段，居然不小心按了个Ctrl+Z撤销了。。悲剧啊。。。&lt;br>
&lt;img src="http://farm4.static.flickr.com/3356/3296617583_fa18f38e86_o.jpg" alt="">&lt;br>
刚看到一个SPAM，感觉不是SPAM…搜索一下。。都是这句话。。。汗啊。。
附内容：&lt;/p>
&lt;blockquote>
&lt;p>非常喜欢博主的博客theme，很PL，回去模仿一个去，不建议吧！呵呵&lt;/p>
&lt;/blockquote></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>wordpress flickr manager修改版下载（兼容2.8.x）</title><link>https://fatkun.github.io/2010/06/wordpress-flickr-manager-2-8.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/wordpress-flickr-manager-2-8.html</guid><pubDate>Tue, 01 Jun 2010 07:34:51 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>wordpress flickr manager可以很方便的在WP写文章插入图片，可以官方的插件搜索出来的已经没更新了。。只能找到别人的修改版了。
修改版下载地址：&lt;a href="http://u.115.com/file/f9b6284208" style="color: #a91b33; text-decoration: none;" title=" downloaded 129 times">WordPress flickr manager 兼容2.8.x &lt;/a>
&lt;a href="http://www.flickr.com/photos/fatkun/4659371950/" title="phpQjmCZM">&lt;img src="http://farm5.static.flickr.com/4029/4659371950_87fd35e913_b.jpg" alt="phpQjmCZM">&lt;/a>{.flickr-image.alignnone}
附图一张：&lt;a href="http://www.flickr.com/photos/fatkun/4659340996/" title="mm">&lt;img src="http://farm5.static.flickr.com/4025/4659340996_5497184711_b.jpg" alt="mm">&lt;/a>{.flickr-image.alignnone}&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/wordpress/">Wordpress</category><category domain="https://fatkun.github.io/tags/%E6%8F%92%E4%BB%B6/">插件</category></item><item><title>C#遍历DataSet</title><link>https://fatkun.github.io/2010/06/%E9%81%8D%E5%8E%86dataset.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/06/%E9%81%8D%E5%8E%86dataset.html</guid><pubDate>Mon, 31 May 2010 12:12:49 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>C#中的Dataset就像一个数据库，有多个表(Table)，一般只有一个表，然后每个表中有行(DataRow)和列(DataColumn)，DataRow[DataColumn]可以得到某行某列数据。&lt;/p>
&lt;pre escaped="true" lang="csharp">foreach (DataTable dt in YourDataset.Tables)
{
foreach (DataRow dr in dt.Rows)
foreach (DataColumn dc in dt.Columns)
Console.WriteLine("{0}, {1}, {2} ", dt.TableName, dc.ColumnName, dr[dc]);
}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/asp.net/">ASP.NET</category></item><item><title>心理学家教你谈恋爱</title><link>https://fatkun.github.io/2010/05/how-to-love.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/05/how-to-love.html</guid><pubDate>Mon, 31 May 2010 03:52:55 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>**第一式：小危险激发“心动”感觉。**人从事某些激烈或冒险活动时的身心反应，与恋爱时“过电”的感觉极其相似。除了玩玩过山车、看看惊悚片等办法，爱泼斯坦还教大家一个小游戏：两人交替着向后仰倒，由对方在身后接住。
**第二式：一点点靠近。**近水楼台有助于人们之间产生好感。如果两个人有意识地接近对方，故意地让对方进入自己的个人空间，很快他们之间就会变得亲密起来。练习法：两人相隔约1米站定，然后每隔10秒将距离拉近一点点，一直到双方快要碰到为止。
**第三式：模仿对方。**人们更容易同与自己相似的人———不论是智力水平、出身背景还是个人魅力方面———成为情侣，有时仅仅是模仿对方也能够增进相互之间的感情。练习法：两人靠近站着或坐下，随意地挪动自己的手脚，但是同时要模仿对方的动作，要做到两人都感到自己是自由而双方又是一致的。
**第四式：准备一些笑话。**在持久而幸福的婚恋关系中，爱侣们总能让对方开怀大笑。还有研究则表明，女性更容易倾心于能够让自己笑的男伴。
**第五式：一起做没做过的事情。**人的记忆都是分类储放，如果你在对方的每类记忆中都是第一个想起的人，那么也就真正做到“我中有你，你中有我”了。
**第六式：放松心理防线。**放松警戒才有助于感情的培养，但用酒精麻痹神经却不是好办法。可以两人轻轻地拥抱在一起，试着感觉对方的呼吸，逐渐使自己的呼吸与之同步。几分钟后，两人就会觉得合为一体。
**第七式：适当迁就对方。**为了对方特意做一些好的改变，比如戒烟、戒酒等，会让你的地位急速飙升。
**第八式：经常轻轻触碰。**简单的触碰能让人产生温暖、舒服的感觉，轻抚对方的后背功效神奇，对女性尤为如此。
**第九式：分享秘密。**将自己正在想的事物写在纸上，然后用几分钟的时间通过语言以外的方式向对方传达自己的思想，让对方来猜。
**第十式：全心全意。**自己三心二意的人往往会对伴侣的行为也疑神疑鬼，缺乏信任，长此以往，会对双方的关系造成致命的破坏。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category></item><item><title>MSSQL多个外键对应同一个表时查询外键的内容</title><link>https://fatkun.github.io/2010/05/mssql-foreign-key.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/05/mssql-foreign-key.html</guid><pubDate>Sat, 29 May 2010 04:11:05 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>当有一个表同时有多个外键同时指向某一个表时，需要通过外键来查询到相应的信息。
举个例子：这是一个订车票的
城市表&lt;/p>
&lt;pre escaped="true" lang="sql">CityID CityName
1 广州
2 湛江
3 江门
4 肇庆
5 惠州
6 汕头
&lt;/pre>
&lt;p>车次表&lt;/p>
&lt;pre escaped="true" lang="sql">CarID CarName StartCityID EndCityID
1 G001 1 2
2 G002 1 3&lt;/pre>
&lt;p>这里的StartCityID和EndCityID分别是城市表的外键&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>现在要把对应的始发城市和终点城市的名称取到，mssql语句可以这样&lt;br>
方法一：&lt;/p>
&lt;pre escaped="true" lang="sql">SELECT 始发站=c1.CityName,终点站=c2.CityName
FROM car,City c1,City c2
WHERE StartCityID = c1.CityID AND EndCityID = c2.CityID&lt;/pre>
&lt;p>方法二：&lt;/p>
&lt;pre escaped="true" lang="sql">SELECT 始发站=c1.CityName,终点站=c2.CityName
FROM car
join City c1 on StartCityID = c1.CityID
join City c2 on EndCityID = c2.CityID&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category><category domain="https://fatkun.github.io/tags/join/">Join</category><category domain="https://fatkun.github.io/tags/sqlserver/">Sqlserver</category><category domain="https://fatkun.github.io/tags/%E5%A4%96%E9%94%AE/">外键</category></item><item><title>JQuery无限联动的下拉框插件（选城市）</title><link>https://fatkun.github.io/2010/05/json2select.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/05/json2select.html</guid><pubDate>Fri, 28 May 2010 08:34:38 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>经常可能会用到一些需要联动的下拉框，包括选择城市之类的。可能是二级联动，三级联动等等~
JQuery中有个双联动的&lt;a href="http://plugins.jquery.com/project/doubleselect">doubleselect&lt;/a>，不过有时我们需要很多个下拉框一起关联。发现一个国内的jquery插件，感觉不错，中国地名压缩后最小可以达到29KB。
以后很有可能会用到，记录下来先
博客介绍：&lt;a href="http://shawphy.com/2008/12/json2select.html">http://shawphy.com/2008/12/json2select.html&lt;/a>
例子：&lt;a href="http://shawphy.googlecode.com/svn/javascript/json2select/json2select.html">http://shawphy.googlecode.com/svn/javascript/json2select/json2select.html&lt;/a>
全国城市数据：&lt;a href="http://shawphy.com/2009/07/json2select-data-of-city.html">http://shawphy.com/2009/07/json2select-data-of-city.html&lt;/a>
压缩后全国城市数据：&lt;a href="http://www.cnweb.org/down/areajson/">http://www.cnweb.org/down/areajson/&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/json/">Json</category><category domain="https://fatkun.github.io/tags/option/">Option</category><category domain="https://fatkun.github.io/tags/select/">Select</category><category domain="https://fatkun.github.io/tags/%E4%B8%89%E7%BA%A7%E8%81%94%E5%8A%A8/">三级联动</category></item><item><title>利用.htaccess解决000webhost免费主机Google Adsense验证问题(adsense.txt)</title><link>https://fatkun.github.io/2010/05/000webhost-and-google-adsense-adsense-txt.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/05/000webhost-and-google-adsense-adsense-txt.html</guid><pubDate>Fri, 28 May 2010 02:41:27 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>最近在申请Google Adsense，提示要验证域名的所有者，所以上网找到了这个方法。我使用的是wordpress，用super-cache时加了一些规则，注意要把下面的规则放到最前面。
&lt;strong>原创文章，转载请注明：&lt;/strong> 转载自&lt;a style="color: #5371c5; text-decoration: none; padding: 0px; margin: 0px;" href="http://www.imlongleg.com/archives/94.html">利用rewrite规则解决000webhost免费主机Google Adsense验证问题&lt;/a>&lt;/p>
&lt;h2 id="解决方法">解决方法：&lt;/h2>
&lt;p>最近长脚在生气Google Adsense的广告申请，可是在申请过程中遇到了瓶颈。Google Adsense需要在网站根目录放置一个adsense.txt的文件，来证明这个网站的所有权。长脚在放了好几次，都无法正常的通过浏览器访问到这个txt文件，网上查找了一下，好像是000webhost主机做过设置还是怎么的，反正就是不行。
不过长脚还是找来一个偏门的解决办法,利用.htaccess中添加rewrite语句。具体请看下例：
&lt;strong>RewriteRule ^a.txt$ a.html&lt;/strong>
其中要上传的文件为a.html，访问的为a.txt
如果你的.htaccess文件中是空的，那就要写全下列语句了
&lt;strong>RewriteEngine on&lt;br>
RewriteBase /&lt;br>
RewriteRule ^a.txt$ a.html&lt;/strong>
有以上问题的朋友不妨试试看这个方法&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/htaccess/">Htaccess</category></item><item><title>四川省成都市都江堰市、彭州市交界发生5级地震</title><link>https://fatkun.github.io/2010/05/earthquake-of-chengdu.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/05/earthquake-of-chengdu.html</guid><pubDate>Tue, 25 May 2010 08:57:18 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p style="margin-top: 24px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 6px; border: 0px initial initial;"> 据中国地震台网测定，2010-05-25 14:11:52(北京时间)，在四川省成都市都江堰市、彭州市交界(北纬31.10度，东经103.70度)，发生(M)5.0级地震，震源深度10.0公里。&lt;/p>
&lt;p style="margin-top: 24px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 6px; border: 0px initial initial;"> 额。。地球太危险~~
&lt;/p>
&lt;p style="margin-top: 24px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 6px; border: 0px initial initial;"> &lt;strong>&lt;a style="color: #004276; text-decoration: underline;" href="http://news.sohu.com/20100525/n272337003.shtml" target="_blank">市民声称感觉到地震晃动 成都等城市没有出现混乱&lt;/a>&lt;/strong>&lt;/p>
&lt;p style="margin-top: 24px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 6px; border: 0px initial initial;"> 成都、绵阳部分市民声称感觉到地震的晃动，甚至有市民还从家中跑道大街上。但成都等城市没有出现混乱。&lt;/p>
&lt;p style="margin-top: 24px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 6px; border: 0px initial initial;"> 14:11分左右，记者在成都红星路6层的高楼上，感觉到一阵晃动，有明显的震感。部分成都市民说，明显看到家中的电灯来回晃动。不过地震持续时间不长，大约10多秒后基本恢复正常。[&lt;a style="color: #004276; text-decoration: underline;" href="http://news.sohu.com/20100525/n272337003.shtml" target="_blank">详细&lt;/a>]&lt;/p>
&lt;p style="margin-top: 24px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 6px; border: 0px initial initial;"> 来源：&lt;a href="http://news.sohu.com/20100525/n272336738.shtml">http://news.sohu.com/20100525/n272336738.shtml&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E6%88%90%E9%83%BD%E5%9C%B0%E9%9C%87/">成都地震</category></item><item><title>把腾讯微博邀请码都丢出来</title><link>https://fatkun.github.io/2010/05/%E6%8A%8A%E8%85%BE%E8%AE%AF%E5%BE%AE%E5%8D%9A%E9%82%80%E8%AF%B7%E7%A0%81%E9%83%BD%E4%B8%A2%E5%87%BA%E6%9D%A5.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/05/%E6%8A%8A%E8%85%BE%E8%AE%AF%E5%BE%AE%E5%8D%9A%E9%82%80%E8%AF%B7%E7%A0%81%E9%83%BD%E4%B8%A2%E5%87%BA%E6%9D%A5.html</guid><pubDate>Sat, 22 May 2010 15:59:33 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>QQ微博里还有挺多邀请码，还是丢在这里好了。。。最近QQ微博更新了一下，包括同城广播等等一些小细节的东西，还不错。。&lt;br>
&lt;strong>邀请码如下,如果拿了哪个最好在下面回复一下吧&lt;/strong>&lt;/p>
&lt;p>&lt;a href="http://t.qq.com/invite/a9b163371c27e11d6283">http://t.qq.com/invite/a9b163371c27e11d6283&lt;/a>&lt;br>
&lt;a href="http://t.qq.com/invite/3d41bc7a0d8e98d902b5">http://t.qq.com/invite/3d41bc7a0d8e98d902b5&lt;/a>&lt;br>
&lt;a href="http://t.qq.com/invite/f3da9f33678c5a67cb3d">http://t.qq.com/invite/f3da9f33678c5a67cb3d&lt;/a>&lt;br>
&lt;a href="http://t.qq.com/invite/7c988a6d54f472cc065d">http://t.qq.com/invite/7c988a6d54f472cc065d&lt;/a>&lt;br>
&lt;a href="http://t.qq.com/invite/e523e61c82ba62671b3d">http://t.qq.com/invite/e523e61c82ba62671b3d&lt;/a>&lt;br>
&lt;a href="http://t.qq.com/invite/9d5cd95462e3ffb8d15b">http://t.qq.com/invite/9d5cd95462e3ffb8d15b&lt;/a>&lt;br>
&lt;a href="http://t.qq.com/invite/252272ff47c2cb8d4665">http://t.qq.com/invite/252272ff47c2cb8d4665&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>GAE-使用cron计划任务(java)时无法上传cron.xml，500错误</title><link>https://fatkun.github.io/2010/05/google-app-engine-java-cron.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/05/google-app-engine-java-cron.html</guid><pubDate>Tue, 11 May 2010 11:50:22 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="错误信息">错误信息&lt;/h2>
&lt;blockquote>
&lt;p>com.google.appengine.tools.admin.AdminException: Unable to update app: Error posting to URL: &lt;a href="https://appengine.google.com/api/datastore/cron/update?app_id=fatkuns&amp;amp;version=4&amp;amp;">https://appengine.google.com/api/datastore/cron/update?app_id=fatkuns&amp;amp;version=4&amp;amp;&lt;/a>&lt;br>
500 Internal Server Error
Server Error (500)&lt;br>
A server error has occurred.
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:62)
at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:271)
at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:145)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.io.IOException: Error posting to URL: &lt;a href="https://appengine.google.com/api/datastore/cron/update?app_id=fatkuns&amp;amp;version=4&amp;amp;">https://appengine.google.com/api/datastore/cron/update?app_id=fatkuns&amp;amp;version=4&amp;amp;&lt;/a>&lt;br>
500 Internal Server Error
Server Error (500)&lt;br>
A server error has occurred.
at com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java:149)
at com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java:82)
at com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java:559)
at com.google.appengine.tools.admin.AppVersionUpload.updateCron(AppVersionUpload.java:260)
at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java:133)
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:56)
… 4 more&lt;/p>
&lt;/blockquote>
&lt;h2 id="原因">原因：&lt;/h2>
&lt;p>&lt;span style="font-weight: normal; font-size: 13px;">cron.xml文件书写不正确&lt;/span>
&lt;span style="font-size: 13px;">&lt;strong>记得&lt;timezone>Asia/Shanghai&lt;/timezone>这个是必须写的，不然无法上传，官方的例子居然有一个没写&lt;/strong>&lt;/span>&lt;/p>
&lt;blockquote>
&lt;?xml version=&amp;#8221;1.0&amp;#8243; encoding=&amp;#8221;UTF-8&amp;#8243;?>
&lt;cronentries>
&lt;cron>
&lt;url>/cron&lt;/url>
&lt;description>描述&lt;/description>
&lt;schedule>every 2 minutes&lt;/schedule>
&lt;timezone>Asia/Shanghai&lt;/timezone>
&lt;/cron>
&lt;/cronentries>
&lt;/blockquote>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 597px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> &lt;?xml version=&amp;#8221;1.0&amp;#8243; encoding=&amp;#8221;UTF-8&amp;#8243;?>&lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 597px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> &lt;cronentries>&lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 597px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> &lt;cron>&lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 597px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> &lt;url>/cron&lt;/url>&lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 597px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> &lt;description>描述&lt;/description>&lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 597px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> &lt;schedule>every 2 minutes&lt;/schedule>&lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 597px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> &lt;timezone>Asia/Shanghai&lt;/timezone>&lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 597px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> &lt;/cron>&lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 597px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> &lt;/cronentries>&lt;/div>
**更新：**发现如果 url填写错误也会上传失败，正确的方式是写“/xxxx”这样的路径，不能写全路径..</description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/gae/">GAE</category><category domain="https://fatkun.github.io/tags/google-app-engine/">Google App Engine</category></item><item><title>使用JQuery的ajax方法造成浏览器假死</title><link>https://fatkun.github.io/2010/05/jquery-ajax-browers-dead.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/05/jquery-ajax-browers-dead.html</guid><pubDate>Tue, 04 May 2010 16:07:31 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="问题">问题&lt;/h2>
&lt;p>最近做项目时使用JQuery的load等方法时会造成浏览器假死，在本地测试到不是很明显，上传到服务器后，浏览器居然能卡个10多秒。。（假死）&lt;br>
因为我用jquery加载了整个页面，而不是少量的数据，听说用jquery加载大量的数据是会假死的，可能需要创建一个DOM树比较消耗时间吧。&lt;/p>
&lt;h2 id="解决方法">解决方法&lt;/h2>
&lt;p>发现把jquery加载页面中引入的JS放在&lt;strong>主页面&lt;/strong>上，假死情况就不会发生了。假死时间大大缩短。主页面的脚本如果不是马上要用到，可以放到底部让它慢慢下载，这样就不会影响到页面的显示。
另外还遇到了IE6的一个图像缓存的BUG~My god！·&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category></item><item><title>QQ腾讯微博邀请码发送【仅有两个】</title><link>https://fatkun.github.io/2010/04/qq_mico_blog_invite.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/04/qq_mico_blog_invite.html</guid><pubDate>Tue, 27 Apr 2010 04:52:32 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;a href="http://t.qq.com/invite/">http://t.qq.com/invite/&lt;/a>&lt;br>
&lt;img src="http://farm4.static.flickr.com/3207/4557046898_5ebe1ed4e0_o.png" alt="">&lt;br>
这么久才得到邀请码，估计我不怎么活跃~~&lt;br>
只有3个。。。留一个给朋友~然后2个给大家。。估计这东西也快烂大街上了。。要的在下面填邮箱地址写上你的邮箱，以及在回复中表示你想要这东西就可以了··我会发邮件给你的。&lt;br>
只有两个邀请码，先来先得~送完即止~&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/qq%E5%BE%AE%E5%8D%9A/">Qq微博</category><category domain="https://fatkun.github.io/tags/%E9%82%80%E8%AF%B7%E7%A0%81/">邀请码</category></item><item><title>jsp getOutputStream() has already been called for this response异常解决方法</title><link>https://fatkun.github.io/2010/04/jsp-getoutputstream-has-already-been-called-for-this-response.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/04/jsp-getoutputstream-has-already-been-called-for-this-response.html</guid><pubDate>Sun, 25 Apr 2010 13:01:06 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>添加以下两段代码即可，我是在用jsp输出图像的时候出现这个问题&lt;/p>
&lt;pre escaped="true" lang="java">out.clear();
out = pageContext.pushBody();&lt;/pre>
&lt;h2 id="附上我的输出图像的jsp代码">附上我的输出图像的JSP代码&lt;/h2>
&lt;pre escaped="true" lang="java">&amp;lt;%@ page info="Random Image Show" pageEncoding="UTF-8" contentType="image/jpg" autoFlush="true" buffer="16kb" session="false"
import="java.io.FileInputStream"%>
&amp;lt;%
ServletOutputStream sos = null;
if (sos == null) sos = response.getOutputStream();
FileInputStream fis = new FileInputStream((String) request.getAttribute("filename"));
byte[] buf = new byte[1024]; //缓冲区大小
int len = 0;
while ((len = fis.read(buf)) != -1) {
sos.write(buf, 0, len);
}
sos.flush();
sos.close();
fis.close();
out.clear();
out = pageContext.pushBody();
%>
&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java/">JAVA</category><category domain="https://fatkun.github.io/tags/%E9%94%99%E8%AF%AF/">错误</category></item><item><title>“菊花文”与反屏蔽</title><link>https://fatkun.github.io/2010/04/juhua-anti-block.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/04/juhua-anti-block.html</guid><pubDate>Fri, 16 Apr 2010 12:10:17 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img class="alignnone" src="http://farm1.static.flickr.com/77/157881589_69e90629ab_o.png" alt="" width="800" height="550" />
&lt;a style="color: #666666; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; display: block;" rel="bookmark" href="http://fatkun.com/2010/04/%e8%8f%8a%e8%8a%b1%e6%96%87%e8%bd%ac%e6%8d%a2%e5%b7%a5%e5%85%b7/">&lt;span style="color: #000000; ">菊花文（&lt;/span>&lt;/a>&lt;a style="color: #666666; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; display: block;" rel="bookmark" href="http://fatkun.com/2010/04/%e8%8f%8a%e8%8a%b1%e6%96%87%e8%bd%ac%e6%8d%a2%e5%b7%a5%e5%85%b7/">菊花文转换工具&lt;/a>&lt;span style="color: #000000; ">&lt;a style="color: #666666; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; display: block;" rel="bookmark" href="http://fatkun.com/2010/04/%e8%8f%8a%e8%8a%b1%e6%96%87%e8%bd%ac%e6%8d%a2%e5%b7%a5%e5%85%b7/">）貌似很久就出现了，&lt;/a>到现在也没有多流行起来，不太容易反屏蔽，也不能代表非主流，始终不能流行起来。菊花文的原理在于每个字加上一个“菊花样的字符”，其实这结果在反屏蔽上是和在每个字加上一个空格一样的。像cnbeta把单字都屏蔽的是完全无效的（如：他妈妈的-》他文明用语文明用语的），在形式上不如火星文多变化，“屏蔽掉一个火星文，还有千千万万个火星文”。&lt;/span>
&lt;span style="color: #000000; ">说道屏蔽，当然会想到WALL，不少媒体都公布某国人民翻墙出去为看某著名动作爱情片女星，追随者达到了25000+，大部分是某国人民~&lt;/span>
&lt;span style="color: #000000; ">话说这媒体不怕被和谐么~敢公开墙的存在？！&lt;/span></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/gfw/">Gfw</category><category domain="https://fatkun.github.io/tags/%E5%8F%8D%E5%B1%8F%E8%94%BD/">反屏蔽</category></item><item><title>菊花文转换工具</title><link>https://fatkun.github.io/2010/04/%E8%8F%8A%E8%8A%B1%E6%96%87%E8%BD%AC%E6%8D%A2%E5%B7%A5%E5%85%B7.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/04/%E8%8F%8A%E8%8A%B1%E6%96%87%E8%BD%AC%E6%8D%A2%E5%B7%A5%E5%85%B7.html</guid><pubDate>Sun, 11 Apr 2010 11:27:46 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>网上流传的菊花文（菊҉花҉文҉）转换工具~真强大，感觉在可识别上比火星文强多了，但是还是挺容易被屏蔽的。菊花文的原理搜索了下都没有介绍，看了下源码，是把原来的字符码（CharCode）加上某个值转换过来的，至于为什么成这样。。。我也不清楚。。&lt;br>
附上转换工具，中国人民是非常有智慧的。&lt;/p>
&lt;h2 id="转换工具">转换工具&lt;/h2>
&lt;textarea id="in" style="width:300px;height:50px">Hello World.&lt;/textarea>
&lt;p>&lt;input type="button" value="[̲̅加̲̅边̲̅框̲̅]" id="trans" onclick="t()" />&lt;input type="button" value="爆҉菊҉花҉" id="trans1" onclick="f()" />&lt;/p>
&lt;textarea id="out" style="width:300px;height:50px">&lt;/textarea>
&lt;p>Design &amp;amp; Code by @&lt;a href="http://twitter.com/darasion" target="_blank">darasion&lt;/a>. Upload by @&lt;a href="http://twitter.com/guxiaoqiang" target="_blank">guxiaoqiang&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E5%8F%8D%E5%B1%8F%E8%94%BD/">反屏蔽</category><category domain="https://fatkun.github.io/tags/%E7%81%AB%E6%98%9F%E6%96%87/">火星文</category><category domain="https://fatkun.github.io/tags/%E8%8F%8A%E8%8A%B1%E6%96%87/">菊花文</category><category domain="https://fatkun.github.io/tags/%E8%8F%8A%E8%8A%B1%E6%96%87%E5%8E%9F%E7%90%86/">菊花文原理</category><category domain="https://fatkun.github.io/tags/%E8%BD%AC%E6%8D%A2%E5%B7%A5%E5%85%B7/">转换工具</category></item><item><title>TortoiseHg 1.0.1 与 Mercurial 1.5.1 版本控制软件</title><link>https://fatkun.github.io/2010/04/tortoisehg-and-mercurial-version-control.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/04/tortoisehg-and-mercurial-version-control.html</guid><pubDate>Sat, 10 Apr 2010 15:12:11 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Mercurial 是一款跨平台的快速、轻量级的分布式源代码管理软件， 使用python开发，免费开源。高效的实现、简易的学习曲线使得它既适合于大规模项目，也适用于小项目的代码管理。目前很多著名项目都已经开始使用 Mercurial来管理代码， 如 Mozilla、OpenOffice、Python等。&lt;strong>Google Code在09年早期也已经提供了对Mercurial的支持。（在后台source设置一下即可）&lt;/strong>
TortoiseHg为Mercurial集成了一系列图形化工具和Shell扩展， 类似于TortoiseSVN为SVN提供的功能。&lt;br>
&lt;img src="http://farm5.static.flickr.com/4009/4508101528_e9d8aa127b_o.png" alt="">&lt;/p>
&lt;p>TortoiseHg还是那只龟~如果用惯了TortoiseSVN，这个也是很容易上手的。
暂时感觉hg 相对于 svn的好处是 ：
1，不像svn那样在每个目录都建一个.svn文件夹
2，有一个完整的本地库，所以浏览历史版本是很快的，不用联网。
3，如果不能联网可以先提交到本地的版本库，有网络再提交上服务器
官方网站：&lt;a href="http://tortoisehg.bitbucket.org/">http://tortoisehg.bitbucket.org/&lt;/a>
win_x86版下载地址：&lt;a href="http://bitbucket.org/tortoisehg/stable/downloads/tortoisehg-1.0.1-hg-1.5.1-x86.msi">http://bitbucket.org/tortoisehg/stable/downloads/tortoisehg-1.0.1-hg-1.5.1-x86.msi&lt;/a>
This is a bug fix release. We recommend all users upgrade to this release.&lt;/p>
&lt;h2 id="packaged-versions" style="margin-top: 0.83em !important; padding-top: 0px; margin-bottom: 0.83em !important; font: normal normal normal 1.3em/normal 'Lucida Grande', 'Trebuchet MS', Tahoma, Arial, sans-serif; letter-spacing: -1px; font-size: 2em !important; margin-right: 0px !important; margin-left: 0px !important; font-family: Georgia, Times, 'Times New Roman', serif; font-weight: normal;"> Packaged Versions&lt;/h2>
&lt;ul style="margin-top: 1.33em; margin-right: 0px; margin-bottom: 1.33em; margin-left: 0px; list-style-position: inside; padding-left: 1px;"> &lt;li> Mercurial 1.5.1 &lt;/li>
&lt;li> GTK has been downgraded from 2.18.7 to 2.16.6 &lt;/li>
&lt;li> dulwich has been upgraded to 0.5.1 &lt;/li>
&lt;li> See extension-versions.txt in the install directory for the complete list of bundled extensions and modules and their versions &lt;/li>&lt;/ul></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/hg/">Hg</category><category domain="https://fatkun.github.io/tags/svn/">Svn</category><category domain="https://fatkun.github.io/tags/%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6/">版本控制</category></item><item><title>java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0[解决方法]</title><link>https://fatkun.github.io/2010/03/java-lang-illegalargumentexception-cannot-convert-value-of-type.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/03/java-lang-illegalargumentexception-cannot-convert-value-of-type.html</guid><pubDate>Sat, 27 Mar 2010 16:35:20 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;blockquote>
&lt;p>Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0 implementing com.mysoft.applications.database.interfaces.MyInterface,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [ibatis.ibator.services.TestService] for property ‘service’: no matching editors or conversion strategy found&lt;br>
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)&lt;br>
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)&lt;br>
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)&lt;br>
… 42 more
在配置事务时加入了aspectjweaver.jar这个包后出现了这个问题。
本文来源：&lt;a href="http://blog.csdn.net/taochenpfj/archive/2009/07/29/4390158.aspx">http://blog.csdn.net/taochenpfj/archive/2009/07/29/4390158.aspx&lt;/a>&lt;/p>
&lt;/blockquote>
&lt;p>如果在Spring配置文件中配置的事务是通过AOP标签实现的，那就在&amp;lt;aop:config /&amp;gt;中增加proxy-target-class=”true”属性。就异常显示的信息可以看到，Spring在转换时，主要是将代理类转换成接口，反而不能转换成实际类。
如果是通过bean方式增加事务控制，则在配置文件中增加&lt;/p>
&lt;pre escaped="true" lang="xml">&amp;lt;bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
&amp;lt;property name="proxyTargetClass">
&amp;lt;value>true&amp;lt;/value>
&amp;lt;/property>
&amp;lt;/bean>
&lt;/pre>
&lt;p>上面这段配置信息只是一部分。其他的各位再摸索吧！
这里有个兄弟也是这样的问题，他的是bean控制事务的http://longterm.javaeye.com/blog/394395&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/%E4%BA%8B%E5%8A%A1/">事务</category><category domain="https://fatkun.github.io/tags/%E6%8A%A5%E9%94%99/">报错</category></item><item><title>win7“我的电脑”右键”管理”菜单失效的解决办法</title><link>https://fatkun.github.io/2010/03/win7%E2%80%9C%E6%88%91%E7%9A%84%E7%94%B5%E8%84%91%E2%80%9D%E5%8F%B3%E9%94%AE%E7%AE%A1%E7%90%86%E8%8F%9C%E5%8D%95%E5%A4%B1%E6%95%88%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/03/win7%E2%80%9C%E6%88%91%E7%9A%84%E7%94%B5%E8%84%91%E2%80%9D%E5%8F%B3%E9%94%AE%E7%AE%A1%E7%90%86%E8%8F%9C%E5%8D%95%E5%A4%B1%E6%95%88%E7%9A%84%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95.html</guid><pubDate>Mon, 22 Mar 2010 08:41:27 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>不知道装了什么WIN7右键的管理菜单不能用了，提示Explorer.exe出错。上网搜索下，测试可用。记录下来。&lt;br>
————–&lt;br>
本文来源：&lt;a href="http://hi.baidu.com/xlshuang/blog/item/6d1ca7cdfad74a590eb34529.html">http://hi.baidu.com/xlshuang/blog/item/6d1ca7cdfad74a590eb34529.html&lt;/a>&lt;/p>
&lt;p>将下面的文本复制到记事本，然后保存为xxx.reg的文件，双击导入即可&lt;br>
&lt;code>Windows Registry Editor Version 5.00&amp;lt;br /&amp;gt; [HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Manage]&amp;lt;br /&amp;gt; @=hex(2):40,00,25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,74,\&amp;lt;br /&amp;gt; 00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6d,00,\&amp;lt;br /&amp;gt; 79,00,63,00,6f,00,6d,00,70,00,75,00,74,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,\&amp;lt;br /&amp;gt; 00,34,00,30,00,30,00,00,00&amp;lt;br /&amp;gt; &amp;quot;MUIVerb&amp;quot;=hex(2):40,00,25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,\&amp;lt;br /&amp;gt; 6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,\&amp;lt;br /&amp;gt; 00,6d,00,79,00,63,00,6f,00,6d,00,70,00,75,00,74,00,2e,00,64,00,6c,00,6c,00,\&amp;lt;br /&amp;gt; 2c,00,2d,00,34,00,30,00,30,00,00,00&amp;lt;br /&amp;gt; &amp;quot;SuppressionPolicy&amp;quot;=dword:4000003c&amp;lt;br /&amp;gt; &amp;quot;HasLUAShield&amp;quot;=&amp;quot;&amp;quot;&amp;lt;br /&amp;gt; [HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Manage\command]&amp;lt;br /&amp;gt; @=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,73,00,79,00,73,\&amp;lt;br /&amp;gt; 00,74,00,65,00,6d,00,33,00,32,00,5c,00,6d,00,6d,00,63,00,2e,00,65,00,78,00,\&amp;lt;br /&amp;gt; 65,00,20,00,2f,00,73,00,20,00,25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,\&amp;lt;br /&amp;gt; 00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,63,00,6f,00,\&amp;lt;br /&amp;gt; 6d,00,70,00,6d,00,67,00,6d,00,74,00,2e,00,6d,00,73,00,63,00,00,00&lt;/code>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/win7/">Win7</category><category domain="https://fatkun.github.io/tags/%E6%97%A0%E6%95%88/">无效</category><category domain="https://fatkun.github.io/tags/%E7%AE%A1%E7%90%86/">管理</category><category domain="https://fatkun.github.io/tags/%E9%94%99%E8%AF%AF/">错误</category></item><item><title>错误:The type javax.servlet.ServletContext cannot be resolved</title><link>https://fatkun.github.io/2010/03/%E9%94%99%E8%AF%AFthe-type-javax-servlet-servletcontext-cannot-be-resolved.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/03/%E9%94%99%E8%AF%AFthe-type-javax-servlet-servletcontext-cannot-be-resolved.html</guid><pubDate>Fri, 19 Mar 2010 12:08:56 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>碰到这个错误，原来是tomcat里的包没有加入Build Path，我把servlet-api.jar加入jdk1.6.0\jre\lib\ext 目录就解决了。&lt;br>
———————
来源：http://blog.csdn.net/cnrefresh/archive/2009/03/10/3977242.aspx&lt;br>
软件包 javax.servlet 不存在
原来这个包在web服务器才有，j2se中并没有，所以导致了错误。&lt;br>
解决方法：&lt;br>
方法(1) 找到%tomcat%\common\lib目录下的servlet-api.jar，把这个路径添加到环境变量classpath当中，就可以了。（这个好像不是很管用，我重装了tomcat之后，再重新配置好像就不行了）&lt;br>
方法(2) 找到%tomcat%\common\lib目录下的servlet-api.jar，把这个jar添加到%java_home%\jdk1.6.0\jre\lib\ext目录下面，不同的jdk版本都一样。&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/%E9%94%99%E8%AF%AF/">错误</category></item><item><title>Rational Rose 2003 下载及破解方法</title><link>https://fatkun.github.io/2010/03/rational-rose-2003-download-and-crack.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/03/rational-rose-2003-download-and-crack.html</guid><pubDate>Sun, 14 Mar 2010 06:18:52 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这学期要学UML，做实验要用到这个软件。所以找到了这个破解版的破解方法。。还挺烦的。。不过测试破解成功。。
本文来源：&lt;a href="http://blog.csdn.net/fenglibing/archive/2007/08/17/1747693.aspx">http://blog.csdn.net/fenglibing/archive/2007/08/17/1747693.aspx&lt;/a>
————————-
下载地址（没测试过是否可用）
Flashget://W0ZMQVNIR0VUXWZsYXNoZ2V0eDovL3xtaHRzfGNtRjBhVzl1WVd3Z2NtOXpaVEl3TURNdWNtRnl8MzYxMDMxMTIxfDJBOTdFNkVBN0Q4QTQ5ODhBODBDQTVGMjFCRjQ5NkRDfC9bRkxBU0hHRVRd&lt;/p>
&lt;p>操作：&lt;/p>
&lt;p>１、安装Rational Rose2003时，在需选择安装项的时候，只选择Rational Rose EnterPrise Edition即可，不需选择其他项。
２、安装好Rational Rose Enterprise Editon后，打开rose2003crack.rar压缩包，里面有四个文件，分别为flexlm.cpl、license.dat、lmgrd.exe、rational.exe。
３、用记事本或者是EditPlus打开license.dat文件，大约在文件的中间位置有：SERVER Microsoft ANY
DAEMON rational “C:\Program Files\Rational\common\rational.exe”　　将其修改为：SERVER 计算机名　ANY DAEMON rational “自己安装的目录\rational.exe”后，保存
注：若是按默认目录安装，则只需修改计算机名即可。
４、将license.dat、 lmgrd.exe 、rational.exe三个文件一起拷贝到：安装目录\rational\common\ 下面。
如：若为默认则为：C:\Program Files\Rational\common\目录。
５、将flexlm.cpl拷贝到system32目录下。如win2000系统中为C:\WINNT\system32目录。
６、进入控制面板，则在控制面板的上方会增加了一个图标，即FLEXlm License Manager，将其打开，在Setup页中lmgrd.exe右侧目录写为：C:\Program Files\Rational\Common\lmgrd.exe（若为默认安装目录）
License File右侧目录写为：C:\Program Files\Rational\Common\license.dat
７、回到Control页，点击Start，若出现”Server Started”，则表示已经成功，可以点击Status,若状态为：计算机名：license server UP(MASTER)则成功。
８、这时可打开安装的Rational Rose Enterprise Edition，若还是出现Error，则打开Rational License Key Administrator ，点击工具栏中的第一个工具（Start WIzard）,点击下一步，在Server Name中的名字改为自己的计算机名即可。因现在的学习需在使用Rational Rose，所以进行了安装，但确实花了不少工夫，所以特把自己安装的经验来跟大家一起分享，希望能对大家有所帮助。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category></item><item><title>如何制作好的PPT（演示幻灯片）？提高用户体验</title><link>https://fatkun.github.io/2010/03/how-to-make-ppt-perfect.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/03/how-to-make-ppt-perfect.html</guid><pubDate>Mon, 01 Mar 2010 11:51:18 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>首先，在以下的讨论中必须明确一点：PPT主要是提供给你希望传播的对象观看的，用于辅助或增强你言语上的不足（例如一些语句不如一幅图片表达得生动形象）。
以下内容是我Fatkun随意YY，欢迎探讨。&lt;br>
插播：旧的台式电脑丢在家里了，新的电脑还没买。。所以依然是上网困难~今天已经开学了&lt;del>更新一篇文章先，怕搜索引擎忘了我咯&lt;/del>&lt;/p>
&lt;p>1，错误点一：把PPT当成自己的演讲词，照着PPT上的语句念下去。根据上面我提到PPT的目的可知，PPT主要面向的是你的听众，而不是你。PPT可以作为提醒你的演讲流程的记忆，但切记不要“照板宣科”，一般用小标题的形式然后用自己的话解释某个问题！&lt;br>
2，错误点二：在一页PPT内显示大段文字。现在很少人有耐心去读大段文字了，相对于文字，大家更喜欢看图。配上一张贴近内容搞笑的图片通常会得到听众“配图传神”的肯定。容易吸引听众的注意。&lt;br>
除了上面的几个错误点，还有以下这几个方面要注意的。&lt;br>
1，尽量使用大的字号，颜色尽量和背景色为对比色。通常投影仪用久了投影效果比较差，和你在电脑前看到的效果不一样，保守做法是白底黑字加粗。如果用到非系统自带的字体需要把字体文件一起打包出来。&lt;br>
2，如果和我一样不会设计PPT，可以上网下载PPT模板。尽量不使用背景图片颜色复杂的模板，因为可能影响文字的显示效果。&lt;br>
3，使用简洁生动有趣的语句。&lt;br>
4，使用数字编号将观点分点列出。&lt;br>
5，给PPT留一些空白让听众想入菲菲，独立思考，不要全屏都是文字或图片。&lt;br>
以上，就是我认为比较重要的地方，好的PPT能够吸引听众的注意力，给你的演讲锦上添花。
当然，最最主要的PPT还是&lt;strong>内容本身&lt;/strong>！本文只是阐述在好的内容下锦上添花~~&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/ppt/">Ppt</category><category domain="https://fatkun.github.io/tags/%E7%94%A8%E6%88%B7%E4%BD%93%E9%AA%8C/">用户体验</category></item><item><title>1月28日（明天）回家去</title><link>https://fatkun.github.io/2010/01/go-home.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/01/go-home.html</guid><pubDate>Wed, 27 Jan 2010 13:10:41 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>回家基本与网络脱离~所以在这段时间是不会更新博客了，并且也没什么内容可写。&lt;br>
所以还是回家继续深造学习，回来再写博客，暂停博客更新一个月，回来再写~现在才发现做一个博主是那么的不容易~更新内容不是件简单的事情。&lt;br>
在此祝各位新年快乐，在2010年里顺风顺水，万事如意！博客访问人数翻倍~~&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E5%9B%9E%E5%AE%B6/">回家</category></item><item><title>测试用手机写博客</title><link>https://fatkun.github.io/2010/01/%E6%B5%8B%E8%AF%95%E7%94%A8%E6%89%8B%E6%9C%BA%E5%86%99%E5%8D%9A%E5%AE%A2.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/01/%E6%B5%8B%E8%AF%95%E7%94%A8%E6%89%8B%E6%9C%BA%E5%86%99%E5%8D%9A%E5%AE%A2.html</guid><pubDate>Mon, 25 Jan 2010 09:01:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>使用了WP-T-WAP插件，用Opera5.0beta看看效果如何。
换行？&lt;br>
再试试&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>GAE-Google App Engine网址抓取(java.net.UrlConnection)</title><link>https://fatkun.github.io/2010/01/get-website-source-using-google-app-engine.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/01/get-website-source-using-google-app-engine.html</guid><pubDate>Sat, 23 Jan 2010 08:17:12 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Google App Engine 的网址抓取挺方便的，可以使用java.net.UrlConnection这个类。有了这个我们可以干什么？例如可以从某处获取天气信息等等~&lt;br>
&lt;img src="http://farm3.static.flickr.com/2724/4297317270_500f2c34b3.jpg" alt="">&lt;br>
(提醒一下，上面的是图片。。不要误点了啊。。。)&lt;br>
看看例子：&lt;a href="http://2.latest.fatkuns.appspot.com/">http://2.latest.fatkuns.appspot.com/&lt;/a>&lt;/p>
&lt;h2 id="gae网址抓取是什么">GAE网址抓取是什么？&lt;/h2>
&lt;blockquote>
&lt;p>App Engine 应用程序可以抓取资源，并通过互联网使用 HTTP 和 HTTPS 请求与其他主机通信。应用程序使用网址抓取服务来进行请求。
我觉得其实就是可以通过它抓取别人网页的源代码。&lt;/p>
&lt;/blockquote>
&lt;h2 id="使用url获取源码">使用URL获取源码&lt;/h2>
&lt;pre escaped="true" lang="java">package com.fatkun;
/**
* 在GAE上抓取网址
* @author Fatkun
* @site http://fatkun.com
*/
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import javax.servlet.http.*;
@SuppressWarnings("serial")
public class URL2Servlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("text/plain; charset=utf-8");//显示编码
URL url = new URL("http://fatkun.com");
// 读取源码
//读取中文时，使用Reader类是每次读出两个字节的，不会出现中文乱码
InputStreamReader in = new InputStreamReader(url.openStream(), "UTF-8");
char[] buf = new char[2048];//缓存
StringBuffer sb = new StringBuffer();
int len = 0;
while ((len = in.read(buf)) != -1) {//当没到文档尽头继续读取
sb.append(buf, 0, len);
}
// 输出在网页上
resp.getWriter().println(sb.toString());
}
}&lt;/pre>
&lt;h2 id="使用httpurlconnection-来post内容">使用HttpURLConnection 来POST内容&lt;/h2>
&lt;pre escaped="true" lang="java">// 此处的地址请换成你的，在本地测试时可以填入http://localhost:8888/request.jsp
URL url = new URL("http://2.latest.fatkuns.appspot.com/request.jsp");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);// 使用 URL 连接进行输出
connection.setRequestMethod("POST");
// 取得输出流
OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
// 用UTF-8编码，保证中文传递正常
String message = URLEncoder.encode("你好，I'm Fatkun!", "UTF-8");
// 写入发送的内容
writer.write("msg=" + message);
writer.close();
&lt;/pre>
&lt;p>上面是主要的代码，看注释好了，都很清楚。&lt;/p>
&lt;h2 id="google-app-engine中文乱码问题">Google App Engine中文乱码问题&lt;/h2>
&lt;p>注意在读取中文的网页时，由于编码是使用UTF或者GBK,GB2312等编码，使用InputStream类不太方便，另外有可以出现错误。&lt;br>
试过使用InputStream类，然后用new String(bytes[],”utf-8″)来转换编码，不过出现一点问题，不知道是我不会用还是怎么的。&lt;br>
不过使用这样的写法就方便多了。&lt;br>
InputStreamReader in = new InputStreamReader(url.openStream(), “UTF-8”);&lt;br>
编码都不用转换了~指定它的编码就行。&lt;br>
注意这里要加上“UTF-8”，虽然不加在本地测试时没问题，不过上传到GAE上就不能显示中文了。&lt;br>
PS2:这里的UTF-8是代表你抓取网页的编码。如果你抓取的网页是gb2312的需要根据实质需求改变。
附上我做的例子：&lt;a href="http://2.latest.fatkuns.appspot.com/">http://2.latest.fatkuns.appspot.com/&lt;/a>&lt;br>
源码在这里：&lt;a href="http://2.latest.fatkuns.appspot.com/source.rar">http://2.latest.fatkuns.appspot.com/source.rar&lt;/a>,里面的lib目录下的我删除了，请自行添加。&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/gae/">GAE</category><category domain="https://fatkun.github.io/tags/google-app-engine/">Google App Engine</category><category domain="https://fatkun.github.io/tags/%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81/">中文乱码</category><category domain="https://fatkun.github.io/tags/%E7%BD%91%E5%9D%80%E6%8A%93%E5%8F%96/">网址抓取</category></item><item><title>谷歌宣布谷歌中国业务恢复正常</title><link>https://fatkun.github.io/2010/01/google-of-china.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/01/google-of-china.html</guid><pubDate>Tue, 19 Jan 2010 04:12:58 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px;"> 谷歌中国不走了！网上的评论由“谷歌真汉子”变为“谷歌真怂”。作为一个商业的公司，网友们把“不作恶”炒得太热了，好像google就一定不能“作恶”。而谷歌的这次行为被网友们视为“炒作”，我并不赞同或者否认，或者说我不关心。我只关心G`F`W今天又把哪几个网站OOXX了，政府又出了几条“利国利民”的政策。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px;"> 从谷歌刚开始想要和政府谈判时我就打包票说了：“你丫傻B，和流氓讲道理，他只会和你耍流氓！”，&lt;strong>这种行为是“不得人心”的，终究是要失败的！&lt;/strong>&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px;"> 我承认我比较喜欢Google，google的很多产品我都有用到！Google搜索，Gmail，日历，Chrome，Rss Reader，还有将来会考虑的手机系统Android。这些都是免费的，发现越来越难离开它们，好用！简单！google的开源精神也许也发挥了不少作用！喜欢google的创新，喜欢google的工作环境（我也想去Google工作啊，可是我水平还需要提高）。。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px;"> “Google涉黄论”：OK，你确实是能从google上搜索到这些，但是你想想要屏蔽这些东西是多么困难？！又要保证快速的索引所有网页保证质量，又要过滤这部分东西，不少简单的关键词“一刀切”（绿霸），或者把所有黄色的图片都屏蔽了的！！&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px;"> 而且看到 &amp;#8220;可能吧&amp;#8221; 说到CCAV的那些专家们刷关键字我就觉得恶心！中国的造假能力确实了不起！~&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px;">
&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px;"> &lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px;"> 以下新闻来源：&lt;a href="http://www.cnbeta.com/articles/102445.htm">http://www.cnbeta.com/articles/102445.htm&lt;/a> &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px;"> &lt;strong>据法新社消息，当地时间18日下午，在宣布退出中国市场、员工停止工作一周后，美国网络巨头谷歌再次表示在中国的业务恢复正常运转。&lt;/strong>&lt;br style="padding: 0px; margin: 0px;" />“在发表声明之后，我们给公司职员放了一段长假，以便运行测试和扫描，保证网络的安全可靠” ，谷歌在回复法新社的询问中说，“谷歌中国的职员现在都已经回到工作岗位，一切业务正常运行。” &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding: 0px;"> 上周，新京报报道称谷歌中国的工程师不再能进入公司的全球数据库，不能正常工作。&lt;br style="padding: 0px; margin: 0px;" />&lt;br style="padding: 0px; margin: 0px;" />美国国务院发言人克劳利15日宣布，最早可能在下周初将就谷歌事件向中国发出外交照会。这位发言人说，“它将表达我们对这一事件的关注，并要求中国提供信息，解释这一事件是如何发生的，以及他们准备怎么处理这一问题。”&lt;br style="padding: 0px; margin: 0px;" />&lt;br style="padding: 0px; margin: 0px;" />对此，中国表示谷歌事件不会影响中美关系，但是谷歌必须遵守中国的法律。商务部发言人上周五说，外国公司应该“尊重东道国的法律、公共利益、文化和传统，并为此承担社会责任”。 &lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/google/">Google</category><category domain="https://fatkun.github.io/tags/google%E5%BE%88%E5%8F%97%E4%BC%A4/">Google很受伤</category><category domain="https://fatkun.github.io/tags/%E8%B0%B7%E6%AD%8C%E4%B8%AD%E5%9B%BD/">谷歌中国</category><category domain="https://fatkun.github.io/tags/%E8%B0%B7%E6%AD%8C%E4%B8%AD%E5%9B%BD%E6%81%A2%E5%A4%8D/">谷歌中国恢复</category><category domain="https://fatkun.github.io/tags/%E8%B0%B7%E6%AD%8C%E9%80%80%E5%87%BA/">谷歌退出</category></item><item><title>《仙剑奇侠传五》官方博客地址</title><link>https://fatkun.github.io/2010/01/pal5-blog.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/01/pal5-blog.html</guid><pubDate>Mon, 18 Jan 2010 14:26:03 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>仙剑奇侠传5的官方博客&lt;br>
&lt;img src="http://farm5.static.flickr.com/4041/4284343915_f9330fd195.jpg" alt="">&lt;br>
官方博客地址在此：&lt;a href="http://blog.sina.com.cn/softstarpal5">http://blog.sina.com.cn/softstarpal5&lt;/a>
那个博客目前有少量的图片。。
仙剑系列曾是很多人喜爱的游戏&lt;del>期待中&lt;/del>&lt;/p>
&lt;p>下面这篇日志是官方博客2009-12-06发的，开发进度才是27%，所以说想要玩还得等很久很久，&lt;a href="http://blog.sina.com.cn/s/blog_62d8c9d90100fzxj.html">http://blog.sina.com.cn/s/blog_62d8c9d90100fzxj.html&lt;/a>&lt;/p>
&lt;blockquote>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; padding: 0px; border: 0px initial initial;">> 自上周5博客开放到现在，博客访问量已达14868，非常感谢大家的支持，我们真的有些受宠若惊，同时也感到自身背负责任的重大，此时的心情可谓是压力与欣喜并存，我们会继续努力！> &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; padding: 0px; border: 0px initial initial;">> 目前项目的完成度约为27%，基本的游戏框架、剧情故事、人物设定已经完成，如无意外，2010年内游戏将开发完成，届时希望能让大家满意~> &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; padding: 0px; border: 0px initial initial;">> 留言中很多玩家希望放图，下周内我会满足大家的要求，不过图量不会太多，我们会阶段更新，再次感谢大家的支持~> &lt;/p>
&lt;/blockquote>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; word-wrap: normal; word-break: normal; line-height: 21px; padding: 0px; border: 0px initial initial;"></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E4%BB%99%E5%89%915/">仙剑5</category><category domain="https://fatkun.github.io/tags/%E4%BB%99%E5%89%915%E5%8D%9A%E5%AE%A2/">仙剑5博客</category><category domain="https://fatkun.github.io/tags/%E4%BB%99%E5%89%91%E5%A5%87%E4%BE%A0%E4%BC%A05/">仙剑奇侠传5</category><category domain="https://fatkun.github.io/tags/%E5%AE%98%E6%96%B9%E5%8D%9A%E5%AE%A2/">官方博客</category></item><item><title>获取QQ头像地址</title><link>https://fatkun.github.io/2010/01/get-qq-avatar-url.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/01/get-qq-avatar-url.html</guid><pubDate>Thu, 14 Jan 2010 16:19:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>由于QQ通过判断cookies是否登陆，所以&lt;strong>获取QQ头像已经失效&lt;/strong>了。期待新的解决方法。(新方法：&lt;a href="http://fatkun.com/2010/07/get-qq-avatar-with-cookie/" target="_blank">使用cookie获取QQ头像（JSP版）&lt;/a>)&lt;br>
最近期末了~要考试，所以博客基本没怎么更新了~放假回家后可能都没什么机会上网咯~所以可能博客会停止更新一段时间~
今晚突然想得到某人的QQ头像，找找是否有一样的头像（纯蛋疼得无聊~）。 这个网站可以通过上传图片搜索相同的图片 &lt;a href="http://www.tineye.com/">http://www.tineye.com/&lt;/a>，传说Google以后会支持这个功能~
&lt;img style="border: 0px initial initial;" src="http://farm5.static.flickr.com/4048/4273718797_61f507b4bd.jpg" alt="" width="500" height="239" />&lt;/p>
&lt;p>说到Google，就不得不说Google可能要退出中国市场，可是真要说些什么，却什么都不敢说。杯具都是瓷器造的，Ma de in china! F*ck G..F.W! 好吧，说完了，于事无补。身在天朝只好笑而不语。
说正题，主要说说我的搜索方法的思路~&lt;/p>
&lt;h2 id="如何找到qq头像地址">如何找到QQ头像地址？&lt;/h2>
&lt;ol>
&lt;li>首先想到的是通过&lt;strong>搜索引擎&lt;/strong>搜索是否有现成的。不过第一次使用的关键词是“QQ头像地址”，结果找到的都失效了（如Myqq以及Vipqq的）&lt;/li>
&lt;li>查看myqq以及Vipqq的代码。失望啊，它头像获取的地址是&lt;a href="http://my.qq.com/qq_face.php">http://my.qq.com/qq_face.php&lt;/a>，可惜，没有参数给我们调用，估计是通过Cookies传值的或者其他&lt;/li>
&lt;li>想想还有没有同类的网站显示QQ头像的。对，WebQQ，里面有QQ头像地址，果然，就给我找到了。&lt;/li>
&lt;li>找到之后，觉得我第一次的搜索关键字好像不太好，换一个“获取QQ头像”，丫的，搜索出来了。&lt;/li>
&lt;/ol>
&lt;h2 id="qq头像地址在此">QQ头像地址在此&lt;/h2>
&lt;p>QQ10000号的qq头像：&lt;img src="http://face4.qun.qq.com/cgi/svr/face/getface?uin=10000" alt="qq">&lt;br>
任意QQ头像地址：
&lt;a href="http://face4.qun.qq.com/cgi/svr/face/getface?uin=">http://face4.qun.qq.com/cgi/svr/face/getface?uin=&lt;/a>&lt;span style="color: #ff0000;">&lt;strong>529403452 &lt;/strong>&lt;/span>&lt;a href="http://face4.qun.qq.com/cgi/svr/face/getface?uin=529403452" target="_blank">点此看看效果&lt;/a>
QQ会员动态头像（仅会员的头像可查看）：
http://58.60.9.59/HISFACE/getfacefile?from=qqclub&amp;amp;usertype=1&amp;amp;dstuin=&lt;strong>&lt;span style="color: #ff0000;">529403452&lt;/span>&lt;/strong>
注：把上面&lt;span style="color: #ff0000;">&lt;strong>红色加粗&lt;/strong>&lt;/span>的QQ号换为其他人的QQ号就行了，任何人的都可以。
注2：上面的QQ号非本人QQ号，在网上搜索到的，如有侵权，请联系我修改。&lt;/p>
&lt;h2 id="用jquery显示头像纯蛋疼">用Jquery显示头像（纯蛋疼）&lt;/h2>
&lt;img id="avatar" alt="" />
输入你的qq号试试：
&lt;input id="qqnum" onkeyup="getQQAvatar()" type="text" /></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/qq%E5%A4%B4%E5%83%8F/">Qq头像</category><category domain="https://fatkun.github.io/tags/qq%E5%A4%B4%E5%83%8F%E7%BD%91%E5%9D%80/">Qq头像网址</category><category domain="https://fatkun.github.io/tags/%E6%98%BE%E7%A4%BAqq%E5%A4%B4%E5%83%8F/">显示qq头像</category></item><item><title>中国网民使用浏览器，分辨率，操作系统份额（09年12月）</title><link>https://fatkun.github.io/2010/01/analytics-of-china-in-2009.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/01/analytics-of-china-in-2009.html</guid><pubDate>Thu, 07 Jan 2010 05:58:48 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>做网页前端的都会关注用户都在使用什么浏览器~因为不同的浏览器之间有些差异（大家都有各自的标准，特别是IE），不过近几年来好一些了，微软也意识到自己走抛开大众的路线是会被咒骂的~IE系列将向W3C标准靠拢，IE7,IE8对标准支持也好一点了~将要出来的IE9听说还会支持HTML5。希望以后看到各个浏览器都坚决维护标准~只要在任何一个浏览器测试，其他浏览器浏览的效果都一样~·这样就省了不少的时间。&lt;br>
以下数据来源&lt;a href="http://data.cnzz.com/main.php?s=resolve#">CNZZ.COM&lt;/a>，2009年12月数据&lt;/p>
&lt;h2 id="浏览器的份额">浏览器的份额&lt;/h2>
&lt;p>&lt;img src="http://farm3.static.flickr.com/2791/4250314158_b7a5149552.jpg" alt="">&lt;/p>
&lt;p>从图上看到，在中国，IE还是占主流~IE包括那些以IE为内核的浏览器（遨游，360浏览器，腾讯TT，世界之窗）加起来接近96%，IE6占有率63.8%。火狐在中国只有可怜的1.5%，要知道火狐在全世界的份额已经有24%多了~~&lt;br>
IE6可能是中国用户使用XP系统多，而且不升级或由于某些原因不能升级。**IE6已经非常老了，性能不够好，强烈建议升级。**有次和别人在QQ群上讨论为什么要升级IE6，普通用户觉得用IE6就能上网，何必瞎折腾升级呢。看来想IE6灭亡的最主要还是那些做网页前端的了。。&lt;/p>
&lt;h2 id="操作系统的份额">操作系统的份额&lt;/h2>
&lt;p>&lt;img src="http://farm3.static.flickr.com/2641/4250313964_1761b101dd.jpg" alt="">&lt;br>
可以看出XP在中国仍然是最多人用的，占了93.4%。而XP默认的浏览器就是IE6，这是IE6这么多人使用的一个原因。其次，得益于中国的盗 版事业~XP在中国快速扩张~期望几年后网民的电脑硬件升级了都装上WIN7吧，WIN7的内置浏览器是IE8，至少比IE6好~~&lt;/p>
&lt;h2 id="分辨率">分辨率&lt;/h2>
&lt;p>&lt;img src="http://farm5.static.flickr.com/4064/4249538789_2a09b2b448.jpg" alt="">&lt;br>
46.5%的人使用的分辨率是1024*768（17寸显示器的标准分辨率），然后1440*900（19寸宽屏标准分辨率）占了15.2%。值得一提的是800*600的已经很少了（1.9%），所以做网页按1024*768的分辨率做就可以适应大多数人。而且在大分辨率的显示也不会很小气。&lt;/p>
&lt;h2 id="搜索引擎">搜索引擎&lt;/h2>
&lt;p>以下数据来源&lt;a href="http://www.iaskchina.cn/Report/view/id/85">北京正望咨询&lt;/a>，日期：2009年&lt;br>
&lt;img src="http://farm3.static.flickr.com/2728/4250313516_675ebd30fb.jpg" alt="">&lt;br>
&lt;img src="http://farm3.static.flickr.com/2746/4250313738_ee93847f08.jpg" alt="">&lt;br>
且不论数据是否正确。从图上可以看到在中国，百度占了主要的搜索量（69.9%），Google的搜索份额并没有提高很多。&lt;br>
谷歌音乐也没有为谷歌带来很多流量，虽然都是正版音乐，音质都是不错的，但是收录的歌曲还不够完整。而百度MP3可以随意的搜索很多歌曲，尽管质量参差。不知道会不会有人告百度侵犯版权呢，工信部在干嘛呢？版署局在干嘛呢？&lt;br>
另外一个我比较喜欢用百度知道，而不是天涯问答。&lt;br>
不过，我的首选搜索引擎是GOOGLE，其次才是百度。GOOGLE索引的效率更快更高，我前面那篇文章才发布不久就被收录了，而百度还没收录~而且百度会有封锁博客的，会把某个博客的搜索结果全部删除！（例如：用百度搜索卢松松的博客site:lusongsong.com）可恶！
在中国，还是老老实实的做人吧。老老实实的在IE6下测试。。。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/ie6/">IE6</category><category domain="https://fatkun.github.io/tags/%E5%88%86%E6%9E%90/">分析</category><category domain="https://fatkun.github.io/tags/%E6%B5%8F%E8%A7%88%E5%99%A8%E4%BB%BD%E9%A2%9D/">浏览器份额</category></item><item><title>添加了几个我常去的博客链接</title><link>https://fatkun.github.io/2010/01/friend-links.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/01/friend-links.html</guid><pubDate>Tue, 05 Jan 2010 10:20:53 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>在上一次的GOOGLE PR更新的时候&lt;del>我的博客终于也有PR了&lt;/del>&lt;del>下面是我的博客收录情况（截至：2010-01-05 18:00）
不过由于中途换了一次博客程序~现在的百度收录的还是旧数据&lt;/del>&lt;del>谷歌的已经更新了&lt;/del>&lt;del>欢呼~
还有一个不得不说的是，在中国&lt;/del>~&lt;strong>百度超多人使用&lt;/strong>~~不过我使用的优先级是&lt;strong>Google&lt;/strong>（是英文的,非中国的谷歌）-&amp;gt;百度&lt;br>
&lt;img src="http://farm5.static.flickr.com/4058/4246933959_ab8deea2a2.jpg" alt="">&lt;/p>
&lt;p>另外为了能加快一些网页打开的速度&lt;del>除了打开WP-Super-Cache之外&lt;/del>我把google的统计代码去掉了~~以前加的时候，老喜欢上去看看~现在倒省了这事情~
其实我&lt;strong>写博客的目的&lt;/strong>有&lt;/p>
&lt;ol>
&lt;li>把我所学的东西都记录下来（当然这也给我自己找了个借口，逼着我学习~不然没东西写，是吧？）&lt;/li>
&lt;li>收藏一些喜欢的文章，包括技术啊，等等~（天朝不稳定~还是自己藏一份好）&lt;/li>
&lt;li>分享给大家，共同学习，进步~（我也经常使用搜索网站Google等，深知搜索到一个好的博客给出一个好的解答是多么爽的事情~）&lt;/li>
&lt;li>有个自己说话的地方
&lt;strong>关于友情链接&lt;/strong>
&lt;strong>&lt;img style="border: 0px initial initial;" src="http://farm5.static.flickr.com/4067/4246933759_c5780a8a40.jpg" alt="" />&lt;/strong>
另外友情链接方面&lt;del>我的博客才刚起步&lt;/del>不敢向别人提出链接要求，当然，友情链接是建立友情的基础上的~我希望有链接，&lt;strong>但不希望只为了链接而链接&lt;/strong>。
所以在这个原因上~我私自添加了几位牛人的博客&lt;del>哇咔咔，都是我常去的博客（还没征求过他们意见呢&lt;/del>不知道有没有问题·~~）
&lt;strong>排名不分先后啊&lt;/strong>&lt;/li>
&lt;/ol>
&lt;ul style="list-style-type: square; list-style-position: initial; list-style-image: url(http://fatkun.com/wp-content/themes/artemis_fatkun/images/dot.gif); margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 20px; padding: 0px;"> &lt;li style="padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> &lt;a style="color: #be4b29; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial;" title="技术" href="http://dddspace.com/">DDD的一亩三分地&lt;/a> 技术方面的 &lt;/li>
&lt;li style="padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> &lt;a style="color: #be4b29; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial;" title="Linux技术" href="http://kangzj.net/">Kangzj&lt;/a> Linux都懂~~ &lt;/li>
&lt;li style="padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> &lt;a style="color: #be4b29; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial;" title="JS大牛" href="http://www.neoease.com/">mg12&amp;#8217;s Blog&lt;/a> 这个大牛~做博客主题，和JS很牛 &lt;/li>
&lt;li style="padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> &lt;a style="color: #be4b29; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial;" title="网页前端" href="http://www.hzhjun.cn/">大踏步走的学习课堂&lt;/a> 网页前端 &lt;/li>
&lt;li style="padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> &lt;a style="color: #be4b29; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial;" title="Wordpress,Jquery" href="http://immmmm.com/">木木木木木&lt;/a> WordPress改的很好~~Jquery &lt;/li>
&lt;li style="padding-top: 5px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;"> &lt;a style="color: #be4b29; text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial;" title="小邪，PHP牛人" rel="contact" href="http://www.evlos.org/" target="_blank">邪罗刹的菠萝阁&lt;/a> Php很不错~~另外小邪很好人的~~nice`~ &lt;/li>&lt;/ul>
欢迎大家去围观~~~我私自添加的链接，希望上面各位博主不要介意啊~~
**GOOGLE~~**
刚发完文章~到谷歌一搜~发现就有了~~靠，这也太快了吧。。时间不超过10分钟~
![][2]</description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/google-pr/">Google Pr</category><category domain="https://fatkun.github.io/tags/%E5%8D%9A%E5%AE%A2/">博客</category><category domain="https://fatkun.github.io/tags/%E5%8D%9A%E5%AE%A2%E7%9B%AE%E7%9A%84/">博客目的</category><category domain="https://fatkun.github.io/tags/%E5%8F%8B%E6%83%85%E9%93%BE%E6%8E%A5/">友情链接</category><category domain="https://fatkun.github.io/tags/%E6%94%B6%E5%BD%95/">收录</category></item><item><title>让别人心悦诚服听你的</title><link>https://fatkun.github.io/2010/01/let-other-hear-you.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/01/let-other-hear-you.html</guid><pubDate>Tue, 05 Jan 2010 00:00:02 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> 在人际交往中，用灵活多变的劝说方法能够让别人心悦诚服听你的。&lt;/p>
&lt;img style="margin-top: 8px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; max-width: 610px; padding: 0px; border: 1px solid #000000;" src="http://www.53773.com/uploads/allimg/c091117/125T5555G50-13352.jpg" alt="让别人心悦诚服听你的" />
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> &lt;br style="padding: 0px; margin: 0px;" /> &lt;strong>颠倒黑白&lt;/strong>&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> 一旦常规性逻辑被弄混，人的思维就会产生错误，失去判断能力，这是人们普遍的心理特点。以打破对方逻辑思维结构为目的的诡辩不应该受到常规逻辑的约束。&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> &lt;strong>利用正当名义&lt;/strong>&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> 名义总是具有给予希望、刺激功名欲并诱发对新生活的向往的魔力。它对后悔的人和寻找奋斗目标的人都能起到激励作用。&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> &lt;strong>利用数字提高可信度&lt;/strong>&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> 即使是令人难以信服的内容，只要列出&amp;#8221;以调查和客观事实为基础的&amp;#8221;具体统计数据，就可以大大提高可信度，因为很多人都十分迷信数据。记住，最好精确到小数点以后，如&amp;#8221;99.9%&amp;#8221;。&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> &lt;strong>用事实进行反驳理论&lt;/strong>&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> 对方提出某种理论时，用具体事实进行反驳。因为越是强调理论的人越缺乏具体素材，对此应坚持用事实反驳。&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> &lt;strong>不要贪小失大&lt;/strong>&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> 有句谚语说&amp;#8221;捡了芝麻丢了西瓜&amp;#8221;，比喻为贪小利而失大益。有时必须临机应变、主动丢掉芝麻。如果只顾着避免眼前的损失，可能会导致日后无法弥补的大损失。只顾眼前利益就可能丢掉全局，即所谓的贪小失大。所以要具备丢掉芝麻的勇气。&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> &lt;strong>揭其短处&lt;/strong>&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> 虽然是讨论，可一旦升级为近似口角的争论，就难以找出解决的办法。这时与其使用正当的语言进行理论，不如直接攻击对方身体、能力、地位上的缺陷。这种方法虽然有些卑鄙，但在争论中不进则退，取胜才是最重要的。&lt;/p>
&lt;p style="margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; font-size: 14px; line-height: 23px; padding: 0px;"> 来源：&lt;/p>
[http://www.53773.com/][1]</description><category domain="https://fatkun.github.io/categories/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category><category domain="https://fatkun.github.io/tags/%E5%B0%8F%E6%8A%80%E5%B7%A7/">小技巧</category></item><item><title>男女同学交往的好处</title><link>https://fatkun.github.io/2010/01/the-benefits-of-contacts.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/01/the-benefits-of-contacts.html</guid><pubDate>Mon, 04 Jan 2010 04:33:35 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p style="padding: 0px; margin: 0px;"> 我们都有过这种体验：有异性参加的活动，较之只有同性参加的活动，我们一般会感到更愉快，活动的积极性会更高，往往玩得更起劲，干得更出色。这就是心理学上的“异性效应“。当有异性参加活动时，异性间心理接近的需要就得到了满足，于是，彼此间就获得了不同程度的愉悦感，激发起内在的积极性和创造力。尽管健康的两性交往对我们的成长有诸多的好处，我们要把握好两性交往的尺度，防止“过“与“不及“。&lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> &lt;p> &lt;img src="http://farm4.static.flickr.com/3273/3048334331_fb8e93c019.jpg" alt="" /> &lt;/p>
&lt;p style="padding: 0px; margin: 0px;">
&lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> &lt;strong> 男女同学之间交往的好处至少可以表现为以下几个方面：&lt;/strong> &lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> &lt;strong> 首先，个性方面。&lt;/strong>只在同性范围内交往，我们的心理发展往往会狭隘，远不如既与同性又与异性的多项交往更能丰富我们的个性。多项的人际交往，可以使差异较大的个性相互渗透，个性互补，使性格更为豁达开朗，情感体验更为丰富，意志也更为坚强。保加利亚的一位心理学家说过：男人真正的力量是带一点女性温柔色彩的刚毅。 &lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> &lt;strong> 其次，智力方面。&lt;/strong>男、女生在智力类型是有差异的。男女生经常在一起互相学习、互相影响，就可以取长补短，差异互补，提高自己的智力活动水平和学习效率。 &lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> &lt;strong>最后，情感方面。&lt;/strong>人际交往间的情感是丰富而微妙的，在异性交往中获得的情感交流和感受，往往是在同性朋友身上寻不到的。这是因为两性在情感特点是有差异，女生的情感比较细腻温和，富于同情心，情感中富有使人宁静的力量。这样，男生的苦恼、挫折感可以在女生平和的心绪与同情的目光中找到安慰；而男生情感外露、粗扩、热烈而有力，可以消除女生的愁苦与疑惑。 &lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> &lt;strong>不过，该如何与异性正常交往呢？&lt;/strong> &lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> &lt;strong>首先，要端正态度&lt;/strong>，培养健康的交往意识，淡化对对方性别的意识。思无邪，交往时自然就会落落大方。 &lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> &lt;strong>其次，交往关系要疏而不远&lt;/strong>，若即若离，把握两人交往的心理距离，排斥让彼此感到过于亲密和引起心绪波动的接触。如果我们在交往中发现对方的苗头不对，要调整自己的态度，使交往回复到波澜不惊、心静如水的状态。这样更有利于我们的成长。 &lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> &lt;strong>再次，要广泛交往，避免个别接触，交往程度宜浅不宜深。&lt;/strong>广泛接触，利于我们认识、了解更多的异性，对异性有一个基本的总体把握，并学会辨别异性。有的人外表像个迷人的小帅哥，但交往中会发现他华而不实，有的人学习成绩顶呱呱，却恃才傲物、颐指气使。如果只进行有限的小范围个别交往，难免会“只见树木，不见森林“，对异性的了解不但有限，可能还失之偏颇。所以，利用每一次集体活动的机会，有意识地在更广阔的人际范围内进行交往，是我们十分需要的。 &lt;/p>
&lt;p style="padding: 0px; margin: 0px;"> &lt;p style="padding: 0px; margin: 0px;"> 来源：&lt;a href="http://www.53773.com/rjxl/txjw/2009/1201/8507.html">http://www.53773.com/&lt;/a> &lt;/p></description><category domain="https://fatkun.github.io/categories/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category><category domain="https://fatkun.github.io/tags/%E4%BA%A4%E5%BE%80/">交往</category><category domain="https://fatkun.github.io/tags/%E5%A5%BD%E5%A4%84/">好处</category><category domain="https://fatkun.github.io/tags/%E5%BC%82%E6%80%A7%E4%BA%A4%E5%BE%80/">异性交往</category><category domain="https://fatkun.github.io/tags/%E7%94%B7%E5%A5%B3/">男女</category></item><item><title>JQUERY实现背景图渐显（淡入淡出）</title><link>https://fatkun.github.io/2010/01/jquery-animate-background.html</link><guid isPermaLink="true">https://fatkun.github.io/2010/01/jquery-animate-background.html</guid><pubDate>Fri, 01 Jan 2010 16:31:29 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>普通的CSS Hover最多就换一下背景图，不是很好看~我们利用jquery给它加上一些淡入的效果~
在&lt;a href="http://leotheme.cn/javascript/jquery-dragoninteractive-navi.html" target="_blank">这里&lt;/a>看到这个例子，我想我还是自己练习一下吧·~效果可以看&lt;a href="http://dragoninteractive.com/">http://dragoninteractive.com/&lt;/a>网站~，挺帅的~&lt;br>
&lt;img src="http://farm3.static.flickr.com/2741/4232344401_a6bb0be121.jpg" alt="">&lt;/p>
&lt;h2 id="实现原理">实现原理&lt;/h2>
&lt;p>通过一个两张不同的图片，两个不同的层重叠在一起，顶层暂时透明，当鼠标移上去时，顶层由透明变成不透明，鼠标离开反之。&lt;/p>
&lt;h2 id="准备工作">准备工作&lt;/h2>
&lt;p>用PS做一张图~如下图，注意记下高度是多少。我这张图的高度是两个40px的图
&lt;img class="alignnone" src="http://farm5.static.flickr.com/4034/4233112590_85f70380b1.jpg" alt="" width="150" height="80" />
下面写代码&lt;br>
&lt;strong>html结构：&lt;/strong>&lt;/p>
&lt;pre lang="html" line="1">&lt;a id="logo" href="http://fatkun.com">&lt;span>fatkun.com&lt;/span>&lt;/a>&lt;/pre>
&lt;p>&lt;strong>css代码：&lt;/strong>&lt;/p>
&lt;pre lang="css">#logo{
margin:0 auto;
position:relative;/*相对定位,为了下面hover的绝对定位*/
background:url(fatkun.png) left top no-repeat;/*设置背景图*/
width:150px;
height:40px;/*注意这里高度*/
display:block;
text-indent:-9999px;
}
#logo .hover{/*为JQ准备*/
background:url(fatkun.png) left bottom no-repeat;/*background-position和上面不同*/
position:absolute;/*为了使两张图片重叠在一起*/
top:0;
left:0;
height:40px;
width:150px;
}&lt;/pre>
&lt;p>&lt;strong>最后最重要的JQuery代码出现了&lt;/strong>&lt;/p>
&lt;pre lang="js">&lt;/pre>
&lt;p>我做的例子在这里：&lt;a href="http://fatkun.com/demo/jquery-animate-background/">http://fatkun.com/demo/jquery-animate-background/&lt;/a>
到学期末了~~考试就要来了~更新减缓·~2010，祝各位朋友新年快乐。&lt;/p></description><category domain="https://fatkun.github.io/categories/jquery/">Jquery</category><category domain="https://fatkun.github.io/tags/jquery/">Jquery</category><category domain="https://fatkun.github.io/tags/jquery%E5%8A%A8%E7%94%BB/">Jquery动画</category><category domain="https://fatkun.github.io/tags/%E6%B8%90%E5%8F%98/">渐变</category></item><item><title>在博客上显示QQ签名</title><link>https://fatkun.github.io/2009/12/show-qq-signed-on-blog.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/show-qq-signed-on-blog.html</guid><pubDate>Tue, 29 Dec 2009 15:19:58 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>先看看效果&lt;del>也可以在上面看到&lt;/del>那就是QQ签名了。&lt;br>
&lt;img src="http://farm5.static.flickr.com/4038/4225675170_4d9dcd1c34.jpg" alt="">&lt;br>
QQ签名哪里来呢·嘿嘿，我们可以利用taotao.com来取到我们的QQ签名，当然，需要你设置把签名保存在滔滔里，不然只能获取到滔滔的信息了。&lt;/p>
&lt;p>大猫曾写过 &lt;a href="http://ooxx.me/qq-sig.orz">在Blog上显示QQ签名 – (庙)是一天建成的&lt;/a> ，输入下面的地址可以得到滔滔第一条信息，不过这个地址失效了。&lt;/p>
&lt;blockquote>
&lt;pre id="line1" style="font-family: monospace; line-height: 14px; padding: 0px; margin: 0px;">http://taotao.qq.com/v1/qz_first/firstjson?uin=你的QQ号&lt;/pre>
&lt;/blockquote>
&lt;p>没关系~~我们从滔滔给出的JS插件来找就可以。&lt;/p>
&lt;h2 id="下面是分析如果看不懂直接跳到下面一段">下面是分析，如果看不懂直接跳到下面一段&lt;/h2>
&lt;pre lang="xml">&lt;/pre>
&lt;p>当然你可以直接用上面的代码显示在你的博客上~但是我只需要我自己的签名信息就可以了。&lt;br>
从http://www.taotao.com/js/dkapi.js可以看到下面这个地址，复制到浏览器看一下~&lt;/p>
&lt;blockquote>
&lt;p>&lt;a href="http://www.taotao.com/cgi-bin/msgj?qq=">http://www.taotao.com/cgi-bin/msgj?qq=&lt;/a>这里换成你的QQ号&amp;amp;num=1
打开的结果是一段JS&lt;/p>
&lt;/blockquote>
&lt;pre escaped="true" lang="xml">doApi({"posts":[{"cn":"人参要泡在杯具里才入味。有点感冒&amp;amp;喉咙痛~没发热~~37.1° ","id":"14294845341","sr":3,"time":"3,1"}],"ret":0,"total":203,"type":0,"ui":{"lrank":0,"name":"QQ昵称","qq":你的QQ号,"rank":0,"rec":"","usn":9948760}})&lt;/pre>
&lt;p>以前我看到的好像只返回一段JSON的，现在前面加上了个调用函数，没关系，我们来实现就可以了。&lt;/p>
&lt;h2 id="上面是分析方法如果看不懂直接跳到这里实现">上面是分析方法，如果看不懂直接跳到这里实现&lt;/h2>
&lt;p>具体代码：&lt;/p>
&lt;pre lang="js">&lt;div id="taotao"> &lt;/div>
&lt;/pre>
&lt;p>在wordpress的做法是可以在header.php内你想显示的地方加一个&lt;div id=&amp;#8221;taotao&amp;#8221;>&lt;/div>，然后上面的代码可以放在任何地方。不过注意代码顺序不要乱了,doApi方法要在taotao.js的前面，这样才可以调用嘛~
很简单~&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/qq/">QQ</category><category domain="https://fatkun.github.io/tags/qq%E7%AD%BE%E5%90%8D/">Qq签名</category><category domain="https://fatkun.github.io/tags/%E5%8D%9A%E5%AE%A2/">博客</category><category domain="https://fatkun.github.io/tags/%E6%98%BE%E7%A4%BAqq%E7%AD%BE%E5%90%8D/">显示qq签名</category><category domain="https://fatkun.github.io/tags/%E6%BB%94%E6%BB%94/">滔滔</category></item><item><title>博客同步到多个博客能否有利于SEO?</title><link>https://fatkun.github.io/2009/12/blog-mover-tool.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/blog-mover-tool.html</guid><pubDate>Fri, 25 Dec 2009 08:39:21 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>今天想到这个问题，博客同步到多个博客能否有利于SEO?例如一些其他服务商提供的博客服务，如百度HI，新浪，Msn Space等。貌似这些博客的收录都挺快的。不知道在这些博客上同步自己的独立博客，并加上链接，不知道有没有SEO的效果？~&lt;br>
没了解过SEO。。所以我也不懂~&lt;br>
正想着要不要自己试试写一个类似的程序~还是到Google搜索一下有没有类似的东西先吧。然后找到了下面这个~&lt;br>
Blog Mover （博客搬家通用工具）&lt;a href="http://blogmover.redv.com/">http://blogmover.redv.com/&lt;/a>&lt;br>
&lt;img src="http://farm3.static.flickr.com/2510/4212121149_ff95d0b9f9.jpg" alt="">&lt;/p>
&lt;blockquote>
&lt;p>“博客搬家”是指将某个 Blog 用户（Blogger）的全部或者部分日志（Web Log）从源 BSP（Blog Service Provider 即博客服务提供商） 搬迁到目标 BSP。&lt;br>
Blog Mover 具有如下特点：&lt;br>
搬迁后原 Blog 的数据不会丢失，将仍然保留；&lt;br>
搬迁的范围包括日期、内容、评论、标签（Tags）以及图片、多媒体文件；当然不同的 BSP 所支持的略有不同。&lt;br>
你可以选择源 Blog 的部分日志进行搬迁。
而且支持不少类型的博客~&lt;br>
&lt;img src="http://farm5.static.flickr.com/4010/4212885316_b3f3a047fe.jpg" alt="">&lt;br>
试用了一下&lt;del>发现无论是我的百度博客还是WP博客都出错了耶&lt;/del>难道我RP不好？都不能正常使用？&lt;br>
那位作者开放了源代码，项目地址是在：&lt;a style="font: normal normal normal 12px/normal tahoma, times, serif, 宋体; line-height: 18px; padding: 0px; margin: 0px;" href="http://code.google.com/p/blog-mover/">&lt;a href="http://code.google.com/p/blog-mover/">http://code.google.com/p/blog-mover/&lt;/a>&lt;/a>
我大致看了下是用JSP写的(- -！看后缀名…)文件夹挺多的，目录很深&lt;del>由于是用到了&lt;a rel="nofollow" href="http://maven.apache.org/">Maven2&lt;/a>..小弟不才，还没用过这东西，哎，还有很多东西要学&lt;/del>下载了代码，按照作者提供的方法运行&lt;del>不知道是我的包没下齐全还是咋样&lt;/del>杯具了~~
不过看到作者在11月也有更新程序&lt;del>所以我也下载代码来学学牛人写的代码&lt;/del>哇咔咔~另外，E文不好。。不知道那源码是基于那个协议发布的…汗…貌似是自定义的…&lt;/p>
&lt;/blockquote></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/blogmover/">BlogMover</category><category domain="https://fatkun.github.io/tags/%E5%8D%9A%E5%AE%A2%E6%90%AC%E5%AE%B6/">博客搬家</category></item><item><title>Feed恢复正常，WAP插件作祟</title><link>https://fatkun.github.io/2009/12/feed-wap.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/feed-wap.html</guid><pubDate>Tue, 22 Dec 2009 09:34:57 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>前面说到我的Feedsky解析错误，而FeedBurner却一直正常，向Feedsky客服询问了一下,他的答复如下：&lt;/p>
&lt;blockquote>
&lt;p>您好，在访问http://fatkun.com/feed时，您设置301跳转到了http://fatkun.com/feed/，但我们的爬虫在访问后者时，获取到的是一个html页面；应该是判断agent并跳转rss地址的设置有一些问题，您查看一下，或去掉相关跳转后再观察一下更新。
可是我用ie/chrome跳转都正常。今天偶尔用手机访问一下我的feed源地址，发现跳转到一个html页面，而不是feed页面。原来是我使用了一个Wapple Architect的插件。
把插件停用后到Feedsky更新，发现可以正常更新了。&lt;/p>
&lt;/blockquote>
&lt;h2 id="后记">后记&lt;/h2>
&lt;p>经过这次折腾，我感觉国内的技术还是有点差距（因为我用IE都可以正常跳转到我的feed地址，为啥你爬虫就不行？不会伪装一下？）
刚开始不用FeedBurner是因为都是english，和我校园网访问感觉有点慢，而且绑定域名怪怪的，绑定了还要加个尾巴~~
不管了，反正订阅的人也不多。由于上次换博客程序，搜索引擎的都没有收录我的网页~~~杯具&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/feed/">Feed</category><category domain="https://fatkun.github.io/tags/%E6%9D%AF%E5%85%B7/">杯具</category></item><item><title>Feed又出问题了，可恶的FeedSky</title><link>https://fatkun.github.io/2009/12/bad-feedsky.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/bad-feedsky.html</guid><pubDate>Mon, 21 Dec 2009 05:26:37 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;img src="http://farm3.static.flickr.com/2689/4201839487_5a22d56f24.jpg" alt="">&lt;br>
最近几天我的Feedsky一直没有更新，去后台看了一下,My God。。。解析错误[704]~&lt;br>
访问一下我的源地址 &lt;a href="http://fatkun.com/feed">http://fatkun.com/feed&lt;/a> 没问题~&lt;br>
访问一下我的feedburner的地址,&lt;a href="http://feeds.feedburner.com/fatkun">http://feeds.feedburner.com/fatkun&lt;/a> 也没问题啊!
该死的FeedSky….原本想可以用一个固定域名订阅比较方便，容易无缝转换，看来不是这样子了。&lt;br>
我的Feed地址是:feed.fatkun.com（刚刚看到feedsky也可以用feed.fatkun.com/fatkun地址，是会跳转的）&lt;br>
feedburner如果要绑定地址那么就是：feed.fatkun.com/fatkun&lt;br>
然而000webhost的绑定子域名只能是：在空间自动给你建了个feed文件夹,feed.fatkun.com指向这个文件夹&lt;br>
可是我的Wordpress 的Feed地址就是：fatkun.com/feed
不知道大家看懂了没有，我说得都有点晕~~我只是想无缝转换订阅用户到feedburner而已啊。。。好难啊。。
杯具就是这样产生的。。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/feed/">Feed</category><category domain="https://fatkun.github.io/tags/feedburner/">Feedburner</category><category domain="https://fatkun.github.io/tags/feedsky/">Feedsky</category></item><item><title>11个使用JQuery的WordPress插件</title><link>https://fatkun.github.io/2009/12/11-useful-jquery-powered-wordpress-plugins.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/11-useful-jquery-powered-wordpress-plugins.html</guid><pubDate>Fri, 18 Dec 2009 10:43:12 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 我们都知道各种各样的动态效果和功能都可以通过JQuery添加到网页上,但是至少要懂得一些JQuery的知识才会使用。这不是一个大问题，但是一些Wordpress用户总喜欢一些简单的插件。这篇文章的目的帮助你发现一些好用的WP插件（使用JQuery的~）&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://noscope.com/journal/2009/03/carousel-gallery-jquery-for-wordpress" target="_blank">Carousel Gallery (jQuery) for WordPress&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://noscope.com/journal/2009/03/carousel-gallery-jquery-for-wordpress" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/12/wordpress_jquery_1.jpg" alt="wordpress jquery plugin" />&lt;/a>&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 这个插件使用了Wordpress内建的图库，并且使用幻灯片的显示。
&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.viper007bond.com/wordpress-plugins/jquery-lightbox-for-native-galleries/" target="_blank">jQuery Lightbox For Native Galleries&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.viper007bond.com/wordpress-plugins/jquery-lightbox-for-native-galleries/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/12/wordpress_jquery_2.jpg" alt="wordpress jquery plugin" />&lt;/a>&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 使用ColorBox来显示全尺寸的图片。&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://wordpress.org/extend/plugins/jquery-image-lazy-loading/" target="_blank">jQuery Image Lazy Load WP&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://wordpress.org/extend/plugins/jquery-image-lazy-loading/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/12/wordpress_jquery_3.jpg" alt="wordpress jquery plugin" />&lt;/a>&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 这个插件可以给Wordpress加上延迟加载图片的功能，也就是说在页面底下很远的图片会暂时不加载直到用户拖动滚动条下来。&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://wordpress.org/extend/plugins/jquery-comment-preview/" target="_blank">jQuery Comment Preview&lt;/a>&lt;/h3>
这个插件可以给评论者一个实时的预览自己的评论，它包括一个简单的HTML编辑器，还可以调整评论预览的样式。
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://ronaldheft.com/code/analyticator/" target="_blank">Google Analyticator&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://ronaldheft.com/code/analyticator/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/12/wordpress_jquery_4.jpg" alt="wordpress jquery plugin" />&lt;/a>&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> Google Analyticator把开启谷歌分析（Google Analytics）必须用到的JavaScript代码添加进你的博客，这样就避免了自己修改模板添加代码的麻烦了。还有多个小工具（widgets），可以在前台和后台显示分析数据。（译者注：我也有在用这个插件，很方便）&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://articlesss.com/jquery-post-preview-wordpress-plugin/" target="_blank">jQuery Post Preview WordPress Plugin&lt;/a>&lt;/h3>
如果你不喜欢WordPress内置的编辑器（因为它添加了一些不必要的标签或者其它原因），但是你又想要一个实时预览（所见即所得？）的编辑器，那么这个插件很适合你。
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://wordpress.org/extend/plugins/jquery-pagebar/" target="_blank">jQuery-Pagebar&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://wordpress.org/extend/plugins/jquery-pagebar/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/12/wordpress_jquery_5.jpg" alt="wordpress jquery plugin" />&lt;/a>&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> jQuery-Pagebar 把原来的上一页、下一页替换成滑动条了~&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.prodeveloper.org/j-post-slider-WordPress-plugin-jquery-post-animation-show.html" target="_blank">J Post Slider&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.prodeveloper.org/j-post-slider-WordPress-plugin-jquery-post-animation-show.html" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/12/wordpress_jquery_6.jpg" alt="wordpress jquery plugin" />&lt;/a>&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 这个插件可以循环显示最新的文章，图片，标题，或者摘要。&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://transientmonkey.com/wp-slimbox2" target="_blank">WP-Slimbox2&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://transientmonkey.com/wp-slimbox2" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/12/wordpress_jquery_7.jpg" alt="wordpress jquery plugin" />&lt;/a>&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 这个插件继承了Christophe Beyls写的优秀的Slimbox2。&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.siolon.com/blog/wordpress-post-information-plugin/" target="_blank">WordPress Post Information Plugin&lt;/a>&lt;/h3>
这个插件可以把文章内容放入一个可以折叠的框内~可以节省网页空间~
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.pedrolamas.com/projectos/jquery-lightbox-en/" target="_blank">WordPress jQuery Lightbox&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.pedrolamas.com/projectos/jquery-lightbox-en/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/12/wordpress_jquery_8.jpg" alt="wordpress jquery plugin" />&lt;/a>&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 这个使用了balupton写的jQuery Lightbox插件。&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 第一次翻译~~四级还没过呢~~所以有错漏笑笑就好了。。这个星期六考英语四级~ fatkun &lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 本文来源：&lt;a href="http://webdesignledger.com/resources/11-useful-jquery-powered-wordpress-plugins">http://webdesignledger.com/resources/11-useful-jquery-powered-wordpress-plugins&lt;/a> &lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 中文翻译：&lt;a href="http://fatkun.com/2009/12/11-useful-jquery-powered-wordpress-plugins">http://fatkun.com/2009/12/11-useful-jquery-powered-wordpress-plugins&lt;/a> &lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/jquery/">Jquery</category><category domain="https://fatkun.github.io/tags/plugin/">Plugin</category><category domain="https://fatkun.github.io/tags/wordpress/">Wordpress</category></item><item><title>开始学习Google App Engine(Java) – 准备篇</title><link>https://fatkun.github.io/2009/12/the-first-of-google-app-engine-java.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/the-first-of-google-app-engine-java.html</guid><pubDate>Tue, 15 Dec 2009 12:40:01 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>发现我挺喜欢Google的东西&lt;del>也算一个G粉吧&lt;/del>&lt;del>好喜欢啊好喜欢·~好多免费的东西&lt;/del>~&lt;/p>
&lt;h2 id="什么是google-app-engine">什么是Google App Engine?&lt;/h2>
&lt;blockquote>
&lt;p>按我的理解，简单的一句话就是Google提供一个网络平台，这个平台目前支持 Python、Java，我们可以通过编写程序运行在google的服务器上。&lt;/p>
&lt;/blockquote>
&lt;p>&lt;strong>官方的介绍：&lt;/strong>&lt;/p>
&lt;blockquote>
&lt;p style="padding-top: 1em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 20px; margin: 0px;">> Google App Engine 可让您在 Google 的基础架构上运行您的网络应用程序。App Engine 应用程序易于构建和维护，并可根据您的访问量和数据存储需要的增长轻松扩展。使用 Google App Engine，将不再需要维护服务器：您只需上传您的应用程序，它便可立即为您的用户提供服务。> &lt;/p>
&lt;p style="padding-top: 1em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 20px; margin: 0px;">> 您可以使用 &lt;a style="color: #0000cc;" href="http://www.google.com/a/">Google 企业应用套件&lt;/a>通过自己的域名（例如 &lt;code style="font-family: monospace; color: #007000; font-size: 10pt;">http://www.example.com/&lt;/code>）提供应用程序。或者，您可以使用 &lt;code style="font-family: monospace; color: #007000; font-size: 10pt;">appspot.com&lt;/code> 域上的免费域名来为您的应用程序提供服务。您可以与全世界的人共享您的应用程序，也可以限制为只有贵组织的成员可以访问。> &lt;/p>
&lt;p style="padding-top: 1em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 20px; margin: 0px;">> Google App Engine 支持以几种编程语言编写的应用程序。通过 App Engine 的 Java 运行时环境，您可以使用标准 Java 技术（包括 JVM、Java servlet 和 Java 编程语言，或使用基于 JVM 的解释器或解译器的任何其他语言，例如 JavaScript 或 Ruby）构建应用程序。App Engine 还提供一个专用的 Python 运行时环境，该环境包括一个快速 Python 解释器和 Python 标准库。Java 和 Python 运行时环境构建为确保应用程序快速、安全运行，并不受系统上的其他应用程序的干扰。> &lt;/p>
&lt;p style="padding-top: 1em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 20px; margin: 0px;">> 在 App Engine 中，您只需为您使用的资源付费。没有设置成本，也没有重复的费用。您的应用程序使用的资源，如存储空间和带宽以千兆字节衡量，并以有竞争力的费率收费。您可以控制您的应用程序可以消费的最大资源量，使其一直保持在预算范围内。> &lt;/p>
&lt;p style="padding-top: 1em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 20px; margin: 0px;">> 可以免费开始使用 App Engine。所有应用程序都可以使用多达 500 MB 的存储空间，以及可支持每月约 500 万页面浏览量的足够的 CPU 和带宽，完全免费。为您的应用程序启用付费后，您的免费配额将提高，您只需为使用的超过免费水平的资源付费。> &lt;/p>
&lt;/blockquote>
&lt;p style="padding-top: 1em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 20px; margin: 0px;"> Google为我们提供了充足的免费限额~~要知道有多少？可以到这里看看&lt;a style="color: #551a8b; vertical-align: middle; zoom: 1; padding-right: 4px;" href="http://code.google.com/intl/zh-CN/appengine/docs/quotas.html">配额&lt;/a>。真的足够了，对于我来说~~&lt;/p>
&lt;p style="padding-top: 1em; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 20px; margin: 0px;"> 可以到app Engine 的官方网站来看一下，&lt;a href="http://code.google.com/intl/zh-CN/appengine/">http://code.google.com/intl/zh-CN/appengine/&lt;/a>，这里有很多的文档。大部分都汉化了~~ /yy&lt;/p>
## 前提准备工作
&lt;p>下载东西啦~~到&lt;a href="http://code.google.com/intl/zh-CN/appengine/downloads.html" target="_blank">这里&lt;/a>下载&lt;/p>
&lt;ol>
&lt;li>下载Google App Engine SDK for Java&lt;/li>
&lt;li>如果你需要使用GWT（Google Web Toolkit）,到&lt;a href="http://code.google.com/intl/zh-CN/webtoolkit/download.html" target="_blank">这里&lt;/a>下载(可选)&lt;/li>
&lt;li>下载 Eclipse Google 插件,在&lt;a href="http://code.google.com/intl/zh-CN/eclipse/docs/download.html" target="_blank">这里&lt;/a>啊~
下载eclipse插件，可以通过以下地址：（按版本选择）,如果你还不会安装，看&lt;a href="http://code.google.com/intl/zh-CN/eclipse/docs/download.html">这里&lt;/a>的Detailed instructions for installation from update sites，里面有图文介绍耶！！
另外说的是如果你前面下载了两个SDK，那就下载插件的时候就不用勾选那两个SDK了~~直接选插件那个就行。&lt;/li>
&lt;/ol>
&lt;blockquote>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 326px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">> Eclipse 3.5 (Galileo)> &lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 326px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">> http://dl.google.com/eclipse/plugin/3.5> &lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 326px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">> Eclipse 3.4 (Ganymede)> &lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 326px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">> http://dl.google.com/eclipse/plugin/3.4> &lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 326px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">> Eclipse 3.3 (Europa)> &lt;/div>
&lt;div id="_mcePaste" style="position: absolute; left: -10000px; top: 326px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">> http://dl.google.com/eclipse/plugin/3.3> &lt;/div>
> Eclipse 3.5 (Galileo)
> http://dl.google.com/eclipse/plugin/3.5
> Eclipse 3.4 (Ganymede)
> http://dl.google.com/eclipse/plugin/3.4
> Eclipse 3.3 (Europa)
> http://dl.google.com/eclipse/plugin/3.3
&lt;/blockquote>
&lt;p>如果你是自己下载SDK的，那就解压到任意目录下(小白问：“任意目录是哪个目录？”汗！)，先解压，以后有用。~
这时我们可以在eclipse看到工具栏多出的三个小图标，各点一下试试咯~~
如果你是自己下载SDK的，需要配置SDK的路径。我们可以在新建app engine项目的界面下面看到有配置SDK的链接，点进去，然后选择前面解压的路径~另外GWT可以不勾选~如果你用不上~
就这样吧，懒得截图了·~
下一篇文章写它文档带了的一个小例子~一个简单的留言本~那些例子真的很容易懂啊。。大家多看看文档就会了~~
我也是刚学的，才学两天~所以不会太深入~·哇咔咔~
原创文章：fatkun，转载请保留本文链接。&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/gae/">GAE</category><category domain="https://fatkun.github.io/tags/google/">Google</category><category domain="https://fatkun.github.io/tags/java/">JAVA</category></item><item><title>FlashGame:围住小猫猫~</title><link>https://fatkun.github.io/2009/12/catch-cat-flash-game.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/catch-cat-flash-game.html</guid><pubDate>Tue, 15 Dec 2009 07:00:18 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>围住小猫游戏。用鼠标操作，猫只能踩浅色圆点，点击浅色圆点把它变成深色，阻挡小猫的逃跑。猫每次只能移动一步，如果能用深色圆点把它圈起来的话你就赢了。&lt;br>
游戏攻略：充分利用现有的点慢慢围住。不是很难~呵呵~&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/flash/">Flash</category><category domain="https://fatkun.github.io/tags/%E6%B8%B8%E6%88%8F/">游戏</category></item><item><title>2009年最好的WordPress免费主题</title><link>https://fatkun.github.io/2009/12/the-best-free-wordpress-theme-of-2009.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/the-best-free-wordpress-theme-of-2009.html</guid><pubDate>Mon, 14 Dec 2009 07:55:45 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 这是webdesignledger.com评出的2009年最好的WordPress免费主题~感觉还可以吧~~第一个我喜欢~~&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/02/23/magazeen-free-magazine-look-wordpress-theme/" target="_blank">Magazeen&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/02/23/magazeen-free-magazine-look-wordpress-theme/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_1.jpg" alt="wordpress theme" />&lt;/a>
&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.woothemes.com/2009/11/bueno/" target="_blank">Bueno&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.woothemes.com/2009/11/bueno/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_2.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/05/04/download-gallery-a-free-wordpress-theme/" target="_blank">Gallery&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/05/04/download-gallery-a-free-wordpress-theme/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_3.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://jimbarraud.com/2009/03/19/manifest/" target="_blank">Manifest&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://jimbarraud.com/2009/03/19/manifest/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_14.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://themeshift.com/destyle/" target="_blank">deStyle&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://themeshift.com/destyle/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_7.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/03/10/download-imprezz-a-free-wordpress-theme/" target="_blank">Imprezz&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/03/10/download-imprezz-a-free-wordpress-theme/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_4.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.press75.com/the-folio-elements-wordpress-theme/" target="_blank">Folio Elements&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.press75.com/the-folio-elements-wordpress-theme/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_13.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/02/18/compositio-clean-beautiful-and-free-wordpress-theme/" target="_blank">Compositio&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/02/18/compositio-clean-beautiful-and-free-wordpress-theme/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_5.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.obox-design.com/themes_page.cfm/theme/selecta" target="_blank">Selecta&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.obox-design.com/themes_page.cfm/theme/selecta" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_6.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.woothemes.com/2009/02/irresistible/" target="_blank">Irresistible&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.woothemes.com/2009/02/irresistible/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_8.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/11/07/glassical-a-free-wordpress-theme/" target="_blank">Glassical&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/11/07/glassical-a-free-wordpress-theme/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_9.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.woothemes.com/2009/07/mainstream/" target="_blank">Mainstream&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.woothemes.com/2009/07/mainstream/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_10.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://freebiesdock.com/freemium-wordpress-theme/" target="_blank">FREEmium&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://freebiesdock.com/freemium-wordpress-theme/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_11.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.skinpress.com/blackpower-theme/" target="_blank">Black Power&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.skinpress.com/blackpower-theme/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_12.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;h3 style="margin-top: 35px; margin-right: 30px; margin-bottom: 15px; margin-left: 0px; font-family: Georgia, 'Nimbus Roman No9 L', serif; font-style: normal; font-weight: normal; line-height: 1.1em; font-size: 30px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/01/28/vintage-and-blues-wordpress-themes/" target="_blank">Vintage&lt;/a>&lt;/h3>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> &lt;a style="text-decoration: none; color: #2b8dc0;" href="http://www.smashingmagazine.com/2009/01/28/vintage-and-blues-wordpress-themes/" target="_blank">&lt;img style="margin: 0px; border: 5px solid #e3e3e3;" src="http://webdesignledger.com/wp-content/uploads/2009/11/themes_2009_15.jpg" alt="wordpress theme" />&lt;/a>&lt;/p>
&lt;p style="line-height: 1.6em; margin-top: 0px; margin-right: 10px; margin-bottom: 20px; margin-left: 0px; font-size: 14px;"> 原文来源：&lt;a href="http://webdesignledger.com/freebies/the-best-free-wordpress-themes-of-2009">http://webdesignledger.com/freebies/the-best-free-wordpress-themes-of-2009&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/free/">Free</category><category domain="https://fatkun.github.io/tags/theme/">Theme</category><category domain="https://fatkun.github.io/tags/wordpress/">Wordpress</category><category domain="https://fatkun.github.io/tags/%E4%B8%BB%E9%A2%98/">主题</category><category domain="https://fatkun.github.io/tags/%E5%8D%9A%E5%AE%A2/">博客</category></item><item><title>做了一件愚蠢的事情</title><link>https://fatkun.github.io/2009/12/foolish.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/foolish.html</guid><pubDate>Sun, 13 Dec 2009 10:51:35 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>为了使用&lt;a href="http://feed.fatkun.com">http://feed.fatkun.com&lt;/a>这个域名来作为我的Feed地址~使用了FeedSky.com的服务&lt;del>绑定了域名，但是最近有点奇怪的是我的RSS为什么这么久不更新？汗…
看了一下feedsky的后台&lt;/del>，有更新啊~~&lt;/p>
&lt;blockquote>
&lt;h3 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; font: normal normal normal 16px/normal Arial, Helvetica, sans-serif; color: #444444; font-weight: bold; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #e9e9e8;">> 查看Feed状态> &lt;/h3>
&lt;dl id="feedmedic" style="padding: 0px; margin: 0px;">> &lt;dt style="padding-top: 2px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; background-color: #dbdbdb; word-break: break-all; margin: 0px;">> &lt;strong>源地址：http://fatkun.com/feed&lt;/strong>> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-13 18:35:46     [304] : 客户端通知未更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-13 16:56:05     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-13 15:28:16     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-13 12:59:55     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-13 11:26:49     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-13 08:52:01     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-13 06:59:30     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-13 04:53:11     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-13 03:01:48     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-13 00:54:23     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-12 23:32:07     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-12 20:54:17     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-12 19:21:08     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-12 16:53:36     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-12 15:28:19     [304] : 客户端通知未更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-12 12:54:26     [304] : 客户端通知未更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-12 11:08:05     [200] : 已更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-12 08:50:58     [304] : 客户端通知未更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-12 06:48:11     [304] : 客户端通知未更新> &lt;/dt>
&lt;dt style="padding-top: 1px; padding-right: 0px; padding-bottom: 0px; padding-left: 5px; margin: 0px;">> &lt;strong>正常 : &lt;/strong> 2009-12-12 04:49:25     [304] : 客户端通知未更新> &lt;/dt>> &lt;/dl>
&lt;/blockquote>
&lt;p>一看，&lt;strong>源地址：http://fatkun.com/feed，&lt;/strong>&lt;span style="padding: 0px; margin: 0px;">完蛋了，立即访问一下…地址果然跳转到了http://feed.fatkun.com上（这是我在空间后台设置的跳转），晕，自己跳回给自己了。。怪不得没有更新~~&lt;/span>
&lt;span style="padding: 0px; margin: 0px;">把跳转删了应该就可以了~~&lt;/span>
&lt;span style="padding: 0px; margin: 0px;">最后再说下我的FEED永久地址：&lt;a href="http://feed.fatkun.com">&lt;strong>&lt;a href="http://feed.fatkun.com">http://feed.fatkun.com&lt;/a>&lt;/strong>&lt;/a>&lt;/span>
&lt;span style="padding: 0px; margin: 0px;">&lt;br /> &lt;/span>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/feed/">Feed</category><category domain="https://fatkun.github.io/tags/wordpress/">Wordpress</category><category domain="https://fatkun.github.io/tags/%E7%AC%A8/">笨</category></item><item><title>去掉000webhost自身的统计代码</title><link>https://fatkun.github.io/2009/12/remove-000webhost-analytics-code.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/remove-000webhost-analytics-code.html</guid><pubDate>Sun, 13 Dec 2009 05:18:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;span style="font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22px; font-size: 14px; border-collapse: collapse; color: #333333;">000webhost被称为比收费空间还好的免费空间，的确是不错的。&lt;/span>
&lt;span style="font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22px; font-size: 14px; border-collapse: collapse; color: #333333;">不过有个很麻烦的事，就是它要在每个页面下加了一段自己的统计代码，发&lt;span style="border-collapse: separate; color: #000000; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; font-size: 13px;">现加载这个统计代码有很大的延迟，拖慢了不了速度。&lt;/span>&lt;/span>
这个代码有点儿不爽~我在弄Google Gears 自己博客的时候~发现它出错了，会不会被加上统计代码的原因呢？（后来发现还是不可以用Chromium使用gears，不知道为什么，火狐却可以用。。）
&lt;span style="font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22px; font-size: 14px; border-collapse: collapse; color: #333333;">000webhost允许我们去掉这个统计代码&lt;/span>
&lt;span style="font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22px; font-size: 14px; border-collapse: collapse; color: #333333;">打开&lt;a style="word-wrap: break-word; text-decoration: none; color: #cb441a; line-height: normal;" href="http://members.000webhost.com/analytics.php" target="_blank">&lt;span style="word-wrap: break-word; line-height: normal; color: #0066cc;">&lt;a href="http://members.000webhost.com/analytics.php">http://members.000webhost.com/analytics.php&lt;/a>&lt;/span>&lt;/a>输入你的域名和密码，选一个“disable code”就可以了！&lt;/span>
&lt;span style="font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22px; font-size: 14px; border-collapse: collapse; color: #333333;">&lt;span style="border-collapse: separate; color: #000000; font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; font-size: 13px;">&lt;a href="http://wordpress.org.cn/thread-19924-1-2.html">&lt;img src="http://farm5.static.flickr.com/4039/4180050831_fa3cfef717.jpg" alt="" />&lt;/a>&lt;/span>&lt;/span>
&lt;span style="font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22px; font-size: 14px; border-collapse: collapse; color: #333333;">特地分享一下，请000webhost的朋友也来用用，&lt;strong>感觉好的记得来评论！&lt;/strong>呵呵。。。&lt;/span>
&lt;span style="font-family: Verdana, Helvetica, Arial, sans-serif; line-height: 22px; font-size: 14px; border-collapse: collapse; color: #333333;">如果你想注册000webhost，请&lt;a href="http://www.000webhost.com/235822.html" target="_blank">点这里&lt;/a>~国内注册要通过人工开通·~不明白可以找我。·&lt;/span>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/000webhost/">000webhost</category><category domain="https://fatkun.github.io/tags/%E5%8E%BB%E6%8E%89/">去掉</category><category domain="https://fatkun.github.io/tags/%E7%BB%9F%E8%AE%A1%E4%BB%A3%E7%A0%81/">统计代码</category></item><item><title>2009 年度最佳 jQuery 插件</title><link>https://fatkun.github.io/2009/12/the-best-jquery-plugins-of-2009.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/the-best-jquery-plugins-of-2009.html</guid><pubDate>Sat, 12 Dec 2009 11:03:20 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>jQuery 是个宝库，而 jQuery 的插件体系是个取之不竭的宝库，众多开发者在 jQuery 框架下，设计了数不清的插件，jQuery  的特长是网页效果，因此，它的插件库也多与 UI 有关。本文是 &lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #800080;" href="http://www.webdesignledger.com/">webdesignledger.com&lt;/a> 网站推选的2009年度最佳 jQuery 插件。&lt;/p>
&lt;h3 style="line-height: 32px; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #c0c0c0;"> 拉洋片&lt;/h3>
在一个固定区域，循环显示几段内容，这种方式很像旧时的拉洋片，2009年，这种 Web 效果大行其道，jQuery 有大量与此有关的插件，以下插件无疑是最佳的。
### &lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://css-tricks.com/anythingslider-jquery-plugin/" target="_blank">AnythingSlider&lt;/a>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://css-tricks.com/anythingslider-jquery-plugin/" target="_blank">&lt;img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_1.jpg" alt="jquery plugins" />&lt;/a>
由 CSS-Tricks 的 Chris Coyier 设计，功能齐全，应用十分广泛。&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-305080-hrefhttpcssglobecompost5780easy-slider-17-numeric-navigation-jquery-slider-target_blankeasy-slidera">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider" target="_blank">Easy Slider&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider" target="_blank">&lt;img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_3.jpg" alt="jquery plugins" />&lt;/a>
这个 Content Slider 插件既包含传统“前后”导航模式，又包含页码式导航。&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-305080-hrefhttpwwwndohertybiztagcoda-slider-target_blankcoda-slider-20a">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.ndoherty.biz/tag/coda-slider/" target="_blank">Coda-Slider 2.0&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.ndoherty.biz/tag/coda-slider/" target="_blank">&lt;img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_7.jpg" alt="jquery plugins" />&lt;/a>
Coda-Slider 2.0 是对 Panic Coda 网站上对应效果的模仿。&lt;/p>
&lt;h3 style="line-height: 32px; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #c0c0c0;"> 图片库&lt;/h3>
那些需要借助 Flash 实现滑动与渐入渐出效果图片库的日子已经去过，借助 jQuery，这种效果已经可以在本地实现，以下是本年度备受欢迎的几个 jQuery 图片库插件。
### &lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://devkick.com/lab/galleria/" target="_blank">Galleria&lt;/a>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://devkick.com/lab/galleria/" target="_blank">&lt;img src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_4.jpg" alt="jquery plugins" />&lt;/a>
这是一个基于 jQuery 的图片库，可以逐个加载图片并显示缩略图。&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-305080-hrefhttpwwwcatchmyfamecom20090813jquery-panel-gallery-1-1-plugin-released-target_blankjquery-panel-gallerya">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.catchmyfame.com/2009/08/13/jquery-panel-gallery-1-1-plugin-released/" target="_blank">jQuery Panel Gallery&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.catchmyfame.com/2009/08/13/jquery-panel-gallery-1-1-plugin-released/" target="_blank">&lt;img src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_5.jpg" alt="jquery plugins" />&lt;/a>
一个可以高度定义的图片库插件，无需对单个图片进行任何处理，这个插件会帮你完成一切。&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-305080-hrefhttpwwwgcmingatinetwordpresswp-contentlabjqueryimagestripimageslide-pluginhtml-target_blankslideviewera">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html" target="_blank">slideViewer&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html" target="_blank">&lt;img src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_10.jpg" alt="jquery plugins" />&lt;/a>
slideViewer 会检查你的图片列表中的编号，动态创建各个图片的页码浏览导航。&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-800080-hrefhttpwwwbuildinternetcomprojectsupersized-target_blanksupersizeda">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #800080;" href="http://www.buildinternet.com/project/supersized/" target="_blank">Supersized&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #800080;" href="http://www.buildinternet.com/project/supersized/" target="_blank">&lt;img src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_6.jpg" alt="jquery plugins" />&lt;/a>
一个令人惊讶的图片循环展示插件，包含各种变换效果和预加载选项，会对图片自动改变尺寸以适应浏览器窗口。&lt;/p>
&lt;h3 style="line-height: 32px; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #c0c0c0;"> 导航&lt;/h3>
我们相信，作为网站的导航系统，应该越简单，越易用越好，然而，假如你确实希望实现一些更炫的效果，jQuery 就是最好的选项，以下插件是09年最好的 jQuery  导航插件。
### &lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #800080;" href="http://pupunzi.open-lab.com/mb-jquery-components/mb-_menu/" target="_blank">jquery mb.menu&lt;/a>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #800080;" href="http://pupunzi.open-lab.com/mb-jquery-components/mb-_menu/" target="_blank">&lt;img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_8.jpg" alt="jquery plugins" />&lt;/a>&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-305080-hrefhttpwwwquenesscompost256horizontal-scroll-menu-with-jquery-tutorial-target_blankhorizontal-scroll-menu-with-jquerya">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.queness.com/post/256/horizontal-scroll-menu-with-jquery-tutorial" target="_blank">Horizontal Scroll Menu with jQuery&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.queness.com/post/256/horizontal-scroll-menu-with-jquery-tutorial" target="_blank">&lt;img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_16.jpg" alt="jquery plugins" />&lt;/a>&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-305080-hrefhttpwwwnewmediacampaignscompageautosprites-jquery-menu-plugin-target_blankautospritesa">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.newmediacampaigns.com/page/autosprites-jquery-menu-plugin" target="_blank">AutoSprites&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.newmediacampaigns.com/page/autosprites-jquery-menu-plugin" target="_blank">&lt;img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_9.jpg" alt="jquery plugins" />&lt;/a>&lt;/p>
&lt;h3 style="line-height: 32px; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #c0c0c0;"> 表单和表格&lt;/h3>
在 Web 设计中，表单和表格都是不是很讨人喜欢的东西，但你不得不面对，本年度出现几个不错的 jQuery  插件帮你完成这些任务。
### &lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.unwrongest.com/projects/password-strength/" target="_blank">Password Strength&lt;/a>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.unwrongest.com/projects/password-strength/" target="_blank">&lt;img src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_12.jpg" alt="jquery plugins" />&lt;/a>
这个插件帮你评估用户输入的密码是否足够强壮。&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-800080-hrefhttpwwwwebdesignbeachcombeachbarajax-fancy-captcha-jquery-plugin-target_blankajax-fancy-capchaa">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #800080;" href="http://www.webdesignbeach.com/beachbar/ajax-fancy-captcha-jquery-plugin" target="_blank">Ajax Fancy Capcha&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #800080;" href="http://www.webdesignbeach.com/beachbar/ajax-fancy-captcha-jquery-plugin" target="_blank">&lt;img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_13.jpg" alt="jquery plugins" />&lt;/a>
顾名思义，一个支持 Ajax 又很炫的 jQuery Captcha 插件，它使用了很人性化的验证机制。&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-305080-hrefhttpwwwchromaloopcompostschromatable-jquery-plugin-target_blankchromatablea">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.chromaloop.com/posts/chromatable-jquery-plugin" target="_blank">Chromatable&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.chromaloop.com/posts/chromatable-jquery-plugin" target="_blank">&lt;img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/11/jquery_tables_10.jpg" alt="jquery tables" />&lt;/a>
这个插件可以帮助你在表格上实现滚动条。&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-305080-hrefhttpwwwdfc-ecommetiersmultimediaopensourcejqtransform-target_blankjqtransforma">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/" target="_blank">jqTransform&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/" target="_blank">&lt;img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_14.jpg" alt="jquery plugins" />&lt;/a>
一个式样插件，帮助你对表单中的控件进行式样控制。&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-800080-hrefhttpwwwuploadifycom-target_blankuploadifya">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #800080;" href="http://www.uploadify.com/" target="_blank">Uploadify&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #800080;" href="http://www.uploadify.com/" target="_blank">&lt;img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/12/jquery_2009_15.jpg" alt="jquery plugins" />&lt;/a>
实现多个文件同时上传。&lt;/p>
&lt;h3 id="a-stylefont-family-arial-宋体-font-size-12px-text-decoration-none-border-bottom-style-dotted-border-bottom-width-1px-border-bottom-color-initial-color-305080-hrefhttpwwwjankoatwarpspeedcompost20090720expand-table-rows-with-jquery-jexpand-pluginaspx-target_blankjexpanda">&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.jankoatwarpspeed.com/post/2009/07/20/Expand-table-rows-with-jQuery-jExpand-plugin.aspx" target="_blank">jExpand&lt;/a>&lt;/h3>
&lt;p>&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #305080;" href="http://www.jankoatwarpspeed.com/post/2009/07/20/Expand-table-rows-with-jQuery-jExpand-plugin.aspx" target="_blank">&lt;img style="border: 1px solid #c0c0c0;" src="http://webdesignledger.com/wp-content/uploads/2009/11/jquery_tables_1.jpg" alt="jquery tables" />&lt;/a>
一个很轻量的 jQuery 插件，使你的表格可以扩展，在一些商业应用中，可以让表格更容易组织其中的内容。
本文来源：&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #800080;" href="http://webdesignledger.com/resources/the-best-jquery-plugins-of-2009">&lt;a href="http://webdesignledger.com/resources/the-best-jquery-plugins-of-2009">http://webdesignledger.com/resources/the-best-jquery-plugins-of-2009&lt;/a>&lt;/a>&lt;br>
中文翻译来源：&lt;a style="font-family: Arial, 宋体; font-size: 12px; text-decoration: none; border-bottom-style: dotted; border-bottom-width: 1px; border-bottom-color: initial; color: #800080;" href="http://www.comsharp.com/">COMSHARP CMS 企业网站内容管理系统官方站&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/jquery/">Jquery</category><category domain="https://fatkun.github.io/tags/jquery/">Jquery</category><category domain="https://fatkun.github.io/tags/jquery%E6%8F%92%E4%BB%B6/">Jquery插件</category><category domain="https://fatkun.github.io/tags/plugin/">Plugin</category><category domain="https://fatkun.github.io/tags/upload/">Upload</category></item><item><title>折腾了几天WP，差不多了</title><link>https://fatkun.github.io/2009/12/improve-blog.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/improve-blog.html</guid><pubDate>Fri, 11 Dec 2009 14:02:45 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>陆陆续续的加上了一些插件~WP的插件真多啊，多到我不知道该选哪一个好&lt;del>另外自己的网速也很杯具~（校园网的悲哀）好慢啊&lt;/del>下次弄插件，样式这些还是在本地试好了~然后在上传到服务器~~
选了一个简单的主题&lt;del>不过感觉还不错·~我只要能很好的浏览文字的主题就好了（原先主题字体为13px,我改为14px，舒服点~喜欢上大字体~）
另外如果以前有订阅我博客RSS的，烦请您看看订阅的地址是不是:&lt;strong>&lt;span style="color: #800000;">&lt;a href="http://feed.fatkun.com">http://feed.fatkun.com&lt;/a>&lt;/span>&lt;/strong>，
因为我换了服务器&lt;/del>而且换了博客程序~不知道各位的订阅地址是不是这个？如果不是就换一下啦~~~ 没订阅的同学也可以点下面的链接来订阅啦~~这个算一个技术的博客~·主要关注于网页的方面。&lt;/p>
&lt;!-- Feedsky FEED发布代码开始 -->
&lt;!-- FEED自动发现标记开始 -->
&lt;!-- FEED自动发现标记结束 -->
&lt;p>&lt;a href="http://feed.fatkun.com">&lt;img style="margin-bottom:3px" src="http://img.feedsky.com/images/icon_sub_c1s12.gif" border="0" alt="feedsky" vspace="2" />&lt;/a>&lt;br>
&lt;a href="http://www.zhuaxia.com/add_channel.php?url=http://feed.fatkun.com">&lt;img style="margin-bottom:3px" src="http://img.feedsky.com/images/icon_subshot01_zhuaxia.gif" border="0" alt="抓虾" vspace="2" />&lt;/a>&lt;a href="http://fusion.google.com/add?feedurl=http://feed.fatkun.com">&lt;img style="margin-bottom:3px" src="http://img.feedsky.com/images/icon_subshot01_google.gif" border="0" alt="google reader" vspace="2" />&lt;/a>&lt;a href="http://reader.youdao.com/b.do?keyfrom=feedsky&amp;amp;url=http://feed.fatkun.com">&lt;img style="margin-bottom:3px" src="http://img.feedsky.com/images/icon_subshot01_youdao.gif" border="0" alt="有道" vspace="2" />&lt;/a>&lt;a href="http://mail.qq.com/cgi-bin/feed?u=http://feed.fatkun.com">&lt;img style="margin-bottom:3px" src="http://img.feedsky.com/images/icon_subshot01_qq.gif" border="0" alt="QQ邮箱" vspace="2" />&lt;/a>&lt;/p>
&lt;!-- Feedsky FEED发布代码结束 -->趁还没到期末考试这段时间，我尽量更新一下博客啦~~~谢谢大家的照顾~~</description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/wordpress/">Wordpress</category><category domain="https://fatkun.github.io/tags/%E5%8D%9A%E5%AE%A2/">博客</category><category domain="https://fatkun.github.io/tags/%E6%8A%98%E8%85%BE/">折腾</category></item><item><title>CSS圆角框+Jquery圆角框</title><link>https://fatkun.github.io/2009/12/css-corner-and-jquery-corner.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/css-corner-and-jquery-corner.html</guid><pubDate>Fri, 11 Dec 2009 12:30:32 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>刚在群上看到一个CSS/CSS+JS的圆角框，所以发上来了~平时做网页的时候很多时候都想要做成圆角的~~一般的做法都是做一个圆角的图片~然后上中下三个div类似~但是这样做一般只对固定宽度的有效~不固定宽度的就有点烦了。&lt;br>
现在用JS来实现吧。这个JS可以对图片进行圆角~&lt;/p>
&lt;h2 id="css圆角框组件">CSS圆角框组件&lt;/h2>
&lt;p>&lt;strong>原创：&lt;/strong>&lt;a href="http://binyong.cnblogs.com/" target="_blank">&lt;span style="COLOR: black; TEXT-DECORATION: none; text-underline: none">&lt;span>&lt;strong>冰极峰&lt;/strong>&lt;/span>&lt;/span>&lt;/a>
下载和Demo地址：&lt;a href="http://www.cnblogs.com/binyong/archive/2009/12/11/1621484.html">CSS圆角框组件 V1.0&lt;/a>{#ctl04_TitleUrl}
&lt;img class="alignnone" title="css" src="http://farm3.static.flickr.com/2720/4175810337_5c3b73591e_o.jpg" alt="" width="511" height="707" />
作者也说了它的优缺点~&lt;/p>
&lt;blockquote>
&lt;p>缺点：
对于这种用纯CSS来实现的圆角框，不得不说说它的缺陷。&lt;/p>
&lt;ol>
&lt;li>语义化不够好，因为其圆角全部由HTML结构标签堆砌而成，而这些标签在字面上讲没有任何的含义，全是为了样式的表现而存在的，所以造成HTML代码无端增多，不利于SEO优化。这也是大家所诟病的地方，也是广大前端工程师不喜欢它的最大原因。&lt;/li>
&lt;li>样式的定义比较复杂，可操作性繁琐，如果没有弄懂原理，会觉得特麻烦。&lt;/li>
&lt;li>边线框宽度只适用于较小的值，无法定义线框的大小，因为一超过1px的宽度值，就会产生比较直观的锯齿。&lt;/li>
&lt;li>圆角不能调节大小，如果要模拟更圆滑的效果，就需要添加更多的容器，造成结构更加复杂。&lt;/li>
&lt;li>不太适合对图形要求比较高的场合，因为它不够圆滑，如果将它放大会看到一些锯齿。
优点：
说了这么多缺点，也要来说说它的优点：&lt;/li>
&lt;li>兼容性好，这种圆角框通用于全部的浏览器，不存在兼容性问题。&lt;/li>
&lt;li>弹性自适应宽度高度的大小变化，特别适用于流体布局的页面中使用。&lt;/li>
&lt;li>可自定义边框和背景色，随心所欲地改变风格。&lt;/li>
&lt;li>不需要制作圆角图片，节约网络流量，并且也可以减少或降低设计人员的工作量，减少前端人员布局定位的兼容性工作。
扩展性：
如果将它的不足尽最大化地减弱，那么这将是一种不错的效果，我想这些工作就需要JS来参与了，而这样的话已超出本文标题的范围了。并且这种JS的圆角框已经有了比较成熟的作品了。&lt;/li>
&lt;/ol>
&lt;/blockquote>
&lt;h2 id="jquerycornerjs">Jquery.corner.js&lt;/h2>
&lt;p>我以前用过这个插件，感觉还是可以的（可是不知道我上次用的时候在IE6下，圆角框的border消失了。不知道是不是bug)。这个插件非常容易使用&lt;del>就算不熟悉Jquery也没关系&lt;/del>有很多效果~
jquery.corner的DEMO可以在这里看：&lt;a href="http://malsup.com/jquery/corner/">http://malsup.com/jquery/corner/&lt;/a>
下载地址也在这：&lt;a href="http://malsup.com/jquery/corner/">http://malsup.com/jquery/corner/&lt;/a>&lt;br>
预览图：&lt;br>
&lt;img src="http://farm3.static.flickr.com/2633/4175810341_91f156b21b_o.jpg" alt="">&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/css/">Css</category><category domain="https://fatkun.github.io/tags/css%E5%9C%86%E8%A7%92%E6%A1%86/">CSS圆角框</category><category domain="https://fatkun.github.io/tags/jquery/">Jquery</category></item><item><title>折腾，继续折腾，Z-blog转WordPress</title><link>https://fatkun.github.io/2009/12/zblog-to-wordpress.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/zblog-to-wordpress.html</guid><pubDate>Wed, 09 Dec 2009 00:34:34 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>很久之前就想把以前用的zblog 换为wordpress了~但是WP在Godaddy免费空间上不太能正常使用，（Godaddy免费空间会自动插入一些广告代码），看了下因为Wordpress的JS是动态调用的，通过一个网页把很多JS合并为一个，正因为如此，Godaddy插入了广告代码，就弄得不正常啦。虽然可以修改WP的代码，但是太麻烦了。。
想想还是换其他空间吧，最早是准备把博客换到地平线的免费空间~·速度很快。不过怕没备案给水产了，还不是很安全啊。
偶然看到&lt;a href="http://www.ifunkey.com/819.html" target="_blank">这篇文章&lt;/a>，把我以前申请的000webhost激活鸟~所以有了我现在这个空间，没错，就是&lt;a href="http://000webhost.com">000webhost.com&lt;/a>的免费空间。用我憋足的英语发了过去，不到一小时后，我的账号就激活了，哇咔咔！
接下来，&lt;strong>杯具开始酝酿中。&lt;/strong>
标题说到&lt;strong>z-blog转wordpress&lt;/strong>，我就顺便说一下方法吧
我是先在Z-blog安装月光博客的Movable Type导出插件的，因为原插件有点问题，导出的标签是几个连在一起的，我对它修改了一下，就没问题了（有需要的童鞋可以叫我传给你）另外一些文章有代码，而Movable Type插件不会调用高亮插件的代码，所以我对Z-blog 的Function改了一下。导出后在Wordpress导入就行啦。
&lt;strong>一直很顺利中。。。杯具开始了&lt;/strong>
首先是不知道怎么绑定域名，就大概弄了一下，绑定了一下NS，再绑定A记录。貌似OK了，可以访问。好，安装Wordpress，控制网页的Auto Install维护中，杯具…自己上传安装吧。通过FTP上传安装包到空间。用http://www.net2ftp.com/网页解压它&lt;del>安装完成。
哇咔咔，装一些插件先，装了个Super-Cache插件，在修改.htaccess文件的时候。。&lt;strong>杯具发生了。&lt;strong>改完之后发现出现500错误！啊，什么问题？当时我一直没想到原来是由于&lt;/strong>.htaccess文件&lt;/strong>出问题的，（没经验啊，只知道这个是转发规则的。。）而且还是一个那么迷惑的500错误~
一直以为是不是我的域名绑定错了？重新绑定一下其他IP，发现还不行。以为IP还没解析，晚了，睡觉，明天再来看。可是第二天还是一样，500错误！有点迷惑的是我绑定一个子域名时，居然没出错（因为里面没.htaccess文件，当时不知道）。到网上搜索一下
&lt;strong>原来可以不用绑定NS的，只要绑定A记录就行。&lt;/strong>
当然，绑定之后还是不能访问。又搜索一下，发现难道是我的.htaccess文件的问题？删了之后，正常了。还以为000webhost不稳定呢。原来是自己的问题！汗，杯具啊。
另外一个杯具是，我的所有域名都指向了000webhost，连我的feed.fatkun.com都没办法绑定。（所以暂时rss还没弄好。）我的域名只绑定了@和一些字母，没有指定*泛域名啊。000webhost的NS我也删了，难道是它的NS还在生效？
杯具啊，杯具。。VeryCD.com今天下午开始就不能访问了。。官方公告说是因为服务器原因所以关闭，预计明天中午修复。很怕VeryCD都被和谐了啊，很多资源都靠它呢&lt;/del>！杯具的天朝~
杯具完了，明天有是新的一天！另外有需要申请000webhost.com免费空间的，我可以帮忙一下~我不寂寞，因为有寂寞陪着哥~&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/wordpress/">Wordpress</category><category domain="https://fatkun.github.io/tags/zblog/">Zblog</category><category domain="https://fatkun.github.io/tags/%E6%8A%98%E8%85%BE/">折腾</category></item><item><title>终于换上WordPress了</title><link>https://fatkun.github.io/2009/12/hello-world.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/hello-world.html</guid><pubDate>Mon, 07 Dec 2009 17:41:00 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>迟点再说其中的杯具事情~~&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>第四届网页设计大赛，我们是冠军！</title><link>https://fatkun.github.io/2009/12/%E7%AC%AC%E5%9B%9B%E5%B1%8A%E7%BD%91%E9%A1%B5%E8%AE%BE%E8%AE%A1%E5%A4%A7%E8%B5%9B%EF%BC%8C%E6%88%91%E4%BB%AC%E6%98%AF%E5%86%A0%E5%86%9B%EF%BC%81.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/12/%E7%AC%AC%E5%9B%9B%E5%B1%8A%E7%BD%91%E9%A1%B5%E8%AE%BE%E8%AE%A1%E5%A4%A7%E8%B5%9B%EF%BC%8C%E6%88%91%E4%BB%AC%E6%98%AF%E5%86%A0%E5%86%9B%EF%BC%81.html</guid><pubDate>Fri, 04 Dec 2009 07:47:04 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> 2009年12月1日晚，我们3C团队获得了第四届网页设计大赛的冠军。尽管如此，却失去了最初的那种喜悦的感觉，不过却换来另一份喜悦。
 
&lt;strong>比赛前写的(在草稿箱呆了几天)&lt;/strong>
很感谢olunx劝我参加比赛，一个月的时间，有时偷偷闲，有时写写代码，累积了不少的文件，不少的代码，至少在心情起伏不定的情况下找到一丝的充实。­
一起写代码的乐趣：就像共同学习一样，你追我赶。为了同一个目标而努力。­
…&lt;/p>
&lt;p> 2009年12月1日晚，我们3C团队获得了第四届网页设计大赛的冠军。尽管如此，却失去了最初的那种喜悦的感觉，不过却换来另一份喜悦。
 
&lt;strong>比赛前写的(在草稿箱呆了几天)&lt;/strong>
很感谢olunx劝我参加比赛，一个月的时间，有时偷偷闲，有时写写代码，累积了不少的文件，不少的代码，至少在心情起伏不定的情况下找到一丝的充实。­
一起写代码的乐趣：就像共同学习一样，你追我赶。为了同一个目标而努力。­
遇到很多各种各样的错误，这是个郁闷的问题，只有不厌其烦的到Google.com查找答案。­
其实编程大部分都是体力活，重复的写着相似的代码，那是挺考耐心的。­
我不喜欢到最后阶段改来改去，我觉得如果有新的功能就早点加上去，也许这与我的性格有关。­
MyEclipse占用超多资源，特别是在编辑JS文件之后，还剩几M内存，还有什么话好说呢。­
12-1日决赛，今天下午有彩排，还没准备好。明天要开班会，还要在12点前把作品发给他，不能再改了。
在快要比赛前，olunx的心情低落鸟。我说：“要善始善终！”，他说：“我的目的已经达到了，我的始与终在于代码的开始与结束”。可是我的目的还没达到…
 
&lt;strong>排练&lt;/strong>
­和fuchal排练，他给了我很多意见，但基本上都给我一一拒绝了。我比较笨，记不住那么多稿~
把演讲稿发给了漫妥看~经验丰富嘛&lt;del>给了我很多意见，但最后唯一用上的就是咱们3C都是逃课精英~哇咔咔，在这感谢漫妥。
还有在彩排的时候~很搞笑的一件事情是，别人在那边彩排，我在用笔记本玩《植物大战僵尸》。幸好组织人员没看到哇&lt;/del>
 
&lt;strong>比赛中&lt;/strong>
通过手机发了几条心情，相当于现场直播呀( ⊙ o ⊙ )！
&lt;span>16:11 在等待彩排开始，来早了！&lt;/span>
&lt;span>&lt;span>18:14 比赛开始了，我们是第十队。&lt;/span>&lt;/span>
&lt;span>&lt;span>&lt;span>19:00 现在是第五队在演讲，我有一点点紧张了，刚开始一直没有紧张，哇咔咔，加油！Fatkun！&lt;/span>&lt;/span>&lt;/span>
&lt;span>&lt;span>&lt;span>&lt;span>19:42 现在是第八队，还有一队就到我们演讲了，心情平静，Fatkun，加油！3C加油！&lt;/span>&lt;/span>&lt;/span>&lt;/span>
&lt;span>&lt;span>&lt;span>&lt;span>&lt;span>20:25 我们队讲演完毕，虽然刚开始出现一点小问题，我的脚有点在震动，不过还是挺满意自己的表现的。谢谢我们班同学的掌声！谢谢大家的掌声！等待颁奖。&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>
&lt;span>&lt;span>&lt;span>&lt;span>&lt;span>&lt;span>22:51 比赛结束~恭喜3C团队获得第一名~Fatkun，好样的！谢谢我们的3C团队，谢谢我们的啦啦队，非常感谢你们的掌声！（这条是吃完夜宵才发滴~比赛早在9点多就结束鸟）&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>
&lt;span>&lt;span>&lt;span>&lt;span>&lt;span>&lt;span>上面就是我的心情变化鸟~&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>
 
&lt;span>&lt;span>&lt;span>&lt;span>&lt;span>&lt;span>&lt;strong>总结&lt;/strong>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>
前面一篇文章有说到我为什么参加这次比赛，所以我本来的目标就不在于得奖，而在于上台演讲。或许缺少了那份期待，就少了那份惊喜。又或许找到了比得奖更重要的东西。在我演讲完毕之后，我松了一口气。我觉得我演讲得还蛮好嘛~充满感情滴~又顺畅~所以我在心情写了一句“等待颁奖”，这句看似是胸有成竹，其实是我已经不在乎颁奖结果了。无论结果如何，我都觉得无所谓，我的目的已经达到了（哇咔咔）。
 
&lt;strong>小插曲&lt;/strong>
刚开始时由于笔记本待机了，网页打不开。不是吧，这时候玩野！一段短时间停留后，正想要发挥我YY的本事，想把我们这一个月的艰辛史暴出来，额。。网页可以访问鸟~继续演讲。。
olunx的问答表现不错，继续发挥~~
 
&lt;strong>感谢List（下列排名分先后）&lt;/strong>
3C团队，没有你们，我没机会上台去演讲:-)
咱们的拉拉队（漫妥，淑娟，文娟，小花，遂乾，剑龙…）谢谢你们的鼓励，谢谢你们的掌声。
谢谢漫妥帮我看稿子，谢谢遂乾的大饼，不然饿死我了~~
谢谢HCL，可源师兄~~的鼓励
谢谢组织这场晚会的部长梁同学(( ⊙ o ⊙ )！没问姓名…)，谢谢干事坤灼~
谢谢所有为我们鼓掌的师弟师妹师姐师兄们（不鼓掌的就不谢谢啦，哇咔咔）
如果还有遗留，请速与我联系。或者你在宿舍默默祝福我们，也请联系我·~
 
&lt;strong>最后&lt;/strong>
虽然以前一直期待一等奖，但拿了那么多三等奖后，已经习惯了吧。
这次比赛有点惊喜，有点失落。
最后给出我们网站的全部源代码：&lt;a target="_blank" href="http://code.google.com/p/class-manager-system/">&lt;a href="http://code.google.com/p/class-manager-system/">http://code.google.com/p/class-manager-system/&lt;/a>&lt;/a>
使用Struts2+Spring+Hibernate编写的，网站还不算全部完成。
使用&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; line-height: normal; font-size: 13px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">&lt;a href="http://www.apache.org/licenses/LICENSE-2.0" rel="nofollow" style="color: rgb(0, 0, 204); ">Apache License 2.0&lt;/a>开源&lt;/span>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E5%86%A0%E5%86%9B/">冠军</category><category domain="https://fatkun.github.io/tags/%E6%AF%94%E8%B5%9B/">比赛</category><category domain="https://fatkun.github.io/tags/%E7%BD%91%E9%A1%B5%E8%AE%BE%E8%AE%A1%E5%A4%A7%E8%B5%9B/">网页设计大赛</category></item><item><title>《奋斗》和《蜗居》的区别</title><link>https://fatkun.github.io/2009/11/%E3%80%8A%E5%A5%8B%E6%96%97%E3%80%8B%E5%92%8C%E3%80%8A%E8%9C%97%E5%B1%85%E3%80%8B%E7%9A%84%E5%8C%BA%E5%88%AB.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/11/%E3%80%8A%E5%A5%8B%E6%96%97%E3%80%8B%E5%92%8C%E3%80%8A%E8%9C%97%E5%B1%85%E3%80%8B%E7%9A%84%E5%8C%BA%E5%88%AB.html</guid><pubDate>Sat, 28 Nov 2009 02:06:05 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>最近有在看蜗居~~所以把下面的内容贴下来了。。买房子不容易啊。&lt;br>
《奋斗》的编剧叫石康，纯爷们，确切年龄51岁；&lt;br>
《蜗居》的编剧叫六六，纯娘们，大概年龄36岁。&lt;br>
《奋斗》是一个老男人写的浪漫主义的奇幻故事；&lt;br>
《蜗居》是一个小女人写的现实主义的恐怖小说。&lt;br>
看了《奋斗》，觉得故事好假；&lt;br>
看了《蜗居》，觉得人生好假。&lt;br>
《奋斗》也许会给人带来希望；&lt;br>
《蜗居》一定会给人带来绝望。&lt;br>
《奋斗》说的是北京那旮旯的事儿；&lt;br>
《蜗居》说的是上海一面德额事体。&lt;br>
《奋斗》讲的是年轻人如何盖房子；&lt;br>
《蜗居》讲的是年轻人如何买房子。&lt;br>
…&lt;/p>
&lt;p>最近有在看蜗居~~所以把下面的内容贴下来了。。买房子不容易啊。&lt;br>
《奋斗》的编剧叫石康，纯爷们，确切年龄51岁；&lt;br>
《蜗居》的编剧叫六六，纯娘们，大概年龄36岁。&lt;br>
《奋斗》是一个老男人写的浪漫主义的奇幻故事；&lt;br>
《蜗居》是一个小女人写的现实主义的恐怖小说。&lt;br>
看了《奋斗》，觉得故事好假；&lt;br>
看了《蜗居》，觉得人生好假。&lt;br>
《奋斗》也许会给人带来希望；&lt;br>
《蜗居》一定会给人带来绝望。&lt;br>
《奋斗》说的是北京那旮旯的事儿；&lt;br>
《蜗居》说的是上海一面德额事体。&lt;br>
《奋斗》讲的是年轻人如何盖房子；&lt;br>
《蜗居》讲的是年轻人如何买房子。&lt;br>
《奋斗》讲了几对年轻无知的男女的混乱爱情故事，主讲‘情’；&lt;br>
《蜗居》讲了一帮青春渐逝的男女的疯狂同居故事，主讲‘性’。&lt;br>
《奋斗》努力把青涩理想的青年慢慢塑造成成熟稳重的男人；&lt;br>
《蜗居》试图把抛妻弃子的男人快速改造成重情重义的男子。&lt;br>
《奋斗》让女人不相信男人；&lt;br>
《蜗居》让男人不相信女人。&lt;br>
喜欢《奋斗》的观众有些真的去奋斗了；&lt;br>
喜欢《蜗居》的观众有些真的当二奶了。&lt;br>
《奋斗》是冷酷现实的迷幻剂；&lt;br>
《蜗居》是残酷现实的催化剂。&lt;br>
《奋斗》满足了80后最后逝去的一丝幻想情节；&lt;br>
《蜗居》刺痛了80后正在面临的一个严酷现实。&lt;br>
&lt;a href="http://www.izoan.cn/post/fendou_woju.html" target="_blank">来源&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>MSSQL触发器基础（在触发器遍历所有数据）</title><link>https://fatkun.github.io/2009/11/mssql%E8%A7%A6%E5%8F%91%E5%99%A8%E5%9F%BA%E7%A1%80%EF%BC%88%E5%9C%A8%E8%A7%A6%E5%8F%91%E5%99%A8%E9%81%8D%E5%8E%86%E6%89%80%E6%9C%89%E6%95%B0%E6%8D%AE%EF%BC%89.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/11/mssql%E8%A7%A6%E5%8F%91%E5%99%A8%E5%9F%BA%E7%A1%80%EF%BC%88%E5%9C%A8%E8%A7%A6%E5%8F%91%E5%99%A8%E9%81%8D%E5%8E%86%E6%89%80%E6%9C%89%E6%95%B0%E6%8D%AE%EF%BC%89.html</guid><pubDate>Mon, 23 Nov 2009 21:14:07 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>最近很懒，也有忙的原因&lt;del>一些东西懒得发上来了·&lt;del>还是要写上来才可以，不然学到的东西以后我就忘记了&lt;br>
以下只保证在MSSQL下顺利执行&lt;/del>可能在MySql不太一样。&lt;br>
最近在做作业的时候想用用数据库的触发器写写~发觉还不是一般的烦呀&lt;/del>变量多了就觉得有点烦了&lt;del>不过语言还是挺容易上手的&lt;/del>&lt;br>
插播一句：ID自增的写法&lt;/p>
&lt;pre escaped="true" lang="sql">create table ritem(
id int IDENTITY(1,1)
);&lt;/pre>
&lt;p>触发器的基本写法&lt;/p>
&lt;pre escaped="true" lang="sql">create trigger 触发器名 on 数据表名 for (insert|update|delete)
as
begin
在这里写代码
end&lt;/pre>
&lt;p>定义变量，并赋值&lt;/p>
&lt;pre escaped="true" lang="sql">create trigger t_insert_ritem on ritem for insert
as
begin
declare @id int
select @id=id from inserted
-- 从插入的数据获得ID的值，还有一个deleted
-- inserted表示新的数据，deleted表示旧的数据（自己理解的，不知道对不对？）
set @id = @id - 1
-- 另一种赋值
PRINT @id
-- 可以把值打印出来，在查询分析器结果可以看到
raiserror('抛出错误 id的值为：%d',16,1,@id)
-- 也可以这样输出
if (@id&amp;lt;0) begin
rollback transaction
-- 回滚事务
end
if exists(select * from ritem where id=@id) begin
-- 还可以用exists来判断是否为空
end
end
CREATE TRIGGER TRIGGER_Update ON ritem
FOR UPDATE
AS
if Update(UserName)
begin
-- 判断UserName有没有更新
end
&lt;/pre>
&lt;blockquote>
&lt;div class="quote">> 　　1.插入操作(Insert)&lt;br /> 　　Inserted表有数据，Deleted表无数据&lt;br /> 　　2.删除操作(Delete)&lt;br /> 　　Inserted表无数据，Deleted表有数据&lt;br /> 　　3.更新操作(Update)&lt;br /> 　　Inserted表有数据(新数据)，Deleted表有数据(旧数据)> &lt;/div>
&lt;/blockquote>
&lt;p>当你更新一个数据想要把相关联的所有数据都更新的时候就要用游标(CURSOR)鸟~~MSSQL的遍历&lt;/p>
&lt;pre escaped="true" lang="sql" line="1">declare @id int, @rid int
declare cur_tmp CURSOR FOR select id,rid from ritem
OPEN cur_tmp
FETCH NEXT FROM cur_tmp INTO @id,@rid -- 这里是取到select的值
WHILE @@FETCH_STATUS = 0
BEGIN
-- 在这中间加入循环
FETCH NEXT FROM cur_tmp INTO @id,@rid
END
CLOSE cur_tmp
DEALLOCATE cur_tmp -- 释放游标&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category><category domain="https://fatkun.github.io/tags/cursor/">CURSOR</category><category domain="https://fatkun.github.io/tags/trigger/">TRIGGER</category><category domain="https://fatkun.github.io/tags/%E8%A7%A6%E5%8F%91%E5%99%A8/">触发器</category><category domain="https://fatkun.github.io/tags/%E9%81%8D%E5%8E%86%E6%95%B0%E6%8D%AE%E8%A1%A8/">遍历数据表</category></item><item><title>我的学习之路 – fatkun</title><link>https://fatkun.github.io/2009/11/%E6%88%91%E7%9A%84%E5%AD%A6%E4%B9%A0%E4%B9%8B%E8%B7%AF-fatkun.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/11/%E6%88%91%E7%9A%84%E5%AD%A6%E4%B9%A0%E4%B9%8B%E8%B7%AF-fatkun.html</guid><pubDate>Sun, 15 Nov 2009 19:00:32 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> &lt;span class="Apple-style-span" style="font-size: 16px; ">最近很有心情写文章，我郁闷的时候最爱写，也许这是我解愁的方式吧。写日记也有同样的效果，可惜我不喜欢写，除了小学要求写日记作业，之后从未写过。另外值得一提的是我以前高中写作文是非常烂的，每次写作文都犯愁，怎么才能凑上800字。后来忽然多愁善感起来。现在再写作文，800字已不是难事，高中时也背了很多作文素材，当然现在写的也很烂。&lt;/span>&lt;/p>
&lt;div id="blogDetailDiv" style="FONT-SIZE: 16px"> &amp;#8230;&lt;/div>
&lt;p> &lt;span class="Apple-style-span" style="font-size: 16px; ">最近很有心情写文章，我郁闷的时候最爱写，也许这是我解愁的方式吧。写日记也有同样的效果，可惜我不喜欢写，除了小学要求写日记作业，之后从未写过。另外值得一提的是我以前高中写作文是非常烂的，每次写作文都犯愁，怎么才能凑上800字。后来忽然多愁善感起来。现在再写作文，800字已不是难事，高中时也背了很多作文素材，当然现在写的也很烂。&lt;/span>&lt;/p>
&lt;div id="blogDetailDiv" style="FONT-SIZE: 16px"> &lt;p> 不说题外话了，那时还是小学/初中，接触了当时最流行的游戏，仙剑一，以及DOS版的大富翁！这些游戏都是在舅舅家的电脑玩的。被电脑游戏吸引了。一直没有自己的电脑，直到升上高中，父亲答应我考上廉中（也叫第一中学）就给我买电脑。刚开始，和大家一样，连如何使用电脑都不知道，安装文件都装在C:\，都装在根目录下，非常多文件。找各种的游戏玩，觉得很新奇，中午不睡觉也在玩。（PS:以前中午不睡也挺精神的，现在老了） &lt;/p>
&lt;p> &amp;shy; &lt;/p>
&lt;p> &lt;strong>做错才会记忆深刻&lt;/strong> &lt;/p>
&lt;p> 1，曾经，用format命令格式化错盘，造成一堆的音乐没了，可惜。但，从此我知道了NTFS不会显示在DOS下，除非加载驱动。&amp;shy; &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> &lt;strong>我相信，勤能补拙&lt;/strong> &lt;/p>
&lt;p> 2，装了不计其数的系统。还要是那种安装版的，装一次要一个小时左右。从此，我学会了用Ghost备份。&amp;shy; &lt;/p>
&lt;p> 高考完，那段时间，买了本电脑报合订版，上下两册，很厚！每次随便翻一下，全书估计一大半给我看完了。 &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> &lt;strong>兴趣与学习动机&lt;/strong> &lt;/p>
&lt;p> 3，高中时，喜欢上做网页，想做一个个人网站。家里电脑没联网，先是在frontpage里胡乱的弄，随便拖拉很多个绝对定位的层（DIV）。感觉做得差不多啦，很有成就感。（这份网页没保存住，丢了）后来在别的电脑上看，不同分辨率下那些层的位置都混乱了。从网吧保存网页回家看，不知道从哪找到了一份HTML文档。原来是要用表格来布局的。便制作了第二版的网页（至今还有保留在我硬盘上），基本可以见人的网页。前面都是静态的网页，每个网页都要写一个文件，烦死了。再次去学了ASP，并使用了韩国的模板，这是第三版网页（有保留）。高中时期结束，转眼间来到了大一。大一第一学期没带电脑，基本脱离了学习电脑知识。&amp;shy;不过倒是看了不少书（有时间），当然也在这时看了很多言情小说，白天看，晚上看，持续了一年。大一下学期到大二第一学期才胡乱的学了XHTML+CSS，感觉已经没有以前学习的热情。学习的动机变了，&amp;ldquo;为什么学习？&amp;rdquo;出现在我的脑海中，为了以后找工作吧。学了XHTML当然要试一下啦，再用自己熟悉的ASP写了一个网站(第三届网页设计大赛作品原型，有保留)，自己的美工很烂，所以把美工交给了olunx童鞋~谢谢olunx童鞋的设计。 &lt;/p>
&lt;p> 　　插播心理学：经统计，大部分人的智商都在中等，也就是大家的智力都是差不多的，除了智力，还有些外在的因素影响你的学习，包括兴趣，学习动机，学习态度&amp;#8230;etc &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> &lt;strong>师傅领进门，修行看个人。&lt;/strong>&lt;strong>不要企望老师能教给你多少！&lt;/strong> &lt;/p>
&lt;p> 4，大二有JAVA基础教程课，当时上课的时候基本上老师说到哪里，我就学到哪，根本没有自学的欲望。把实验做了就算了。真正说学JAVA的是在大二的假期，回家看了马士兵的JAVA视频教程。视频很多，看到后半部分就腻了。越看越不想看，虽然每天呆在家里不知道干什么，但却不想去看。不过还是看完视频，自己看看例子，练习写一下。总算觉得比在学校上课好多了。和olunx写了一个&amp;ldquo;广药学生助手（GSA）&amp;rdquo;，当时很多都不会（现在也不会- -!），乱写一通，第一次体验了团队是什么样子（虽然只有两个人），还不懂得怎么沟通，沟通不够导致有些问题出现了分歧。大三有JSP课程，所以在大二的暑假，又把王勇的J2EE视频教程看了，Strust1.x，Hibernate，Spring&amp;#8230;还是一样，看到最后不想看了。可我还是坚持下来了，就算看的不仔细也把它看完。回校之后一段不短时间什么也不干（心情郁闷，什么都不想干），刚学的东西也差不多忘光了。一直到现在，答应了olunx参加比赛，而且这次由我来演讲。插播：当时我问了olunx两个问题，1.&amp;ldquo;学的东西差不多忘了，而且没经验？&amp;rdquo;答：&amp;ldquo;没问题，一边学一边写。&amp;rdquo;2.&amp;ldquo;失落中，提不起劲?&amp;rdquo;答：&amp;ldquo;没事。&amp;rdquo;。嗯，就这样，我决定参加了，因为有个诱惑的东西深深吸引着我，一次锻炼自己的机会！嗯，我要抓住机会，不要错过！现在的状态是：假装情绪稳定中&amp;#8230;（哇，还有很多代码要敲~） &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> &lt;strong>Hacker?黑客！&lt;/strong> &lt;/p>
&lt;p> 5，高中时期特迷恋黑客，觉得黑客很牛B。所以高中学期最喜欢的就是同学的同学那本《黑客X档案》杂志。感觉那些人真牛B，进入别人的网站，盗取别人的QQ&amp;#8230;晚自修之时，这本杂志能让我一晚上看完。复习的念头早抛在脑后。怎奈何，资质太低，又不勤奋学习，最后只成了菜鸟一个，到了大学就完全放弃成为hacker这种想法了。在此期间，胡乱的学了Delphi，没有系统的学习，导致最后好像什么也没学到！（话说，我十分痛恨病毒，特别是感染型的！@#￥%&amp;hellip;&amp;hellip;&amp;*省略N多脏话，害我今天杀毒用了接近4小时全盘扫描，什么事情也干不了！） &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> &lt;strong>心理学&lt;/strong> &lt;/p>
&lt;p> 6，感觉是挺实用的一门学科，帮了我不少，正为此努力！ &lt;/p>
&lt;p> &amp;nbsp; &lt;/p>
&lt;p> &lt;strong>总结&lt;/strong> &lt;/p>
&lt;p> 决定了要在这行业混，注定了终身学习的命运。活到老，学到老。每个人的学习方法可能都不同，选择适合自己的方式才是最好的。Fatkun，加油！ &lt;/p>&lt;/div></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/fatkun/">Fatkun</category><category domain="https://fatkun.github.io/tags/%E5%AD%A6%E4%B9%A0/">学习</category><category domain="https://fatkun.github.io/tags/%E6%88%91/">我</category></item><item><title>除了计算机，还有心理学</title><link>https://fatkun.github.io/2009/11/%E9%99%A4%E4%BA%86%E8%AE%A1%E7%AE%97%E6%9C%BA%EF%BC%8C%E8%BF%98%E6%9C%89%E5%BF%83%E7%90%86%E5%AD%A6.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/11/%E9%99%A4%E4%BA%86%E8%AE%A1%E7%AE%97%E6%9C%BA%EF%BC%8C%E8%BF%98%E6%9C%89%E5%BF%83%E7%90%86%E5%AD%A6.html</guid><pubDate>Sat, 07 Nov 2009 08:56:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>兴趣是最好的老师。我说过，专业和工作大部分是不对口的。除了计算机是我的爱好之外，心理学是我的第二个兴趣了。为什么心理学深深吸引我？&lt;br>
1，心理学能帮助我了解自己。为什么自己会自卑，为什么自己会不加入共，产，党，而跑去加入寂寞党。&lt;br>
2，能帮助我了解别人的意思。&lt;br>
3，能帮助别人。&lt;br>
心理学就是这么一个比魔术还神奇的东西。不过心理学的分类也很多，什么犯罪心理学，访谈技巧，XX心理学等（记不住了，分类可到这里看http://www.hudong.com/wiki/心理学以及其分类），随便翻开一本标准的教材，吓到我了，好多文字啊！不过如果真的想要学心理学，还得下功夫看书。上次看到小钊在学“民法通则”，同样需要记忆很多东西。&lt;br>
…&lt;/p>
&lt;p>兴趣是最好的老师。我说过，专业和工作大部分是不对口的。除了计算机是我的爱好之外，心理学是我的第二个兴趣了。为什么心理学深深吸引我？&lt;br>
1，心理学能帮助我了解自己。为什么自己会自卑，为什么自己会不加入共，产，党，而跑去加入寂寞党。&lt;br>
2，能帮助我了解别人的意思。&lt;br>
3，能帮助别人。&lt;br>
心理学就是这么一个比魔术还神奇的东西。不过心理学的分类也很多，什么犯罪心理学，访谈技巧，XX心理学等（记不住了，分类可到这里看http://www.hudong.com/wiki/心理学以及其分类），随便翻开一本标准的教材，吓到我了，好多文字啊！不过如果真的想要学心理学，还得下功夫看书。上次看到小钊在学“民法通则”，同样需要记忆很多东西。&lt;br>
我现在才看了一些非教材的文字，容易接受多了。学艺尚浅啊，要多看书。&lt;br>
一些平时用到的心理暗示：&lt;br>
想要结束谈话时可以把目光移向其他地方，表示不愿意在听对方讲话了。相反，当别人在说话时看着对方的眼睛，对方会认为你在专心听。（当然，不要死盯着别人看~别人和你没仇恨~）&lt;br>
还有个小游戏，游戏名叫“红丝线”，不过不是月老那条。拿一根很长的红线，分别剪出15cm，5m，12m，注意不能用尺子量，靠自己感觉。最后发现，自己剪的15cm比较接近实质长度，而12m的误差较大。这个游戏告诉我们，做事情要循序渐进，一步一个脚印，踏踏实实。&lt;br>
乱吹一些:-)，学习心理学还得要坚持呢。不知道能否做到，但我要相信自己可以的！&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category></item><item><title>最近我在忙的事情</title><link>https://fatkun.github.io/2009/10/%E6%9C%80%E8%BF%91%E6%88%91%E5%9C%A8%E5%BF%99%E7%9A%84%E4%BA%8B%E6%83%85.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E6%9C%80%E8%BF%91%E6%88%91%E5%9C%A8%E5%BF%99%E7%9A%84%E4%BA%8B%E6%83%85.html</guid><pubDate>Fri, 30 Oct 2009 04:46:14 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>为了摆脱空虚，寂寞。总得找点事情干一下，和同学参加一个学校的比赛。&lt;br>
使用JAVA编写网页，大家都是半桶水，做起来也挺难的。&lt;br>
第一个难关就是大家对SVN都不太熟，花了几天时间才大致懂得怎么用，其中一次由于误操作，删错了文件，才认识了版本控制的好处啊，找了几个文章搞定。还有冲突问题~感觉也挺麻烦的。&lt;br>
把这几天学到的东西贴上来。。&lt;br>
————————————-&lt;br>
0，SVN的基本用法(fatkun)&lt;br>
————————————-&lt;br>
…&lt;/p>
&lt;p>为了摆脱空虚，寂寞。总得找点事情干一下，和同学参加一个学校的比赛。&lt;br>
使用JAVA编写网页，大家都是半桶水，做起来也挺难的。&lt;br>
第一个难关就是大家对SVN都不太熟，花了几天时间才大致懂得怎么用，其中一次由于误操作，删错了文件，才认识了版本控制的好处啊，找了几个文章搞定。还有冲突问题~感觉也挺麻烦的。&lt;br>
把这几天学到的东西贴上来。。&lt;br>
————————————-&lt;br>
0，SVN的基本用法(fatkun)&lt;br>
————————————-&lt;br>
新建的文件需要add进来才会上传&lt;br>
————————————-&lt;br>
1，SVN冲突处理(fatkun)&lt;br>
————————————-&lt;br>
1.update一下，冲突的文件会有“！”（叹号的图形）&lt;br>
2.在冲突的文件右键，可以查看”Diff”比较服务器与本地文件的差异&lt;br>
3.修改本地文件，手工合并自己和服务器版本，选择resolve保持自己的版本。或者放弃自己修改，resolve选择服务器的版本。&lt;br>
4.commit或update&lt;br>
————————————-&lt;br>
2，SVN回滚到某个版本(fatkun)&lt;br>
————————————-&lt;br>
1.show log查看想恢复到那个版本&lt;br>
2.update到最新版&lt;br>
3.Merge(合并),参数可填入”73-77″即想从73版本到77版本合并起来一个版本&lt;br>
4.检查没错后commit&lt;br>
————————————-&lt;br>
3，hibernate数据库乱码(fatkun)&lt;br>
————————————-&lt;br>
1.确保新建的数据库编码为utf-8&lt;br>
2.jdbc.url 属性改为“jdbc:mysql://localhost:3306/classmis?characterEncoding=utf-8”&lt;br>
3.Hibernate.cfg.xml加入以下代码&lt;/p>
&lt;pre class="brush:html;">&amp;lt;property name="connection.useUnicode"&amp;gt;true&amp;lt;/property&amp;gt;
&amp;lt;property name="connection.characterEncoding"&amp;gt;UTF-8&amp;lt;/property&amp;gt;
&lt;/pre>
&lt;p>————————————-&lt;br>
4，classes文件夹生成(fatkun)&lt;br>
————————————-&lt;br>
1.在菜单“Project-&amp;gt;Clean”就可以重新编译了（如果还不生成请检查配置）&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E5%BF%99/">忙</category></item><item><title>一些网页截图工具</title><link>https://fatkun.github.io/2009/10/%E4%B8%80%E4%BA%9B%E7%BD%91%E9%A1%B5%E6%88%AA%E5%9B%BE%E5%B7%A5%E5%85%B7.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E4%B8%80%E4%BA%9B%E7%BD%91%E9%A1%B5%E6%88%AA%E5%9B%BE%E5%B7%A5%E5%85%B7.html</guid><pubDate>Sun, 25 Oct 2009 21:20:55 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> &lt;span class="Apple-style-span" style="font-family: Verdana, 'Lucida Grande', Arial, Helvetica, sans-serif; line-height: 25px; font-size: 14px; color: rgb(68, 68, 68); ">&lt;img src="http://www.kekaku.com/wp-content/uploads/2009/10/200910220834.jpg" alt="我收集的一些网页截图工具" title="我收集的一些网页截图工具" width="440" height="485" class="alignnone size-full wp-image-937" style="background-image: url(http://www.kekaku.com/wp-content/themes/kekaku_v2/images/shadow.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-top: 5px; padding-right: 10px; padding-bottom: 10px; padding-left: 5px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-position: 100% 100%; background-repeat: no-repeat no-repeat; " />…&lt;/p>&lt;/p>
&lt;p> &lt;/span>&lt;/p>
&lt;p>
&lt;/p>
&lt;p> &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: Verdana, 'Lucida Grande', Arial, Helvetica, sans-serif; line-height: 25px; font-size: 14px; color: rgb(68, 68, 68); ">&lt;img src="http://www.kekaku.com/wp-content/uploads/2009/10/200910220834.jpg" alt="我收集的一些网页截图工具" title="我收集的一些网页截图工具" width="440" height="485" class="alignnone size-full wp-image-937" style="background-image: url(http://www.kekaku.com/wp-content/themes/kekaku_v2/images/shadow.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-top: 5px; padding-right: 10px; padding-bottom: 10px; padding-left: 5px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-position: 100% 100%; background-repeat: no-repeat no-repeat; " />&lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 网页截图工具，我相信很多人在日常工作中都要用到，我现在用的是&lt;a href="http://skitch.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Skitch&lt;/a>，非常不错的一款Mac下的截图软件。网页截图的方法有很多，主要分为浏览器截图插件、屏幕截图软件以及在线网页截图工具。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &amp;nbsp; &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;strong>一、 浏览器截图插件&lt;/strong> &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 1. Firefox浏览器截图插件 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;a rel="nofollow" href="https://addons.mozilla.org/en-US/firefox/addon/3408" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Save as image&lt;/a>、&lt;a rel="nofollow" href="http://pearlcrescent.com/products/pagesaver/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Pearl Crescent Page Saver&lt;/a>、&lt;a rel="nofollow" href="http://www.snissa.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Snissa&lt;/a>&amp;nbsp;和&amp;nbsp;&lt;a rel="nofollow" href="https://addons.mozilla.org/en-US/firefox/addon/1146" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Screengrab!&lt;/a>&amp;nbsp;都是 Firefox 上用于网页截图的扩展，不过对于部分网页内嵌代码并不感应，比如一些内嵌的媒体播放器、Flash 动画等等。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;a href="https://addons.mozilla.org/zh-CN/firefox/addon/4889" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Picnik for Firefox&lt;/a>&amp;nbsp;是基于 Flash 的在线图形编辑工具&amp;nbsp;&lt;a href="http://www.picnik.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Picnik&lt;/a>&amp;nbsp;的 Firefox 扩展，除了快捷发送网页中图片到 Picnik 进行处理和编辑之外，还能对于网页进行截图，然后发送到 Picnik。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 2. IE浏览器截图插件 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;a rel="nofollow" href="http://www.filedudes.com/ieSnapshotter-download-45699.html" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">ieSnapshotter&lt;/a>&amp;nbsp;则是应用于 IE 的截图插件，虽然方便，问题与 Firefox 的同类扩展一样，对于部分内嵌媒体无法截取。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 3.&amp;nbsp;&lt;a rel="nofollow" href="http://www.maxthon.cn/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Maxthon&lt;/a>&amp;nbsp;的 2.0 版也增加了网页截图功能，直接整合在了浏览器中。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 4. Safari浏览器截图插件 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;a href="http://www.tastyapps.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Web Snapper&lt;/a>，安装后，Safari浏览器的顶部工具栏会出现一个照相机图标，点击该图标就可以获得整个超长或超宽网页的截图并另存为照片或PDF。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;strong>二、屏幕截图软件&lt;/strong> &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 1. Windows下的屏幕截图软件 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;a rel="nofollow" href="http://www.techsmith.com/screen-capture.asp" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">SnagIt&lt;/a>&amp;nbsp;是专业的截图软件，还自带一个图片编辑工具，就是体积比较大，还是收费软件； &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;a rel="nofollow" href="http://www.faststone.org/FSCaptureDetail.htm" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">FastStone Capture&lt;/a>&amp;nbsp;5.3 版本之后，就收费了，不过原本 5.3 版本功能挺齐全的，而且官方也有 Portable 版本，完全绿色，启羁目前就在用这个，个人比较推荐； &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;a rel="nofollow" href="http://www.hyperionics.com/hsdx/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">HyperSnap-DX&lt;/a>&amp;nbsp;也是老牌的 Windows 上的专业截图软件，启羁在用 FastStone Capture 之前就在用这个，不过一样体积不小，设定选项太复杂，虽然买了授权，不过最后还是弃用了 &amp;ndash; 对了，这是一款收费软件； &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;a rel="nofollow" href="http://www.websitescreenshots.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">WebShot&lt;/a>&amp;nbsp;看名字就知道了，专门用于网页截图的，效果一般； &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;a rel="nofollow
" href="http://www.softpedia.com/get/Multimedia/Graphic/Graphic-Capture/IX-Screencatcher.shtml" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">I4X Screencatcher&lt;/a>&amp;nbsp;是免费软件，功能应用很简单，同样免费的还有国产的&amp;nbsp;&lt;a rel="nofollow" href="http://www.epsnap.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">EPSnap&lt;/a>，相对来说，在免费的中文同类软件里面做的算是最好的了。至于&amp;nbsp;&lt;a rel="nofollow" href="http://www.ntwind.com/software/winsnap.html" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">WinSnap&lt;/a>，虽然也可以免费使用，但是个人觉得功能比 FastStone Capture、EPSnap 略差，而且使用也不是很方便，包括快捷保存和个性化设定部分。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 2. Mac OS X 下的屏幕截图软件 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &lt;a href="http://skitch.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Skitch&lt;/a>，是Mac平台上一款非常好玩的截图分享软件，和著名的漫画制作软件Comic Life出自的同一家公司：&lt;a href="http://plasq.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Plasq&lt;/a>。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 另外还有&lt;a rel="nofollow" href="http://www.derailer.org/paparazzi/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">&amp;nbsp;Paparazzi!&lt;/a>&amp;nbsp;和&amp;nbsp;&lt;a rel="nofollow" href="http://projects.digitalwaters.net/index.php?q=instantshot" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">InstantShot&lt;/a>&amp;nbsp;。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 三、在线网页截图工具 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 1.&amp;nbsp;&lt;a href="http://www.thumbalizr.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">thumbalizr&lt;/a> &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 可以输出多种尺寸的略缩图，并且提供API便于第三方使用。支持完整的网页截图输出。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 2.&amp;nbsp;&lt;a href="http://browsershots.org/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Browsershots&lt;/a> &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 原来是为网页开发人员测试不同操作系统、不同浏览器下网页显示效果的，不过你当然也可以用它来截图。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 3.&amp;nbsp;&lt;a href="http://webthumb.bluga.net/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">WebThumb&lt;/a> &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 它的功能也很强大：支持实时略缩图、支持PDF和Flash格式、提供多种标准的API。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 4.&amp;nbsp;&lt;a href="http://www.webshotspro.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">WebshotsPro&lt;/a> &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 只能输出4种尺寸的略缩图，但是对中文支持很好。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 5.&amp;nbsp;&lt;a href="http://www.shrinktheweb.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">ShrinkTheWeb&lt;/a> &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 输出3种尺寸的图片，支持完整网页截图，并提供了多种PHP以及JS的插件代码。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 6.&lt;a rel="nofollow" href="http://www.browsrcamp.com/" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">BrowsrCamp&lt;/a> &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 似乎不少人都忘记了一款已经改版的在线网页截图工具 BrowsrCamp，原本是作为在 Safari 浏览环境下测试网页的工具，不过可以变相作为 Safari 浏览器截图效果的工具，而且截图生成速度非常快。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 7.&amp;nbsp;&lt;a href="http://clip2net.com/%3Cbr%20/%3E" target="_blank" style="color: rgb(44, 98, 158); text-decoration: none; ">Clip2Net&lt;/a>&amp;nbsp;整合了截图工具以及图片存储服务。通过设置，用户可以将截图、上传以及复制图片地址的整个过程一次操作完成。并且，Clip2Net分别提供了500M的存储空间及日流量。对于像我这样经常需要在文章中插入图片的博客作者来说，无疑是不可或缺的工具。 &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> &amp;nbsp; &lt;/p>
&lt;p style="margin-top: 10px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; "> 来源：&lt;a href="http://www.kekaku.com/?p=936">http://www.kekaku.com/?p=936&lt;/a> &lt;/p>
&lt;p> &lt;/span> &lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/browsershot/">BrowserShot</category><category domain="https://fatkun.github.io/tags/webthumb/">WebThumb</category><category domain="https://fatkun.github.io/tags/%E7%BD%91%E9%A1%B5%E6%88%AA%E5%9B%BE/">网页截图</category></item><item><title>十四项心理定律，那里都有用</title><link>https://fatkun.github.io/2009/10/%E5%8D%81%E5%9B%9B%E9%A1%B9%E5%BF%83%E7%90%86%E5%AE%9A%E5%BE%8B%EF%BC%8C%E9%82%A3%E9%87%8C%E9%83%BD%E6%9C%89%E7%94%A8.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E5%8D%81%E5%9B%9B%E9%A1%B9%E5%BF%83%E7%90%86%E5%AE%9A%E5%BE%8B%EF%BC%8C%E9%82%A3%E9%87%8C%E9%83%BD%E6%9C%89%E7%94%A8.html</guid><pubDate>Sat, 24 Oct 2009 19:40:13 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>　以下是十四项心理定律，你可以应用它们在任何的领域里。无论是销售沟通、还是设立目标、时间管理、领导组织都可以应用这些原理和定律。&lt;br>
　　&lt;strong>1、坚信定律&lt;/strong>&lt;br>
　　当你对某件事情抱着百分之一万的相信，它最后就会变成事实。&lt;br>
　　&lt;strong>2、期望定律&lt;/strong>&lt;br>
　　期望定律告诉我们，当我们怀着对某件事情非常强烈期望的时候，我们所期望的事物就会出现。&lt;br>
　　&lt;strong>3、情绪定律&lt;/strong>&lt;br>
　　情绪定律告诉我们，人百分之百是情绪化的。即使有人说某人很理性，其实当这个人很有”理性”地思考问题的时候，也是受到他当时情绪状态的影响，”理性地思考”本身也是一种情绪状态。所以人百分之百是情绪化的动物，而且任何时候的决定都是情绪化的决定。&lt;br>
…&lt;/p>
&lt;p>以下是十四项心理定律，你可以应用它们在任何的领域里。无论是销售沟通、还是设立目标、时间管理、领导组织都可以应用这些原理和定律。&lt;br>
　　&lt;strong>1、坚信定律&lt;/strong>&lt;br>
　　当你对某件事情抱着百分之一万的相信，它最后就会变成事实。&lt;br>
　　&lt;strong>2、期望定律&lt;/strong>&lt;br>
　　期望定律告诉我们，当我们怀着对某件事情非常强烈期望的时候，我们所期望的事物就会出现。&lt;br>
　　&lt;strong>3、情绪定律&lt;/strong>&lt;br>
　　情绪定律告诉我们，人百分之百是情绪化的。即使有人说某人很理性，其实当这个人很有”理性”地思考问题的时候，也是受到他当时情绪状态的影响，”理性地思考”本身也是一种情绪状态。所以人百分之百是情绪化的动物，而且任何时候的决定都是情绪化的决定。&lt;br>
　　&lt;strong>4、因果定律&lt;/strong>&lt;br>
　　任何事情的发生，都有其必然的原因。有因才有果。换句话说，当你看到任何现象的时候，你不用觉得不可理解或者奇怪，因为任何事情的发生都必有其原因。你今天的现状结果是你过去种下的因导致的结果。&lt;br>
　　&lt;strong>5、吸引定律&lt;/strong>&lt;br>
　　当你的思想专注在某一领域的时候，跟这个领域相关的人、事、物就会被你吸引而来。&lt;br>
　　&lt;strong>6、重复定律&lt;/strong>&lt;br>
　　任何的行为和思维，只要你不断的重复就会得到不断的加强。在你的潜意识当中，只要你能够不断地重复一些人、事、物，它们都会在潜意识里变成事实。&lt;br>
　　&lt;strong>7、累积定律&lt;/strong>&lt;br>
　　很多年轻人都曾梦想做一番大事业，其实天下并没有什么大事可做，有的只是小事。一件一件小事累积起来就形成了大事。任何大成就或者大灾难都是累积的结果。&lt;br>
　　&lt;strong>8、辐射定律&lt;/strong>&lt;br>
　　当你做一件事情的时候，影响的并不只是这件事情的本身，它还会辐射到相关的其他领域。任何事情都有辐射作用。&lt;br>
　　&lt;strong>9、相关定律&lt;/strong>&lt;br>
　　相关定律告诉我们：这个世界上的每一件事情之间都有一定的联系，没有一件事情是完全独立的。要解决某个难题最好从其他相关的某个地方人手，而不只是专注在一个困难点上。&lt;br>
　　&lt;strong>10、专精定律&lt;/strong>&lt;br>
专精定律告诉我们，只有专精在一个领域，这个领域才能有所发展。所以无论你做任何的行业都要把做该行业的最顶尖为目标，只有当你能够专精的时候，你所做的领域才会出类拔萃地成长。&lt;br>
　　&lt;strong>11、替换定律&lt;/strong>&lt;br>
　　替换定律就是说，当我们有一项不想要的记忆或者是负面的习惯，我们是无法完全去除掉，只能用一种新的记忆或新的习惯去替换他。&lt;br>
　　&lt;strong>12、惯性定律&lt;/strong>&lt;br>
　　任何事情只要你能够持续不断去加强它，它终究会变成一种习惯。&lt;br>
　　&lt;strong>13、显现定律&lt;/strong>&lt;br>
　　显现定律就是说，当我们持续寻找、追问答案的时候，它们最终都必将显现。&lt;br>
　　&lt;strong>14、需求定律&lt;/strong>&lt;br>
　　任何人做任何事情都是带有一种需求。尊重并满足对方的需求，别人才会尊重我们的需求。&lt;br>
来源：&lt;a href="http://www.psychcn.com/psylife/200906/550042770.shtml" target="_blank">华夏心理&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category><category domain="https://fatkun.github.io/tags/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category><category domain="https://fatkun.github.io/tags/%E5%BF%83%E7%90%86%E5%AE%9A%E5%BE%8B/">心理定律</category></item><item><title>信息管理实验7-使用GridView实现查看详细信息，修改，删除数据</title><link>https://fatkun.github.io/2009/10/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C7-%E4%BD%BF%E7%94%A8gridview%E5%AE%9E%E7%8E%B0%E6%9F%A5%E7%9C%8B%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF%EF%BC%8C%E4%BF%AE%E6%94%B9%EF%BC%8C%E5%88%A0.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C7-%E4%BD%BF%E7%94%A8gridview%E5%AE%9E%E7%8E%B0%E6%9F%A5%E7%9C%8B%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF%EF%BC%8C%E4%BF%AE%E6%94%B9%EF%BC%8C%E5%88%A0.html</guid><pubDate>Fri, 23 Oct 2009 19:10:36 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;img src="http://farm3.static.flickr.com/2496/4035743699_d440b8084c_o.jpg" alt="">&lt;br>
信息管理实验7-使用GridView实现查看详细信息，修改，删除数据&lt;br>
首先创建好一个数据库&amp;amp;表&lt;br>
CREATE DATABASE MedicineDB;&lt;br>
USE MedicineDB;&lt;br>
CREATE TABLE Medicine(&lt;br>
[ID] bigint,&lt;br>
[Name] varchar(50),&lt;br>
[Price] bigint,&lt;br>
[Type] varchar(50),&lt;br>
[Intro] text,&lt;br>
primary key(ID)&lt;br>
)&lt;/p>
&lt;p>首先创建好一个数据库&amp;amp;表&lt;/p>
&lt;pre class="brush:sql;">CREATE DATABASE MedicineDB;
USE MedicineDB;
CREATE TABLE Medicine(
[ID] bigint,
[Name] varchar(50),
[Price] bigint,
[Type] varchar(50),
[Intro] text,
primary key(ID)
);
USE MedicineDB;
INSERT INTO Medicine VALUES (1,'板蓝根','9','冲剂','清热解毒');
INSERT INTO Medicine VALUES (2,'999感冒颗粒','10','冲剂','感冒');&lt;/pre>
&lt;p>新建一个DB类&lt;/p>
&lt;pre class="brush:c#;">using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
/// &amp;lt;summary&amp;gt;
/// DB 的摘要说明
/// &amp;lt;/summary&amp;gt;
public class DB
{
public DB()
{
}
//创建数据库连接
public static SqlConnection createCon(){
return new SqlConnection("server=.\\sqlexpress;database=MedicineDB;uid=sa;pwd=123;");
}
//将数据绑定到GridView
public static void gvDataBind(GridView gv,string sql){
SqlConnection conn = DB.createCon();
SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
DataSet ds = new DataSet();
sda.Fill(ds);
gv.DataSource = ds;
gv.DataBind();
conn.Close();
}
//执行SQL语句
public static void executeCmd(string sql) {
SqlConnection conn = DB.createCon();
conn.Open();
SqlCommand cmd = new SqlCommand(sql,conn);
cmd.ExecuteNonQuery();
conn.Close();
}
}&lt;/pre>
&lt;h2 id="界面设计">界面设计&lt;/h2>
&lt;p>&lt;img src="http://farm3.static.flickr.com/2496/4035743699_d440b8084c_o.jpg" alt="">&lt;br>
&lt;img src="http://farm3.static.flickr.com/2472/4036492940_7d7665ac4a_o.jpg" alt="">&lt;br>
拉进一个GridView，在编辑列绑定数据（如图）并添加一个HyperLinkField(“详细”链接)和一个CommandField(“删除”链接)，另外把GridView属性AutoGenerateColumns设为False&lt;br>
&lt;img src="http://farm3.static.flickr.com/2699/4036493010_d8668a7a50_o.jpg" alt="">&lt;br>
&lt;img src="http://farm3.static.flickr.com/2655/4035743927_350f579f0c_o.jpg" alt="">&lt;br>
&lt;img src="http://farm3.static.flickr.com/2642/4036493078_d9feeab45c_o.jpg" alt="">&lt;br>
Default.aspx最终代码如下&lt;/p>
&lt;pre class="brush:html;">&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;
&amp;lt;head runat="server"&amp;gt;
&amp;lt;title&amp;gt;无标题页&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form id="form1" runat="server"&amp;gt;
&amp;lt;div&amp;gt;
&amp;lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound"
OnRowDeleting="GridView1_RowDeleting"&amp;gt;
&amp;lt;Columns&amp;gt;
&amp;lt;asp:BoundField DataField="ID" HeaderText="ID" /&amp;gt;
&amp;lt;asp:BoundField DataField="Name" HeaderText="药品名" /&amp;gt;
&amp;lt;asp:BoundField DataField="Price" HeaderText="价格" /&amp;gt;
&amp;lt;asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="Show.aspx?id={0}"
Text="详细" /&amp;gt;
&amp;lt;asp:CommandField ShowDeleteButton="True" /&amp;gt;
&amp;lt;/Columns&amp;gt;
&amp;lt;/asp:GridView&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre>
&lt;p>Default.aspx.cs 代码&lt;/p>
&lt;pre class="brush:csharp;">using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) bind();
}
public void bind() {
string sql = "select * from Medicine";
GridView1.DataKeyNames = new string[]{"ID"};
DB.gvDataBind(GridView1, sql);
}
//记得绑定删除事件
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e){
string sql = "delete from Medicine where ID = " + GridView1.DataKeys[e.RowIndex].Value;
DB.executeCmd(sql);
Response.Redirect("Default.aspx");
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) {
if (e.Row.RowType == DataControlRowType.DataRow) {
((LinkButton)(e.Row.Cells[4].Controls[0])).Attributes.Add("onclick", "return confirm('确定要删除吗？')");
}
}
}&lt;/pre>
&lt;p>&lt;strong>注意：绑定UI的事件和代码关联，确保这里的参数和代码中的方法一致。&lt;/strong>&lt;br>
&lt;img src="http://farm3.static.flickr.com/2737/4036493178_53325a72eb_o.jpg" alt="">&lt;br>
新建一个页面Show.aspx&lt;br>
Show.aspx代码如下&lt;/p>
&lt;pre class="brush:html;">&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Show.aspx.cs" Inherits="Show" %&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;
&amp;lt;head runat="server"&amp;gt;
&amp;lt;title&amp;gt;无标题页&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form id="form1" runat="server"&amp;gt;
&amp;lt;div&amp;gt;
ID&amp;lt;asp:TextBox ID="TextBox1" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
&amp;lt;br /&amp;gt;
药品名&amp;lt;asp:TextBox ID="TextBox2" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
&amp;lt;br /&amp;gt;
价格&amp;lt;asp:TextBox ID="TextBox3" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
&amp;lt;br /&amp;gt;
类型&amp;lt;asp:TextBox ID="TextBox4" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;
详细介绍
&amp;lt;asp:TextBox ID="TextBox5" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
&amp;lt;asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="保存" /&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre>
&lt;p>Show.aspx.cs代码&lt;/p>
&lt;pre class="brush:c#;">using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Show : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
string id = Request.QueryString["id"].ToString();
string sql = "select * from Medicine where ID = " + id;
SqlConnection conn = DB.createCon();
SqlDataAdapter sda = new SqlDataAdapter(sql,conn);
DataSet ds = new DataSet();
sda.Fill(ds,"Medicine");
DataRowView drv = ds.Tables["Medicine"].DefaultView[0];
TextBox1.Text = Convert.ToString(drv.Row["ID"]);
TextBox2.Text = Convert.ToString(drv.Row["Name"]);
TextBox3.Text = Convert.ToString(drv.Row["Price"]);
TextBox4.Text = Convert.ToString(drv.Row["Type"]);
TextBox5.Text = Convert.ToString(drv.Row["Intro"]);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string id = Request.QueryString["id"].ToString();
string sql = "update Medicine set [ID] = " + TextBox1.Text.Trim() + ",[Name] = '" + TextBox2.Text.Trim()
+"',[Price] = "+TextBox3.Text.Trim()+",[Type] = '"+TextBox4.Text.Trim()+"',[Intro] = '"
+ TextBox5.Text.Trim() + "' where ID = " + id;
DB.executeCmd(sql);
Response.Redirect("Default.aspx");
}
}&lt;/pre>
&lt;p>就这样完成了~原创文章，转载请保留出处(fatkun.com)&lt;/p></description><category domain="https://fatkun.github.io/categories/asp.net/">ASP.NET</category></item><item><title>使用javascript操作table(表格)Dom,添加/删除一行</title><link>https://fatkun.github.io/2009/10/%E4%BD%BF%E7%94%A8javascript%E6%93%8D%E4%BD%9Ctable%E8%A1%A8%E6%A0%BCdom%E6%B7%BB%E5%8A%A0%E5%88%A0%E9%99%A4%E4%B8%80%E8%A1%8C.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E4%BD%BF%E7%94%A8javascript%E6%93%8D%E4%BD%9Ctable%E8%A1%A8%E6%A0%BCdom%E6%B7%BB%E5%8A%A0%E5%88%A0%E9%99%A4%E4%B8%80%E8%A1%8C.html</guid><pubDate>Thu, 22 Oct 2009 19:09:32 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>看代码吧…&lt;br>
主要三个方法是insertRow和insertCell，deleteRow&lt;/p>
&lt;p>看代码吧…&lt;/p>
&lt;pre class="brush:js;">&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=gb2312"&amp;gt;
&amp;lt;title&amp;gt;无标题文档&amp;lt;/title&amp;gt;
&amp;lt;script type="text/javascript" language="javascript"&amp;gt;
function addCell(){
oRow = document.getElementById("mytable").insertRow();//插入行
for (var k=0;k&amp;lt;4;k++){
var oCell = oRow.insertCell();//插入单元格
if (k==0)
oCell.innerHTML = "&amp;lt;input type='checkbox'/&amp;gt;";
else
oCell.innerHTML = document.getElementById("mytable").rows.length;
}
}
function delRow(){
for (var k=0; k&amp;lt;document.getElementById("mytable").rows.length; k++){
var arow = document.getElementById("mytable").rows(k);//得到每一行
var cb = arow.getElementsByTagName("input");
if (cb[0].checked){
document.getElementById("mytable").deleteRow(k);//删除第k行
k--;
}
}
}
function selectAll(){
for (var k=0; k&amp;lt;document.getElementById("mytable").rows.length; k++){
var arow = document.getElementById("mytable").rows(k);
var cb = arow.getElementsByTagName("input");
if (!cb[0].checked){
cb[0].checked = true;
}
}
}
function unSelectAll(){
for (var k=0; k&amp;lt;document.getElementById("mytable").rows.length; k++){
var arow = document.getElementById("mytable").rows(k);
var cb = arow.getElementsByTagName("input");
if (cb[0].checked){
cb[0].checked = false;
}
}
}
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;input type="button" onClick="addCell()" value="添加"/&amp;gt;
&amp;lt;input type="button" onClick="delRow()" value="删除"/&amp;gt;
&amp;lt;input type="button" onClick="selectAll()" value="全选"&amp;gt;
&amp;lt;input type="button" onClick="unSelectAll()" value="全不选"&amp;gt;
&amp;lt;table id="mytable"&amp;gt;&amp;lt;/table&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/jsp%E5%AE%9E%E9%AA%8C/">JSP实验</category></item><item><title>让你摆脱枯燥、无聊的三十招！</title><link>https://fatkun.github.io/2009/10/%E8%AE%A9%E4%BD%A0%E6%91%86%E8%84%B1%E6%9E%AF%E7%87%A5%E3%80%81%E6%97%A0%E8%81%8A%E7%9A%84%E4%B8%89%E5%8D%81%E6%8B%9B%EF%BC%81.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E8%AE%A9%E4%BD%A0%E6%91%86%E8%84%B1%E6%9E%AF%E7%87%A5%E3%80%81%E6%97%A0%E8%81%8A%E7%9A%84%E4%B8%89%E5%8D%81%E6%8B%9B%EF%BC%81.html</guid><pubDate>Wed, 21 Oct 2009 01:31:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>我从来不感到无聊乏味，但是好多读者写信问我这样一个问题：“我感觉工作很无聊，怎么办？”&lt;br>
　　我稍停了一下 ，想象我为什么记不起我曾经工作时乏味无聊过。随后我意识到：我总是让自己很忙碌，做一些事情，不管它们是不是那样的富有成效。&lt;br>
　　有时候我弄一些新项目或者是提高一下自己，或者有时候仅仅是上网看一些有趣的东西，玩个小游戏。（我至今也不会玩很多游戏，几年前的时候我还只玩玩空中接龙。生活中扮演好自己的角色好了，没必要去网络、虚拟世界充当什么英雄……）&lt;br>
　　所以，简单点说：愉悦自己。使自己忙起来，挑战自己。找别人聊天，开阔一下思路。&lt;br>
…&lt;/p>
&lt;p>我从来不感到无聊乏味，但是好多读者写信问我这样一个问题：“我感觉工作很无聊，怎么办？”&lt;br>
　　我稍停了一下 ，想象我为什么记不起我曾经工作时乏味无聊过。随后我意识到：我总是让自己很忙碌，做一些事情，不管它们是不是那样的富有成效。&lt;br>
　　有时候我弄一些新项目或者是提高一下自己，或者有时候仅仅是上网看一些有趣的东西，玩个小游戏。（我至今也不会玩很多游戏，几年前的时候我还只玩玩空中接龙。生活中扮演好自己的角色好了，没必要去网络、虚拟世界充当什么英雄……）&lt;br>
　　所以，简单点说：愉悦自己。使自己忙起来，挑战自己。找别人聊天，开阔一下思路。&lt;br>
　　详细点说：首先必须分析自己为什么会感到无聊：是不是因为你的工作很乏味？你正在干一些你并不想干的活？有没有什么方法让你去追求一些更好的事物？或者你已经有了一个非常合适的工作，但是一些人或事限制住你了？你怎样脱离这种状况呢？&lt;br>
　　我不想把这种一连串类似的问题列举下去了，但是可以给你一些想法，也不是彻底的解决方案，仅仅是我从自身的实践中总结出来的，希望对你也一样有作用。&lt;br>
　　&lt;strong>创造挑战&lt;/strong>&lt;br>
　　我想这是我的这份列表里面最好的东西了，但是你可能会有异议。很多时候我们很无聊是因为我们没有遇到什么挑战——当适应一种生活后，一切就变得那么的简单而有规律。那么，改变一下吧。不要等着别人给你带来挑战了，自己创造挑战。你怎么挑战自己呢？确定一个全新的工作目标，尝试一下更努力的工作，开发新项目。集中在那些令人兴奋的新目标上，然后不断的追求。&lt;br>
　　&lt;strong>开始准备下一份工作&lt;/strong>&lt;br>
　　如果你真的很乏味而且不知道怎么做，那你可能就需要采取行动了，但不是马上换份工作。先从准备下一份履历表开始，关注一下空缺的职位和招聘启示，更新一下简历然后投递到一些地方，发几封邮件探探情况等等。找一些你永远不会感到枯燥的事，找一些你永远充满激情的事情。&lt;br>
　　&lt;strong>罗列一下人生目标&lt;/strong>&lt;br>
　　你想在人生里实现什么？不仅仅是工作方面，而是你整个人生方面。如果你以前这样罗列过，那么重新更新一下你的列表吧。然后选择一个目标今年之内实现它。然后想一下为了达到这个目标，今天应该开始干点什么——不管有多么的微不足道。让自己运作起来，接近自己的目标。&lt;br>
　　&lt;strong>读读禅，感悟生活&lt;/strong>&lt;br>
　　或者是其他你感兴趣的东西。如果这些东西有助于你更好的生活，那再好不过了。但是你得限制你花在这个上面的时间，不要把重心都花费到这上面去了，否则就本末倒置了。&lt;br>
　　&lt;strong>整理你的工作室&lt;/strong>&lt;br>
　　如果我确实没有找到什么可干的事情，我一般会打扫我的书桌（如果书桌上很乱的话）。或者是盯着周围的所有东西然后问自己：”他们确实应该被放在这里吗？我该怎么清理他们？”我知道这听起来怪怪的，但是我的工作室的确很整洁。就拿现在来说，我的桌上只有一台电脑，一点也不乱。没有文件，没有纸，没有办公用品，什么也没有。所有的事都在电脑上完成，我喜欢这样。也许你不需要这样整洁，但是减少零乱确实很有意思。&lt;br>
　　&lt;strong>发展一个个人爱好&lt;/strong>&lt;br>
　　我的爱好（在它被发展成职业之前）是写博客。我会在工作之余写博客，甚至是工作中的空隙时间。并不是所有人都能在工作时间发展他的个人爱好。举个例子：你上班的时候用胶水粘飞机模型可能会让你的同事很反感。但是有时候你可以阅读它们。顺便说一句我可以很自然的在上班时玩博客，因为我属于自由职业者。而很多人只能秘密地进行，我可不想你因为我的建议而被解雇。&lt;br>
　　&lt;strong>把你的工作当成游戏&lt;/strong>&lt;br>
　　你可以把任何工作变得像游戏一样。看看你十分钟之内能把屏幕铺满多少个小窗口；假装你的同事是小说中的坏蛋；想象你是中央情报局的卧底，不要让别人知道；或者是当一个公主，随你怎么幻想。&lt;br>
　　&lt;strong>自学&lt;/strong>&lt;br>
　　在关岛这个被称作“edumacation”——听起来不像个单词，但是我们喜欢玩字母游戏。不管我们怎么称呼它，你可以在网络上的任何地方有所收获，无论是和工作有关或是无关。成为你自己的大学老师。维基百科就是一个好地方。当然你并不需要了解所有的专业的知识。&lt;br>
　　&lt;strong>提高技能&lt;/strong>&lt;br>
　　顺着以上同样的思路：选择一样你愿意学习的技能，然后挑战自己去做得更好。不管是编程，还是写作，还是Adobe InDesign。你可以为你以后的职业考虑，或者是自己当老板；再或者仅仅是因为很了解这个技能从而让自己满意。&lt;br>
　　&lt;strong>玩数独&lt;/strong>&lt;br>
　　这可能不是最有意思的或者最刺激的游戏。但是我还是觉得非常有乐趣，我只是有时玩一玩而不像很多人那样沉迷其中。但是我承认这是打发时光的好方法。&lt;br>
　　&lt;strong>换一张悦目的桌面背景&lt;/strong>&lt;br>
　　当我没事儿可干的时候我喜欢上网，去flickr或者是其他的壁纸网站逛一逛，直到我找到自己想要的简单，悦目的图片。我几乎每月都会这样，我正打算一会儿去找一张呢！&lt;br>
　　&lt;strong>做仰卧起坐&lt;/strong>&lt;br>
　　如果你很乏味，可能你会想健身。你可以就在你的办公桌边的地板上做仰卧起坐（如果怕同事看着你的话可以出去做。）或者是走几个台阶，做几个无负重的下蹲起立，或者是坐在椅子上往下压。&lt;br>
　　&lt;strong>放一两天假&lt;/strong>&lt;br>
　　有时候你需要放松一下，给自己充点电再重新开始工作。在你放松的时候不要做任何有关工作的事情：休闲放松、阅读、睡觉、锻炼等等。把你的大脑从工作中解放出来。想想你应该优先考虑的事情，找到本质的问题，重新找到生活。&lt;br>
　　&lt;strong>散散步&lt;/strong>&lt;br>
　　这是我通常都会去做的事。特别是当我整天坐在哪里，全身的血都拥堵在下半身的时候。我需要让我的血液保持循环！走出去，逛一逛，看看人们，看看景色，想想你的一天，想想你的生活，想想你周围的人们。&lt;br>
　　&lt;strong>多喝水&lt;/strong>&lt;br>
　　脱水状态可能使我们疲劳和行动迟缓。水可以帮助我们恢复清醒。每天多喝水（虽然这会导致你多上厕所）。&lt;br>
　　&lt;strong>问候一下你爱的人&lt;/strong>&lt;br>
　　除了你没有更好的事情可做的时候，还有什么时候更适合联系你爱的人呢？给他们打个招呼，这是保持联系的好方法！&lt;br>
　　&lt;strong>读书&lt;/strong>&lt;br>
　　我喜欢上哪儿都带上一本小说，一有时间就拿出来，在候诊室里，在邮局排队时。如果没有小说，那你可以带上你要读却没有时间读的那些资料，当你在办公室里坐着无聊的时候拿出来读一读。你也可以在电脑里新建一个“待读”的文件夹。&lt;br>
　　&lt;strong>写自己的小说&lt;/strong>&lt;br>
　　很多人都有一个写小说的冲动在自己的头脑里晃来晃去。写下来吧，女士们先生们。管他情节内容有多烂，写出来吧，这些主意自己可不会跑出来。&lt;br>
　　&lt;strong>小憩一会儿&lt;/strong>&lt;br>
　　如果你没有一个合适的环境这样做时，你可以在你的办公桌下面蜷成一团披上毛衣或者是去车里好好睡。我学过怎样椅子上睡觉，但是幸运的是我在家里工作我可以睡在沙发上。&lt;br>
　　&lt;strong>创造一个新计划或者是新形象&lt;/strong>&lt;br>
　　如果工作停滞不前了，那就开始一个新的吧。创新，为了给公司和个人带来持久的利益，你可以做些什么吗？如果你的职业已经走到尽头了，那就创造一个新形象。找一些别人还没有做但不得不做的事情，并且这些事情是真的有利于公司的——自己去完成吧。你可以先和老板商量，有时也可以先做，然后再告诉主管。如果这个有利于公司，如果他们够聪明，他们会很高兴的。&lt;br>
　　&lt;strong>写封情书&lt;/strong>&lt;br>
　　如果你有另一半了，写一封情书告诉他为什么爱他吧。他们都会喜欢这个的，电邮就可以了，如果是纸笔手写的那就更好啦。&lt;br>
　　&lt;strong>做一些赚钱的小事&lt;/strong>&lt;br>
　　这可以是开个存款帐户如果你没有的话，也可以设置一个自动转账储蓄，或者是看一看基金或者是读一读理财方面的书，学会一些基本的财政知识。&lt;br>
　　&lt;strong>写博客&lt;/strong>&lt;br>
　　当事情没有进展的时候，这是我最愿意干的事情。我会新建一个文本文件，然后开始写。我喜欢列举条目（你们看到这里可能已经意识到这一点了），写下我的想法。如果进展确实非常缓慢，我就会把文章全部贴到博客，如果需要我可以晚些时候再发。注意：记得确认你确实喜欢你自己写的东西。&lt;br>
　　&lt;strong>做一件迫不得已的事&lt;/strong>&lt;br>
　　可以是办公室里的“墨盒用完了！”也可以是办公室无关的“我今天必须买手纸去！”这些事能让你动起来，这可以帮你摆脱枯燥。去完成一些有用的事。&lt;br>
　　&lt;strong>更新财政状况&lt;/strong>&lt;br>
　　我经常通过MICROSOFT MONEY来记录我的财政情况。但最近我用google的spreadsheet，这样我就可以随时上网了解我的财政状况了。我也想过一些其他的解决方案，但是，对我个人来说，这种事情越简单越好。不管怎样，每周去了解一下账目明细可以让你知道你的状况，不会超支。找一些空闲时间去着手做吧！&lt;br>
　　&lt;strong>冥想&lt;/strong>&lt;br>
　　有些人认为这只是打瞌睡的一种更有神秘感的说法而已。但是对我来说这不是催眠，我只是闭上眼睛集中精力于我的呼吸。这并不是什么新鲜事儿——他帮助你注意自己的现在，并使你保持平静。有时注意力集中在某些事物上会让你瞌睡，比如说两只鸟儿，一块大石头。&lt;br>
　　&lt;strong>整理文件&lt;/strong>&lt;br>
　　好了，这对于某些人来说更枯燥无味。但是我喜欢有组织有顺序的东西。我喜欢从干净整洁有序中得到一种满足感。这不会占用很长时间。&lt;br>
　　&lt;strong>清理收件箱&lt;/strong>&lt;br>
　　我喜欢让我的收件箱保持空的状态。不管是电邮的收件箱还是现实中的收件箱。都点开看看，直到都被阅读一遍。不需要把所有的事情都完成，但是，如果你有什么计划的话，写一个to-do list。你的收件箱有上千封邮件？把他们放进临时文件夹，你基本不会去看它们。所以把你的收件箱清空。&lt;br>
　　&lt;strong>来点音乐&lt;/strong>&lt;br>
　　一些有激情的节奏会有所帮助，可以让你的工作显得更有趣。如果你的同事不介意的话可以用扬声器放，也可以插上耳塞听。&lt;br>
　　&lt;strong>疯狂起来&lt;/strong>&lt;br>
　　我们需要放松。用你的最高音调唱歌，或者在办公室里跳段舞。我保证肯定有人笑话你，但是办公室里有点幽默是没有坏处的。或者是走出办公室干点疯狂的事情，一下午的疯狂不会伤害你（当然，不要干一些违法或者是有生命危险的活动）。&lt;br>
原文：&lt;a href="http://zenhabits.net/2008/01/30-things-to-do-to-keep-from-getting-bored-out-of-your-skull-at-work/" target="_blank">30 Things to Do to Keep From Getting Bored Out of Your Skull at Work – Zenhabits&lt;/a>&lt;br>
译者：&lt;a href="http://www.mifengtd.cn/" target="_blank">Liwenqi&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category><category domain="https://fatkun.github.io/tags/%E5%AF%82%E5%AF%9E/">寂寞</category><category domain="https://fatkun.github.io/tags/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category><category domain="https://fatkun.github.io/tags/%E6%91%86%E8%84%B1/">摆脱</category><category domain="https://fatkun.github.io/tags/%E6%97%A0%E8%81%8A/">无聊</category></item><item><title>谈谈最近比较热门的游戏：植物大战僵尸，机械迷城(Machinarium)攻略与下载</title><link>https://fatkun.github.io/2009/10/%E8%B0%88%E8%B0%88%E6%9C%80%E8%BF%91%E6%AF%94%E8%BE%83%E7%83%AD%E9%97%A8%E7%9A%84%E6%B8%B8%E6%88%8F%EF%BC%9A%E6%A4%8D%E7%89%A9%E5%A4%A7%E6%88%98%E5%83%B5%E5%B0%B8%EF%BC%8C%E6%9C%BA%E6%A2%B0%E8%BF%B7.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E8%B0%88%E8%B0%88%E6%9C%80%E8%BF%91%E6%AF%94%E8%BE%83%E7%83%AD%E9%97%A8%E7%9A%84%E6%B8%B8%E6%88%8F%EF%BC%9A%E6%A4%8D%E7%89%A9%E5%A4%A7%E6%88%98%E5%83%B5%E5%B0%B8%EF%BC%8C%E6%9C%BA%E6%A2%B0%E8%BF%B7.html</guid><pubDate>Mon, 19 Oct 2009 19:51:39 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>《机械迷城》是前几天（好像是10月16日吧）才由Amanita Design team发布的一款解密类游戏。相信很多人都玩过而且很快就通关了吧，看到网上已经有攻略了。&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2688/4024362329_7068ace9bb.jpg" alt="" title="" />&lt;/p>
&lt;p>《机械迷城》是前几天（好像是10月16日吧）才由Amanita Design team发布的一款解密类游戏。相信很多人都玩过而且很快就通关了吧，看到网上已经有攻略了。&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2688/4024362329_7068ace9bb.jpg" alt="" title="" />&lt;br>
这是游戏简介：&lt;/p>
&lt;blockquote>
&lt;div class="quote">> 机械迷城&lt;br /> 由捷克独立开发小组Amanita Design设计制作的最新作品《Machinarium》PC版发售日定于09年10月16日。此作堪称以独特的水墨风格展现给玩家的是一款冒险解谜游戏，值得期待。&lt;br /> 游戏将采用传统点击式界面,和Samorost游戏相似,2D背景和人物,没有对白.不过,Machinarium游戏时间将更长更复杂,这次画面将由手画,而玩家有个小物品栏。&lt;br /> Machinarium中每个人都是机器人,包括我们的小英雄,他将对从 &amp;#8220;Black Cap Brotherhood&amp;#8221;来的坏人。&lt;br /> 本游戏在2009年独立游戏节上斩获了视觉艺术奖。> &lt;/div>
&lt;/blockquote>
&lt;p>没玩过的赶紧玩了，&lt;a href="http://www.verycd.com/topics/2775000/" target="_blank">&lt;b>机械迷城下载地址在这里啊在这里&lt;/b>&lt;/a>&lt;br>
机械迷城安装完的大小才350MB，相对很多游戏算小的了。虽然是2D的风格，不过画面很唯美，剧情很普通~呵呵，就是小机器人以前经常被欺负，报完仇，最后把MM救出来。那个机器人也很可爱，可以伸长缩短的~另外还值得一提的是背景音乐是很不错的，每个场景都有不同的音乐。&lt;br>
游戏刚开始的难度不是很大，慢慢的难度有点加深，不过也不是太难，比较花时间想吧。游戏性不错，相当于把很多小游戏在里面，但这么多个游戏就为了故事主题服务。有很多巧妙的地方。&lt;br>
最郁闷的是我玩的途中有一处过不了，就是要把偷了拼图的小鸟弄下来。看了别人说的攻略，因为那只鸟会跟着你做动作，上下上下的伸缩身体，就可以把小鸟从电线上荡下来了。可是无论多快的速度，那小鸟死活不下来~郁闷啊。郁闷了一天后，同学来试了一下就把小鸟弄下来了。再一次郁闷了，为什么我荡不下来。晕，要保持节奏，&lt;strong>等到小鸟落到最低点再伸长身体，最高点再缩短身体&lt;/strong>，反复几次就能做到了。想不到。。。&lt;br>
还有一个地方是有个机器人问你问题，如果你答对了什么事情都没发生。。。正郁闷，看看攻略，晕，要故意答错才行。。又一次想不到了。&lt;br>
这个游戏的时间虽然短暂，但是游戏性是很好的，加上唯美的画面，动听的音乐。简直可以和大型游戏媲美。非常适合无聊时玩玩，不过你会被它深深吸引的。&lt;br>
说了这么多，&lt;strong>攻略在哪？&lt;strong>呵呵，就在游戏的文件，在&lt;/strong>“10”文件夹&lt;/strong>里面以111的扩展名，用图片浏览器打开就可以看到了。攻略做得很好看，就像漫画书呀。&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2529/4025116438_1ccdb5c64b_o.jpg" alt="" title="" />&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2607/4024362639_bdf4070402_o.jpg" alt="" title="" />&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2451/4025116770_8621312c61_o.jpg" alt="" title="" />&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2726/4024363095_665dc18e50_o.jpg" alt="" title="" />&lt;br>
说了这个游戏，不得不说再前段时间疯狂喜欢的游戏《植物大战僵尸》了&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2439/4025446779_4d45c58d70_o.jpg" alt="" title="" />&lt;/p>
&lt;blockquote>
&lt;div class="quote">> 植物大战僵尸(Plants vs. Zombies)是一款新奇的即时战略、塔防御战游戏，武装您的49种植物，切换他们不同的功能，诸如樱桃炸弹或强悍的食人花，更加快速有效的将僵尸阻挡在入侵的道路上。不同的敌人，不同的玩法构成五种不同的游戏模式，加之夕阳、浓雾以及泳池之类的障碍增加了其挑战性 奇特的游戏乐趣永无止境。可怕的僵尸即将入侵你的家庭，你唯一的防御方式就是您栽种的植物。> &lt;/div>
&lt;/blockquote>
&lt;p>&lt;a href="http://dl.pconline.com.cn/download/55136.html" target="_blank">&lt;b>植物大战僵尸中文版下载地址在这里啊在这里&lt;/b>&lt;/a>&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2562/4025446933_668dbef11a_o.jpg" alt="" title="" />&lt;br>
植物大战僵尸是一个挺悠闲的游戏。加上有大量不同种类的植物以及不同的僵尸，还有浓雾、晚上等不同的场景，必须要合理的选择与种植植物，还要加上你敏捷的思维，才能在这游戏中自由翱翔。当然，这么多组合，没有说那个是最好的，能过关就行。&lt;br>
另外还有很多道具，都需要在游戏中获取的金币才能购买，以及有一个无限关（据说是1000关），使得游戏的时间延长（但我还是没耐心玩到1000关啊）。&lt;br>
玩这个游戏最大的好处就是根本不需要什么攻略，随意你怎么种，取得胜利并不会太难。攻略嘛，就看看那玩1000关的视频，很牛B，不过玩到几十关就没意思了。&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/machinarium/">Machinarium</category><category domain="https://fatkun.github.io/tags/%E6%9C%BA%E6%A2%B0%E8%BF%B7%E5%9F%8E/">机械迷城</category><category domain="https://fatkun.github.io/tags/%E6%A4%8D%E7%89%A9%E5%A4%A7%E6%88%98%E5%83%B5%E5%B0%B8/">植物大战僵尸</category><category domain="https://fatkun.github.io/tags/%E6%B8%B8%E6%88%8F/">游戏</category><category domain="https://fatkun.github.io/tags/%E7%AE%80%E5%8D%95/">简单</category></item><item><title>手把手教你调戏QQ好友，恶搞吖</title><link>https://fatkun.github.io/2009/10/%E6%89%8B%E6%8A%8A%E6%89%8B%E6%95%99%E4%BD%A0%E8%B0%83%E6%88%8Fqq%E5%A5%BD%E5%8F%8B%EF%BC%8C%E6%81%B6%E6%90%9E%E5%90%96.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E6%89%8B%E6%8A%8A%E6%89%8B%E6%95%99%E4%BD%A0%E8%B0%83%E6%88%8Fqq%E5%A5%BD%E5%8F%8B%EF%BC%8C%E6%81%B6%E6%90%9E%E5%90%96.html</guid><pubDate>Sat, 17 Oct 2009 17:01:08 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> 1、打开QQ聊天窗口 任何一个好友聊天 在最上面都会出现一个提示信息——“交谈中请勿轻信汇款、中奖消息，勿轻易拨打陌生电话”。前面有个感叹号图片，右键添加QQ表情。2、然后自定义一个文字颜色，红：121 绿：130 蓝 193，宋体，9号字（如下图2所示）3、聊天窗口先调出表情，然后输入“对方给您发送到消息可能包含病毒&lt;/p>
&lt;p> 1、打开QQ聊天窗口 任何一个好友聊天 在最上面都会出现一个提示信息——“交谈中请勿轻信汇款、中奖消息，勿轻易拨打陌生电话”。前面有个感叹号图片，右键添加QQ表情。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 2、然后自定义一个文字颜色，红：121 绿：130 蓝 193，宋体，9号字（如下图2所示）&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 3、聊天窗口先调出表情，然后输入&amp;ldquo;对方给您发送到消息可能包含病毒，已被安全中心隐蔽，安全中心检测到您的QQ客户端已经感染，请立即重新启动电脑！&amp;rdquo;，发送给你的好友，欧了。&lt;/p>
&lt;img class="size-full wp-image-1106" title="感叹号图片，右键添加QQ表情。" alt="未命名2" width="384" height="112" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " src="http://www.shichangzhi.com/wp-content/uploads/2009/09/%E6%9C%AA%E5%91%BD%E5%90%8D2.jpg" />
感叹号图片，右键添加QQ表情。
&lt;img class="size-full wp-image-1107" title="红：121 绿：130 蓝 193，宋体，9号字" alt="红：121 绿：130 蓝 193，宋体，9号字" width="400" height="252" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " src="http://www.shichangzhi.com/wp-content/uploads/2009/09/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg" />
红：121 绿：130 蓝 193，宋体，9号字
&lt;img class="size-full wp-image-1109" title="请立即重新启动电脑！" alt="请立即重新启动电脑！" width="383" height="176" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; " src="http://www.shichangzhi.com/wp-content/uploads/2009/09/%E6%9C%AA%E5%91%BD%E5%90%8D11.jpg" />
请立即重新启动电脑！
来源：[老时说][1]</description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/qq/">QQ</category><category domain="https://fatkun.github.io/tags/%E6%AC%BA%E9%AA%97/">欺骗</category></item><item><title>今天才发现有几条评论要审核，各位抱歉了。</title><link>https://fatkun.github.io/2009/10/%E4%BB%8A%E5%A4%A9%E6%89%8D%E5%8F%91%E7%8E%B0%E6%9C%89%E5%87%A0%E6%9D%A1%E8%AF%84%E8%AE%BA%E8%A6%81%E5%AE%A1%E6%A0%B8%EF%BC%8C%E5%90%84%E4%BD%8D%E6%8A%B1%E6%AD%89%E4%BA%86%E3%80%82.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E4%BB%8A%E5%A4%A9%E6%89%8D%E5%8F%91%E7%8E%B0%E6%9C%89%E5%87%A0%E6%9D%A1%E8%AF%84%E8%AE%BA%E8%A6%81%E5%AE%A1%E6%A0%B8%EF%BC%8C%E5%90%84%E4%BD%8D%E6%8A%B1%E6%AD%89%E4%BA%86%E3%80%82.html</guid><pubDate>Sat, 17 Oct 2009 08:19:15 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>TotoroⅡ（基于Totoro的Z-Blog的评论及引用管理审核系统增强版），这个是Z-BLOG的垃圾评论审核插件，里面有加分减分机制，达到某个分数就认为了垃圾评论了，Z-BLOG默认的阀值太低了，只有50.。。现在我把他设为200。对没有及时发现的评论表示抱歉。。。&lt;br>
说到这个问题，想到Wordpress有个防止英文评论的插件，一定要输入有中文字符~（用正则判断），下面一般还提示：“you must type some chinese word such as “你好”…”，呵呵，有点搞笑~&lt;br>
…&lt;/p>
&lt;p>TotoroⅡ（基于Totoro的Z-Blog的评论及引用管理审核系统增强版），这个是Z-BLOG的垃圾评论审核插件，里面有加分减分机制，达到某个分数就认为了垃圾评论了，Z-BLOG默认的阀值太低了，只有50.。。现在我把他设为200。对没有及时发现的评论表示抱歉。。。&lt;br>
说到这个问题，想到Wordpress有个防止英文评论的插件，一定要输入有中文字符~（用正则判断），下面一般还提示：“you must type some chinese word such as “你好”…”，呵呵，有点搞笑~&lt;br>
现在又涉及到另一个问题，防垃圾评论与用户体验问题。过严的防止必定导致访客的评论积极性降低，也不利于博主和访客的交流，不能及时的看到评论（还得到后台审核才看到，以前一直没注意到这东西，所以忽略了几条评论，再次道歉。），所以，适度放松点是必要的。何况我博客都没有垃圾评论~呵呵~&lt;br>
另外，今天&lt;a href="http://ooxx.me" target="_blank">大猫&lt;/a>提醒我一个用户体验的问题&lt;/p>
&lt;blockquote>
&lt;div class="quote">> 应该把记住我,下次回复时不用重新输入个人信息默认checked或不用提示直接记忆&amp;#8230;> &lt;/div>
&lt;/blockquote>
&lt;p>细节问题( ⊙ o ⊙ )！老忽略了~虽然是个细小的问题，但是还是要给一个良好的体验给访客的！&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E5%AE%A1%E6%A0%B8/">审核</category></item><item><title>你为了什么而写博客？</title><link>https://fatkun.github.io/2009/10/%E4%BD%A0%E4%B8%BA%E4%BA%86%E4%BB%80%E4%B9%88%E8%80%8C%E5%86%99%E5%8D%9A%E5%AE%A2%EF%BC%9F.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E4%BD%A0%E4%B8%BA%E4%BA%86%E4%BB%80%E4%B9%88%E8%80%8C%E5%86%99%E5%8D%9A%E5%AE%A2%EF%BC%9F.html</guid><pubDate>Fri, 16 Oct 2009 02:37:13 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>写了一个月的博客，发现每天更新一篇文章也是个问题。你为了什么会写博客？&lt;br>
我写博客的原因有以下几个：&lt;/p>
&lt;blockquote>
&lt;div class="quote">> 1，本人容易健忘，所以把一些自己学到的东西写到博客上，既可以给自己看，也可以给别人看&lt;br /> 2，作为一个博客，可以把好的东西推荐给大家，转载一些好的文章，方便自己找&lt;br /> 3，为了满足自己的虚荣心？IP/PV？&lt;br /> 4，为了有个地方说说话，不然闷死了> &lt;/div>
&lt;/blockquote>
&lt;p>写了一个月的博客，发现每天更新一篇文章也是个问题。你为了什么会写博客？&lt;br>
我写博客的原因有以下几个：&lt;/p>
&lt;blockquote>
&lt;div class="quote">> 1，本人容易健忘，所以把一些自己学到的东西写到博客上，既可以给自己看，也可以给别人看&lt;br /> 2，作为一个博客，可以把好的东西推荐给大家，转载一些好的文章，方便自己找&lt;br /> 3，为了满足自己的虚荣心？IP/PV？&lt;br /> 4，为了有个地方说说话，不然闷死了> &lt;/div>
&lt;/blockquote>
&lt;p>基于上面的原因，貌似并没有必要很及时的更新自己的文章。也许是因为我寂寞了，到处到阅读器找寻新鲜有趣的文章看看~&lt;br>
不过也就是今年才开始用订阅器，最开始用的是Opera9.6内置的订阅器，后来停用一段时间，一是基本换用Chrome浏览器了，二是觉得在Opera上的订阅器看起来并不舒服。&lt;br>
后来接触到Google阅读器，一下子就喜欢上了~简洁易用！发现我挺喜欢Google.com（不是谷歌，是Google）的产品的。&lt;br>
写博客刚开始肯定是无收入的，就算到了一个程度，能达到收支平衡就不错了。&lt;br>
也许写博客只为了能说说话，和志同道合的博主一起交流~一起成长~&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E4%B8%BA%E4%BB%80%E4%B9%88/">为什么</category><category domain="https://fatkun.github.io/tags/%E5%8D%9A%E5%AE%A2/">博客</category></item><item><title>网乐志版权维护组织成立宣言和组织的各项说明</title><link>https://fatkun.github.io/2009/10/%E7%BD%91%E4%B9%90%E5%BF%97%E7%89%88%E6%9D%83%E7%BB%B4%E6%8A%A4%E7%BB%84%E7%BB%87%E6%88%90%E7%AB%8B%E5%AE%A3%E8%A8%80%E5%92%8C%E7%BB%84%E7%BB%87%E7%9A%84%E5%90%84%E9%A1%B9%E8%AF%B4%E6%98%8E.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E7%BD%91%E4%B9%90%E5%BF%97%E7%89%88%E6%9D%83%E7%BB%B4%E6%8A%A4%E7%BB%84%E7%BB%87%E6%88%90%E7%AB%8B%E5%AE%A3%E8%A8%80%E5%92%8C%E7%BB%84%E7%BB%87%E7%9A%84%E5%90%84%E9%A1%B9%E8%AF%B4%E6%98%8E.html</guid><pubDate>Fri, 16 Oct 2009 01:31:34 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>我已经放弃了这篇文章的版权，转载本文无须加上本博客的链接。如果你有意为维护原创权益出一份力，请你转载这篇文章。       在中国，原创文章被恶意抄袭的现象是相当普遍的。可以说，原创文章的作者就像砧板上的肉一样，任由抄袭者的宰割。&lt;/p>
&lt;p> &lt;span class="Apple-style-span" style="font-family: Tahoma, 'century gothic', Arial, verdana, sans-serif; line-height: 20px; font-size: 13px; ">&lt;span class="Apple-style-span" style="font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; ">&lt;font color="#ff0000" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">      我已经放弃了这篇文章的版权，转载本文无须加上本博客的链接。如果你有意为维护原创权益出一份力，请你转载这篇文章。&lt;/font> &lt;/span>&lt;/p>&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 在中国，原创文章被恶意抄袭的现象是相当普遍的。可以说，原创文章的作者就像砧板上的肉一样，任由抄袭者的宰割。那些恶意的抄袭者会去掉原创文章的&amp;ldquo;原文链接&amp;rdquo;，甚者会去掉原创文章中图片的&amp;ldquo;水印&amp;rdquo;。如果是撞到PR和流量都比自己高的无耻抄袭者，往往会造成这样的局面：&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />&lt;font color="#ff0000" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">1.抄袭者的抄袭文章在搜索引擎中的排名较前，抄袭者会被认为是原创者。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />2.原创者的原创文章在搜索引擎中的排名较后，原创者会被认为是抄袭者。&lt;/font>&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> 如果这种无耻的抄袭之风得不到遏制，必然导致这样的结果：&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />&lt;font color="#ff0000" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">1.原创者的尊严和人格受到了极大的损害，但却无处伸张，必然会大大挫伤原创者的创作积极性，甚者会因此放弃写作。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />2.抄袭者成功地&amp;ldquo;不劳而获&amp;rdquo;，尝到甜头之后必然会变本加厉，更多的原创者会惨遭毒手。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />3.无耻的抄袭之风必然会更加泛滥，原创者的生存必将举步维艰。&lt;/font>&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> 其实本人和本人的兄弟也深受这些抄袭者的残害，版权侵害一直发生在我身边，下面列举一些事例吧：&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />1.我兄弟的博客&amp;mdash;&amp;mdash;《网憩阁》的文章被去掉&amp;ldquo;原文链接&amp;rdquo;转载到一个百度空间上。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />2.我兄弟的博客&amp;mdash;&amp;mdash;《Louis Han Life Log》的文章被去掉&amp;ldquo;原文链接&amp;rdquo;，文章图片被去掉&amp;ldquo;水印&amp;rdquo;转载到一个名为《锐博》的商业博客上。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />3.我的博客&amp;mdash;&amp;mdash;《占奇博客》的所有教程类文章被一个垃圾采集站全部&amp;ldquo;采集&amp;rdquo;了。&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> &lt;font color="#0000ff" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 我身边一直发生这样的事情，让我感到心酸和难过，中国的互联网风气真的堕落成这样了吗？没错，是真的。难道我们这些原创博主只能在这种风气下，任由这些抄袭者无耻地宰割吗？难道我们这些原创的博主就要默默地忍受这些抄袭者无耻的迫害？不能，我们要联合起来，我们要团结起来，我们要拿回我们应有的权利。&lt;/font>&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 可是在版权法律缺失，版权管理松懈的中国，我们应该怎么办呢？向法院投诉？人家的案件已经多到处理不来了，还会理你这些&amp;ldquo;小事情&amp;rdquo;？向那个抄袭者发出书面投诉？或许那个抄袭者会这样回复你：就你那个小博客，我抄你的文章是你的荣誉。我们应该怎么办？还是那句&amp;mdash;&amp;mdash;联合起来。&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> &lt;font color="#0000ff" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 我们联合起来可以做什么有实质意义的事情呢？能做的太多了！我们可以&amp;ldquo;共同揭发&amp;rdquo;，&amp;ldquo;共同声讨&amp;rdquo;，&amp;ldquo;共同抵制&amp;rdquo;，&amp;ldquo;共同投诉&amp;rdquo;。我们要形成一股力量，一股正义的力量，一股有影响力的正义力量。我们要把我们的力量，紧紧地聚合在一个拳头上，哪里有侵权，我们的拳头就轰向那里。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />&lt;img src="http://farm3.static.flickr.com/2506/4010366257_8f861f061d.jpg" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; display: block; float: none; " alt="" />&lt;/font>&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-r
ight: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 要联合起来，就必须要建立一个组织，一个分工明确并易于聚合力量的高效组织。下面我就从&amp;ldquo;组织的章程和性质&amp;rdquo;，&amp;ldquo;组员的架构&amp;rdquo;，&amp;ldquo;组织工作模式的一些说明&amp;rdquo;和&amp;ldquo;组员的义务&amp;rdquo;这四方面来阐述&amp;ldquo;我们的维权原理与模式&amp;rdquo;。&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> 第一个方面：组织的章程和性质（等待法律专业的组员更术语化，目前暂列出几条。）&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />1.组织的名称是《网乐志版权维护组织》，是一个&amp;ldquo;非盈利性组织&amp;rdquo;，组织实行&amp;ldquo;民主制&amp;rdquo;，组织接受全体组员的监督。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />2.组员在组织中拥有&amp;ldquo;选择权&amp;rdquo;，&amp;ldquo;被选择权&amp;rdquo;，&amp;ldquo;表决权&amp;rdquo;等等的一切民主权利，但组员也有相关的义务（下面说明）。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />3.（更多的条款等待法律专业组员的草案吧）。&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> &lt;font color="#800080" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">第二个方面：组员的架构&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />我们组织的组员架构如下：&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />一、&amp;ldquo;理事长&amp;rdquo;一名，是组织的最高负责人。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />二、&amp;ldquo;秘书长&amp;rdquo;三名，分管和协调组织内的各项工作，是组织的第二负责人，也是组织的心脏。三、&amp;ldquo;仲裁组成员&amp;rdquo;，名额待定，负责仲裁各种各样的侵权举报，即是说：仲裁组的职责是审核和确认侵权举报，仲裁组的仲裁结果也是组织认定举报是否属实的唯一标准。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />四、&amp;ldquo;行动组成员&amp;rdquo;，最受组织尊重的成员，名额待定。行动组成员主要是由有经验的负责任的志愿者担任。他们的任务是协助&amp;ldquo;受害人&amp;rdquo;，&amp;ldquo;理事长&amp;rdquo;，&amp;ldquo;秘书长&amp;rdquo;组织各种&amp;ldquo;共同声讨&amp;rdquo;，&amp;ldquo;共同抵制&amp;rdquo;，&amp;ldquo;共同投诉&amp;rdquo;的活动（活动形式后面有说明）。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />五、以上的四种职务都允许相互兼任，一般来说，&amp;ldquo;理事长&amp;rdquo;和&amp;ldquo;秘书长&amp;rdquo;都要兼任两个组的职务。&lt;/font>&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> &lt;font color="#ff0000" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">第三方面：组织工作模式的一些说明&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 由于筹备仓促，目前组织只能在&lt;a href="http://bbs.wanglezhi.com/" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(172, 6, 4); text-decoration: none; background-color: transparent; ">网乐志官方论坛&lt;/a>里的一个版块内开展活动，不过这应该不会影响到我们的工作，我们的工作是简单而高效的。下面请听我详细阐述：我们要做什么和我们应该怎样做：&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />1.网乐志论坛的地址是&lt;a title="http://bbs.wanglezhi.com/" href="http://bbs.wanglezhi.com/" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(172, 6, 4); text-decoration: none; background-color: transparent; ">http://bbs.wanglezhi.com/&lt;/a>&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />2.我们在网乐志官方论坛里开了一个《网乐志版权维护组织》的版块，版块里分了四个区，分别是《举报仲裁区》，《行动组织区》，《自由交流区》，《组织事务区》。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />3.组员一旦发现侵权行为，请在《举办仲裁区》里按要求发帖举报，让仲裁组的成员审核。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />4.一经审核成功，仲裁组的成员会把这项举报移交《行动组织区》，行动组的成员，理事长，秘书长和受害人一齐组织大家进行各种维权活动。&lt;/font>&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> &lt;font color="#ff0000" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">我们组织维权活动的形式有：&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />一、在我们的博客上共同声讨&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />1.被侵权的组员请先自行撰写一篇声讨文章，文章必须包含足够的证据，最好有截图。文章要求用语文明，不能包含粗言秽语。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; marg
in-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />2.所有的组员在自己博客上开一个分页，专门发布或刊登&amp;ldquo;被侵权组员撰写的声讨文章&amp;rdquo;（这也是每位组员应尽的义务）。&lt;/font>&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> &lt;font color="#ff0000" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">用邮件共同声讨&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />受害人可以组织其他组员和你一起发邮件到Google，百度等等的搜索引擎或者有关部门投诉，人多力量大，人多影响大。&lt;/font>&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> &lt;font color="#800080" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">第四方面：组员应尽的义务&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />1.组员的博客需要加上组织的Logo，并且Logo链接到组织活动的论坛版块。如果博客上实在找不到加Logo的地方，也可以添加为文字形式的友情链接。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />2.组员需要在自己的博客上开设一个专门发布或刊登&amp;ldquo;受害人声讨文章&amp;rdquo;的专门页面，并且有义务发布或刊登受害人的文章。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />3.组员有义务响应组织发起的维权活动。你不帮助人，人家怎么会帮助你呢？我们建议每位组员都能够做到每两天登录组织的版块一次，看看有没有受害人需要你的帮助。&lt;/font>&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> 其他方面：各种杂项一并说明了&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />1.关于组织的Logo目前还没有设计好，欢迎你们投稿，Logo尺寸最好是125X125，以《网乐志版权维护组织》为主题进行设计。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />2.网乐志官方论坛的Logo也没有设计好，欢迎你们的投稿，Logo请以&amp;ldquo;草根博主聚合&amp;rdquo;为主题进行设计，相关参数自行到论坛的顶部测量就行了。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />3.诚邀懂法律的朋友兄弟，完善我们组织的性质和章程。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />4.再重申一次，由于筹备太过仓促，目前组织只能在&lt;a href="http://bbs.wanglezhi.com/" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(172, 6, 4); text-decoration: none; background-color: transparent; ">网乐志官方论坛&lt;/a>里的一个版块内开展活动，论坛地址是&lt;a title="http://bbs.wanglezhi.com/" href="http://bbs.wanglezhi.com/" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(172, 6, 4); text-decoration: none; background-color: transparent; ">http://bbs.wanglezhi.com/&lt;/a>。我们十分过意不去。&amp;nbsp;&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />5.希望大家支持，请加入我们，加入地址是&lt;a href="http://bbs.wanglezhi.com/forumdisplay.php?fid=50" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(172, 6, 4); text-decoration: none; background-color: transparent; ">http://bbs.wanglezhi.com/forumdisplay.php?fid=50&lt;/a>&lt;/p>
&lt;p style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 微软雅黑, Tahoma, Georgia, Arial, 'century gothic', verdana, sans-serif; font-size: 15px; "> 来源：&lt;a target="_blank" href="http://www.zseeker.com/wanglezhi-rights/">占奇博客&lt;/a>&lt;/p>
&lt;p> &lt;/span>&lt;/p>
&lt;p> &amp;nbsp;&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E7%89%88%E6%9D%83%E7%BB%B4%E6%8A%A4/">版权维护</category><category domain="https://fatkun.github.io/tags/%E7%BD%91%E4%B9%90%E5%BF%97/">网乐志</category></item><item><title>信息管理实验6-使用存储过程</title><link>https://fatkun.github.io/2009/10/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C6-%E4%BD%BF%E7%94%A8%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C6-%E4%BD%BF%E7%94%A8%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B.html</guid><pubDate>Thu, 15 Oct 2009 00:09:49 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>按照下图添加控件&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2621/4010298479_54a7f2c5db.jpg" alt="" title="" />&lt;br>
&lt;strong>确保你的数据库中有northwind数据库，以及表Region，没有的话就自己建立一个吧&lt;/strong>&lt;/p>
&lt;p>按照下图添加控件&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2621/4010298479_54a7f2c5db.jpg" alt="" title="" />&lt;br>
最后的所有文件&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2454/4011063580_c0481e1b19.jpg" alt="" title="" />&lt;br>
&lt;strong>确保你的数据库中有northwind数据库，以及表Region，没有的话就自己建立一个吧&lt;/strong>&lt;br>
1 新建存储过程：&lt;/p>
&lt;pre class="brush:sql;">CREATE PROCEDURE insert_Region
@RegionID int,@RegionDescription nchar(50)
AS
insert into Region(RegionID,RegionDescription)
values(@RegionID,@RegionDescription)
&lt;/pre>
&lt;p>2:添加一个DB类:&lt;/p>
&lt;pre class="brush:c#;">using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
/// &amp;lt;summary&amp;gt;
/// DB 的摘要说明
/// &amp;lt;/summary&amp;gt;
public class DB
{
public DB() {
}
public static SqlConnection createCon() {
return new SqlConnection("server=.;database=northwind;uid=sa;pwd=;");
}
}
&lt;/pre>
&lt;p>default.aspx&lt;/p>
&lt;pre class="brush:html;">&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;
&amp;lt;head runat="server"&amp;gt;
&amp;lt;title&amp;gt;无标题页&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form id="form1" runat="server"&amp;gt;
&amp;lt;div&amp;gt;
&amp;lt;asp:GridView ID="GridView1" runat="server"&amp;gt;
&amp;lt;/asp:GridView&amp;gt;
&amp;lt;br /&amp;gt;
ID:&amp;lt;asp:TextBox ID="TextBox1" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
&amp;lt;br /&amp;gt;
Desc:&amp;lt;asp:TextBox ID="TextBox2" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;asp:Button ID="Button1" runat="server" Text="调用存储过程" OnClick="Button1_Click" /&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre>
&lt;p>default.aspx.cs&lt;/p>
&lt;pre class="brush:c#;">using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
bind();
}
}
public void bind() {
string sql = "select * from Region";
SqlConnection con = DB.createCon();//创建数据库连接
SqlDataAdapter sda = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
con.Open();
sda.Fill(ds,"Region");
GridView1.DataSource = ds;
GridView1.DataBind();//绑定数据
con.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = DB.createCon();
con.Open();
SqlCommand sqlCmd = new SqlCommand("insert_Region", con);//调用的存储过程
sqlCmd.CommandType = CommandType.StoredProcedure;//使用存储过程方式
sqlCmd.Parameters.Add("@RegionID", SqlDbType.Int).Value = TextBox1.Text.Trim();//添加参数
sqlCmd.Parameters.Add("@RegionDescription", SqlDbType.NChar,50).Value = TextBox2.Text.Trim();
sqlCmd.ExecuteNonQuery();//执行
con.Close();
bind();
}
}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/asp.net/">ASP.NET</category><category domain="https://fatkun.github.io/tags/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C/">信息管理实验</category><category domain="https://fatkun.github.io/tags/%E5%AD%98%E5%82%A8%E8%BF%87%E7%A8%8B/">存储过程</category></item><item><title>河蟹无处不在之QQ签名</title><link>https://fatkun.github.io/2009/10/%E6%B2%B3%E8%9F%B9%E6%97%A0%E5%A4%84%E4%B8%8D%E5%9C%A8%E4%B9%8Bqq%E7%AD%BE%E5%90%8D.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E6%B2%B3%E8%9F%B9%E6%97%A0%E5%A4%84%E4%B8%8D%E5%9C%A8%E4%B9%8Bqq%E7%AD%BE%E5%90%8D.html</guid><pubDate>Wed, 14 Oct 2009 22:07:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>QQ个性签名也有河蟹的，有一天，&lt;a href="http://fatkun.com" target="_blank">本人&lt;/a>闲得蛋疼，改QQ签名。。&lt;br>
当我输入“高清无码的我？搞不懂，看不透？”，很不幸，修改错误了。我还以为又是那天杀的该死的可恶的校园网断线了~我试着改另外的词，居然一下子就改好了~啊，不是校园网的错啊，怪错你拉。对不起~~&lt;br>
发现了这个惊天地泣鬼神的天大秘密，QQ个性签名很和谐。也许你早就知道了=。=&lt;/p>
&lt;p>QQ个性签名也有河蟹的，有一天，&lt;a href="http://fatkun.com" target="_blank">本人&lt;/a>闲得蛋疼，改QQ签名。。&lt;br>
当我输入“高清无码的我？搞不懂，看不透？”，很不幸，修改错误了。我还以为又是那天杀的该死的可恶的校园网断线了~我试着改另外的词，居然一下子就改好了~啊，不是校园网的错啊，怪错你拉。对不起~~&lt;br>
发现了这个惊天地泣鬼神的天大秘密，QQ个性签名很和谐。也许你早就知道了=。=&lt;br>
啥也不说，看图。。&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2621/4010903574_872345a515.jpg" alt="" title="" />&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/qq/">QQ</category><category domain="https://fatkun.github.io/tags/qq%E4%B8%AA%E6%80%A7%E7%AD%BE%E5%90%8D/">QQ个性签名</category><category domain="https://fatkun.github.io/tags/%E5%92%8C%E8%B0%90/">和谐</category></item><item><title>76个脏、极端并且有创意的免费脏乱字体</title><link>https://fatkun.github.io/2009/10/76%E4%B8%AA%E8%84%8F%E3%80%81%E6%9E%81%E7%AB%AF%E5%B9%B6%E4%B8%94%E6%9C%89%E5%88%9B%E6%84%8F%E7%9A%84%E5%85%8D%E8%B4%B9%E8%84%8F%E4%B9%B1%E5%AD%97%E4%BD%93.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/76%E4%B8%AA%E8%84%8F%E3%80%81%E6%9E%81%E7%AB%AF%E5%B9%B6%E4%B8%94%E6%9C%89%E5%88%9B%E6%84%8F%E7%9A%84%E5%85%8D%E8%B4%B9%E8%84%8F%E4%B9%B1%E5%AD%97%E4%BD%93.html</guid><pubDate>Wed, 14 Oct 2009 02:22:31 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img onload="ResizeImage(this,620)" src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/karabine-free-grunge-fonts.jpg" alt="" title="" />
&amp;nbsp;现在，这种脏乱，或者说带有一些非主流风格的设计，当然其中也包括那些复古风格越来越流行，如果要进行类似的设计，我们也许最需要的就是类似的字体和笔刷，那么下面是由Dainis Graveris为我们收集的76组字体，不多做介绍，大家看图就好了.
&lt;p> 现在，这种脏乱，或者说带有一些非主流风格的设计，当然其中也包括那些复古风格越来越流行，如果要进行类似的设计，我们也许最需要的就是类似的字体和笔刷，那么下面是由&lt;span>&lt;a title="Dainis Graveris" style="color: rgb(4, 99, 128); text-decoration: none; font-weight: 700; " href="http://www.1stwebdesigner.com/author/admin/">Dainis Graveris&lt;/a>为我们收集的76组字体，不多做介绍，大家看图就好了。&lt;/span>&lt;/p>
&lt;h2 id="span-classapple-style-span-stylefont-family-verdana-geneva-tahoma-sans-serif-font-size-13px-font-weight-normal-line-height-22px-color-rgb51-51-51-p">&lt;span class="Apple-style-span" style="font-family: Verdana, Geneva, Tahoma, sans-serif; font-size: 13px; font-weight: normal; line-height: 22px; color: rgb(51, 51, 51); ">&lt;/p>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 1.&lt;a href="http://www.dafont.com/killed-dj.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;Killed DJ&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/killed-dj.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/killed-dj-free-grunge-fonts.jpg" alt="killed-dj-free-grunge-fonts" width="570" height="256" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 2.&lt;a href="http://synergydigital.deviantart.com/art/Grunge-Serifia-Font-OTF-93046795" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;Grunge Serifia Font OTF&lt;/a>&amp;nbsp;by&lt;a href="http://synergydigital.deviantart.com/" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;SynergyDigital&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outli
ne-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/grunge-serifa-free-grunge-fonts.jpg" alt="grunge-serifa-free-grunge-fonts" width="570" height="340" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 3.&amp;nbsp;&lt;a href="http://www.dafont.com/karabine.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Karabine&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/karabine.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/karabine-free-grunge-fonts.jpg" alt="karabine-free-grunge-fonts" width="496" height="194" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 4.&lt;a href="http://www.dafont.com/marcelle.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;Marcelle&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/marcelle.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; backgrou
nd-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/marcelle-free-grunge-fonts.jpg" alt="marcelle-free-grunge-fonts" width="399" height="225" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 5.&lt;a href="http://www.dafont.com/bleeding-cowboys.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;Bleeding Cowboys&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/bleeding-cowboys.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/bleeding-cowboys-free-grunge-fonts.jpg" alt="bleeding-cowboys-free-grunge-fonts" width="570" height="186" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 6.&lt;a href="http://www.dafont.com/vtks-bandana.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;Bandana&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/vtks-bandana.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; b
ackground-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/bandana-free-grunge-fonts.jpg" alt="bandana-free-grunge-fonts" width="468" height="309" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 7.&lt;a href="http://www.dafont.com/pulse-sans.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;Pulse Sans Virgin&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/pulse-sans.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/pulse-free-grunge-fonts.jpg" alt="pulse-free-grunge-fonts" width="570" height="172" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 8.&lt;a href="http://www.dafont.com/loserboi-grunge.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;Loserboi Grunge&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/loserboi-grunge.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: tr
ansparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/loserboi-free-grunge-fonts.jpg" alt="loserboi-free-grunge-fonts" width="570" height="111" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 9.&lt;a href="http://www.dafont.com/docteur-atomic.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;Docteur Atomic&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/docteur-atomic-free-grunge-fonts.jpg" alt="docteur-atomic-free-grunge-fonts" width="496" height="216" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 11.&lt;a href="http://www.dafont.com/the-king-queen-font.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;The King &amp; Queen font&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/the-king-queen-font.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-p
osition: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/king-and-queen-free-grunge-fonts.jpg" alt="king-and-queen-free-grunge-fonts" width="570" height="127" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 12.&amp;nbsp;&lt;a href="http://www.dafont.com/everyday-ghost.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Everyday Ghost&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/everyday-ghost.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/everyday-ghost-free-grunge-fonts.jpg" alt="everyday-ghost-free-grunge-fonts" width="570" height="118" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 13.&amp;nbsp;&lt;a href="http://www.dafont.com/abusive-pencil.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Abusive Pencil&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/abusive-pencil.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; backgroun
d-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/abusive-pencil-free-grunge-fonts.jpg" alt="abusive-pencil-free-grunge-fonts" width="570" height="242" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 14.&amp;nbsp;&lt;a href="http://www.dafont.com/times-new-yorker.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Times New Yorker&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/times-new-yorker.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/times-new-yorker-free-grunge-fonts.jpg" alt="times-new-yorker-free-grunge-fonts" width="570" height="324" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 15.&amp;nbsp;&lt;a href="http://www.dafont.com/soulmission.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Soul Mission&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/soulmission.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style:
none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/soul-mission-free-grunge-fonts.jpg" alt="soul-mission-free-grunge-fonts" width="570" height="188" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 16.&amp;nbsp;&lt;a href="http://www.dafont.com/inked-god.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Inked God&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/inked-god.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/inked-god-free-grunge-fonts.jpg" alt="inked-god-free-grunge-fonts" width="570" height="275" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 17.&amp;nbsp;&lt;a href="http://www.dafont.com/ginga.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Ginga&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/ginga.font" target="_blank" style="margin-top: 0px; margin-right: 0px
; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/ginga-free-grunge-fonts.jpg" alt="ginga-free-grunge-fonts" width="570" height="337" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 18.&amp;nbsp;&lt;a href="http://www.dafont.com/ascent-2-stardom.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Ascent 2 Stardom&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/ascent-2-stardom.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/ascent-free-grunge-fonts.jpg" alt="ascent-free-grunge-fonts" width="570" height="328" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 19.&amp;nbsp;&lt;a href="http://www.dafont.com/chicago-house-trial.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Chicago House&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: i
nitial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/chicago-house-trial.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/chicago-house-free-grunge-fonts.jpg" alt="chicago-house-free-grunge-fonts" width="345" height="210" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 20.&amp;nbsp;&lt;a href="http://www.dafont.com/black-oak.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Black Oak&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/black-oak.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/black-oak-free-grunge-fonts.jpg" alt="black-oak-free-grunge-fonts" width="570" height="242" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 21.&amp;nbsp;&lt;a href="http://www.dafont.com/vtks-scrubbed.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">VTKS Scrubbled&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-
bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/vtks-scrubbed.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/vtks-scrubbed-free-grunge-fonts.jpg" alt="vtks-scrubbed-free-grunge-fonts" width="570" height="337" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 22.&amp;nbsp;&lt;a href="http://www.dafont.com/charles-s.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Charles S.&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/charles-s.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/charles-s-free-grunge-fonts.jpg" alt="charles-s-free-grunge-fonts" width="570" height="195" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 23.&amp;nbsp;&lt;a href="http://www.dafont.com/28-days-later.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent;
border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">28 Days Later&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/28-days-later.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/28-days-later-free-grunge-fonts.jpg" alt="28-days-later-free-grunge-fonts" width="570" height="94" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 24.&amp;nbsp;&lt;a href="http://www.dafont.com/angelic-war.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Angelic War&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/angelic-war.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/angelic-war-free-grunge-fonts.jpg" alt="angelic-war-free-grunge-fonts" width="570" height="114" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 25.&amp;nbsp;&lt;a href="http://www.dafont.com/capture-it.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bot
tom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Capture IT&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/capture-it.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/capture-it-free-grunge-fonts.jpg" alt="capture-it-free-grunge-fonts" width="570" height="173" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 26.&amp;nbsp;&lt;a href="http://www.dafont.com/dirt2-soulstalker.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Dirt2 SoulStalker&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/dirt2-soulstalker.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/dirt-soulstalker-free-grunge-fonts.jpg" alt="dirt-soulstalker-free-grunge-fonts" width="570" height="114" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 27.&amp;nbsp;&lt;a href="http://www.dafont.com/trashco.font" target="_blank" style="margi
n-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Trashco&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/trashco.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/trashco-free-grunge-fonts.jpg" alt="trashco-free-grunge-fonts" width="570" height="156" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 28.&amp;nbsp;&lt;a href="http://www.dafont.com/hawaii-lover.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Hawaii Lover&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/hawaii-lover.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/hawaii-lover-free-grunge-fonts.jpg" alt="hawaii-lover-free-grunge-fonts" width="570" height="137" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style
: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 29.&amp;nbsp;&lt;a href="http://www.dafont.com/broken-ghost.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Broken Ghost&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/broken-ghost.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/broken-ghost-free-grunge-fonts.jpg" alt="broken-ghost-free-grunge-fonts" width="570" height="203" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 30.&amp;nbsp;&lt;a href="http://www.dafont.com/laundromat-1967.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Laundromat 1967&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/laundromat-1967.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/laundromat-1967-free-grunge-fonts.jpg" alt="laundromat-1967-free-grunge-fonts" width="570" height="102" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a
>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 31.&amp;nbsp;&lt;a href="http://www.dafont.com/the-last-soundtrack.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">The Last Soundtrack&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/the-last-soundtrack.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/the-last-soundtrack-free-grunge-fonts.jpg" alt="the-last-soundtrack-free-grunge-fonts" width="570" height="242" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 32.&amp;nbsp;&lt;a href="http://www.urbanfonts.com/fonts/Aenima.htm" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Aenima&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.urbanfonts.com/fonts/Aenima.htm" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/aenima-free-grunge-fonts.jpg" alt="aenima-free-grunge-fonts" width="435" height="186" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color:
initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 33.&amp;nbsp;&lt;a href="http://www.urbanfonts.com/fonts/alias.htm" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Alias&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.urbanfonts.com/fonts/alias.htm" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/alias-free-grunge-fonts.jpg" alt="alias-free-grunge-fonts" width="492" height="213" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 34.&amp;nbsp;&lt;a href="http://www.dafont.com/dirty-and-classic.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Dirty and Classic&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/dirty-and-classic.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/dirty-and-classic-free-grunge-fonts.jpg" alt="dirty-and-classic-free-grunge-fonts" width="570" height="277" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding
-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 35.&amp;nbsp;&lt;a href="http://www.dafont.com/rough-linen.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Rough Linen&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/rough-linen.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/rough-linen-free-grunge-fonts.jpg" alt="rough-linen-free-grunge-fonts" width="570" height="188" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 36.&amp;nbsp;&lt;a href="http://www.dafont.com/epoxy-history.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Epoxy History&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/epoxy-history.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; c
ursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/epoxy-history-free-grunge-fonts.jpg" alt="epoxy-history-free-grunge-fonts" width="570" height="180" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 37.&amp;nbsp;&lt;a href="http://www.dafont.com/defused.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Defused&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/defused.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/defused-free-grunge-fonts.jpg" alt="defused-free-grunge-fonts" width="400" height="197" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 38.&amp;nbsp;&lt;a href="http://www.dafont.com/dirty-ames.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Dirty Ames&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/dirty-ames.font" target="_blank" style="margin-top: 0
px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/dirty-ames-free-grunge-fonts.jpg" alt="dirty-ames-free-grunge-fonts" width="378" height="378" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 39.&amp;nbsp;&lt;a href="http://www.dafont.com/desperado.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Desperado&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/desperado.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/desperado-free-grunge-fonts.jpg" alt="desperado-free-grunge-fonts" width="400" height="167" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 40.&amp;nbsp;&lt;a href="http://www.dafont.com/idiot.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Idiot&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/idiot.font" target="_blank" style
="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/idiot-free-grunge-fonts.jpg" alt="idiot-free-grunge-fonts" width="399" height="111" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 41.&amp;nbsp;&lt;a href="http://www.dafont.com/sidewalk.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">SideWalk&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/sidewalk.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/side-walk-free-grunge-fonts.jpg" alt="side-walk-free-grunge-fonts" width="570" height="359" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 42.&lt;a href="http://www.dafont.com/birth-of-a-hero.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;Birth of a Hero&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; backgrou
nd-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/birth-of-a-hero.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/birth-of-hero-free-grunge-fonts.jpg" alt="birth-of-hero-free-grunge-fonts" width="425" height="362" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 43.&lt;a href="http://www.dafont.com/blackcasper.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&amp;nbsp;BlackCasper&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/blackcasper.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/black-casper-free-grunge-fonts.jpg" alt="black-casper-free-grunge-fonts" width="570" height="144" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 44.&amp;nbsp;&lt;a href="http://www.dafont.com/northwood-high.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration:
none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Northwood High&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/northwood-high.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/northwood-high-free-grunge-fonts.jpg" alt="northwood-high-free-grunge-fonts" width="570" height="123" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 45.&amp;nbsp;&lt;a href="http://www.dafont.com/cheap-stealer.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Cheap Stealer&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/cheap-stealer.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/cheap-stealer-free-grunge-fonts.jpg" alt="cheap-stealer-free-grunge-fonts" width="570" height="326" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 46.&amp;nbsp;&lt;a href="http://www.dafont.com/cocaine-sans.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right:
0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Cocaine Sans&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/cocaine-sans.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/cocaine-sans-free-grunge-fonts.jpg" alt="cocaine-sans-free-grunge-fonts" width="570" height="104" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 47.&amp;nbsp;&lt;a href="http://www.dafont.com/hard-rock.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Hard Rock&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/hard-rock.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/hard-rock-free-grunge-fonts.jpg" alt="hard-rock-free-grunge-fonts" width="570" height="330" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color:
initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 48.&amp;nbsp;&lt;a href="http://www.dafont.com/chic-decay.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Chic Decay&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/chic-decay.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/chic-decay-free-grunge-fonts.jpg" alt="chic-decay-free-grunge-fonts" width="570" height="175" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 49.&amp;nbsp;&lt;a href="http://keepwaiting.deviantart.com/art/Dirt2Death-Font-102951487" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Dirt2Death Font&lt;/a>&amp;nbsp;by&amp;nbsp;&lt;a href="http://keepwaiting.deviantart.com/" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">KeepWaiting&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://keepwaiting.deviantart.com/art/Dirt2Death-Font-102951487" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/dirt-2-death-free-grunge-fonts.jpg" alt="dirt-2-death-free-grunge-fonts" width="498" height="291" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; b
ackground-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 50.&amp;nbsp;&lt;a href="http://www.dafont.com/heroin-07.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Heroin 07&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/heroin-07.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/heroin-07-free-grunge-fonts.jpg" alt="heroin-07-free-grunge-fonts" width="399" height="266" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 51.&amp;nbsp;&lt;a href="http://www.dafont.com/street-blues-trial.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Street Blues Trial&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/street-blues-trial.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/street-blues-free-grunge-fonts.jpg" alt="street-blues-free-grunge-fonts" width="570" height="92" style="margin-to
p: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 52.&amp;nbsp;&lt;a href="http://www.dafont.com/turbo-ripped.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Turbo Ripped&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/turbo-ripped.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/turbo-ripped-free-grunge-fonts.jpg" alt="turbo-ripped-free-grunge-fonts" width="570" height="261" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 53.&amp;nbsp;&lt;a href="http://www.dafont.com/neoprint-m319.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">NeoPrint M319&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/neoprint-m319.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/neoprint-free-grunge-fonts.jpg" alt="neoprint-free-grunge-fonts" width="570" height="118" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width:
initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 54.&amp;nbsp;&lt;a href="http://www.dafont.com/84-rock.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">84 Rock&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/84-rock.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/84-rock-free-grunge-fonts.jpg" alt="84-rock-free-grunge-fonts" width="398" height="297" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 55.&amp;nbsp;&lt;a href="http://www.dafont.com/a-bite.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">A Bite&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/a-bite.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initi
al; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/a-bite-free-grunge-fonts.jpg" alt="a-bite-free-grunge-fonts" width="570" height="276" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 56.&amp;nbsp;&lt;a href="http://www.bittbox.com/freebies/bb-free-font-fusty-saddle" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">BB Fusty Saddle&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.bittbox.com/freebies/bb-free-font-fusty-saddle" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/fusty-saddle-free-grunge-fonts.jpg" alt="fusty-saddle-free-grunge-fonts" width="464" height="265" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 57.&amp;nbsp;&lt;a href="http://www.bittbox.com/freebies/bb-petie-boy" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">BB Petie Boy&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.bittbox.com/freebies/bb-petie-boy" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; bo
rder-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/petie-boy-free-grunge-fonts.jpg" alt="petie-boy-free-grunge-fonts" width="462" height="294" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 58.&amp;nbsp;&lt;a href="http://www.dafont.com/rusted-plastic.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Rusted Plastic&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/rusted-plastic.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/rusted-plastic-free-grunge-fonts.jpg" alt="rusted-plastic-free-grunge-fonts" width="570" height="211" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 59.&amp;nbsp;&lt;a href="http://www.urbanfonts.com/fonts/Bill_Hicks.htm" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Bill Hicks&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.urbanfonts.com/fonts/Bill_Hicks.htm" target="_blank
" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/bill-hicks-free-grunge-fonts.jpg" alt="bill-hicks-free-grunge-fonts" width="570" height="123" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 60.&amp;nbsp;&lt;a href="http://www.dafont.com/10minutes.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">10 Minutes&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/10minutes.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/10-minutes-free-grunge-fonts.jpg" alt="10-minutes-free-grunge-fonts" width="570" height="92" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 61.&amp;nbsp;&lt;a href="http://www.urbanfonts.com/fonts/2Peas_Billboard.htm" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">2Peas Billboard&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; back
ground-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.urbanfonts.com/fonts/2Peas_Billboard.htm" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/2peas-billboard-free-grunge-fonts.jpg" alt="2peas-billboard-free-grunge-fonts" width="570" height="118" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 62.&amp;nbsp;&lt;a href="http://www.vtks.com.br/freefonts.html" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Caveirada&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.vtks.com.br/freefonts.html" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/caveirada-free-grunge-fonts.jpg" alt="caveirada-free-grunge-fonts" width="391" height="198" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 63.&amp;nbsp;&lt;a href="http://www.vtks.com.br/freefonts.html" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-co
lor: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Choice&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.vtks.com.br/freefonts.html" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/choice-free-grunge-fonts.jpg" alt="choice-free-grunge-fonts" width="391" height="198" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 64.&amp;nbsp;&lt;a href="http://www.vtks.com.br/freefonts.html" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">No Signal&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.vtks.com.br/freefonts.html" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/no-signal-free-grunge-fonts.jpg" alt="no-signal-free-grunge-fonts" width="391" height="198" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 65.&amp;nbsp;&lt;a href="http://www.dafont.com/vtks-untitled.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-b
ottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Untitled&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/vtks-untitled.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/untitled-free-grunge-fonts.jpg" alt="untitled-free-grunge-fonts" width="391" height="198" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 66.&amp;nbsp;&lt;a href="http://www.bittbox.com/fonts/bb-free-font-23rd-street-demo-version" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">23rd Street Demo Version&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.bittbox.com/fonts/bb-free-font-23rd-street-demo-version" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/23rd-street-free-grunge-fonts.jpg" alt="23rd-street-free-grunge-fonts" width="484" height="189" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-l
eft-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 67.&amp;nbsp;&lt;a href="http://www.dafont.com/fail.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Fail&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/fail.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/fail-free-grunge-fonts.jpg" alt="fail-free-grunge-fonts" width="244" height="144" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 68.&amp;nbsp;&lt;a href="http://www.dafont.com/vtks-revolt.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Vtks Revolt&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/vtks-revolt.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/vtks-revolt-free-grunge-fonts.jpg" alt="vtks-revolt-free-grunge-fonts" width="419" height="372" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top:
0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 69.&amp;nbsp;&lt;a href="http://www.dafont.com/vtks-refused.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">VTKS Refused&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/vtks-refused.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/vtks-refused-free-grunge-fonts.jpg" alt="vtks-refused-free-grunge-fonts" width="468" height="292" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 70.&amp;nbsp;&lt;a href="http://www.dafont.com/vtks-hardness.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Vtks Hardness&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/vtks-hardness.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/vtks-hardness-free-grunge-fonts.jpg" alt="vtks-hardness-free-grunge-fonts" width="468" height="177" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important;
border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 71.&amp;nbsp;&lt;a href="http://www.dafont.com/malgecito.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Malgecito&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/malgecito.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/malgecito-free-grunge-fonts.jpg" alt="malgecito-free-grunge-fonts" width="505" height="112" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/h2>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 72.&amp;nbsp;&lt;a href="http://www.dafont.com/waste-of-paint.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Waste Of Paint&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/waste-of-paint.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/waste-of-paint-free-grunge-fonts.jpg" alt="waste-of-paint-free-grunge-fonts" width="570" height="89" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; bo
rder-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 73.&amp;nbsp;&lt;a href="http://www.dafont.com/distorted-and-scrat.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Distorted and Scratchy&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/distorted-and-scrat.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/distorted-and-scratchy-free-grunge-fonts.jpg" alt="distorted-and-scratchy-free-grunge-fonts" width="570" height="71" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 74.&amp;nbsp;&lt;a href="http://www.dafont.com/monomadness.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Mono Madness&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://www.dafont.com/monomadness.font" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/mono-madness-free-grunge-fonts.jpg" alt="mono-madness-free-grunge-fonts" width="570" height="297" style="margin-top: 0px; margin-right: 0px;
margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 75.&amp;nbsp;&lt;a href="http://keepwaiting.deviantart.com/art/PlagueDeath-ttf-FONT-36787878" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">PlagueDeath&lt;/a>&amp;nbsp;by&amp;nbsp;&lt;a href="http://keepwaiting.deviantart.com/" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">KeepWaiting&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://keepwaiting.deviantart.com/art/PlagueDeath-ttf-FONT-36787878" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/plague-death-free-grunge-fonts.jpg" alt="plague-death-free-grunge-fonts" width="395" height="298" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 76.&amp;nbsp;&lt;a href="http://bobsmade.deviantart.com/art/bobsmade-font-60278115" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">bobsmade font&amp;nbsp;&lt;/a>by&amp;nbsp;&lt;a href="http://bobsmade.deviantart.com/" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; backgr
ound-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">Bobsmade&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://bobsmade.deviantart.com/art/bobsmade-font-60278115" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: underline; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/bobsmade-font-free-grunge-fonts.jpg" alt="bobsmade-font-free-grunge-fonts" width="570" height="291" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-color: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;h2 style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 1.7em; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; font-style: normal; font-weight: normal; font-family: 'Palatino Linotype', Georgia, Times, 'Times New Roman', serif; color: rgb(68, 68, 68); background-position: initial initial; background-repeat: initial initial; "> 77.&amp;nbsp;&lt;a href="http://keepwaiting.deviantart.com/art/DEAD-SECRETARY-FONT-96256842" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">DEAD SECRETARY FONT&lt;/a>&amp;nbsp;by&amp;nbsp;&lt;a href="http://keepwaiting.deviantart.com/" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 22px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">KeepWaiting&lt;/a>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 25px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; background-position: initial initial; background-repeat: initial initial; "> &lt;a href="http://keepwaiting.deviantart.com/art/DEAD-SECRETARY-FONT-96256842" target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; text-decoration: none; cursor: pointer; color: rgb(51, 102, 153); background-position: initial initial; background-repeat: initial initial; ">&lt;img src="http://www.1stwebdesigner.com/wp-content/uploads/2009/09/extreme-grunge-fonts/dead-secretary-free-grunge-fonts.jpg" alt="dead-secretary-free-grunge-fonts" width="398" height="291" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; vertical-align: baseline; outline-style: none; outline-width: initial; outline-color: initial; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-width: initial; border-color: initial; text-decoration: none; max-width: 600px; border-top-width: 2px !important; border-right-width: 2px !important; border-bottom-width: 2px !important; border-left-width: 2px !important; border-top-color: rgb(160, 159, 159) !important; border-right-color: rgb(160, 159, 159) !important; border-bottom-c
olor: rgb(160, 159, 159) !important; border-left-color: rgb(160, 159, 159) !important; background-position: initial initial; background-repeat: initial initial; " />&lt;/a>&lt;/p>
&lt;p> &lt;/span>&lt;/h2>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 原文地址：&lt;a title="76 Dirty, Extreme And Creative Free Grunge Fonts" rel="bookmark" style="color: rgb(4, 99, 128); text-decoration: none; font-weight: 700; " href="http://www.1stwebdesigner.com/design/76-dirty-extreme-and-creative-free-grunge-fonts/">76 Dirty, Extreme And Creative Free Grunge Fonts&lt;/a> &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &amp;nbsp; &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 来源：&lt;a href="http://www.nethobo.com/2009/09/27/76-dirty-extreme-and-creative-mess-free-fonts/" target="_blank">76个脏、极端并且有创意的免费脏乱字体&lt;/a> &lt;/p>
&lt;p> &amp;nbsp; &lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/%E5%AD%97%E4%BD%93/">字体</category><category domain="https://fatkun.github.io/tags/%E8%8B%B1%E6%96%87%E5%AD%97%E4%BD%93/">英文字体</category></item><item><title>央视:谷歌涉嫌大范围侵犯中文图书著作权</title><link>https://fatkun.github.io/2009/10/%E5%A4%AE%E8%A7%86%E8%B0%B7%E6%AD%8C%E6%B6%89%E5%AB%8C%E5%A4%A7%E8%8C%83%E5%9B%B4%E4%BE%B5%E7%8A%AF%E4%B8%AD%E6%96%87%E5%9B%BE%E4%B9%A6%E8%91%97%E4%BD%9C%E6%9D%83.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E5%A4%AE%E8%A7%86%E8%B0%B7%E6%AD%8C%E6%B6%89%E5%AB%8C%E5%A4%A7%E8%8C%83%E5%9B%B4%E4%BE%B5%E7%8A%AF%E4%B8%AD%E6%96%87%E5%9B%BE%E4%B9%A6%E8%91%97%E4%BD%9C%E6%9D%83.html</guid><pubDate>Tue, 13 Oct 2009 19:41:41 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2524/4006716801_33fec77fd9_o.jpg" alt="" title="" />
**10月13日，央视在今天的《朝闻天下》栏目中报道，谷歌数字图书馆涉嫌大范围侵权中文图书，从中国文字著作权协会获悉，570位权利人17922部作品在未经授权已被谷歌扫描上网。**
中国文字著作权协会相关负责人表示，这570位包括国家领导人、政府官员和作家在内的权利人对此毫不知情，且没有证据表明谷歌公司取得了权利人的授权。法学专家认为，谷歌的这种未经许可的复制和网络转载的行为均涉嫌侵犯著作权
&lt;p>&lt;strong>10月13日，央视在今天的《朝闻天下》栏目中报道，谷歌数字图书馆涉嫌大范围侵权中文图书，从中国文字著作权协会获悉，570位权利人17922部作品在未经授权已被谷歌扫描上网。&lt;/strong>&lt;br>
中国文字著作权协会相关负责人表示，这570位包括国家领导人、政府官员和作家在内的权利人对此毫不知情，且没有证据表明谷歌公司取得了权利人的授权。法学专家认为，谷歌的这种未经许可的复制和网络转载的行为均涉嫌侵犯著作权。&lt;br>
中国文字著作权协会相关负责人还表示，由于谷歌强势霸道的态度，目前与谷歌总部方面的协商并无结果，中国文字著作权协会正在与知识产权专家协商下一步的维权行动。（完）&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2524/4006716801_33fec77fd9_o.jpg" alt="" title="" />&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://farm3.static.flickr.com/2482/4007482862_6e36a4f1da_o.jpg" alt="" title="" />&lt;br>
来源：&lt;a href="http://www.cnbeta.com/articles/95402.htm" target="_blank">cnbeta&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/cctv/">CCTV</category><category domain="https://fatkun.github.io/tags/google/">Google</category><category domain="https://fatkun.github.io/tags/%E5%A4%AE%E8%A7%86/">央视</category><category domain="https://fatkun.github.io/tags/%E8%B0%B7%E6%AD%8C/">谷歌</category><category domain="https://fatkun.github.io/tags/%E8%B0%B7%E6%AD%8C%E5%BE%88%E5%8F%97%E4%BC%A4/">谷歌很受伤</category></item><item><title>【原创】Z-blog插件-SyntaxHighlighter for Z-blog代码高亮0.2版</title><link>https://fatkun.github.io/2009/10/%E3%80%90%E5%8E%9F%E5%88%9B%E3%80%91z-blog%E6%8F%92%E4%BB%B6-syntaxhighlighter-for-z-blog%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE0-2%E7%89%88.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E3%80%90%E5%8E%9F%E5%88%9B%E3%80%91z-blog%E6%8F%92%E4%BB%B6-syntaxhighlighter-for-z-blog%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE0-2%E7%89%88.html</guid><pubDate>Tue, 13 Oct 2009 02:27:45 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>Z-blog里面的代码高亮插件(Highlight)已经是很久以前的了，作为一个写代码的人怎么可以没有代码高亮，让看代码的人舒服一点。现在是0.2版，可能还有很多问题。插件是把Highlight改的，改了来适应SyntaxHighlighter的使用，才用Z-BLOG差不多一个月，还没研究过怎么写插件，不过使用起来已经很好了。&lt;/p>
&lt;p>&lt;strong>SyntaxHighlighter&lt;/strong>是一个很多人使用的代码高亮JS工具，项目地址是&lt;a href="http://code.google.com/p/syntaxhighlighter/" target="_blank">&lt;a href="http://code.google.com/p/syntaxhighlighter/">http://code.google.com/p/syntaxhighlighter/&lt;/a>&lt;/a>，本插件使用的是2.0版本。&lt;br>
Z-blog里面的代码高亮插件(Highlight)已经是很久以前的了，作为一个写代码的人怎么可以没有代码高亮，让看代码的人舒服一点。现在是0.2版，一堆语言解析，好强大，可是做插件时累坏我，文件太多了可能还有问题。插件是把Highlight改的，改了来适应SyntaxHighlighter的使用，才用Z-BLOG差不多一个月，还没研究过怎么写插件。&lt;br>
以前也写过&lt;a href="http://blog.fatkun.com/view.asp?id=12" target="_blank">在Z-Blog上使用SyntaxHighlighter1.5（代码高亮，不复制行号）修改方法&lt;/a>，但是不是插件，修改起来麻烦，也不方便。&lt;br>
&lt;strong>更新后记住要“文件重建”&lt;/strong>&lt;br>
&lt;a href="http://blog.fatkun.com/SyntaxHighlighter.rar" target="_blank">&lt;font size="4">&lt;b>0.2版点击此下载&lt;/b>&lt;/font>&lt;/a>&lt;br>
&lt;strong>更新信息&lt;/strong>&lt;br>
0.2 版&lt;/p>
&lt;ul>
&lt;li>管理页面，能选择需要解析的语言。&lt;br>
0.1 alpha版&lt;br>
基础版本&lt;br>
&lt;strong>当前已知的问题&lt;/strong>&lt;/li>
&lt;/ul>
&lt;blockquote>
&lt;p>1，插件没有配置页面，所以把所有JS都加载（0.2版已解决）
&lt;strong>使用方法&lt;/strong>&lt;br>
&lt;strong>[&lt;span />code=&lt;strong>这里填写语言，例如html、C#等&lt;/strong>]&lt;strong>这里写代码&lt;/strong>[/code]&lt;/strong>&lt;br>
&lt;strong>下面是代码演示&lt;/strong>&lt;/p>
&lt;/blockquote>
&lt;pre class="brush:html;">&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&amp;gt;
&amp;lt;title&amp;gt;SyntaxHighlighter Build Test Page&amp;lt;/title&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shCore.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushBash.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushCpp.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushCSharp.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushCss.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushDelphi.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushDiff.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushGroovy.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushJava.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushJScript.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushPhp.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushPlain.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushPython.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushRuby.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushScala.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushSql.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushVb.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="scripts/shBrushXml.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;link type="text/css" rel="stylesheet" href="styles/shCore.css"/&amp;gt;
&amp;lt;link type="text/css" rel="stylesheet" href="styles/shThemeDefault.css"/&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
SyntaxHighlighter.config.clipboardSwf = 'scripts/clipboard.swf';
SyntaxHighlighter.all();
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body &amp;gt;
&amp;lt;h1&amp;gt;SyntaxHihglighter Test&amp;lt;/h1&amp;gt;
&amp;lt;p&amp;gt;This is a test file to insure that everything is working well.&amp;lt;/p&amp;gt;
&amp;lt;pre class="brush: c-sharp;"&amp;gt;
function test() : String
{
return 10;
}
&amp;lt;/pre&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/syntaxhighlighter/">SyntaxHighlighter</category><category domain="https://fatkun.github.io/tags/z-blog/">Z-Blog</category><category domain="https://fatkun.github.io/tags/%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE/">代码高亮</category><category domain="https://fatkun.github.io/tags/%E6%8F%92%E4%BB%B6/">插件</category></item><item><title>第一次使用Flickr.com【7P】</title><link>https://fatkun.github.io/2009/10/%E7%AC%AC%E4%B8%80%E6%AC%A1%E4%BD%BF%E7%94%A8flickr-com%E3%80%907p%E3%80%91.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E7%AC%AC%E4%B8%80%E6%AC%A1%E4%BD%BF%E7%94%A8flickr-com%E3%80%907p%E3%80%91.html</guid><pubDate>Mon, 12 Oct 2009 20:23:40 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;img src="http://farm4.static.flickr.com/3476/3999820551_90897a6c18.jpg" alt="">
博客也是刚建立不到一个月的时间。很多东西还不会~看到很多人都使用其他图库来存储图像，我想有几个原因： 节省博客占用的空间以及流量（一般合租国外虚拟主机流量都不多吧） 转移博客到其他主机方便。至少不需要把大量的图片转移。 放在其他图站速度更快。 无论是那个原因，找个适合的图站都非常重要。&lt;/p>
&lt;p>博客也是刚建立不到一个月的时间。很多东西还不会~看到很多人都使用其他图库来存储图像，我想有几个原因：&lt;/p>
&lt;blockquote>
&lt;ul>
&lt;li>节省博客占用的空间以及流量（一般合租国外虚拟主机流量都不多吧）&lt;/li>
&lt;li>转移博客到其他主机方便。至少不需要把大量的图片转移。&lt;/li>
&lt;li>放在其他图站速度更快。
无论是那个原因，找个适合的图站都非常重要。虽然我的站点现在放在godaddy.com的免费空间上(购买域名附带)，但是屏蔽它的广告用着总不安心，可能有一天就被收回了，而且强制加上的广告也很可恶（哎，穷人没办法呀，将就用呗），导致Wordpress很多问题出现，所以还是用Z-Blog好了。
不过使用图站也存在风险：&lt;/li>
&lt;li> 身在伟大的天朝，国外的网站随时有可能在天朝**被消失（G.F..W）**Flickr就曾经被和谐过&lt;/li>
&lt;li>当然，国内的也不能幸免，例如：饭否，叽歪 都在&lt;strong>被维护&lt;/strong>中
尽管如此，国内的博主不畏强权，英勇抗战，翻墙也要冲出世界。。。哎，&lt;strong>国事莫提，不谈政治&lt;/strong>！
既然这么多博主都使用&lt;a target="_blank" href="http://Flickr.com">Flickr.com&lt;/a>,那我也随大流使用呗。
 
贴几张图试试，使用中好像每次要找图片全尺寸静态链接都要打开图片所在的网页？有没有更方便的得到图片的地址？
另外要注意的是，如果图片上有链接，必须是要链接到Flickr.com的，协议上说滴。。。
&lt;img src="http://farm3.static.flickr.com/2673/3999821071_858c087db1_o.jpg" alt="">
 
&lt;img src="http://farm3.static.flickr.com/2658/3999820969_643b1b1dd1_o.jpg" alt="">
 
&lt;img src="http://farm4.static.flickr.com/3524/3999820825_24fd075d21_o.jpg" alt="">
 
&lt;img src="http://farm4.static.flickr.com/3519/3999820733_30af6d57d3_o.jpg" alt="">
 
&lt;img src="http://farm4.static.flickr.com/3484/3999820649_93bf91bd69_o.jpg" alt="">
 
&lt;img src="http://farm4.static.flickr.com/3476/3999820551_a74865757d_o.jpg" alt="">
 
&lt;img src="http://farm3.static.flickr.com/2430/4000586280_5e8116f1ae_o.jpg" alt="">
 
 &lt;/li>
&lt;/ul>
&lt;/blockquote></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/flickr/">Flickr</category><category domain="https://fatkun.github.io/tags/%E5%9B%BE%E7%89%87%E5%AD%98%E5%82%A8/">图片存储</category><category domain="https://fatkun.github.io/tags/%E7%85%A7%E7%89%87/">照片</category></item><item><title>人际心理学：如何拒绝别人的无理要求</title><link>https://fatkun.github.io/2009/10/%E4%BA%BA%E9%99%85%E5%BF%83%E7%90%86%E5%AD%A6%EF%BC%9A%E5%A6%82%E4%BD%95%E6%8B%92%E7%BB%9D%E5%88%AB%E4%BA%BA%E7%9A%84%E6%97%A0%E7%90%86%E8%A6%81%E6%B1%82.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E4%BA%BA%E9%99%85%E5%BF%83%E7%90%86%E5%AD%A6%EF%BC%9A%E5%A6%82%E4%BD%95%E6%8B%92%E7%BB%9D%E5%88%AB%E4%BA%BA%E7%9A%84%E6%97%A0%E7%90%86%E8%A6%81%E6%B1%82.html</guid><pubDate>Sat, 10 Oct 2009 15:15:27 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>我一般都很少拒绝别人的~~哎。。。就像《我的青春谁做主》那个高啥说的，被人抬上去下不来了，好人啊。 — fatkun&lt;br>
转个文章，希望拒绝别人也能处理好。&lt;br>
还有前一篇文章 &lt;a href="http://blog.fatkun.com/post/2009/10/38.html" target="_blank">如何应对生活中的拒绝！（表白、求婚被拒绝……）&lt;/a>&lt;br>
——————————-&lt;br>
　你是否希望有时能说不？很多人被迫同意每个请求，宁愿竭尽全力做事，也不愿拒绝帮忙，即使自己也没有时间。其实学会委婉的拒绝同样可以赢得周围人对你的尊敬。&lt;br>
…&lt;/p>
&lt;p>我一般都很少拒绝别人的~~哎。。。就像《我的青春谁做主》那个高啥说的，被人抬上去下不来了，好人啊。 — fatkun&lt;br>
转个文章，希望拒绝别人也能处理好。&lt;br>
还有前一篇文章 &lt;a href="http://blog.fatkun.com/post/2009/10/38.html" target="_blank">如何应对生活中的拒绝！（表白、求婚被拒绝……）&lt;/a>&lt;br>
——————————-&lt;br>
　你是否希望有时能说不？很多人被迫同意每个请求，宁愿竭尽全力做事，也不愿拒绝帮忙，即使自己也没有时间。其实学会委婉的拒绝同样可以赢得周围人对你的尊敬。&lt;br>
　　那么，为什么我们继续答应呢？这可能是因为我们相信，拒绝表示漠不关心，甚至自私，而我们可能害怕令别人灰心。此外，这可能是害怕被讨厌，批评，损害友情。&lt;br>
　　有趣的是，拒绝的能力与自信紧密联系。缺乏自信和自尊的人常常为拒绝别人而感到不安，而且有觉得别人的需求比自己的更重要的倾向。&lt;br>
　　或许有专横的父母或做了父母的人更有这一趋势。尤其是妇女，很容易落入“陷阱”。童年的影响是关键，已形成信念，如”我只有顺从和帮助别人，才能变得可爱” 。如果你觉得你已经成为一个”取悦别人”的人，你的自我价值的体现变得依靠为别人做事。恶性循环，使得你身边的人都希望你随时随地在他们身边，为他们服务。&lt;br>
　　不会拒绝让你疲惫，感到压迫和烦躁。不要等到你的能量耗尽时，才采取行动。&lt;br>
　　拒绝的技巧：&lt;br>
　　&lt;strong>保持简单回应&lt;/strong>。如果你要拒绝，坚决而直接。使用短语，如：“感谢你看得起我，但现在不方便”或”对不起，我不能帮忙”。尝试用你的身体语言强调不，不需过分道歉。记住，你不需允许才能拒绝。&lt;br>
　　&lt;strong>给自己一些时间&lt;/strong>。打破“是”循环，使用的短语“我会回到你的身边”，然后考虑你的选择。在空闲时考虑考虑，你会更有信心地拒绝。&lt;br>
　　&lt;strong>考虑一项妥协方案&lt;/strong>。如果你要同意这项请求，才采取这方法，但用限的时间或能力做。避免妥协，如果你真的想拒绝。&lt;br>
　　&lt;strong>区分拒绝与排斥&lt;/strong>。记得你是拒绝请求，而不是排斥一个人。通常人们都会明白，你有拒绝的权利，就像是他们有权利要求帮助。&lt;br>
　　&lt;strong>不要为拒绝你的孩子感到愧疚&lt;/strong>。他们有时被拒绝对他们是很重要，使他们更有自制力。这是成人世界里不可缺少的。不是不让他们抗议，而是让他们知道谁是负责设定界限。&lt;br>
　　&lt;strong>做回你自己&lt;/strong>。要明确和坦白什是么你真正想要的。更好地认识自己，找出什么是你在生活必需的。&lt;br>
来源 ： &lt;a href="http://www.izoan.cn/post/ruhejujuebieren-wuliyaoqiu.html" target="_blank">左岸读书&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category><category domain="https://fatkun.github.io/tags/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category><category domain="https://fatkun.github.io/tags/%E6%8B%92%E7%BB%9D/">拒绝</category></item><item><title>JSP实验二-JSP从Request获取值</title><link>https://fatkun.github.io/2009/10/jsp%E5%AE%9E%E9%AA%8C%E4%BA%8C-jsp%E4%BB%8Erequest%E8%8E%B7%E5%8F%96%E5%80%BC.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/jsp%E5%AE%9E%E9%AA%8C%E4%BA%8C-jsp%E4%BB%8Erequest%E8%8E%B7%E5%8F%96%E5%80%BC.html</guid><pubDate>Sat, 10 Oct 2009 04:18:48 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>把这两个文件放入服务器的目录里就可以了，忘记放哪里了？没关系，看这里&lt;a href="http://blog.fatkun.com/view.asp?id=16" target="_blank">JBOSS把网页文件放入哪里&lt;/a>&lt;br>
注意这句代码“request.setCharacterEncoding(“GBK”);”不然会导致接收过来的乱码的&lt;/p>
&lt;p>把这两个文件放入服务器的目录里就可以了，忘记放哪里了？没关系，看这里&lt;a href="http://blog.fatkun.com/view.asp?id=16" target="_blank">JBOSS把网页文件放入哪里&lt;/a>&lt;br>
注意这句代码“request.setCharacterEncoding(“GBK”);”不然会导致接收过来的乱码的&lt;br>
index.html文件&lt;/p>
&lt;pre class="brush:&amp;quot;html&amp;quot;;">&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=GBK"&amp;gt;
&amp;lt;title&amp;gt;Insert title here&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form action="request.jsp" method="post"&amp;gt;
文本框:&amp;lt;input type="text" name="txt" /&amp;gt;&amp;lt;br/&amp;gt;
单选按钮：&amp;lt;input type="radio" name="rd" value="男" /&amp;gt;男
&amp;lt;input type="radio" name="rd" value="女" /&amp;gt;女&amp;lt;br/&amp;gt;
多选按钮：&amp;lt;input type="checkbox" name="chb" value="大方" /&amp;gt;大方
&amp;lt;input type="checkbox" name="chb" value="体贴" /&amp;gt;体贴
&amp;lt;input type="checkbox" name="chb" value="热情" /&amp;gt;热情
&amp;lt;br/&amp;gt;
大文本框：&amp;lt;textarea rows="8" cols="30" name="memo"&amp;gt;&amp;lt;/textarea&amp;gt;&amp;lt;br/&amp;gt;
选择框：
&amp;lt;select name="sel"&amp;gt;
&amp;lt;option value="北京"&amp;gt;北京&amp;lt;/option&amp;gt;
&amp;lt;option value="上海"&amp;gt;上海&amp;lt;/option&amp;gt;
&amp;lt;/select&amp;gt;
&amp;lt;br/&amp;gt;
&amp;lt;input type="submit" value="提交" /&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre>
&lt;p>request.jsp文件&lt;/p>
&lt;pre class="brush:&amp;quot;java&amp;quot;;">&amp;lt;%@ page language="java" contentType="text/html; charset=GBK"
pageEncoding="GBK"%&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=GBK"&amp;gt;
&amp;lt;title&amp;gt;Insert title here&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;%
request.setCharacterEncoding("GBK");//设置编码
out.println("文本框内容是："+request.getParameter("txt"));
out.println("&amp;lt;br/&amp;gt;");
out.println("单选框内容是："+request.getParameter("rd"));
out.println("&amp;lt;br/&amp;gt;");
out.println("多选框内容是："+request.getParameter("chb"));
out.println("&amp;lt;br/&amp;gt;");
out.println("大文本框内容是："+request.getParameter("memo"));
out.println("&amp;lt;br/&amp;gt;");
out.println("选择框内容是："+request.getParameter("sel"));
%&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/jsp%E5%AE%9E%E9%AA%8C/">JSP实验</category></item><item><title>谷歌向部分用户推超简洁页面</title><link>https://fatkun.github.io/2009/10/%E8%B0%B7%E6%AD%8C%E5%90%91%E9%83%A8%E5%88%86%E7%94%A8%E6%88%B7%E6%8E%A8%E8%B6%85%E7%AE%80%E6%B4%81%E9%A1%B5%E9%9D%A2.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E8%B0%B7%E6%AD%8C%E5%90%91%E9%83%A8%E5%88%86%E7%94%A8%E6%88%B7%E6%8E%A8%E8%B6%85%E7%AE%80%E6%B4%81%E9%A1%B5%E9%9D%A2.html</guid><pubDate>Fri, 09 Oct 2009 11:01:53 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/10/200910090320324111.jpg" alt="" title="" />
&amp;nbsp;谷歌已开始对小众用户推出一个新的实验性页面,页面上只有谷歌的标志和一个搜索框,此举将这个搜索大鳄的极简主义表现到了极致.只有当你移动鼠标的时候,搜索框才会出现导航选项.目前谷歌页面上的文字超过了30个.谷歌在10月8日早上(当地时间)发布了一个特殊的代码,用户可以复制该代码,粘贴到浏览器中,然后就可以使用一个简化的页面设计.。。
&lt;p> &lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">谷歌已开始对小众用户推出一个新的实验性页面,页面上只有谷歌的标志和一个搜索框,此举将这个搜索大鳄的极简主义表现到了极致.&lt;/strong>&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 只有当你移动鼠标的时候,搜索框才会出现导航选项.目前谷歌页面上的文字超过了30个.谷歌在10月8日早上(当地时间)发布了一个特殊的代码,用户可以复制该代码,粘贴到浏览器中,然后就可以使用一个简化的页面设计.&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &amp;nbsp;&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 首先打开&lt;a style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; " href="http://www.google.com/">google.com&lt;/a>首页（不能是.cn），然后复制以下代码到地址栏里，回车。之后刷新一下当前页面，就是了。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> javascript:void(document.cookie="PREF=ID=abac7a90f5a3784b:LD=en:NR=10:TM=1254990196:LM=1254990236:S=uB6F4jDnMP_DuxtT;path=/; domain=.google.com");&lt;/p>
&amp;nbsp;
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &amp;nbsp;&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/10/200910090320324111.jpg" alt="" title="" />&lt;br /> &lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />但是用这个代码生成的页面还包括&amp;ldquo;google搜索&amp;rdquo;和&amp;ldquo;手气不错&amp;rdquo;两个按键.对于完美的极简主义者来说,这两个按键还是瑕疵.&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />外国媒体还公布了一个将这两个键都去掉的方法.但是不一定适用所有的浏览器.&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &amp;nbsp;&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 来源：&lt;a target="_blank" href="http://www.cnbeta.com/articles/95163.htm">www.cnbeta.com/articles/95163.htm&lt;/a>&lt;/p>
&amp;nbsp;</description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/google/">Google</category><category domain="https://fatkun.github.io/tags/%E7%AE%80%E6%B4%81/">简洁</category></item><item><title>如何应对生活中的拒绝！（表白、求婚被拒绝……）</title><link>https://fatkun.github.io/2009/10/%E5%A6%82%E4%BD%95%E5%BA%94%E5%AF%B9%E7%94%9F%E6%B4%BB%E4%B8%AD%E7%9A%84%E6%8B%92%E7%BB%9D%EF%BC%81%EF%BC%88%E8%A1%A8%E7%99%BD%E3%80%81%E6%B1%82%E5%A9%9A%E8%A2%AB%E6%8B%92%E7%BB%9D%E2%80%A6%E2%80%A6.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E5%A6%82%E4%BD%95%E5%BA%94%E5%AF%B9%E7%94%9F%E6%B4%BB%E4%B8%AD%E7%9A%84%E6%8B%92%E7%BB%9D%EF%BC%81%EF%BC%88%E8%A1%A8%E7%99%BD%E3%80%81%E6%B1%82%E5%A9%9A%E8%A2%AB%E6%8B%92%E7%BB%9D%E2%80%A6%E2%80%A6.html</guid><pubDate>Fri, 09 Oct 2009 09:43:24 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>左岸以前有都大家如何拒绝别人的无理要求，《人际心理学——如何拒绝别人的无理要求 》，生活中，每个人都会遇到拒绝，这是不可避免的，被拒绝的原因也是各种各样的。你可能会在应聘职位的时候被拒绝，求婚的时候被拒绝或者要求老板给你加薪的时候被拒绝。这些对于你来说并不是愉快的经历，但你同时也应该感谢生活给你这样一个机会，你可以学会如何应对生活中的拒绝，避免被这些挫折击败！&lt;br>
　　下面是如何应对拒绝的一些办法：&lt;br>
…&lt;/p>
&lt;p>咋应对别人的拒绝呢~~好好看看吧。。 –fatkun&lt;br>
————————-&lt;br>
左岸以前有都大家如何拒绝别人的无理要求，《人际心理学——如何拒绝别人的无理要求 》，生活中，每个人都会遇到拒绝，这是不可避免的，被拒绝的原因也是各种各样的。你可能会在应聘职位的时候被拒绝，求婚的时候被拒绝或者要求老板给你加薪的时候被拒绝。这些对于你来说并不是愉快的经历，但你同时也应该感谢生活给你这样一个机会，你可以学会如何应对生活中的拒绝，避免被这些挫折击败！&lt;br>
　　下面是如何应对拒绝的一些办法：&lt;br>
　　&lt;strong>不要总认为是自己的原因（Don’t take it personally）&lt;/strong>&lt;br>
　　在生活中被拒绝有很多情况是因为你选择的时机不对。例如，你邀请别人一起去吃午饭，但是别人已经吃过了，这样别人肯定会拒绝你！如果你在圣诞期间去应聘百货公司的兼职工作，你也肯定会被拒绝，因为他们在圣诞假期之前已经有了足够的人手。有一些被拒绝的情况可能和你没有任何关系，所以，如果你被拒绝，不要认为自己不行或者别人不喜欢你，这仅仅是一个时机的问题。&lt;br>
　　&lt;strong>想开点(Think positively)&lt;/strong>&lt;br>
　　当你被拒绝的时候，很难让自己想开，但一定要试着把想法转变过来。例如，如果你邀请某人出席一个社会活动而他拒绝了，那你可以想想你对别人说不的时候。有时候，被拒绝也可能是塞翁失马，说不定是一件好事呢。&lt;br>
　　&lt;strong>认真听别人拒绝你的原因（Listen to the rejection carefully）&lt;/strong>&lt;br>
　　注意去听别人拒绝你的原因，这很重要。因为这会告诉你会不会有第二次机会。如果你去应聘一个职位，然后人力资源经理告诉你“现在还不行，但是你可以在3个月之内和我电话联系”，那么你就知道自己被拒绝的原因了，你可以把这件事情的重点放在时机上。你也可以试着问一些问题，了解自己为什么现在不能被聘用，为什么是接下来的3月内。&lt;br>
　　&lt;strong>善待自己（Be kind to yourself）&lt;/strong>&lt;br>
　　被别人拒绝总是很令人失望，不管是因为个人的原因，还是专业技能的原因，都会让你觉得很受挫折。所以，如果你被别人拒绝，那么你一定要想办法善待自己，比如自我鼓励，不要因为悲伤而去狂吃，狂饮，狂抽烟或者狂消费。&lt;br>
　　&lt;strong>让自己有信心（Have confidence in who you are）&lt;/strong>&lt;br>
　　学会在遭受挫折的时候更有自信，在逆境中仍然不失自我。把挫折看作动力，不断完善自己，挑战自己，该说的时候还说，该笑的时候还笑，周围人看待你的态度也会悄然发生转变。你被拒绝的机会也会降低。&lt;br>
　　&lt;strong>每个人都有被拒绝的经历（Know that everyone gets rejected）&lt;/strong>&lt;br>
　　地球上有60亿人，我们都有各自的特点，各自的长处。有时候会有机会来垂青，有时也会遭到拒绝。要认识到被拒绝是每个人都必须经历的，这是一种实实在在的感受，所以，在被拒绝的时候你需要克服这道精神障碍，继续向前吧！&lt;br>
　　&lt;strong>不断努力尝试（Try and try again）&lt;/strong>&lt;br>
　　“被拒绝20次，总会有1次被接受”，很多名人都是在不断努力尝试碰壁后，最终被别人所认可，从而获得个人的成功。需要把拒绝看作是一种失败，相反，你应该把它看作是推动你梦想的助力器。&lt;br>
　　很多情况下，被别人拒绝需要你很好的去处理。如果你用积极自信的态度去处理，那么你很可能会有一个好的结果。因此，不管你是不是在人生的低谷，用积极自信的态度去提高自己，遭受挫折的时候也不要气馁，因为你知道自己离成功又少了一道障碍！&lt;br>
来源：&lt;a href="http://www.izoan.cn/post/shenghuo-jujue.html" target="_blank">左岸读书&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category><category domain="https://fatkun.github.io/tags/%E5%BF%83%E7%90%86%E5%AD%A6/">心理学</category></item><item><title>Struts2.x框架的知识点</title><link>https://fatkun.github.io/2009/10/struts2-x%E6%A1%86%E6%9E%B6%E7%9A%84%E7%9F%A5%E8%AF%86%E7%82%B9.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/struts2-x%E6%A1%86%E6%9E%B6%E7%9A%84%E7%9F%A5%E8%AF%86%E7%82%B9.html</guid><pubDate>Fri, 09 Oct 2009 05:27:17 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>郁闷，从10月5日开始四天不能上网，杯具了。。。。不能上网就不上呗&lt;del>反正上的是寂寞&lt;/del>今天终于可以上网了。。发泄一下，可恶的校园网！~&lt;br>
不过在不能上网的几天内把Struts2的视频看完了·~哇咔咔。。不过还没练习~~可能很多还不会·&lt;br>
不说郁闷的事了，把知识点列出来先，以后一点点的把例子弄出来。&lt;br>
1，最最最常用的就是那个配置文件啦。。&lt;strong>Struts.xml&lt;/strong>&lt;br>
1）Packa&lt;/p>
&lt;p>郁闷，从10月5日开始四天不能上网，杯具了。。。。不能上网就不上呗&lt;del>反正上的是寂寞&lt;/del>今天终于可以上网了。。发泄一下，可恶的校园网！~&lt;br>
不过在不能上网的几天内把Struts2的视频看完了·~哇咔咔。。不过还没练习~~可能很多还不会·&lt;br>
不说郁闷的事了，把知识点列出来先，以后一点点的把例子弄出来。&lt;br>
1，最最最常用的就是那个配置文件啦。。&lt;strong>Struts.xml&lt;/strong>&lt;/p>
&lt;blockquote>
&lt;div class="quote">> 1）Package的继承（extends），通常继承struts-default这个滴，Struts默认的配置，如果不继承这个就要自己把一些拦截器配上去啦。&lt;br /> 2）namespace命名空间&lt;br /> 3）action中的method属性的使用&lt;br /> 4）result中type属性的使用(主要有chain,redirectAction,dispatcher,redirect)&lt;br /> 5）通配符的使用> &lt;/div>
&lt;/blockquote>
&lt;p>2，&lt;strong>OGNL语法&lt;/strong>，感觉学学一些基本的语法就好了，不用学太复杂的。&lt;br>
3，&lt;strong>拦截器（interceptor）&lt;/strong>，主要用来在中间拦截住检查一下或者改变一下再返回，“切面编程”。&lt;br>
4，&lt;strong>Struts2标签&lt;/strong>，对这个标签没什么好感，个人觉得用JSTL标签+HTML好了。不过ONGL要用到。&lt;br>
5，I18N国际化&lt;br>
6，异常的处理&lt;br>
7，通过ActionContext获取Request,Session,Application等可以实现接口SessionAware等&lt;br>
8，&lt;strong>验证框架(Validation)&lt;/strong>，可以覆盖validate方法，也可以通过配置实现&lt;br>
9，其他一些零零碎碎的东西，上传啊等~~&lt;br>
一下子列出这么多知识点。。Struts还真不简单耶，一个框架也这么难，My God!~努力学习·~~&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/java/">JAVA</category><category domain="https://fatkun.github.io/tags/struts2%E6%A1%86%E6%9E%B6/">Struts2框架</category></item><item><title>Registry Workshop V4.2.3 操作注册表非常方便</title><link>https://fatkun.github.io/2009/10/registry-workshop-v4-2-3-%E6%93%8D%E4%BD%9C%E6%B3%A8%E5%86%8C%E8%A1%A8%E9%9D%9E%E5%B8%B8%E6%96%B9%E4%BE%BF.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/registry-workshop-v4-2-3-%E6%93%8D%E4%BD%9C%E6%B3%A8%E5%86%8C%E8%A1%A8%E9%9D%9E%E5%B8%B8%E6%96%B9%E4%BE%BF.html</guid><pubDate>Sun, 04 Oct 2009 14:34:40 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;strong>软件名称：&lt;/strong> Registry Workshop V4.2.3 简体中文特别版&lt;br>
&lt;strong>下载地址：&lt;/strong>&lt;a href="http://xiazai.xiazaiba.com/Soft/R/RegistryWorkshop_V4.2.3_XiaZaiBa.exe" target="_blank">&lt;a href="http://xiazai.xiazaiba.com/Soft/R/RegistryWorkshop_V4.2.3_XiaZaiBa.exe">http://xiazai.xiazaiba.com/Soft/R/RegistryWorkshop_V4.2.3_XiaZaiBa.exe&lt;/a>&lt;/a>&lt;br>
&lt;strong>软件介绍：&lt;/strong>&lt;br>
Registry Workshop 是一款高级的注册表编辑工具，能够完全替代 WIndows 系统自带的 RegEdit 注册表编辑器。除了RegEdit的特性外，Registry Workshop 提供许多其他功能提高注册表编辑操作效率：能够剪切，复制和粘贴注册项和键值名，还可以进行撤销和重做操作；能够快速地查找和替换所需注册项，键值名和字符串；允许编辑注册表文件同系统自带的注册表编辑器一样；并且提供容易使用和灵活的收藏夹功能。&lt;br>
…&lt;/p>
&lt;p>&lt;strong>软件名称：&lt;/strong> Registry Workshop V4.2.3 简体中文特别版&lt;br>
&lt;strong>下载地址：&lt;/strong>&lt;a href="http://xiazai.xiazaiba.com/Soft/R/RegistryWorkshop_V4.2.3_XiaZaiBa.exe" target="_blank">&lt;a href="http://xiazai.xiazaiba.com/Soft/R/RegistryWorkshop_V4.2.3_XiaZaiBa.exe">http://xiazai.xiazaiba.com/Soft/R/RegistryWorkshop_V4.2.3_XiaZaiBa.exe&lt;/a>&lt;/a>&lt;br>
&lt;strong>软件介绍：&lt;/strong>&lt;br>
Registry Workshop 是一款高级的注册表编辑工具，能够完全替代 WIndows 系统自带的 RegEdit 注册表编辑器。除了RegEdit的特性外，Registry Workshop 提供许多其他功能提高注册表编辑操作效率：能够剪切，复制和粘贴注册项和键值名，还可以进行撤销和重做操作；能够快速地查找和替换所需注册项，键值名和字符串；允许编辑注册表文件同系统自带的注册表编辑器一样；并且提供容易使用和灵活的收藏夹功能。&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/10/200910040635477432.jpg" alt="" title="" />&lt;br>
&lt;strong>软件下载页面：&lt;/strong> &lt;a href="http://www.xiazaiba.com/html/428.html" target="_blank">&lt;a href="http://www.xiazaiba.com/html/428.html">http://www.xiazaiba.com/html/428.html&lt;/a>&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E5%B0%8F%E8%BD%AF%E4%BB%B6/">小软件</category><category domain="https://fatkun.github.io/tags/registry/">Registry</category><category domain="https://fatkun.github.io/tags/registry-workshop/">Registry Workshop</category><category domain="https://fatkun.github.io/tags/%E6%B3%A8%E5%86%8C%E8%A1%A8/">注册表</category></item><item><title>数码图片放大不失真！ShortCut PhotoZoom Pro V3.0.2</title><link>https://fatkun.github.io/2009/10/%E6%95%B0%E7%A0%81%E5%9B%BE%E7%89%87%E6%94%BE%E5%A4%A7%E4%B8%8D%E5%A4%B1%E7%9C%9F%EF%BC%81shortcut-photozoom-pro-v3-0-2.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E6%95%B0%E7%A0%81%E5%9B%BE%E7%89%87%E6%94%BE%E5%A4%A7%E4%B8%8D%E5%A4%B1%E7%9C%9F%EF%BC%81shortcut-photozoom-pro-v3-0-2.html</guid><pubDate>Sun, 04 Oct 2009 05:51:25 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>一款新颖的、技术上具有革命性的对数码图片进行放大的工具。通常的工具对数码图片进行放大时，总会降低图片的品质，而这款软件使用了S-SPLINE技术（一种申请过专利的，拥有自动调节、高级的插值算法的技术），可以将尽可能地提高放大图片的品质。程序最大的特色是可以对图片进行放大而没有锯齿,不会失真&lt;br>
&lt;strong>注意这个软件千万别点更新，解锁会失效的&lt;/strong>&lt;br>
注册码：1111111111111111111111111&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/10/200910032155267376.png" alt="" title="" />&lt;br>
…&lt;/p>
&lt;p>一款新颖的、技术上具有革命性的对数码图片进行放大的工具。通常的工具对数码图片进行放大时，总会降低图片的品质，而这款软件使用了S-SPLINE技术（一种申请过专利的，拥有自动调节、高级的插值算法的技术），可以将尽可能地提高放大图片的品质。程序最大的特色是可以对图片进行放大而没有锯齿,不会失真&lt;br>
&lt;strong>注意这个软件千万别点更新，解锁会失效的&lt;/strong>&lt;br>
注册码：1111111111111111111111111&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/10/200910032155267376.png" alt="" title="" />&lt;br>
下载地址：http://www.xdowns.com/soft/31/93/2006/Soft_33997.html&lt;/p></description><category domain="https://fatkun.github.io/categories/%E5%B0%8F%E8%BD%AF%E4%BB%B6/">小软件</category><category domain="https://fatkun.github.io/tags/photozoom/">PhotoZoom</category><category domain="https://fatkun.github.io/tags/%E4%BF%AE%E6%94%B9%E5%B0%BA%E5%AF%B8/">修改尺寸</category><category domain="https://fatkun.github.io/tags/%E5%9B%BE%E7%89%87/">图片</category><category domain="https://fatkun.github.io/tags/%E6%94%BE%E5%A4%A7/">放大</category></item><item><title>冷新闻：巨大鸡蛋让它的鸡妈妈死亡</title><link>https://fatkun.github.io/2009/10/%E5%86%B7%E6%96%B0%E9%97%BB%EF%BC%9A%E5%B7%A8%E5%A4%A7%E9%B8%A1%E8%9B%8B%E8%AE%A9%E5%AE%83%E7%9A%84%E9%B8%A1%E5%A6%88%E5%A6%88%E6%AD%BB%E4%BA%A1.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/10/%E5%86%B7%E6%96%B0%E9%97%BB%EF%BC%9A%E5%B7%A8%E5%A4%A7%E9%B8%A1%E8%9B%8B%E8%AE%A9%E5%AE%83%E7%9A%84%E9%B8%A1%E5%A6%88%E5%A6%88%E6%AD%BB%E4%BA%A1.html</guid><pubDate>Fri, 02 Oct 2009 03:55:50 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img src="http://fatkun.com/upload/2009/10/200910011956382747.jpg" alt="一日一冷新闻：巨大鸡蛋让它的鸡妈妈死亡 | Jandan.net" title="一日一冷新闻：巨大鸡蛋让它的鸡妈妈死亡" style="margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 500px; height: auto; " />
&amp;nbsp;农场主在自家鸡舍里发现了一个巨大的鸡蛋，它重138g ，如图，比普通的鸡蛋大了几乎一倍多。人们在为大鸡蛋而震惊的同时，也不幸的发现生出这个大蛋的英雄鸡妈妈却因未知原因(体力耗尽！？)死亡，倒在了鸡舍中。农场主回忆道：当我看到英雄鸡妈妈时，它甚至还用最后的力气微微抬起头来，用神秘的目光扫视我、大鸡蛋和这个世界最后一眼。# 该事情发生在美国纽约Honeyoye Falls ，近日。来源ab
&lt;p> &lt;span class="Apple-style-span" style="font-family: Tahoma, Arial; line-height: 20px; color: rgb(17, 17, 17); ">&lt;img src="http://fatkun.com/upload/2009/10/200910011956382747.jpg" alt="一日一冷新闻：巨大鸡蛋让它的鸡妈妈死亡 | Jandan.net" title="一日一冷新闻：巨大鸡蛋让它的鸡妈妈死亡" style="margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 500px; height: auto; " />&lt;/p>&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.7em; "> 农场主在自家鸡舍里发现了一个巨大的鸡蛋，它重138g ，如图，比普通的鸡蛋大了几乎一倍多。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.7em; "> 人们在为大鸡蛋而震惊的同时，也不幸的发现生出这个大蛋的英雄鸡妈妈却因未知原因(体力耗尽！？)死亡，倒在了鸡舍中。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.7em; "> 农场主回忆道：当我看到英雄鸡妈妈时，它甚至还用最后的力气微微抬起头来，用神秘的目光扫视我、大鸡蛋和这个世界最后一眼。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.7em; "> # 该事情发生在美国纽约Honeyoye Falls ，近日。&lt;a rel="external nofollow" href="http://abclocal.go.com/kabc/story?section=news/national_world&amp;id=7037341" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(16, 92, 182); text-decoration: none; ">来源abc&lt;/a>&lt;/p>
&lt;p> &lt;/span>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>信息管理实验5-ASP.NET操作XML</title><link>https://fatkun.github.io/2009/09/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C5-asp-net%E6%93%8D%E4%BD%9Cxml.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C5-asp-net%E6%93%8D%E4%BD%9Cxml.html</guid><pubDate>Wed, 30 Sep 2009 08:49:49 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909300056007868.jpg" alt="" title="" />
1：实验目的，实验要求（自己写）
2：实验步骤：
一：Xml是实现病历共享的另外一种较好的方式。C#通过System.Xml空间下的一系列类来处理XML文档，如何使用这些类呢？
在应用程序的头部添加：
using System.Xml
二：新建patient.xml文档
&lt;pre class="xml">&lt;?xml version="1.0" encoding="gb2312"?>
&lt;patientsmaterial>
&lt;/patientsmaterial>
...
&lt;p>1：实验目的，实验要求（自己写）
2：实验步骤：
一：Xml是实现病历共享的另外一种较好的方式。C#通过System.Xml空间下的一系列类来处理XML文档，如何使用这些类呢？
在应用程序的头部添加：
using System.Xml
二：新建patient.xml文档&lt;/p>
&lt;pre class="xml">
&amp;lt;?xml version="1.0" encoding="gb2312"?&amp;gt;
&amp;lt;patientsmaterial&amp;gt;
&amp;lt;/patientsmaterial&amp;gt;
&lt;/pre>
&lt;p> 三：创建ASP.NET应用程序，并在窗体上添加两个BUTTON按钮，5个TextBox，如图：&lt;br />
&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909300056007868.jpg" alt="" title="" />&lt;br />
给出代码：&lt;br />
Default.aspx&lt;/p>
&lt;pre class="html">
&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;
&amp;lt;head runat="server"&amp;gt;
&amp;lt;title&amp;gt;无标题页&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form id="form1" runat="server"&amp;gt;
&amp;lt;div&amp;gt;
ID:&amp;lt;asp:TextBox ID="TextBox1" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;
姓名:&amp;lt;asp:TextBox ID="TextBox2" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;
性别:&amp;lt;asp:TextBox ID="TextBox3" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;
E-mail:&amp;lt;asp:TextBox ID="TextBox4" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;
地址:&amp;lt;asp:TextBox ID="TextBox5" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;br /&amp;gt;
&amp;nbsp;&amp;lt;asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="输出所有节点(Button1)" /&amp;gt;
&amp;lt;asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="添加一个节点(Button2)" /&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre>
&lt;p> Default.aspx.cs&lt;/p>
&lt;pre class="c#">
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
public partial class _Default : System.Web.UI.Page
{
//注意修改为自己patient.xml文件的路径
string filePath = "C:\\Documents and Settings\\Administrator\\My Documents\\Visual Studio 2005\\WebSites\\WebSite5\\patient.xml";
protected void Page_Load(object sender, EventArgs e)
{
}
//输出所有节点
public void getAllElements() {
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(filePath);
XmlNodeList nodeList = xmlDoc.SelectNodes("/patientsmaterial/patient");
Response.Write("所有节点:&lt;br />");
for (int i = 0; i &amp;lt; nodeList.Count; i++)
{
Response.Write("ID："+nodeList.Item(i).Attributes["ID"].Value);//输出ID
Response.Write("&lt;br />");
for (int j = 0; j &amp;lt; nodeList.Item(i).ChildNodes.Count; j++)
{
Response.Write(nodeList.Item(i).ChildNodes[j].Name + "：");
Response.Write(nodeList.Item(i).ChildNodes[j].InnerText);
Response.Write("&lt;br />");
}
Response.Write("&lt;br />");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
getAllElements();
}
protected void Button2_Click(object sender, EventArgs e)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(filePath);
//查找&amp;lt;patientsmaterial>
XmlNode root = xmlDoc.SelectSingleNode("patientsmaterial");
//创建patient节点
XmlElement xe1 = xmlDoc.CreateElement("patient");
//设置节点ID属性
xe1.SetAttribute("ID", TextBox1.Text.Trim());
XmlElement xesub1 = xmlDoc.CreateElement("name");
//设置文本节点
xesub1.InnerText = TextBox2.Text.Trim();
//添加到patient节点去
xe1.AppendChild(xesub1);
XmlElement xesub2 = xmlDoc.CreateElement("sex");
xesub2.InnerText = TextBox3.Text.Trim();
xe1.AppendChild(xesub2);
XmlElement xesub3 = xmlDoc.CreateElement("email");
xesub3.InnerText = TextBox4.Text.Trim();
xe1.AppendChild(xesub3);
XmlElement xesub4 = xmlDoc.CreateElement("address");
xesub4.InnerText = TextBox5.Text.Trim();
xe1.AppendChild(xesub4);
//添加到patientsmaterial节点
root.AppendChild(xe1);
xmlDoc.Save(filePath);
getAllElements();
}
}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/asp.net/">ASP.NET</category><category domain="https://fatkun.github.io/tags/asp.net/">ASP.NET</category><category domain="https://fatkun.github.io/tags/xml/">Xml</category><category domain="https://fatkun.github.io/tags/xmldocument/">XmlDocument</category><category domain="https://fatkun.github.io/tags/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C/">信息管理实验</category><category domain="https://fatkun.github.io/tags/%E9%81%8D%E5%8E%86xml/">遍历xml</category></item><item><title>电脑时间不准确怎么办？WinXP的时间同步</title><link>https://fatkun.github.io/2009/09/%E7%94%B5%E8%84%91%E6%97%B6%E9%97%B4%E4%B8%8D%E5%87%86%E7%A1%AE%E6%80%8E%E4%B9%88%E5%8A%9E%EF%BC%9Fwinxp%E7%9A%84%E6%97%B6%E9%97%B4%E5%90%8C%E6%AD%A5.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E7%94%B5%E8%84%91%E6%97%B6%E9%97%B4%E4%B8%8D%E5%87%86%E7%A1%AE%E6%80%8E%E4%B9%88%E5%8A%9E%EF%BC%9Fwinxp%E7%9A%84%E6%97%B6%E9%97%B4%E5%90%8C%E6%AD%A5.html</guid><pubDate>Tue, 29 Sep 2009 11:46:53 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909290352597531.jpg" alt="" title="" />
首先确认Windows Time服务是开启的，可以在cmd下输入net start查看，如果没找到，就用net start w32time启动服务。
在右下角的显示时间的地方双击，在“internet 时间”选项中更新就可以啦。。。这样你就可以炫耀你的时间是和宇宙同步的（哇咔咔）
&lt;p>首先确认Windows Time服务是开启的，可以在cmd下输入net start查看，如果没找到，就用net start w32time启动服务。&lt;br>
在右下角的显示时间的地方双击，在“internet 时间”选项中更新就可以啦。。。这样你就可以炫耀你的时间是和宇宙同步的（哇咔咔）&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909290352597531.jpg" alt="" title="" />&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/%E6%97%B6%E9%97%B4%E5%90%8C%E6%AD%A5/">时间同步</category></item><item><title>每天1440个日本妞给你报时</title><link>https://fatkun.github.io/2009/09/%E6%AF%8F%E5%A4%A91440%E4%B8%AA%E6%97%A5%E6%9C%AC%E5%A6%9E%E7%BB%99%E4%BD%A0%E6%8A%A5%E6%97%B6.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E6%AF%8F%E5%A4%A91440%E4%B8%AA%E6%97%A5%E6%9C%AC%E5%A6%9E%E7%BB%99%E4%BD%A0%E6%8A%A5%E6%97%B6.html</guid><pubDate>Mon, 28 Sep 2009 09:53:47 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>&lt;img src="http://fatkun.com/upload/2009/9/200909280154342556.jpg" alt="">
 网址：http://www.bijint.com/jp/每天1440个日本美女给你报时，即每天1440分钟每一分钟就自动刷新更换一个日本正妞举排给你报时，这个是什么？没错，这个是一个来自日本的有趣网站，听说有人为了看完这1440个日本妞24小时目不转睛盯着屏幕等刷新…… &lt;/p>
&lt;p>&lt;span class="Apple-style-span" style="font-family: verdana, 'bitstream vera sans', tahoma, helvetica, sans-serif; line-height: 17px; color: rgb(85, 85, 85); ">&lt;/p>&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;a href="http://fatkun.com/upload/2009/9/200909280154326530.jpg" style="color: rgb(237, 103, 0); text-decoration: none; ">&lt;img title="3" border="0" alt="3" src="http://fatkun.com/upload/2009/9/200909280154342556.jpg" width="602" height="302" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; max-width: 600px; border-bottom-style: initial; border-bottom-color: initial; border-left-style: initial; border-left-color: initial; display: inline; border-top-style: initial; border-top-color: initial; border-right-style: initial; border-right-color: initial; " />&lt;/a>&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &amp;nbsp;&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;strong>网址：&lt;/strong>&lt;a href="http://www.bijint.com/jp/" style="color: rgb(237, 103, 0); text-decoration: none; ">&lt;strong>http://www.bijint.com/jp/&lt;/strong>&lt;/a>&lt;/p>
&lt;p> &lt;/span>&lt;span class="Apple-style-span" style="font-family: verdana, 'bitstream vera sans', tahoma, helvetica, sans-serif; line-height: 17px; color: rgb(85, 85, 85); ">每天1440个日本美女给你报时，即每天1440分钟每一分钟就自动刷新更换一个日本正妞举排给你报时，这个是什么？没错，这个是一个来自日本的有趣网站，听说有人为了看完这1440个日本妞24小时目不转睛盯着屏幕等刷新&amp;hellip;&amp;hellip;&lt;/span>&amp;nbsp;&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/%E6%8A%A5%E6%97%B6/">报时</category><category domain="https://fatkun.github.io/tags/%E6%97%A5%E6%9C%AC/">日本</category></item><item><title>这篇文章是使用Windows Live Writer所写的~</title><link>https://fatkun.github.io/2009/09/%E8%BF%99%E7%AF%87%E6%96%87%E7%AB%A0%E6%98%AF%E4%BD%BF%E7%94%A8windows-live-writer%E6%89%80%E5%86%99%E7%9A%84.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E8%BF%99%E7%AF%87%E6%96%87%E7%AB%A0%E6%98%AF%E4%BD%BF%E7%94%A8windows-live-writer%E6%89%80%E5%86%99%E7%9A%84.html</guid><pubDate>Sun, 27 Sep 2009 12:06:19 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>测试一下~Windows LIve Writer!
感觉还挺好的&lt;del>哇咔咔&lt;/del>
可以随时修改~
下载地址：&lt;a href="http://download.live.com/writer">http://download.live.com/writer&lt;/a>
突然觉得少了截图工具啦。。不知道插件有没有
UPDATE:发现有一个截图插件 SnagIt Screen Capture 不过除了插件，还要安装SnagIt这个软件，太麻烦了~~
&lt;a href="http://fatkun.com/upload/2009/9/image_2.png">&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="214" alt="image" src="http://fatkun.com/upload/2009/9/image_thumb.png" width="244" border="0" />&lt;/a>&lt;img src="http://www.zu14.cn/coolemotion/emotions/cb_13.gif" alt="">&lt;/p>
&lt;div class="wlWriterEditableSmartContent" id="scid:84E294D0-71C9-4bd0-A0FE-95764E0368D9:afc2cb84-5b17-481a-8534-6073d56e2013" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"> &lt;a href="http://www.bing.com/maps/default.aspx?v=2&amp;cp=23.05225~113.3906&amp;lvl=13&amp;style=r&amp;sp=aN.23.05004_113.3937_%25u5e7f%25u5dde%25u5927%25u5b66%25u57ce_&amp;mkt=en-us&amp;FORM=LLWR" id="map-09a74042-f078-47e3-8892-59e59fc6aa18" alt="查看地图" title="查看地图">&lt;img src="http://fatkun.com/upload/2009/9/map-2af90af8c873.jpg" width="404" height="305" alt="地图图片" />&lt;/a>&lt;/div>
&lt;p>测试一下~Windows LIve Writer!
感觉还挺好的&lt;del>哇咔咔&lt;/del>
可以随时修改~
下载地址：&lt;a href="http://download.live.com/writer">http://download.live.com/writer&lt;/a>
突然觉得少了截图工具啦。。不知道插件有没有
UPDATE:发现有一个截图插件 SnagIt Screen Capture 不过除了插件，还要安装SnagIt这个软件，太麻烦了~~
&lt;a href="http://fatkun.com/upload/2009/9/image_2.png">&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="214" alt="image" src="http://fatkun.com/upload/2009/9/image_thumb.png" width="244" border="0" />&lt;/a>&lt;img src="http://www.zu14.cn/coolemotion/emotions/cb_13.gif" alt="">&lt;/p>
&lt;div class="wlWriterEditableSmartContent" id="scid:84E294D0-71C9-4bd0-A0FE-95764E0368D9:afc2cb84-5b17-481a-8534-6073d56e2013" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"> &lt;a href="http://www.bing.com/maps/default.aspx?v=2&amp;cp=23.05225~113.3906&amp;lvl=13&amp;style=r&amp;sp=aN.23.05004_113.3937_%25u5e7f%25u5dde%25u5927%25u5b66%25u57ce_&amp;mkt=en-us&amp;FORM=LLWR" id="map-09a74042-f078-47e3-8892-59e59fc6aa18" alt="查看地图" title="查看地图">&lt;img src="http://fatkun.com/upload/2009/9/map-2af90af8c873.jpg" width="404" height="305" alt="地图图片" />&lt;/a>&lt;/div></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>信息管理实验4-向数据库插入数据</title><link>https://fatkun.github.io/2009/09/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C4-%E5%90%91%E6%95%B0%E6%8D%AE%E5%BA%93%E6%8F%92%E5%85%A5%E6%95%B0%E6%8D%AE.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C4-%E5%90%91%E6%95%B0%E6%8D%AE%E5%BA%93%E6%8F%92%E5%85%A5%E6%95%B0%E6%8D%AE.html</guid><pubDate>Sun, 27 Sep 2009 08:35:11 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>1实验目的：复习上次实验—把数据库中的数据显示出来的基础上，向数据库中插入数据，并且即使的把更新的数据显示在Gridview控件中。 2程序步骤：&lt;br>
0，用SqlServer创建一个名为“ProductDB”的数据库，新建表Product(ID,ProductID,ProductDes)&lt;br>
1，从工具栏拖入GridView，两个TextBox，一个Button ，具体看下面图片&lt;/p>
&lt;p>1实验目的：复习上次实验—把数据库中的数据显示出来的基础上，向数据库中插入数据，并且即使的把更新的数据显示在Gridview控件中。
2程序步骤：
0，用SqlServer创建一个名为“ProductDB”的数据库，新建表Product(ID,ProductID,ProductDes)&lt;br>
1，从工具栏拖入GridView，两个TextBox，一个Button ，具体看下面图片&lt;br>
2，注意此步骤，双击网页上Button按钮进入代码编辑（为了绑定事件Button1_Click）&lt;br>
3，把对应的代码复制
实验的原始界面：&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/截图1121883855.jpg" alt="" title="" />
最后效果：&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909270101006411.jpg" alt="" title="" />
Default.aspx文件内容&lt;/p>
&lt;pre class="html">&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;
&amp;lt;head runat="server"&amp;gt;
&amp;lt;title&amp;gt;无标题页&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form id="form1" runat="server"&amp;gt;
&amp;lt;div&amp;gt;
&amp;lt;asp:GridView ID="GridView1" runat="server"&amp;gt;
&amp;lt;/asp:GridView&amp;gt;
&amp;lt;/div&amp;gt;
商品ID：&amp;lt;asp:TextBox ID="TextBox1" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;
商品描述：&amp;lt;asp:TextBox ID="TextBox2" runat="server"&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre>
&lt;p>Default.aspx.cs文件内容&lt;/p>
&lt;pre class="c#">using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
string constr = "server=.;database=ProductDB;Uid=sa;pwd=;";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
Bind();
}
}
public void Bind() {
string sqlstr = "select * from Product";
SqlConnection sqlConn = new SqlConnection(constr);
SqlDataAdapter sda = new SqlDataAdapter(sqlstr, sqlConn);
DataSet ds = new DataSet();
sda.Fill(ds);
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
sqlConn.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
string sqlStr = "insert into Product(ProductID,ProductDes) VALUES ('"+TextBox1.Text.Trim()+"','"+TextBox2.Text.Trim()+"')";
SqlConnection sqlConn = new SqlConnection(constr);
sqlConn.Open();
SqlCommand sqlCmd = new SqlCommand(sqlStr, sqlConn);
sqlCmd.ExecuteNonQuery();
sqlConn.Close();
this.Bind();
}
}&lt;/pre></description><category domain="https://fatkun.github.io/categories/asp.net/">ASP.NET</category><category domain="https://fatkun.github.io/tags/sqlcommand/">SqlCommand</category><category domain="https://fatkun.github.io/tags/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C/">信息管理实验</category></item><item><title>Ubuntu 9.10全新图标，主题和壁纸已经就绪</title><link>https://fatkun.github.io/2009/09/ubuntu-9-10%E5%85%A8%E6%96%B0%E5%9B%BE%E6%A0%87%EF%BC%8C%E4%B8%BB%E9%A2%98%E5%92%8C%E5%A3%81%E7%BA%B8%E5%B7%B2%E7%BB%8F%E5%B0%B1%E7%BB%AA.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/ubuntu-9-10%E5%85%A8%E6%96%B0%E5%9B%BE%E6%A0%87%EF%BC%8C%E4%B8%BB%E9%A2%98%E5%92%8C%E5%A3%81%E7%BA%B8%E5%B7%B2%E7%BB%8F%E5%B0%B1%E7%BB%AA.html</guid><pubDate>Sat, 26 Sep 2009 02:01:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> &lt;span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">&lt;img alt="" src="http://fatkun.com/upload/2009/9/200909251807272055.png" />Ubuntu 9.10 Karmic Koala将于2009年10月1日发布Beta版，届时无论是功能还是外表都将进入冻结状态，不会做較大的变动。&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">最近Ubuntu 9.10的已经更新上了全新的图标、主题和壁纸，这应该是Ubuntu近几个发行版来以来，最大的一次UI上的变动了。一起来看看吧！&lt;/strong>…&lt;/span>&lt;/p>
&lt;p> &lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> Ubuntu 9.10 Karmic Koala将于2009年10月1日发布Beta版，届时无论是功能还是外表都将进入冻结状态，不会做較大的变动。&lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">最近Ubuntu 9.10的已经更新上了全新的图标、主题和壁纸，这应该是Ubuntu近几个发行版来以来，最大的一次UI上的变动了。一起来看看吧！&lt;/strong>&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &amp;nbsp;&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> UI的变动一部分是来自GNOME 2.28的更新，这个桌面环境在最近的更新中（2.28）针对按钮和菜单上的图标进行了清理，所有预设的按钮和菜单，都将没有图标样式。这一点正向Windows和Mac OS X靠扰。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 另外，Ubuntu继续改良了原有的Human主题，并引入了全新设计的Breathe图标主题。这个主题的灵感来自KDE项目的Oxygen，&amp;ldquo;Breathe（呼吸）&amp;rdquo;这个名字也似乎与&amp;ldquo;Oxygen（空气）&amp;rdquo;相响应。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 那么，就来欣赏一下吧！&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">通知区域&lt;/strong>&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;img alt="" src="http://fatkun.com/upload/2009/9/200909251807272055.png" />&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 所有在通知区域的图标，都默认使用了灰阶的样式，相当精致美观。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &amp;nbsp;&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Breathe图标样式&lt;/strong>&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 下图基本上可以看出Breathe图标样式的风格了，依然是Ubuntu的黄色系，但是图标被完全重新设计过。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 值得注意的是，预设的Freedesktop的标准文件夹，也有属于自己的图标了。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 注意工具栏，除了&amp;ldquo;后退&amp;rdquo;和&amp;ldquo;前进&amp;rdquo;按钮，其他工具都没有文字了。因此UI变得更紧凑了。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;img alt="" src="http://fatkun.com/upload/2009/9/200909251807283605.png" />&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &amp;nbsp;&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">窗口样式和主题&lt;/strong>&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 默认的主题当然是Ubuntu由来已久的&amp;ldquo;Human&amp;rdquo;啰。不过这次色调的改动比较大，已经不是土黄，而是褐色了。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 注意下面&amp;ldquo;帮助&amp;rdquo;和&amp;ldquo;关闭&amp;rdquo;两个按钮，已经没有了GNOME 2.26时代的图标了。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;img alt="" src="http://fatkun.com/upload/2009/9/200909251807280443.png" />&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &amp;nbsp;&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">壁纸&lt;/strong>&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 下面则是Ubuntu 9.10里全新的壁纸了，各式各样的风格和色彩，相信总有一张是你喜欢的。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 假如还想获取更多地址，可以方便地点击那个链接。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;img alt="" src="http://fatkun.com/upload/2009/9/200909251807298083.png" />&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &amp;nbsp;&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 以上图片从几处细节展示了Ubuntu 9.10在UI上的大致变动，当然不仅如此，GDM登录窗口、Xsplash开机/关机的画面，Ubuntu都进行了全新设计。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> 不知诸位读者对Ubuntu 9.10的界面更新感觉如何？&lt;/p>
&lt;a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; " href="http://linuxdesktop.cn/">LDCN供稿&lt;/a>,LDCN(即LinuxDesktop.cn的缩写),中文名──&amp;ldquo;Linux桌面中文网&amp;rdquo;
,是一个由在校大学生发起的,旨在让所有Linuxer一起参与、更新的Linux资讯、应用互动型社区站点.
&amp;nbsp;
&amp;nbsp;</description><category domain="https://fatkun.github.io/categories/linux/">Linux</category><category domain="https://fatkun.github.io/tags/ubuntu/">Ubuntu</category></item><item><title>【转】浅谈大学生的学习，生活和前程</title><link>https://fatkun.github.io/2009/09/%E3%80%90%E8%BD%AC%E3%80%91%E6%B5%85%E8%B0%88%E5%A4%A7%E5%AD%A6%E7%94%9F%E7%9A%84%E5%AD%A6%E4%B9%A0%EF%BC%8C%E7%94%9F%E6%B4%BB%E5%92%8C%E5%89%8D%E7%A8%8B.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E3%80%90%E8%BD%AC%E3%80%91%E6%B5%85%E8%B0%88%E5%A4%A7%E5%AD%A6%E7%94%9F%E7%9A%84%E5%AD%A6%E4%B9%A0%EF%BC%8C%E7%94%9F%E6%B4%BB%E5%92%8C%E5%89%8D%E7%A8%8B.html</guid><pubDate>Fri, 25 Sep 2009 02:46:16 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>昨天，神差鬼使地去了广州某市场一趟，把菜市场的见闻和我的大学生活联系起来，感慨良多，分点记之，愿和广大的大学生分享我的经验，欢迎大家的指教。&lt;br>
　　（1）对就业前景的担忧&lt;br>
　　走在菜市场满是积水的过道上，见到了很多带着眼镜的，在大声叫卖的年轻人，有卖猪肉的，有卖蔬菜的，有卖鸡蛋的，有卖杂货……他们中的很多都是文质彬彬的，接待顾客时都十分有礼貌。看到此情此景，感慨万分，因为我也是一个带着眼镜的年轻人。他们不属于菜市场的吧？可是此情此景乃是我亲眼所见，并非梦境。难道前几年当作个例报道的大学生卖猪肉的新闻在今天已经不再新鲜了？或者是他们是在帮他们的父母在叫卖吧？突然，灵光在我的脑袋里一闪，“竞争力”三个字突然出现在我的脑海里，我不由得深深地忧虑了起来，他们的今天，是不是我的明天呢？&lt;br>
…&lt;/p>
&lt;p>昨天，神差鬼使地去了广州某市场一趟，把菜市场的见闻和我的大学生活联系起来，感慨良多，分点记之，愿和广大的大学生分享我的经验，欢迎大家的指教。&lt;br>
　　（1）对就业前景的担忧&lt;br>
　　走在菜市场满是积水的过道上，见到了很多带着眼镜的，在大声叫卖的年轻人，有卖猪肉的，有卖蔬菜的，有卖鸡蛋的，有卖杂货……他们中的很多都是文质彬彬的，接待顾客时都十分有礼貌。看到此情此景，感慨万分，因为我也是一个带着眼镜的年轻人。他们不属于菜市场的吧？可是此情此景乃是我亲眼所见，并非梦境。难道前几年当作个例报道的大学生卖猪肉的新闻在今天已经不再新鲜了？或者是他们是在帮他们的父母在叫卖吧？突然，灵光在我的脑袋里一闪，“竞争力”三个字突然出现在我的脑海里，我不由得深深地忧虑了起来，他们的今天，是不是我的明天呢？&lt;br>
　　（2）大学生的竞争力在哪里？&lt;br>
　　或许那些大学生都是在帮他们父母的忙！但我必须指出，大学生和普通老百姓一起卖猪肉并不是什么特殊现象。现在大学生的高失业率，甚者被就业就是最好的证明了。为什么呢？毫无疑问，这个问题的关键在于“竞争力”三个字。一个本科大学生，经过了四年的高等教育，他们的竞争力应当比普通老百姓要强得多才对吧？像我，一个大二的计算机专业的学生，我已经学了《高等数学》，《C语言程序设计》，《大学英语综合教程》，《大学计算机基础》，《线性代数》，《电工学》，《中国近现代史纲要》，《思想道德修养与法律基础》，《马克思主义基本原理概论》……这些课程已经学了一大堆了。照这样来说，大学生应当都是社会精英的了，应当不会沦落到卖猪肉吧。可是事实确实如此，这就值得我们思考了。大学生的竞争力到哪里去了？为什么会和普通老百姓同台竞技了？&lt;br>
　　（3）大学欺骗了我们？&lt;br>
　　很明显，大学生学了这么多，都没有学到自己的脑子里去。如果都到脑子里的话，大学生的“竞争力”就会体现出来了。很多高中学生都说，学了3年，一高考完就全忘记了。大学生是怎么说的呢？我的许多同学都说：哎，学了一学期的课程，期末考试一考完就全都忘记了。四年大学读完了，其实什么也没有学到。其实我的同学这样说是很有道理的！为什么呢？我用我自己的经历来说明一下吧：&lt;br>
　　1.学得太多和太烂&lt;br>
　　大学的课程繁多，针对性也不强，根本上没有办法形成有效的记忆系统。大一的那年，理工科方面学了《高等数学》，《电工学》，《大学物理教程》等等。所用的教材内容都十分抽象，公式繁多，书本上对公式的推导也很抽象，说到底，就是背公式，背熟了公式就去考试，考完试，背过的东西就全忘记了。文科方面更加离谱，学了《中国近现代史纲要》和《思想道德修养与法律基础》，居然要像高中学历史和政治那样——背，不用说，考完试后，忘得比高中还快。&lt;br>
　　2.课堂依然是应试教育的那一套&lt;br>
　　大家对九年义务教育和高中，最大的批评就是：老师在课堂上面讲，学生在课堂下面记，老师灌输，学生接受。学生没有在教学过程中得到了获得知识的能力。上到大学，本来以为大学的课堂会有很多的不同，大学课堂会很尊重学生的个性。上到大学后，我发现我错了。因为大学课程紧张，学时少，课程多，如果不是采取老师在讲台上放臭屁，学生在课桌上听的教学方式，课程根本上不完。老师怕学生觉得课程枯燥，逃课，于是又引入了各种各样的点名制度了。于是我们又回到了以前的课堂了。当然，这只是针对课堂而已，大学的生活和高中的生活是完全不同的。&lt;br>
　　3.知识严重落后于社会需求&lt;br>
　　教材的更新和教学的课程严重落后于社会知识架构的进步，实乃大学教育体制里最大的弊病。拿我大一的C语言来说吧！我大一的C语言教程所用的教材是谭浩强教授的《C程序设计》，用的编程软件（上机软件）是80年代的Borland公司的Turbo C++软件，一个dos系统下的编程软件。我们的C语言课程设计，要求必须用这个软件完成。现在微软最新的编程软件是Visual Studio 2008，新版本也快出了，大多数的软件公司基本都是用2008的版本或者2005的版本，而我们还在学Turbo C++.不得不说的是，编程语言也在快速进步中，像php，.net，Java，Python，ruby等等的一大堆都在不停地进化，创新。然而这些编程语言，都没有被列入教学的课程里去。目前，我学校只是把C和Java列入到必修课而已。C学的是80年代的C，而不是最新的C.目前，互联网第一巨头——Google，最紧缺的人才是Python这些新兴语言的程序员和Liunx维护人员，可是我们大学没有这些课程。&lt;br>
　　4.什么都学，一点针对性也没有&lt;br>
　　大学和其他诸如技工之类的学校有一个很大的不同，普遍认为，大学属于研究类学校，其他诸如技工之类的学校是应用类学校。所谓的研究类学校就是指充分培养学生的综合素质，让学生拥有自己创新自主研究和开发能力，比如开发计算机程序，开发机床的操作系统。所谓的应用类学校就是指让学生学习某一个已经开发出来的系统，让学生能够熟练操作这个系统，进行一系列的生产活动，比如学习学习机床操作，学习Photoshop和Office等等。但是，大学生卖猪肉的事实是不是在告诉我们，我们已经“研究”过头了呢？像我，学计算机的，你让我学好相关的编程语言和硬件设计方面的知识不就行了吗？你让我学爱因斯坦的相对论，学军事理论（射击，枪支什么的），甚者要背一大堆背过就忘记的思想政治。而.net，Python，ruby等等这些新兴的编程语言却没有被列入教学课程中去。这样合理吗？我们研究过头了吧！所谓的研究类学校蓦然变成了“学过就忘记的学校”，还谈得上什么研究呢？我的一个师兄，高考落榜，在上海读技工学校（3年制），他一毕业出来就进了一个工厂当机床操作人员，一进厂的工资是2500元，第二个月，厂里就把他的工资加到了5000元，因为他这种机床操作人员很缺，老板怕他跳槽。他学什么呢？两样东西，上课就学习机床操作的相关理论，学习完理论课后就疯狂地到机床前实践。学习的就是两样东西，学习机床理论和亲手实践自己学到的理论。学完根本就不会再忘记了。当然，大学不能像技工学校一样，用这种教育方式。因为，研究类学校，这个出发点是好的，开发机床操作系统的人始终是大学生，技工学生操作的是大学生开发的系统。但是，你不得不承认，这给了我们一个启示，用3个字就可以概括这个启示——针对性。现在的大学课程就是东打一炮，西打一炮，炮声左耳进右耳出，到头来学生什么都学不到。通常来说，一个毕业的大学生比不上一个毕业的技工学生。一个毕业的大学生通常是什么都不会，很多计算机专业的学生，毕业后连一个小程序都不会编。一个毕业的技工学生，通常能够熟练地操作机床。你说，谁的竞争力大？再举一个例子吧：一个计算机系的学生去应聘，主考官叫他说一下自己的情况。他说：我是个搞IT的，写过2个新浪博客，写过10个百度空间，会一点Photoshop，比较熟悉互联网。主考官收下了他的简历，在简历上面写了3个字——会上网。这就是所谓的大学生了吗？他能够比得上一位机床工人吗？你就别跟老子开玩笑了。研究类学校，研究过头了吧！&lt;br>
　　5.最后的矛头——指向我们的教育体制&lt;br>
　　高考制度，其实我并不反对，中国有13亿人，只有高考制度才能保证教育公平和公正。但是上到大学，这一套早该扔掉了吧！为什么，应试制度，就像一个幽灵，在高等教育里徘徊不去呢？高等教育里，为什么还有应试教育的影子呢？为什么我们学了就忘记呢？为什么我们学了一大堆，到头来上面都得不到呢？为什么大学里的知识会和社会严重脱节呢？反思吧，我们的高等教育体制！我们在培养人才，还是在培养蠢材？&lt;br>
　　（4）大学生的出路在哪里？&lt;br>
　　你以为你安安稳稳地读完四年大学，出来就能找到一份好工作的话。那，你醒醒吧！如果你毕业后，四年大学就像没有读过一样，什么都忘记了，那你在市场上卖猪肉并不是什么稀奇的事儿。你和普通老百姓起点一样，都是什么都不会，人家卖惯猪肉的老百姓刀法还比你熟练。像我师兄那样的机床工人你是没有办法比的，5000个大洋在金融危机的今天，意味着什么，你和我都知道。我们的出路在哪里呢？我们的出路其实在于我们自己！大学的本质在于自学，像我，学计算机，学校不开Python等等的课程，我就自学去吧。作为一个大学生，必须紧紧地了解社会的需求，自学相应的知识。如果你认为我们的高等教育体制还值得信任的话，你还是磨好你的猪肉刀吧！&lt;br>
　　（5）题外话——对那些攻击计算机专业的反击&lt;br>
　　什么专家教授之类的东东，老是攻击计算机专业，说什么计算机专业就业困难，社会需求量少，大家不要去读计算机专业了。现在的专家和教授的质量大家都知道，专家叫“砖家”，教授叫“叫兽”。比如，杨叫兽（羊角兽），主张一周上网超过40小时就已经属于精神病范畴的了，是必须接受电击治疗的了，这就是叫兽的质量了。某些所谓的砖家叫兽，随便找间学校，统计一下，结果发现计算机专业的就业率是最低的，之后就马上大声呼吁：大家不要读计算机啊，就业困难，社会需求量少。前几天我和几个师兄去找辅导员吃饭，大伙们又再一次讨论了就业问题。几个师兄都在IT行业里打拼了一阵子的了，辅导员安排了一届又一届的学生就业。他们都认为，中国的软件产业还处于成长期，其市场潜力还远远没有挖掘出来，人才需求量每年在100万左右，如果大学四年好好利用，充分了解社会需求的话，你的前途无可限量。为什么在很多的学校，计算机专业的就业率都是垫底的呢？辅导员给了我们明确的答案，他说90%的学生毕业出来，连一个最基本的小程序都不会写，学了四年学了什么都不知道，谁肯请你？这就是就业率低的原因了。这不是计算机专业本身的问题，是学生的问题。其实计算机专业确实挺矛盾，一方面是低的就业率，一方面是庞大的人才需求。&lt;br>
　　就说得这里了，再一次希望大家能够多多指教。&lt;br>
来源：http://www.zhanqi.info&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/it/">IT</category><category domain="https://fatkun.github.io/tags/%E5%A4%A7%E5%AD%A6%E7%94%9F/">大学生</category><category domain="https://fatkun.github.io/tags/%E5%AD%A6%E4%B9%A0/">学习</category></item><item><title>Delphi2010发布，以及各语言的排名</title><link>https://fatkun.github.io/2009/09/delphi2010%E5%8F%91%E5%B8%83%EF%BC%8C%E4%BB%A5%E5%8F%8A%E5%90%84%E8%AF%AD%E8%A8%80%E7%9A%84%E6%8E%92%E5%90%8D.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/delphi2010%E5%8F%91%E5%B8%83%EF%BC%8C%E4%BB%A5%E5%8F%8A%E5%90%84%E8%AF%AD%E8%A8%80%E7%9A%84%E6%8E%92%E5%90%8D.html</guid><pubDate>Thu, 24 Sep 2009 11:06:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909240312033714.jpg" alt="" title="" />
Delphi现在已经很少人使用了。现在（2009/09）排名是11
&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909240312033714.jpg" alt="" title="" />
Delphi现在已经很少人使用了。现在（2009/09）排名是11
&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909240316327700.jpg" alt="" title="" /></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category><category domain="https://fatkun.github.io/tags/delphi/">Delphi</category><category domain="https://fatkun.github.io/tags/%E6%8E%92%E8%A1%8C/">排行</category><category domain="https://fatkun.github.io/tags/%E7%BC%96%E7%A8%8B%E8%AF%AD%E8%A8%80/">编程语言</category></item><item><title>信息管理实验三-ASP.NET 使用GirdView</title><link>https://fatkun.github.io/2009/09/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C%E4%B8%89-asp-net-%E4%BD%BF%E7%94%A8girdview.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C%E4%B8%89-asp-net-%E4%BD%BF%E7%94%A8girdview.html</guid><pubDate>Wed, 23 Sep 2009 09:14:02 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>使用Gridview控件显示数据库内容&lt;br>
老 蔡&lt;br>
Email：cxianfa@126.com&lt;br>
实验主要步骤：&lt;br>
1:新建一个数据库名字为EmployDB,在其中添加一张表EmployInfo，字段有Name，Sex，Job，Salary, 并且向其中插入一些数据.&lt;br>
2: 新建一个ASP.NET程序，在主界面上拖放一个Gridview数据库控件。&lt;br>
3：添加命名空间：using System.Data.SqlClient;&lt;br>
Default.aspx&lt;br>
…&lt;/p>
&lt;p>使用Gridview控件显示数据库内容&lt;br>
老 蔡&lt;br>
Email：cxianfa@126.com&lt;br>
实验主要步骤：&lt;br>
1:新建一个数据库名字为EmployDB,在其中添加一张表EmployInfo，字段有Name，Sex，Job，Salary, 并且向其中插入一些数据.&lt;br>
2: 新建一个ASP.NET程序，在主界面上拖放一个Gridview数据库控件。&lt;br>
3：添加命名空间：using System.Data.SqlClient;&lt;br>
Default.aspx&lt;/p>
&lt;pre class="html">&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;
&amp;lt;head runat="server"&amp;gt;
&amp;lt;title&amp;gt;无标题页&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form id="form1" runat="server"&amp;gt;
&amp;lt;div&amp;gt;
&amp;lt;asp:GridView ID="GridView1" runat="server"&amp;gt;
&amp;lt;/asp:GridView&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre>
&lt;p>Default.aspx.cs&lt;/p>
&lt;pre class="c#">using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
SqlConnection sqlcon;
string strCon = "data source=localhost;database=EmployDB;uid=sa;pwd=;";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) {
Bind();
}
}
public void Bind() {
string sqlStr = "select TOP 10 * from EmployInfo";
sqlcon = new SqlConnection(strCon);
SqlDataAdapter sda = new SqlDataAdapter(sqlStr, sqlcon);
DataSet ds = new DataSet();
sqlcon.Open();
sda.Fill(ds, "EmployInfo");
GridView1.DataSource = ds;
GridView1.DataBind();
sqlcon.Close();
}
}
&lt;/pre></description><category domain="https://fatkun.github.io/categories/asp.net/">ASP.NET</category><category domain="https://fatkun.github.io/tags/%E4%BF%A1%E6%81%AF%E7%AE%A1%E7%90%86%E5%AE%9E%E9%AA%8C/">信息管理实验</category></item><item><title>XP的“英文-美式键盘”总是删除不掉解决方法</title><link>https://fatkun.github.io/2009/09/xp%E7%9A%84%E2%80%9C%E8%8B%B1%E6%96%87-%E7%BE%8E%E5%BC%8F%E9%94%AE%E7%9B%98%E2%80%9D%E6%80%BB%E6%98%AF%E5%88%A0%E9%99%A4%E4%B8%8D%E6%8E%89%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/xp%E7%9A%84%E2%80%9C%E8%8B%B1%E6%96%87-%E7%BE%8E%E5%BC%8F%E9%94%AE%E7%9B%98%E2%80%9D%E6%80%BB%E6%98%AF%E5%88%A0%E9%99%A4%E4%B8%8D%E6%8E%89%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html</guid><pubDate>Tue, 22 Sep 2009 04:46:50 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909212108402182.jpg" alt="" title="" />
类似这样的情况
英文
——美式键盘
中文
——简体中文（美式键盘）
——紫光拼音输入法
每次把 英文——美式键盘 删除掉，电脑重启后又会出现。
出现这样的原因是有一次我修改了区域语言，所以造成这样的效果。怎么删除呢？这里我们可以选择一个国产的软件IMETool（http://www.mympc.org）就可以选择需要删除的输入法，重启后不会再出现“英文-美式键盘”啦。
&lt;a href="http://www.mympc.org/down/1/2005-7-13_17130159234.html" target="_blank">点我啦点我下载IMETool&lt;/a>
&amp;#8230;
&lt;p>类似这样的情况&lt;br>
英文&lt;br>
——美式键盘&lt;br>
中文&lt;br>
——简体中文（美式键盘）&lt;br>
——紫光拼音输入法&lt;br>
每次把 英文——美式键盘 删除掉，电脑重启后又会出现。&lt;br>
出现这样的原因是有一次我修改了区域语言，所以造成这样的效果。怎么删除呢？这里我们可以选择一个国产的软件IMETool（http://www.mympc.org）就可以选择需要删除的输入法，重启后不会再出现“英文-美式键盘”啦。&lt;br>
&lt;a href="http://www.mympc.org/down/1/2005-7-13_17130159234.html" target="_blank">点我啦点我下载IMETool&lt;/a>&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909212108402182.jpg" alt="" title="" />&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/%E4%B8%8D%E8%83%BD%E5%88%A0%E9%99%A4/">不能删除</category><category domain="https://fatkun.github.io/tags/%E8%BE%93%E5%85%A5%E6%B3%95/">输入法</category></item><item><title>JBOSS把网页文件放入哪里才能在浏览器浏览？</title><link>https://fatkun.github.io/2009/09/jboss%E6%8A%8A%E7%BD%91%E9%A1%B5%E6%96%87%E4%BB%B6%E6%94%BE%E5%85%A5%E5%93%AA%E9%87%8C%E6%89%8D%E8%83%BD%E5%9C%A8%E6%B5%8F%E8%A7%88%E5%99%A8%E6%B5%8F%E8%A7%88%EF%BC%9F.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/jboss%E6%8A%8A%E7%BD%91%E9%A1%B5%E6%96%87%E4%BB%B6%E6%94%BE%E5%85%A5%E5%93%AA%E9%87%8C%E6%89%8D%E8%83%BD%E5%9C%A8%E6%B5%8F%E8%A7%88%E5%99%A8%E6%B5%8F%E8%A7%88%EF%BC%9F.html</guid><pubDate>Mon, 21 Sep 2009 17:40:43 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/xxxx.jpg" alt="" title="" />
如果使用EclipseJee等工具的就不会有这个疑问了，IDE会自动帮你放到某个目录下面。
那到底文件要放在哪里呢？
答案就是在JBOSS所在目录\server\default\deploy下，新建一个文件夹xxxx.war（xxxx可以为任意字母，区分大小写，从浏览器访问也是这个名字）在里面放入你的网页文件。
我写一个最简单的网页测试一下
index.jsp
&lt;pre class="java">&amp;lt;%
out.println("Hello,Fatkun!");
%>
&lt;/pre>
把index.jsp放入xxxx.war文件夹内，启动JBOSS（如果原先开了的话先关了再开），等一会儿，再启动浏览器访问：http://localhost:8080/xxxx/index.jsp
&amp;#8230;
&lt;p>如果使用EclipseJee等工具的就不会有这个疑问了，IDE会自动帮你放到某个目录下面。&lt;br>
那到底文件要放在哪里呢？&lt;br>
答案就是在JBOSS所在目录\server\default\deploy下，新建一个文件夹xxxx.war（xxxx可以为任意字母，区分大小写，从浏览器访问也是这个名字）在里面放入你的网页文件。&lt;br>
我写一个最简单的网页测试一下&lt;br>
index.jsp&lt;/p>
&lt;pre class="java">&amp;lt;%
out.println("Hello,Fatkun!");
%&amp;gt;
&lt;/pre>
&lt;p>把index.jsp放入xxxx.war文件夹内，启动JBOSS（如果原先开了的话先关了再开），等一会儿，再启动浏览器访问：http://localhost:8080/xxxx/index.jsp&lt;br>
OK,如无意外，你就看到刚才写的网页啦。&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/xxxx.jpg" alt="" title="" />&lt;br>
————–&lt;br>
UPDATE:2009-10-10&lt;br>
如果想启动all的服务，需要在run.bat后面加上参数”-c all”（当然不包括双引号，大家都知道是事情啦~），也就说在cmd中进入jboss/bin目录中，输入”run.bat -c all”就会启动all目录下的东西，记得这时的网页目录变为”JBOSS所在目录\server\all\deploy”下了。&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/jboss/">Jboss</category><category domain="https://fatkun.github.io/tags/jsp%E5%AE%9E%E9%AA%8C/">JSP实验</category></item><item><title>【基础教程】JBOSS4的安装与测试</title><link>https://fatkun.github.io/2009/09/%E3%80%90%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B%E3%80%91jboss4%E7%9A%84%E5%AE%89%E8%A3%85%E4%B8%8E%E6%B5%8B%E8%AF%95.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E3%80%90%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B%E3%80%91jboss4%E7%9A%84%E5%AE%89%E8%A3%85%E4%B8%8E%E6%B5%8B%E8%AF%95.html</guid><pubDate>Mon, 21 Sep 2009 17:19:56 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909211001011467.jpg" alt="" title="" />
准备软件：
JBoss-4.2.3.GA：http://sourceforge.net/projects/jboss/
&lt;a href="http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA.zip/download" target="_blank">点我下载吧&lt;/a>
JDK1.6：http://java.sun.com/javase/downloads/找到JDK6下载
如果本来已经安装JDK1.6了就不用再下载安装了。（注意：JBoss-4.2.3与JDK依赖，&lt;font color="Red">请尽量使用JDK1.6版&lt;/font>，其他版本JDK我没测试过）
&amp;#8230;
&lt;p>准备软件：&lt;br>
JBoss-4.2.3.GA：http://sourceforge.net/projects/jboss/&lt;br>
&lt;a href="http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA.zip/download" target="_blank">点我下载吧&lt;/a>&lt;br>
JDK1.6：http://java.sun.com/javase/downloads/找到JDK6下载&lt;br>
如果本来已经安装JDK1.6了就不用再下载安装了。（注意：JBoss-4.2.3与JDK依赖，&lt;font color="Red">请尽量使用JDK1.6版&lt;/font>，其他版本JDK我没测试过）&lt;br>
安装好JDK后，解压JBOSS到一个目录下，这里我解压到D:\，也就是说我的JBOSS主目录是D:\jboss-4.2.3.GA（&lt;font color="Red">注意不能解压到中文目录下&lt;/font>）&lt;br>
1.然后把JDK的环境变量配置上，在“我的电脑”右键-&amp;gt;系统属性-&amp;gt;“高级”选项卡的“环境变量”，在下面的系统变量找到PATH，编辑它，在最后加入“;你安装JDK的bin目录”（注意前面有一个&lt;strong>分号(;)&lt;/strong>，我加入的内容是“;C:\Program Files\Java\jdk1.6.0_10\bin”）&lt;br>
2.新建“JAVA_HOME”变量，填入值“你安装JDK的目录”（我的是“C:\Program Files\Java\jdk1.6.0_10”）&lt;br>
3.在D:\jboss-4.2.3.GA\bin目录下运行run.bat，等待运行停止后，在浏览器输入http://localhost:8080就可以看到JBOSS的网页了。如果没看到网页，可能那部分有问题，请仔细检查~&lt;br>
JBOSS配置好运行的图像：&lt;br>
&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909211001011467.jpg" alt="" title="" />&lt;/p></description><category domain="https://fatkun.github.io/categories/j2ee/">J2EE</category><category domain="https://fatkun.github.io/tags/jboss/">Jboss</category><category domain="https://fatkun.github.io/tags/jsp%E5%AE%9E%E9%AA%8C/">JSP实验</category><category domain="https://fatkun.github.io/tags/%E6%9C%8D%E5%8A%A1%E5%99%A8/">服务器</category></item><item><title>Unix/Linux 命令速查表</title><link>https://fatkun.github.io/2009/09/unixlinux-%E5%91%BD%E4%BB%A4%E9%80%9F%E6%9F%A5%E8%A1%A8.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/unixlinux-%E5%91%BD%E4%BB%A4%E9%80%9F%E6%9F%A5%E8%A1%A8.html</guid><pubDate>Mon, 21 Sep 2009 09:21:34 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这份 Unix/Linux 命令速查表来自 &lt;a href="http://fosswire.com/2007/08/02/unixlinux-command-cheat-sheet/" target="_blank">FOSSwire&lt;/a>，其中涵盖了包括文件、进程管理、文件权限、SSH、搜索、系统信息、压缩、网络、安装等方面的常用命令。已经将其翻译成了中文，希望对中文 Unix/Linux 使用者能够带来一些帮助。&lt;/p>
&lt;p>这份 Unix/Linux 命令速查表来自 &lt;a href="http://fosswire.com/2007/08/02/unixlinux-command-cheat-sheet/" target="_blank">FOSSwire&lt;/a>，其中涵盖了包括文件、进程管理、文件权限、SSH、搜索、系统信息、压缩、网络、安装等方面的常用命令。已经将其翻译成了中文，希望对中文 Unix/Linux 使用者能够带来一些帮助。&lt;br>
&lt;a href="http://fatkun.com/upload/2009/9/fwunixref.pdf" target="_blank">unix/Linux命令速查表,点此下载&lt;/a>&lt;br>
翻译作者：Linuxtoy&lt;br>
出处：http://linuxtoy.org/archives/unix-linux-command-cheat-sheet.html&lt;/p></description><category domain="https://fatkun.github.io/categories/linux/">Linux</category><category domain="https://fatkun.github.io/tags/linux/">Linux</category><category domain="https://fatkun.github.io/tags/%E5%91%BD%E4%BB%A4/">命令</category><category domain="https://fatkun.github.io/tags/%E9%80%9F%E6%9F%A5%E8%A1%A8/">速查表</category></item><item><title>当时我就震惊了【1P】</title><link>https://fatkun.github.io/2009/09/%E5%BD%93%E6%97%B6%E6%88%91%E5%B0%B1%E9%9C%87%E6%83%8A%E4%BA%86%E3%80%901p%E3%80%91.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E5%BD%93%E6%97%B6%E6%88%91%E5%B0%B1%E9%9C%87%E6%83%8A%E4%BA%86%E3%80%901p%E3%80%91.html</guid><pubDate>Sun, 20 Sep 2009 14:55:44 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909200701517868.jpg" alt="" title="" />
&lt;img onload="ResizeImage(this,620)" src="http://fatkun.com/upload/2009/9/200909200701517868.jpg" alt="" title="" /></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>在Z-Blog上使用SyntaxHighlighter1.5（代码高亮，不复制行号）修改方法</title><link>https://fatkun.github.io/2009/09/%E5%9C%A8z-blog%E4%B8%8A%E4%BD%BF%E7%94%A8syntaxhighlighter1-5%EF%BC%88%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE%EF%BC%8C%E4%B8%8D%E5%A4%8D%E5%88%B6%E8%A1%8C%E5%8F%B7%EF%BC%89%E4%BF%AE%E6%94%B9%E6%96%B9.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E5%9C%A8z-blog%E4%B8%8A%E4%BD%BF%E7%94%A8syntaxhighlighter1-5%EF%BC%88%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE%EF%BC%8C%E4%B8%8D%E5%A4%8D%E5%88%B6%E8%A1%8C%E5%8F%B7%EF%BC%89%E4%BF%AE%E6%94%B9%E6%96%B9.html</guid><pubDate>Sun, 20 Sep 2009 04:44:52 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>这里我是使用了SyntaxHighlighter1.51版本来修改的，到目前为止已经有SyntaxHighlighter2.0版本了。可以到这里下载：http://code.google.com/p/syntaxhighlighter/&lt;br>
至于选择1.5版本修改的其中一个原因是1.5版本前面的行号是用CSS实现的，直接复制代码时不会把前面的行号复制，这是我选择它的一个重要原因。&lt;/p>
&lt;p>有插件了，看看这里&lt;a href="http://fatkun.com/post/2009/10/SyntaxHighlighter2_Z-blog.html" target="_blank">【原创】Z-blog插件-SyntaxHighlighter for Z-blog代码高亮&lt;/a>&lt;br>
这里我是使用了SyntaxHighlighter1.51版本来修改的，到目前为止已经有SyntaxHighlighter2.0版本了。可以到这里下载：http://code.google.com/p/syntaxhighlighter/&lt;br>
至于选择1.5版本修改的其中一个原因是1.5版本前面的行号是用CSS实现的，直接复制代码时不会把前面的行号复制，这是我选择它的一个重要原因。由于flash10不允许直接操作剪贴板，必须由用户激活falsh才能使用“复制按钮”，故1.5版使用复制的方法已经失效了。我参考了javaeye.com的修改方法，直接用一个flash为复制按钮（当然还有更好的方法，例如SyntaxHighlighter2.0已经实现了，还有我前面提到的&lt;a href="http://blog.fatkun.com/view.asp?id=9" target="_blank">Zero Clipboard项目&lt;/a>）&lt;br>
我修改的这个版本可以在Z-Blog很好的使用~在下面我会打包发上来~&lt;br>
由于Z-Blog会把转行改为&lt;BR>，所以我们要转换回来&lt;br>
废话少说，贴部分主要代码&lt;br>
在shCore.js找到下面这句代码&lt;/p>
&lt;pre class="brush:&amp;quot;js&amp;quot;;">this.originalCode=code;this.code=Chop(Unindent(code));
&lt;/pre>
&lt;p>改为：(也就是说把&lt;BR>给替换回转行了)&lt;/p>
&lt;pre class="brush:&amp;quot;js&amp;quot;;">code=code.replace(/&amp;lt;BR&amp;gt;/ig, "\n");this.originalCode=code;this.code=Chop(Unindent(code));
&lt;/pre>
&lt;p>&lt;strong>上面是主要的修改方法，下面说使用方法&lt;/strong>&lt;br>
最后我喜欢把这些代码写在网站设置管理版权申明那里，比较方便修改，你也可以写在模板里（注意下面的路径根据具体目录更换，最好用绝对路径）&lt;/p>
&lt;pre class="brush:&amp;quot;js&amp;quot;;">&amp;lt;link type="text/css" rel="stylesheet" href="https://fatkun.github.io/zb/highlight/SyntaxHighlighter.css"&amp;gt;&amp;lt;/link&amp;gt;
&amp;lt;script language="javascript" src="https://fatkun.github.io/zb/highlight/shCore.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script language="javascript" src="https://fatkun.github.io/zb/highlight/shBrushCSharp.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script language="javascript" src="https://fatkun.github.io/zb/highlight/shBrushJScript.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script language="javascript" src="https://fatkun.github.io/zb/highlight/shBrushSql.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script language="javascript" src="https://fatkun.github.io/zb/highlight/shBrushJava.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script language="javascript" src="https://fatkun.github.io/zb/highlight/shBrushXml.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script language="javascript"&amp;gt;
window.onload = function () {
dp.SyntaxHighlighter.ClipboardSwf = '/zb/highlight/clipboard_new.swf';
dp.SyntaxHighlighter.ClipboardImg = '/zb/highlight/icon_copy.gif';
dp.SyntaxHighlighter.HighlightAll();
}
&amp;lt;/script&amp;gt;
&lt;/pre>
&lt;p>使用方法，在内容中加入：&lt;/p>
&lt;pre class="brush:&amp;quot;xml&amp;quot;;">&amp;lt;pre class="这里写你代码所用的语言，如js,c#,java"&amp;gt;这里贴代码！注意如果有&amp;lt;BR&amp;gt;记得要用转义（&amp;amp;lt;）&amp;lt;/pre&amp;gt;
&lt;/pre>
&lt;p>打包下载啦，猛击这里：&lt;a href="http://fatkun.com/upload/2009/9/dp.SyntaxHighlighter-zblog@fatkun.rar" target="_blank">&lt;a href="mailto:dp.SyntaxHighlighter-zblog@fatkun.rar">dp.SyntaxHighlighter-zblog@fatkun.rar&lt;/a>&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%BD%91%E9%A1%B5%E5%89%8D%E7%AB%AF/">网页前端</category><category domain="https://fatkun.github.io/tags/syntaxhighlighter/">SyntaxHighlighter</category><category domain="https://fatkun.github.io/tags/z-blog/">Z-Blog</category><category domain="https://fatkun.github.io/tags/%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE/">代码高亮</category></item><item><title>SEO菜鸟需要掌握哪些基本SEO技巧？</title><link>https://fatkun.github.io/2009/09/seo%E8%8F%9C%E9%B8%9F%E9%9C%80%E8%A6%81%E6%8E%8C%E6%8F%A1%E5%93%AA%E4%BA%9B%E5%9F%BA%E6%9C%ACseo%E6%8A%80%E5%B7%A7%EF%BC%9F.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/seo%E8%8F%9C%E9%B8%9F%E9%9C%80%E8%A6%81%E6%8E%8C%E6%8F%A1%E5%93%AA%E4%BA%9B%E5%9F%BA%E6%9C%ACseo%E6%8A%80%E5%B7%A7%EF%BC%9F.html</guid><pubDate>Sat, 19 Sep 2009 02:47:06 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>SEO菜鸟需要掌握的基本SEO技巧如下：&lt;br>
&lt;strong>导航&lt;/strong>&lt;br>
请确保你的网站导航都是以html的形式链接。所有页面之间应该有广泛的互联，如果无法实现这一点，可以考虑建立一个网站地图。&lt;br>
&lt;strong>首页&lt;/strong>&lt;br>
网站的首页（home或index页等）应该采用文本的形式，而不是flash等。这个文本里面要包含你的目标关键字或目标短语。&lt;br>
&lt;strong>标签&lt;/strong>&lt;/p>
&lt;title> &lt; /title>这是标题标签，这里面应当包含你最重要的目标关键词。&lt;br /> &lt;b>Meta Tags&lt;/b>&lt;br /> &amp;#8216;description tag&amp;#8217;（描述标签） 和 &amp;#8216;keyword tag&amp;#8217; （关键词标签）应包含你的目标关键字或目标短语，但不要重复。&lt;br /> &amp;#8230;&lt;/p>
&lt;p>
&lt;p>&lt;br /> SEO菜鸟需要掌握的基本SEO技巧如下：&lt;br /> &lt;b>导航&lt;/b>&lt;br /> 请确保你的网站导航都是以html的形式链接。所有页面之间应该有广泛的互联，如果无法实现这一点，可以考虑建立一个网站地图。&lt;br /> &lt;b>首页&lt;/b>&lt;br /> 网站的首页（home或index页等）应该采用文本的形式，而不是flash等。这个文本里面要包含你的目标关键字或目标短语。&lt;br /> &lt;b>标签&lt;/b>&lt;br />&lt;/p>
&lt;pre>&lt;code>&amp;lt;title&amp;gt; &amp;lt; /title&amp;gt;这是标题标签，这里面应当包含你最重要的目标关键词。&amp;lt;br /&amp;gt; &amp;lt;b&amp;gt;Meta Tags&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt; &amp;amp;#8216;description tag&amp;amp;#8217;（描述标签） 和 &amp;amp;#8216;keyword tag&amp;amp;#8217; （关键词标签）应包含你的目标关键字或目标短语，但不要重复。&amp;lt;br /&amp;gt; &amp;lt;b&amp;gt;Alt Tags&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt; 网站上重要的图片，如：logo，照片，导航图片等，要加上简单的描述。&amp;lt;br /&amp;gt; &amp;lt;b&amp;gt;关键词文本&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt; 在你的站点中，应该有一些包含着很高关键字密度的页面。但这个办法不要使用过头，否则会被搜索引擎当作是作弊而适得其反。&amp;lt;br /&amp;gt; &amp;lt;b&amp;gt;向搜索引擎提交&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt; 请不要使用软件或自动提交服务。其实，没有必要向成千上百的搜索引擎提交你的网址。五大主要搜索引擎和目录占着90%的搜索流量。手动的向那几个熟悉的搜索引擎提交你的网址就够了，那花不了你几分钟时间。&amp;lt;br /&amp;gt; &amp;lt;b&amp;gt;友情链接&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt; 和同行网站进行友情链接，内容相关、PR值比自己高的站点最好。千万不要加入链接养殖场 （Link Form），那样会让你被搜索引擎封掉。&amp;lt;br /&amp;gt; 以上的建议，非常简短的，但对于SEO菜鸟非常管用。如果你想更多的学习SEO，并让自己的站点成为互联网上的明星，那么你应该把SEO十万个为什么订阅下来。&amp;lt;br /&amp;gt; 作者:夫唯@SEO培训 SEO修订1.1 2008-09-28&amp;lt;/p&amp;gt;&lt;/code>&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category></item><item><title>计算机无法访问,您可能没有权限使用网络资源(windows 共享文件出错解决方法)</title><link>https://fatkun.github.io/2009/09/%E8%AE%A1%E7%AE%97%E6%9C%BA%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AE%E6%82%A8%E5%8F%AF%E8%83%BD%E6%B2%A1%E6%9C%89%E6%9D%83%E9%99%90%E4%BD%BF%E7%94%A8%E7%BD%91%E7%BB%9C%E8%B5%84%E6%BA%90windows-%E5%85%B1.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E8%AE%A1%E7%AE%97%E6%9C%BA%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AE%E6%82%A8%E5%8F%AF%E8%83%BD%E6%B2%A1%E6%9C%89%E6%9D%83%E9%99%90%E4%BD%BF%E7%94%A8%E7%BD%91%E7%BB%9C%E8%B5%84%E6%BA%90windows-%E5%85%B1.html</guid><pubDate>Thu, 17 Sep 2009 08:04:03 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;table cellspacing="0" cellpadding="0" width="720" align="center"> &lt;tr> &lt;td class="txt_28" valign="top" width="720" height="200"> &lt;p> &lt;font color="#0000ff" size="2">计算机无法访问,您可能没有权限使用网络资源.请与这台服务器的管理员联系以查明您&lt;/font> &lt;/p>
&lt;p> &amp;#8230; &lt;/p>&lt;/table>
&lt;pre>&lt;code> &amp;lt;p&amp;gt;
&lt;/code>&lt;/pre>
&lt;/p>
&lt;pre>&lt;code> &amp;lt;table cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;0&amp;quot; width=&amp;quot;720&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt; &amp;lt;tr&amp;gt; &amp;lt;td class=&amp;quot;txt_28&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;720&amp;quot; height=&amp;quot;200&amp;quot;&amp;gt; &amp;lt;p&amp;gt; &amp;lt;font color=&amp;quot;#0000ff&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;计算机无法访问,您可能没有权限使用网络资源.请与这台服务器的管理员联系以查明您&amp;lt;/font&amp;gt; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; （&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;1)&amp;lt;/font&amp;gt;安装&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;NWlink IPX/SPX/NetBIOS Compatible Transport Protocol&amp;lt;/font&amp;gt;协议。 &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;lt;span style=&amp;quot;color: #ff6600&amp;quot;&amp;gt;（&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;2)&amp;lt;/font&amp;gt;开启&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;guest&amp;lt;/font&amp;gt;账号：&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;&amp;quot;&amp;gt;右击我的电脑&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;管理&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;用户有个&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;guest&amp;lt;/font&amp;gt;，双击之去掉&amp;amp;ldquo;账户已停用&amp;amp;rdquo;前面的勾。&amp;lt;/span&amp;gt; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;lt;p&amp;gt; &amp;amp;nbsp; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; （&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;3)&amp;lt;/font&amp;gt;右击我的电脑&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;属性&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;计算机名，查看该选项卡中出现的局域网工作组名称 &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; （&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;4&amp;lt;/font&amp;gt;）&amp;lt;span style=&amp;quot;color: #ff6600&amp;quot;&amp;gt;使用&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;winxp&amp;lt;/font&amp;gt;防火墙的例外&amp;lt;/span&amp;gt;：&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;winxp&amp;lt;/font&amp;gt;防火墙在默认状态下是全面启用的，这意味着运行计算机的所有网络连接，难于实现网上邻居共享。同时，由于&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;windows&amp;lt;/font&amp;gt;防火墙默认状态下是禁止&amp;amp;ldquo;文件与打印机共享的&amp;amp;rdquo;，所以，启用了防火墙，往往不能共享打印，解决办法是：进入&amp;amp;ldquo;本地连接&amp;amp;rdquo;窗口，点&amp;amp;ldquo;高级&amp;amp;rdquo;&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;&amp;amp;ldquo;设置&amp;amp;rdquo;&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;&amp;amp;ldquo;例外&amp;amp;rdquo;&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;在程序与服务下勾选&amp;amp;ldquo;文件和打印机共享&amp;amp;rdquo;。 &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;lt;span style=&amp;quot;color: #ff6600&amp;quot;&amp;gt;（&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;5)&amp;lt;/font&amp;gt;删除&amp;amp;ldquo;拒绝从网络上访问这台计算机&amp;amp;rdquo;项中的&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;guest&amp;lt;/font&amp;gt;账户&amp;lt;/span&amp;gt;：运行组策略（&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;gpedit.msc&amp;lt;/font&amp;gt;）&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;本地计算机&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;计算机配置&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\windows&amp;lt;/font&amp;gt;设置&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;安全设置&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;本地策略&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;用户权利指派&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;拒绝从网络访问这台计算机。如果其中有&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;guest&amp;lt;/font&amp;gt;，则将其删除。（原因是：有时&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;xp&amp;lt;/font&amp;gt;的&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;guest&amp;lt;/font&amp;gt;是不允许访问共享的） &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;lt;p&amp;gt; &amp;amp;nbsp; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; （&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;6)&amp;lt;/font&amp;gt;取消&amp;amp;ldquo;使用简单文件共享&amp;amp;rdquo;方式：资源管理器&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;工具&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;文件夹选项&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;查看&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;去掉&amp;amp;ldquo;使用简单文件共享（推荐）&amp;amp;rdquo;前面的勾。 &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;lt;p&amp;gt; &amp;amp;nbsp; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; （&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;7)&amp;lt;/font&amp;gt;工作组名称一致。 &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;lt;p&amp;gt; &amp;amp;nbsp; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; （&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;8)&amp;lt;/font&amp;gt;勾选&amp;amp;ldquo;&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;Microsoft&amp;lt;/font&amp;gt;网络的文件和打印机共享&amp;amp;rdquo;。 &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; （&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;9)&amp;lt;/font&amp;gt;运行服务策略&amp;amp;ldquo;&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;Services.msc&amp;lt;/font&amp;gt;&amp;amp;rdquo;。启动其中的&amp;amp;ldquo;&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;Clipbook Server&amp;lt;/font&amp;gt;&amp;amp;rdquo;&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;(&amp;lt;/font&amp;gt;文件夹服务器&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;)&amp;lt;/font&amp;gt;：这个服务允许你们网络上的其他用户看到你的文件夹。当然有时你可把它改为手动启动，然后再使用其他程序在你的网络上发布信息。 &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;lt;p&amp;gt; &amp;amp;nbsp; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; （&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;10)win98&amp;lt;/font&amp;gt;的计算机无法访问&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;win2000/winxp&amp;lt;/font&amp;gt;的计算机，原因是：&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;win2000/winxp&amp;lt;/font&amp;gt;的计算机中的&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;guest&amp;lt;/font&amp;gt;用户被禁用了或者&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;win2000/winxp&amp;lt;/font&amp;gt;采用&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;NTFS&amp;lt;/font&amp;gt;分区格式，设置了权限控制。一般要允许&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;win98&amp;lt;/font&amp;gt;访问的话，&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;win2000/winxp&amp;lt;/font&amp;gt;里的安全控制里不要将&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;everyone&amp;lt;/font&amp;gt;的账号组删除。 &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; 注意：&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;a&amp;lt;/font&amp;gt;、如果您没有加入域并想查看&amp;amp;ldquo;安全&amp;amp;rdquo;选项卡，则设置显示&amp;amp;ldquo;安全&amp;amp;rdquo;选项卡：资源管理器&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;工具&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;文件夹选项&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;查看&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;去掉&amp;amp;ldquo;使用简单文件共享（推荐）&amp;amp;rdquo;前面的勾。&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;b&amp;lt;/font&amp;gt;、查看文件和文件夹的有效权限：资源管理器&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;右击要查看有效权限该文件或文件夹&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;&amp;amp;ldquo;属性&amp;amp;rdquo;&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;单击&amp;amp;ldquo;安全&amp;amp;rdquo;选项卡&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;&amp;amp;ldquo;高级&amp;amp;rdquo;&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;&amp;amp;ldquo;有效权限&amp;amp;rdquo;&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;&amp;amp;ldquo;选择&amp;amp;rdquo;&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\&amp;lt;/font&amp;gt;在&amp;amp;ldquo;名称&amp;amp;rdquo;框中键入用户或组的名称，然后单击&amp;amp;ldquo;确定&amp;amp;rdquo;。选中的复选框表示用户或组对该文件或文件夹的有效权限。&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;c&amp;lt;/font&amp;gt;、只能在格式化为使用&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt; NTFS &amp;lt;/font&amp;gt;的驱动器上设置权限。 &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; （&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;11&amp;lt;/font&amp;gt;）解决网上邻居太慢的方法：&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;win98&amp;lt;/font&amp;gt;，假设网络中没有&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;novell&amp;lt;/font&amp;gt;网络，可删除为了兼容&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;novell netware&amp;lt;/font&amp;gt;网络而装的&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;ipx/spx&amp;lt;/font&amp;gt;兼容协议即可；&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;win2000/xp&amp;lt;/font&amp;gt;，可删除系统盘符&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\documents and setting\&amp;lt;/font&amp;gt;用户名&amp;lt;font face=&amp;quot;Times&amp;quot; roman=&amp;quot;&amp;quot; new=&amp;quot;&amp;quot;&amp;gt;\nethood&amp;lt;/font&amp;gt;文件夹下的所有文件即可。 &amp;lt;/p&amp;gt; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;amp;nbsp; &amp;lt;/p&amp;gt; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;amp;nbsp; &amp;lt;/p&amp;gt; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;amp;nbsp; &amp;lt;/p&amp;gt; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;amp;nbsp; &amp;lt;/p&amp;gt; &amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt; &amp;amp;nbsp; &amp;lt;/p&amp;gt; &amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt; &amp;lt;/table&amp;gt;&lt;/code>&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category></item><item><title>用js+flash复制文本（支持flash10） – Zero Clipboard项目</title><link>https://fatkun.github.io/2009/09/%E7%94%A8jsflash%E5%A4%8D%E5%88%B6%E6%96%87%E6%9C%AC%EF%BC%88%E6%94%AF%E6%8C%81flash10%EF%BC%89-zero-clipboard%E9%A1%B9%E7%9B%AE.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E7%94%A8jsflash%E5%A4%8D%E5%88%B6%E6%96%87%E6%9C%AC%EF%BC%88%E6%94%AF%E6%8C%81flash10%EF%BC%89-zero-clipboard%E9%A1%B9%E7%9B%AE.html</guid><pubDate>Thu, 17 Sep 2009 06:56:03 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>web开发中常常要实现“复制到剪切板”功能。这个功能很实用，但是由于安全问题，浏览器的限制越来越严，实现的方法也越来越有限了。 Firefox 默认下不能直接通过Javascript操作剪切板，必须开启相关的设置才行。想只通过Javascript技术实现跨浏览器的剪切板是行不通的。现在常用的方法是利用JavaScript+Flash实现，普遍流传的办法是_clipboard.swf，这是国外最早实现的（著名的Clipboard Copy解决方案:　http://www.jeffothy.com/weblog/clipboard-copy/）。但是很可惜，_clipboard.swf在新出来的flash10中无效，因为flash10中规定了只有在swf上进行了实际的操作（比如鼠标点击）才能启动剪切板。而_clipboard.swf方法的swf是隐藏的，通过JavaScript来操作flash的剪切板，显然没有对swf进行实际的用户操作。&lt;br>
…&lt;/p>
&lt;p>web开发中常常要实现“复制到剪切板”功能。这个功能很实用，但是由于安全问题，浏览器的限制越来越严，实现的方法也越来越有限了。 Firefox 默认下不能直接通过Javascript操作剪切板，必须开启相关的设置才行。想只通过Javascript技术实现跨浏览器的剪切板是行不通的。现在常用的方法是利用JavaScript+Flash实现，普遍流传的办法是_clipboard.swf，这是国外最早实现的（著名的Clipboard Copy解决方案:　http://www.jeffothy.com/weblog/clipboard-copy/）。但是很可惜，_clipboard.swf在新出来的flash10中无效，因为flash10中规定了只有在swf上进行了实际的操作（比如鼠标点击）才能启动剪切板。而_clipboard.swf方法的swf是隐藏的，通过JavaScript来操作flash的剪切板，显然没有对swf进行实际的用户操作。&lt;br>
针对这个，最近国外出现了一种新的方法，而且专门做了一个JavaScript库 Zero Clipboard ，它包含一个flash影片和一个JavaScript接口，这个flash是透明的（不是隐藏），用户不会察觉到它的存在。这个flash覆盖在一个 DOM元素上，比如button，div之类，当点击这个DOM时，你实际点击的是这个flash，这个作用在flash上的动作能够开启flash的剪切板。这实际上就是一种clickjacking。&lt;br>
DEMO页面 : &lt;a href="http://bowser.macminicolo.net/~jhuckaby/zeroclipboard/">http://bowser.macminicolo.net/~jhuckaby/zeroclipboard/&lt;/a>&lt;br>
Zero Clipboard项目主页：　http://code.google.com/p/zeroclipboard/&lt;/p></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/clipboard-js/">Clipboard JS</category></item><item><title>MSSQL存储过程的用法：基础</title><link>https://fatkun.github.io/2009/09/mssql-store-procedure.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/mssql-store-procedure.html</guid><pubDate>Wed, 16 Sep 2009 08:23:59 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;h2 id="创建存储过程的基本格式">创建存储过程的基本格式：&lt;/h2>
&lt;pre escaped="true" lang="sql">Create procedure update_createtime
@tbID int
as
update t_member set createTime = GetDate() where tbID = @tbID
go&lt;/pre>
&lt;h2 id="添加返回值时就可以这样做">添加返回值时就可以这样做&lt;/h2>
&lt;pre escaped="true" lang="sql">--Developer:zhihui Zhou
--Date：New（）as 2008-10-18
--Email：zhou5791759@163.com
--QQ:297510342
Create procedure update_createtime
@tbID int,
@createTime nvarchar(50) output
as
update t_member set createTime = GetDate() where tbID = @tbID
set @createTime = (select createTime from t_member where tbID = @tbID)
go&lt;/pre>
&lt;h2 id="执行这个存储过程">执行这个存储过程：&lt;/h2>
&lt;pre escaped="true" lang="sql">--Call SQL in the method for
--start
declare @createTime nvarchar(50)
exec update_createTime 1,@createTime output
--end&lt;/pre>
&lt;p>来源：&lt;a href="http://www.cnblogs.com/zhou5791759/archive/2008/10/19/1314292.html">http://www.cnblogs.com/zhou5791759/archive/2008/10/19/1314292.html&lt;/a>&lt;/p></description><category domain="https://fatkun.github.io/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</category></item><item><title>几个目的单纯的网站</title><link>https://fatkun.github.io/2009/09/%E5%87%A0%E4%B8%AA%E7%9B%AE%E7%9A%84%E5%8D%95%E7%BA%AF%E7%9A%84%E7%BD%91%E7%AB%99.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E5%87%A0%E4%B8%AA%E7%9B%AE%E7%9A%84%E5%8D%95%E7%BA%AF%E7%9A%84%E7%BD%91%E7%AB%99.html</guid><pubDate>Mon, 14 Sep 2009 13:21:54 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p> &lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 14px; line-height: 21px; ">俗话说林子大了什么鸟儿都有，在网络世界里您看到什么都不稀奇的。今天给大家介绍的这几个网站真的是目的单纯、页面简单、&lt;a href="http://www.zhuaxiami.com/qq-mail-doodle.html" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; ">创意十足&lt;/a>。她的页面都只有一个，而且目的也只有一个，大家不妨&lt;a href="http://www.zhuaxiami.com/weiguan.html" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; ">围观&lt;/a>一下。真不晓得是哪位有才和有财的朋友创建的这些网站。…&lt;/p>&lt;/p>
&lt;p> &lt;/span>&lt;/p>
&lt;p>
&lt;/p>
&lt;p> &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 14px; line-height: 21px; ">俗话说林子大了什么鸟儿都有，在网络世界里您看到什么都不稀奇的。今天给大家介绍的这几个网站真的是目的单纯、页面简单、&lt;a href="http://www.zhuaxiami.com/qq-mail-doodle.html" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; ">创意十足&lt;/a>。她的页面都只有一个，而且目的也只有一个，大家不妨&lt;a href="http://www.zhuaxiami.com/weiguan.html" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; ">围观&lt;/a>一下。真不晓得是哪位有才和有财的朋友创建的这些网站。&lt;/p>
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "> &lt;img width="500" height="245" alt="" class="alignnone" altsrc="http://img.cnbeta.com/newsimg/090914/1105530135320527.jpg" src="http://img.cnbeta.com/newsimg/090914/1105530135320527.jpg" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " />&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />1、&lt;a href="http://istwitterdown.com/" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; ">http://istwitterdown.com/&lt;/a>&amp;nbsp;&amp;nbsp; 她的目的就是为了告诉我们&lt;a href="http://www.zhuaxiami.com/twitter-sina.html" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; ">Twitter&lt;/a>是不是挂了。&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />2、&lt;a href="http://isistwitterdowndown.com/" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; ">http://isistwitterdowndown.com/&lt;/a>&amp;nbsp;&amp;nbsp; 她的目的是告诉我们前一个网站挂了没有。&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />3、&lt;a href="http://isitchristmas.com/" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; ">http://isitchristmas.com/&lt;/a>&amp;nbsp;&amp;nbsp; 她的目的是告诉我们今天是不是圣诞节。&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />4、&lt;a href="http://isitaleapyear.com/" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; ">http://isitaleapyear.com/&lt;/a>&amp;nbsp;&amp;nbsp; 她的目的是告诉我们今年是不是闰年。&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />&lt;br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />5、&lt;a href="http://isobamapresident.com/" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; ">http://isobamapresident.com/&lt;/a>&amp;nbsp; 她的目的是告诉我们奥巴马是不是总统。 &lt;/p>
&lt;p> &lt;/span> &lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>博客新开张</title><link>https://fatkun.github.io/2009/09/%E5%8D%9A%E5%AE%A2%E6%96%B0%E5%BC%80%E5%BC%A0.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E5%8D%9A%E5%AE%A2%E6%96%B0%E5%BC%80%E5%BC%A0.html</guid><pubDate>Sat, 12 Sep 2009 12:31:14 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>花了48.5元买了fatkun.com这个域名&lt;del>然后在免费空间上开了这个博客&lt;/del>&lt;br>
哇咔咔~~·&lt;br>
以后开始写博客生涯~&lt;/p>
&lt;p>花了48.5元买了fatkun.com这个域名&lt;del>然后在免费空间上开了这个博客&lt;/del>&lt;br>
哇咔咔~~·&lt;br>
以后开始写博客生涯~&lt;/p></description><category domain="https://fatkun.github.io/categories/%E8%83%A1%E8%A8%80%E4%B9%B1%E8%AF%AD/">胡言乱语</category></item><item><title>关闭“打开文件-安全警告”的方法（每次打开程序都弹出安全警告很烦）</title><link>https://fatkun.github.io/2009/09/%E5%85%B3%E9%97%AD%E2%80%9C%E6%89%93%E5%BC%80%E6%96%87%E4%BB%B6-%E5%AE%89%E5%85%A8%E8%AD%A6%E5%91%8A%E2%80%9D%E7%9A%84%E6%96%B9%E6%B3%95%EF%BC%88%E6%AF%8F%E6%AC%A1%E6%89%93%E5%BC%80%E7%A8%8B%E5%BA%8F.html</link><guid isPermaLink="true">https://fatkun.github.io/2009/09/%E5%85%B3%E9%97%AD%E2%80%9C%E6%89%93%E5%BC%80%E6%96%87%E4%BB%B6-%E5%AE%89%E5%85%A8%E8%AD%A6%E5%91%8A%E2%80%9D%E7%9A%84%E6%96%B9%E6%B3%95%EF%BC%88%E6%AF%8F%E6%AC%A1%E6%89%93%E5%BC%80%E7%A8%8B%E5%BA%8F.html</guid><pubDate>Sat, 12 Sep 2009 11:59:08 +0000</pubDate><copyright>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</copyright><description>&lt;p>有的优化软件再优化后，为了提高安全性，都打开了文件打开安全警告提示，可能有的不想用这个功能，可以按如下方法解决．&lt;/p>
&lt;h2 id="方法一">方法一&lt;/h2>
&lt;p>把下面的内容保存为bat文件运行即可&lt;/p>
&lt;pre escaped="false" lang="html" line="1">reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Associations /v ModRiskFileTypes /t REG_SZ /d .bat;.exe;.reg;.vbs /f
gpupdate /force&lt;/pre>
&lt;p>经过测试，在XP和WIN7中都可以使用 ，也可以在“开始”-》运行-》输入CMD确定，打开命令行，复制上面代码，右键CMD粘贴，回车。&lt;br>
&lt;a href="http://www.flickr.com/photos/fatkun/4684923153/" title="cmd">&lt;img src="http://farm5.static.flickr.com/4066/4684923153_ff12ddaea7_b.jpg" alt="cmd">&lt;/a>{.flickr-image.alignnone}&lt;/p>
&lt;h2 id="方法二">方法二&lt;/h2>
&lt;p>开始 –&amp;gt; 运行 –&amp;gt; gpedit.msc (组策略) –&amp;gt; 用户配置 –&amp;gt; 管理模板 –&amp;gt; windows组件 –&amp;gt; 附件管理器 –&amp;gt; 右击 “中等危险文件类型的包含列表” –&amp;gt; 属性 –&amp;gt; 选 “已启用” –&amp;gt; 在 “指定中等危险扩展名” 里输入所要关闭警告的扩展名，例：.exe.;mp3 –&amp;gt; 确定多个之间用分号隔开
update:这段代码只针对以下扩展名（&lt;span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">.bat;.exe;.reg;.vbs&lt;span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal; font-size: 13px;">）的提示，如果需要其他的可以自行添加。如果还不行请&lt;strong>留下你的邮箱&lt;/strong>我可以联系。&lt;/span>&lt;/span>&lt;/p>
&lt;pre escaped="false" lang="html" line="1">&lt;/pre></description><category domain="https://fatkun.github.io/categories/%E7%94%B5%E8%84%91%E7%9F%A5%E8%AF%86/">电脑知识</category><category domain="https://fatkun.github.io/tags/win7/">Win7</category><category domain="https://fatkun.github.io/tags/%E5%AE%89%E5%85%A8%E8%AD%A6%E5%91%8A/">安全警告</category><category domain="https://fatkun.github.io/tags/%E5%AE%89%E8%A3%85%E6%96%87%E4%BB%B6/">安装文件</category></item></channel></rss>