Maison >développement back-end >tutoriel php >PHP 用QueryList抓取网页内容
之前抓取网页数据都是用Java Jsoup,前几天听说用PHP抓更方便,今天就研究了一下,主要是用QueryList来实现.
QueryList是一个基于phpQuery的通用列表采集类,是一个简单、 灵活、强大的采集工具,采集任何复杂的页面 基本上就一句话就能搞定了.
直接拿博客园举例子了,http://www.cnblogs.com/ 我们用QueryList来抓取红框里面的内容
查看网页源代码找到红框的位置
<span> 1</span><span><span>div </span><span>id</span><span>="post_list"</span><span>></span><span> 2</span><span> 3</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span> 4</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span> 5</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('jr1993',4716308,222703,1)"</span><span>></span><span> 6</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4716308"</span><span>></span>0<span></span><span>span</span><span>></span><span> 7</span><span></span><span>div</span><span>></span><span> 8</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span> 9</span><span><span>div </span><span>id</span><span>="digg_tip_4716308"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span> 10</span><span></span><span>div</span><span>></span><span> 11</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span> 12</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/jr1993/p/4716308.html"</span><span> target</span><span>="_blank"</span><span>></span>简单的jQuery 四级分类实用插件<span></span><span>a</span><span>></span><span>h3</span><span>></span><span> 13</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span> 14</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/jr1993/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/694143/20141118194530.png"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> 前言最近因需要自己封装了一个很简单的四级分类的jQuery插件,主要用于后台数据的传输和获取。接下来就分享一下这个实用的插件吧。正文老规矩,先看一下效果,这个就很丑了,没有美化的,因为主要还是用于后台界面使用的,同时请忽略测试数据的内容:那么下面就介绍一下使用方式:首先html代码: ... </span><span> 15</span><span></span><span>p</span><span>></span><span> 16</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span> 17</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/jr1993/"</span><span> class</span><span>="lightblue"</span><span>></span>郭锦荣<span></span><span>a</span><span>></span><span> 18</span><span> 发布于 2015-08-09 20:40 </span><span> 19</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/jr1993/p/4716308.html#commentform"</span><span> title</span><span>=""</span><span> class</span><span>="gray"</span><span>></span><span> 20</span> 评论(0)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/jr1993/p/4716308.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(21)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span> 21</span><span></span><span>div</span><span>></span><span> 22</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span> 23</span><span></span><span>div</span><span>></span><span> 24</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span> 25</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span> 26</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('maybe2030',4715035,229915,1)"</span><span>></span><span> 27</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4715035"</span><span>></span>0<span></span><span>span</span><span>></span><span> 28</span><span></span><span>div</span><span>></span><span> 29</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span> 30</span><span><span>div </span><span>id</span><span>="digg_tip_4715035"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span> 31</span><span></span><span>div</span><span>></span><span> 32</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span> 33</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/maybe2030/p/4715035.html"</span><span> target</span><span>="_blank"</span><span>></span>[Data Structure <span>&</span> Algorithm] 七大查找算法<span></span><span>a</span><span>></span><span>h3</span><span>></span><span> 34</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span> 35</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/maybe2030/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/764050/20150531155648.png"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> 和排序算法一样,查找算法也是一种最为基本的算法。高效地查找可以使我们对数据进行更加高效地操作,熟练掌握各种查找算法也是一项基本的算法技能。 </span><span> 36</span><span></span><span>p</span><span>></span><span> 37</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span> 38</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/maybe2030/"</span><span> class</span><span>="lightblue"</span><span>></span>Poll的笔记<span></span><span>a</span><span>></span><span> 39</span><span> 发布于 2015-08-09 20:27 </span><span> 40</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/maybe2030/p/4715035.html#commentform"</span><span> title</span><span>=""</span><span> class</span><span>="gray"</span><span>></span><span> 41</span> 评论(0)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/maybe2030/p/4715035.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(12)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span> 42</span><span></span><span>div</span><span>></span><span> 43</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span> 44</span><span></span><span>div</span><span>></span><span> 45</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span> 46</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span> 47</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('zhanggui',4716267,191738,1)"</span><span>></span><span> 48</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4716267"</span><span>></span>0<span></span><span>span</span><span>></span><span> 49</span><span></span><span>div</span><span>></span><span> 50</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span> 51</span><span><span>div </span><span>id</span><span>="digg_tip_4716267"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span> 52</span><span></span><span>div</span><span>></span><span> 53</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span> 54</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/zhanggui/p/4716267.html"</span><span> target</span><span>="_blank"</span><span>></span>第二章、进程的描述与控制<span></span><span>a</span><span>></span><span>h3</span><span>></span><span> 55</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span> 56</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/zhanggui/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/527522/20140908182900.png"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> 第二章、进程的描述与控制====##2.1 前趋图和程序执行### 2.1.1 前趋图####概念:所谓前趋图:指一个有向无循环图(DAG),它用于描述进程之间执行的先后顺序。###2.1.2 程序顺序执行####特征:* 顺序性* 封闭性:指程序在封闭的环境中运行,程序运行时独占全机资源,资源的状... </span><span> 57</span><span></span><span>p</span><span>></span><span> 58</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span> 59</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/zhanggui/"</span><span> class</span><span>="lightblue"</span><span>></span>Scottzg<span></span><span>a</span><span>></span><span> 60</span><span> 发布于 2015-08-09 20:24 </span><span> 61</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/zhanggui/p/4716267.html#commentform"</span><span> title</span><span>=""</span><span> class</span><span>="gray"</span><span>></span><span> 62</span> 评论(0)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/zhanggui/p/4716267.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(17)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span> 63</span><span></span><span>div</span><span>></span><span> 64</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span> 65</span><span></span><span>div</span><span>></span><span> 66</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span> 67</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span> 68</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('lubiao',4716200,158099,1)"</span><span>></span><span> 69</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4716200"</span><span>></span>0<span></span><span>span</span><span>></span><span> 70</span><span></span><span>div</span><span>></span><span> 71</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span> 72</span><span><span>div </span><span>id</span><span>="digg_tip_4716200"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span> 73</span><span></span><span>div</span><span>></span><span> 74</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span> 75</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/lubiao/p/4716200.html"</span><span> target</span><span>="_blank"</span><span>></span>树莓派入门笔记<span></span><span>a</span><span>></span><span>h3</span><span>></span><span> 76</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span> 77</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/lubiao/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/550600/20150808222928.png"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> 一、关于开源硬件开源硬件的概念简单理解就是电子硬件的设计详细参数是公开的,比如电路图、材料清单和PCB布局等等。主要类型:Arduino、CubieBoard、RaspberryPi、PcDuino、BeagleBone、KiWIBoard和Mixteil开源中国社区-开源硬件专区http://ww... </span><span> 78</span><span></span><span>p</span><span>></span><span> 79</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span> 80</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/lubiao/"</span><span> class</span><span>="lightblue"</span><span>></span>clbiao<span></span><span>a</span><span>></span><span> 81</span><span> 发布于 2015-08-09 20:05 </span><span> 82</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/lubiao/p/4716200.html#commentform"</span><span> title</span><span>=""</span><span> class</span><span>="gray"</span><span>></span><span> 83</span> 评论(0)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/lubiao/p/4716200.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(59)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span> 84</span><span></span><span>div</span><span>></span><span> 85</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span> 86</span><span></span><span>div</span><span>></span><span> 87</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span> 88</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span> 89</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('xiaoheimiaoer',4716191,124701,1)"</span><span>></span><span> 90</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4716191"</span><span>></span>0<span></span><span>span</span><span>></span><span> 91</span><span></span><span>div</span><span>></span><span> 92</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span> 93</span><span><span>div </span><span>id</span><span>="digg_tip_4716191"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span> 94</span><span></span><span>div</span><span>></span><span> 95</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span> 96</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/xiaoheimiaoer/p/4716191.html"</span><span> target</span><span>="_blank"</span><span>></span>JS监听组合按键<span></span><span>a</span><span>></span><span>h3</span><span>></span><span> 97</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span> 98</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/xiaoheimiaoer/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/435330/20140328110126.png"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> 有些时候,我们需要在网页上,增加一些快捷按键,方便用户使用一些常用的操作,比如:保存,撤销,复制、粘贴等等。 下面简单梳理一下思路: 我们所熟悉的按键有这么集中类型:单独的按键操作,如:delete、up、down等两位组合建,如:ctrl(cmd)+ 其他按键,alt+其他按键,shift... </span><span> 99</span><span></span><span>p</span><span>></span><span>100</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span>101</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/xiaoheimiaoer/"</span><span> class</span><span>="lightblue"</span><span>></span>黑MAO<span></span><span>a</span><span>></span><span>102</span><span> 发布于 2015-08-09 19:59 </span><span>103</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/xiaoheimiaoer/p/4716191.html#commentform"</span><span> title</span><span>=""</span><span> class</span><span>="gray"</span><span>></span><span>104</span> 评论(0)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/xiaoheimiaoer/p/4716191.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(36)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span>105</span><span></span><span>div</span><span>></span><span>106</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>107</span><span></span><span>div</span><span>></span><span>108</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span>109</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span>110</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('QG-whz',4716139,205933,1)"</span><span>></span><span>111</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4716139"</span><span>></span>0<span></span><span>span</span><span>></span><span>112</span><span></span><span>div</span><span>></span><span>113</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>114</span><span><span>div </span><span>id</span><span>="digg_tip_4716139"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span>115</span><span></span><span>div</span><span>></span><span>116</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span>117</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/QG-whz/p/4716139.html"</span><span> target</span><span>="_blank"</span><span>></span>编译器角度看C++复制构造函数<span></span><span>a</span><span>></span><span>h3</span><span>></span><span>118</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span>119</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/QG-whz/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/610439/20150502210248.png"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> #[C++对象模型]复制构造函数的建构操作关于复制构造函数的简单介绍,可以看我以前写过的一篇文章[C++复制控制之复制构造函数](http://www.cnblogs.com/QG-whz/p/4485574.html "C++ 复制控制之复制构造函数")该文章中介绍了复制构造函数的定义、调用时机、... </span><span>120</span><span></span><span>p</span><span>></span><span>121</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span>122</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/QG-whz/"</span><span> class</span><span>="lightblue"</span><span>></span>melonstreet<span></span><span>a</span><span>></span><span>123</span><span> 发布于 2015-08-09 19:44 </span><span>124</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/QG-whz/p/4716139.html#commentform"</span><span> title</span><span>=""</span><span> class</span><span>="gray"</span><span>></span><span>125</span> 评论(0)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/QG-whz/p/4716139.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(41)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span>126</span><span></span><span>div</span><span>></span><span>127</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>128</span><span></span><span>div</span><span>></span><span>129</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span>130</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span>131</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('advances',4716089,238649,1)"</span><span>></span><span>132</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4716089"</span><span>></span>1<span></span><span>span</span><span>></span><span>133</span><span></span><span>div</span><span>></span><span>134</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>135</span><span><span>div </span><span>id</span><span>="digg_tip_4716089"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span>136</span><span></span><span>div</span><span>></span><span>137</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span>138</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/advances/p/4716089.html"</span><span> target</span><span>="_blank"</span><span>></span>【Cocos2d入门教程三】HelloWorld之一目了然<span></span><span>a</span><span>></span><span>h3</span><span>></span><span>139</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span>140</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/advances/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/794244/20150804212641.png"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> 什么程序都是从HelloWorld先开始。同样Cocos2d-x我们先从HelloWorld进行下手、下面是HelloWorld的运行完成图:建立好的Cocos游戏项目中会有两个比较常用接触的文件夹。分别为Classes与resource。Classes存取代码文件,resource存取资源文件,下... </span><span>141</span><span></span><span>p</span><span>></span><span>142</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span>143</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/advances/"</span><span> class</span><span>="lightblue"</span><span>></span>蔡明勇<span></span><span>a</span><span>></span><span>144</span><span> 发布于 2015-08-09 19:27 </span><span>145</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/advances/p/4716089.html#commentform"</span><span> title</span><span>="2015-08-09 20:37"</span><span> class</span><span>="gray"</span><span>></span><span>146</span> 评论(5)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/advances/p/4716089.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(65)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span>147</span><span></span><span>div</span><span>></span><span>148</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>149</span><span></span><span>div</span><span>></span><span>150</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span>151</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span>152</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('kodoyang',4715572,180900,1)"</span><span>></span><span>153</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4715572"</span><span>></span>0<span></span><span>span</span><span>></span><span>154</span><span></span><span>div</span><span>></span><span>155</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>156</span><span><span>div </span><span>id</span><span>="digg_tip_4715572"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span>157</span><span></span><span>div</span><span>></span><span>158</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span>159</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/kodoyang/p/MonteCarloMethod_PI.html"</span><span> target</span><span>="_blank"</span><span>></span>蒙特卡罗方法计算圆周率<span></span><span>a</span><span>></span><span>h3</span><span>></span><span>160</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span>161</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/kodoyang/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/618527/20150809193301.png"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> 为了避免计算时间超过十秒钟,很随意的减小了样本值。 【方形中的所有像素计算】中一共计算10^8次,当在【方形中的随机像素计算】中也计算相同的次数时,就会陷入等待。 猜测原因是获取随机数的时候浪费了很多时间,也可能是循环的次数太多消耗时间。 【方形中的随机像素求平均值】中巴10^8分成了计算10... </span><span>162</span><span></span><span>p</span><span>></span><span>163</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span>164</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/kodoyang/"</span><span> class</span><span>="lightblue"</span><span>></span>kodoyang<span></span><span>a</span><span>></span><span>165</span><span> 发布于 2015-08-09 19:24 </span><span>166</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/kodoyang/p/MonteCarloMethod_PI.html#commentform"</span><span> title</span><span>=""</span><span> class</span><span>="gray"</span><span>></span><span>167</span> 评论(0)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/kodoyang/p/MonteCarloMethod_PI.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(48)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span>168</span><span></span><span>div</span><span>></span><span>169</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>170</span><span></span><span>div</span><span>></span><span>171</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span>172</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span>173</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('xyczero',4716019,198864,1)"</span><span>></span><span>174</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4716019"</span><span>></span>0<span></span><span>span</span><span>></span><span>175</span><span></span><span>div</span><span>></span><span>176</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>177</span><span><span>div </span><span>id</span><span>="digg_tip_4716019"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span>178</span><span></span><span>div</span><span>></span><span>179</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span>180</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/xyczero/p/4716019.html"</span><span> target</span><span>="_blank"</span><span>></span>Android 之夜间模式(多主题)的实现<span></span><span>a</span><span>></span><span>h3</span><span>></span><span>181</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span>182</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/xyczero/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/674691/20140930230333.png"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> ##引言夜间模式其实属于多主题切换的一种,不过是最麻烦的一种。因为在夜间模式下不仅要切换主色调,次要色调等等,还要覆盖一些特殊的颜色,因为在夜间模式下总不能什么都是黑的把,那不得丑死-。-,所以当你夜间模式完成后,你的App对于日后多主题的扩展就可以轻松胜任了。##实现思路多数App由于历史原因当对... </span><span>183</span><span></span><span>p</span><span>></span><span>184</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span>185</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/xyczero/"</span><span> class</span><span>="lightblue"</span><span>></span>xyczero<span></span><span>a</span><span>></span><span>186</span><span> 发布于 2015-08-09 18:40 </span><span>187</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/xyczero/p/4716019.html#commentform"</span><span> title</span><span>=""</span><span> class</span><span>="gray"</span><span>></span><span>188</span> 评论(0)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/xyczero/p/4716019.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(78)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span>189</span><span></span><span>div</span><span>></span><span>190</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>191</span><span></span><span>div</span><span>></span><span>192</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span>193</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span>194</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('xishuai',4715000,124657,1)"</span><span>></span><span>195</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4715000"</span><span>></span>8<span></span><span>span</span><span>></span><span>196</span><span></span><span>div</span><span>></span><span>197</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>198</span><span><span>div </span><span>id</span><span>="digg_tip_4715000"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span>199</span><span></span><span>div</span><span>></span><span>200</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span>201</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/xishuai/p/4715000.html"</span><span> target</span><span>="_blank"</span><span>></span>2015-写给明年现在的自己<span></span><span>a</span><span>></span><span>h3</span><span>></span><span>202</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span>203</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/xishuai/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/435188/20130715165802.png"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> 《[2014-写给明年现在的自己](http://www.cnblogs.com/xishuai/p/3900217.html)》时间如流水,转眼又是一年,回头看去年现在的自己,仿佛还在昨天。去年的那篇博文,如果认真去读的话,你会发现我是带有情绪的,对自己以及对所看到人和事不满的一种情绪发泄,写出来... </span><span>204</span><span></span><span>p</span><span>></span><span>205</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span>206</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/xishuai/"</span><span> class</span><span>="lightblue"</span><span>></span>田园里的蟋蟀<span></span><span>a</span><span>></span><span>207</span><span> 发布于 2015-08-09 18:08 </span><span>208</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/xishuai/p/4715000.html#commentform"</span><span> title</span><span>="2015-08-09 20:17"</span><span> class</span><span>="gray"</span><span>></span><span>209</span> 评论(5)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/xishuai/p/4715000.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(289)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span>210</span><span></span><span>div</span><span>></span><span>211</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>212</span><span></span><span>div</span><span>></span><span>213</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span>214</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span>215</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('anding',4715440,76293,1)"</span><span>></span><span>216</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4715440"</span><span>></span>7<span></span><span>span</span><span>></span><span>217</span><span></span><span>div</span><span>></span><span>218</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>219</span><span><span>div </span><span>id</span><span>="digg_tip_4715440"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span>220</span><span></span><span>div</span><span>></span><span>221</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span>222</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/anding/p/4715440.html"</span><span> target</span><span>="_blank"</span><span>></span>Winform开发全套31个UI组件开源共享<span></span><span>a</span><span>></span><span>h3</span><span>></span><span>223</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span>224</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/anding/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/151257/20150809180411.png"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> 一.前言 这套UI库是上一个公司(好几年前了)完成的。当时主要为开发公司内部ERP系统,重新设计实现了所有用到的Winform组建,包括Form窗体组建6个(支持换肤),基础控件25个。其中有很多参考借鉴其他开源组件,也有几个是集成的别人的组件,然后做了些调整。 现在已经好几年不做Winform..... </span><span>225</span><span></span><span>p</span><span>></span><span>226</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span>227</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/anding/"</span><span> class</span><span>="lightblue"</span><span>></span>/*梦里花落知多少*/<span></span><span>a</span><span>></span><span>228</span><span> 发布于 2015-08-09 18:01 </span><span>229</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/anding/p/4715440.html#commentform"</span><span> title</span><span>="2015-08-09 20:33"</span><span> class</span><span>="gray"</span><span>></span><span>230</span> 评论(4)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/anding/p/4715440.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(346)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span>231</span><span></span><span>div</span><span>></span><span>232</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>233</span><span></span><span>div</span><span>></span><span>234</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span>235</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span>236</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('liulun',4714858,32486,1)"</span><span>></span><span>237</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4714858"</span><span>></span>1<span></span><span>span</span><span>></span><span>238</span><span></span><span>div</span><span>></span><span>239</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>240</span><span><span>div </span><span>id</span><span>="digg_tip_4714858"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span>241</span><span></span><span>div</span><span>></span><span>242</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span>243</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/liulun/p/4714858.html"</span><span> target</span><span>="_blank"</span><span>></span>用Nim语言开发windows GUI图形界面程序<span></span><span>a</span><span>></span><span>h3</span><span>></span><span>244</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span>245</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/liulun/"</span><span> target</span><span>="_blank"</span><span>><span>img </span><span>width</span><span>="48"</span><span> height</span><span>="48"</span><span> class</span><span>="pfs"</span><span> src</span><span>="http://pic.cnblogs.com/face/u28932.png?id=12164046"</span><span> alt</span><span>=""</span><span>></span><span>a</span><span>></span><span> 前言本文得到了“樂師”的大力支持,我们一起调试程序到深夜,要是没有他的帮忙,我不知道要多久才能迈过这道坎,另外“归心”还有其他人也提供了帮助,他们都来自于QQ群:“Nim开发集中营”469329878;感兴趣的朋友,可以加这个群一起讨论配置GUI开发环境我在这篇博客中,写到了Nim开发环境的搭建那篇... </span><span>246</span><span></span><span>p</span><span>></span><span>247</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span>248</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/liulun/"</span><span> class</span><span>="lightblue"</span><span>></span>liulun<span></span><span>a</span><span>></span><span>249</span><span> 发布于 2015-08-09 17:47 </span><span>250</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/liulun/p/4714858.html#commentform"</span><span> title</span><span>=""</span><span> class</span><span>="gray"</span><span>></span><span>251</span> 评论(0)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/liulun/p/4714858.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(175)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span>252</span><span></span><span>div</span><span>></span><span>253</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>254</span><span></span><span>div</span><span>></span><span>255</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span>256</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span>257</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('klguang',4715529,232502,1)"</span><span>></span><span>258</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4715529"</span><span>></span>2<span></span><span>span</span><span>></span><span>259</span><span></span><span>div</span><span>></span><span>260</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>261</span><span><span>div </span><span>id</span><span>="digg_tip_4715529"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span>262</span><span></span><span>div</span><span>></span><span>263</span><span><span>div </span><span>class</span><span>="post_item_body"</span><span>></span><span>264</span><span><span>h3</span><span>><span>a </span><span>class</span><span>="titlelnk"</span><span> href</span><span>="http://www.cnblogs.com/klguang/p/4715529.html"</span><span> target</span><span>="_blank"</span><span>></span>JSP执行过程详解<span></span><span>a</span><span>></span><span>h3</span><span>></span><span>265</span><span><span>p </span><span>class</span><span>="post_item_summary"</span><span>></span><span>266</span><span> 复习JSP的概念 JSP是Java Server Page的缩写,在传统的HTML页面中加入JSP标签和java的程序片段就构成了JSP。 JSP的基本语法:两种注释类型、三个脚本元素、三个元素指令、八个动作指令。 JSP的内置对象常用的有:Request、Response、Out、Session、... </span><span>267</span><span></span><span>p</span><span>></span><span>268</span><span><span>div </span><span>class</span><span>="post_item_foot"</span><span>></span><span>269</span><span><span>a </span><span>href</span><span>="http://www.cnblogs.com/klguang/"</span><span> class</span><span>="lightblue"</span><span>></span>klguang<span></span><span>a</span><span>></span><span>270</span><span> 发布于 2015-08-09 17:46 </span><span>271</span><span><span>span </span><span>class</span><span>="article_comment"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/klguang/p/4715529.html#commentform"</span><span> title</span><span>=""</span><span> class</span><span>="gray"</span><span>></span><span>272</span> 评论(0)<span></span><span>a</span><span>></span><span>span</span><span>><span>span </span><span>class</span><span>="article_view"</span><span>><span>a </span><span>href</span><span>="http://www.cnblogs.com/klguang/p/4715529.html"</span><span> class</span><span>="gray"</span><span>></span>阅读(71)<span></span><span>a</span><span>></span><span>span</span><span>></span><span>div</span><span>></span><span>273</span><span></span><span>div</span><span>></span><span>274</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>275</span><span></span><span>div</span><span>></span><span>276</span><span><span>div </span><span>class</span><span>="post_item"</span><span>></span><span>277</span><span><span>div </span><span>class</span><span>="digg"</span><span>></span><span>278</span><span><span>div </span><span>class</span><span>="diggit"</span><span> onclick</span><span>="DiggPost('Lance--blog',4715495,226155,1)"</span><span>></span><span>279</span><span><span>span </span><span>class</span><span>="diggnum"</span><span> id</span><span>="digg_count_4715495"</span><span>></span>0<span></span><span>span</span><span>></span><span>280</span><span></span><span>div</span><span>></span><span>281</span><span><span>div </span><span>class</span><span>="clear"</span><span>></span><span>div</span><span>></span><span>282</span><span><span>div </span><span>id</span><span>="digg_tip_4715495"</span><span> class</span><span>="digg_tip"</span><span>></span><span>div</span><span>></span><span>283</span><span></span><span>div</span><span>></span><span>284</span><span><span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>