﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-天使的白骨</title><link>http://www.cppblog.com/TianShiDeBaiGu/</link><description>给我一个EMACS，我不需要操作系统</description><language>zh-cn</language><lastBuildDate>Tue, 07 Apr 2026 10:15:39 GMT</lastBuildDate><pubDate>Tue, 07 Apr 2026 10:15:39 GMT</pubDate><ttl>60</ttl><item><title>MIT视频学习笔记，《线性代数》，1.求解线性(线性就是直线的意思)方程组</title><link>http://www.cppblog.com/TianShiDeBaiGu/archive/2018/12/26/216143.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Wed, 26 Dec 2018 04:51:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/archive/2018/12/26/216143.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/216143.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/archive/2018/12/26/216143.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/216143.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/216143.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 其实知识点没什么困难的，就是编辑器中输入这些公式稍微有点麻烦。卸载这边可以给大家参考，我本地整理的不一定都会发上来。线性代数中的矩阵是什么？    一般是指n元一次方程组，未知数和元相同。    row picture, 行图像,&nbsp;&nbsp;对于三维方程组来说，就是一个平面    column picture，列图像,&nbsp;对于三维方程组来说，就是一个向量（起...&nbsp;&nbsp;<a href='http://www.cppblog.com/TianShiDeBaiGu/archive/2018/12/26/216143.html'>阅读全文</a><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/216143.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2018-12-26 12:51 <a href="http://www.cppblog.com/TianShiDeBaiGu/archive/2018/12/26/216143.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于使用java各种架构的小结</title><link>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/07/15/215109.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Sat, 15 Jul 2017 05:09:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/07/15/215109.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/215109.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/07/15/215109.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/215109.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/215109.html</trackback:ping><description><![CDATA[<div>java开发搞了两个月了，由于前后端都要打通，发现了一些以前没注意的问题。</div>
<div>对于常规的前后端开发方案，这篇文章提到了方案选择：<a href="http://blog.csdn.net/yeyincai/article/details/51470475">http://blog.csdn.net/yeyincai/article/details/51470475</a></div>
<div><img src="http://img.blog.csdn.net/20160521171827061?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" align="middle" alt="" /></div>
<div>我自己的经验是这些：</div>
<div>RPC+Model：采用grpc+protobuf的方案，在android和ios之间都很方便通信，比起传统的HTTP(s)+JSON方式，开发效率和运行效率都要高很多，不过门槛比较高一点，工作两年的程序员应该能比较顺畅的入门，主要是ios端配置方面稍微麻烦一些。</div>
<div><br />
</div>
<div>IPC：android多个应用间的通信，测试过了aidl的方式，目前开发起来比较麻烦，报错系统做得太差了,没有找到合适的插件工具处理在android studio中的问题。估计后面干脆改成grpc的方式看看效果如何。</div>
<div><br />
</div>
<div>长链接：打算使用netty，还要看看开发的难易程度。</div>
<div><br />
</div>
<div>开发模式：看样子MVC真的已经过时了。&nbsp;</div>
<div>1. ios和android 都可以使用MVVM，比MVC解耦能力强得多。</div>
<div>2.服务器上，ESB容器外加OSGi组成SOA，也要方便很多。</div>
<div>3.linux客户端，QT半残废，Xwindow主流包装，已经是gnome。</div>
<div><br />
</div>
<div>SQL：持久层和缓存层一般都是注册和保存数据使用</div>
<div><span style="color: #000000; font-family: 'Microsoft YaHei';">1.注册方案，鉴于zookeeper坑太多，偏向于选择consul，consul不像zookeeper这么抽象，封装了服务化的http &nbsp;api，非常方便调用，并且增加了对服务健康检查。</span></div>
<div><font color="#999999" face="Microsoft YaHei"><span style="color: #000000;">2.为什么不选用redis？没深入研究redis。个人认为codis方案（豆瓣开发的分布式缓存）能够满足实际场景的需求。</span></font></div>
<div><font color="#999999" face="Microsoft YaHei"><br />
</font></div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/215109.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2017-07-15 13:09 <a href="http://www.cppblog.com/TianShiDeBaiGu/archive/2017/07/15/215109.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>tegra-tx1笔记，gstreamer抓取板载摄像头视频内容，并传给opencv代码层进行识别。</title><link>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/04/12/214835.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Wed, 12 Apr 2017 07:50:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/04/12/214835.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/214835.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/04/12/214835.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/214835.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/214835.html</trackback:ping><description><![CDATA[@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
买了这个板子有好久了，去年放着没心思搞，今天觉得该干点事了。
<div>我的目标是要使用tx1上的摄像头来抓取视频帧并做识别。<br />
<div>首先，jetson tx-1的板载摄像头是不提供默认v4l2的驱动的，所以我自己给它找了驱动，但是这个驱动是基于gstreamer的。</div>
</div>
<div>所以，我整合了一套gstreamer的管道命令，如下：</div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;">
<p style="margin: 0px; font-size: 12px; line-height: normal; font-family: 'Andale Mono'; color: #28fe14; background-color: rgba(0, 0, 0, 0.901961);"><span style="font-variant-ligatures: no-common-ligatures">export CLIENT_IP=127.0.0.1</span></p>
<p style="margin: 0px; font-size: 12px; line-height: normal; font-family: 'Andale Mono'; color: #28fe14; background-color: rgba(0, 0, 0, 0.901961);"><span style="font-variant-ligatures: no-common-ligatures">gst-launch-1.0 nvcamerasrc fpsRange="30 30" intent=3 ! nvvidconv flip-method=6 ! 'video/x-raw(memory:NVMM), width=(int)960, height=(int)540, format=(string)I420, framerate=(fraction)30/1' ! omxh264enc control-rate=2 bitrate=4000000 ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! queue ! omxh264dec ! nvvidconv ! 'video/x-raw, format=(string)UYVY' ! videoconvert ! jpegenc quality=30 ! rtpjpegpay ! udpsink host=$CLIENT_IP port=5000 sync=false async=false</span></p>
</div>
</div>
<div><br />
</div>
<div>这段代码把摄像头上的内容抓取并压缩为960p的30帧的h264格式的视频流，并通过udp协议丢出到板卡的5000号端口上。</div>
<div>以上是gstreamer的服务器端，接下来，可以将内容抓取下来看看。</div>
<div><br />
</div>
<div>客户端的命令我就不写了，直接使用代码。这段代码是从youtube上的jetson的openCV教程组装来的，自己找了一下opencv处理gstreamer的API，搭上就可以用。</div>
<div><br />
</div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->#include&nbsp;&lt;opencv2/highgui/highgui.hpp&gt;<br />
#include&nbsp;&lt;opencv2/opencv.hpp&gt;<br />
#include&nbsp;&lt;opencv2/imgproc/imgproc.hpp&gt;<br />
#include&nbsp;&lt;opencv2/features2d/features2d.hpp&gt;<br />
#include&nbsp;&lt;opencv2/calib3d/calib3d.hpp&gt;<br />
<br />
<span style="color: #0000FF; ">using</span>&nbsp;<span style="color: #0000FF; ">namespace</span>&nbsp;cv;<br />
<br />
<span style="color: #0000FF; ">int</span>&nbsp;main(<span style="color: #0000FF; ">int</span>,&nbsp;<span style="color: #0000FF; ">char</span>**)<br />
{<br />
&nbsp;&nbsp;VideoCapture&nbsp;input("./stream.sdp");<br />
&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>(!input.isOpened()){&nbsp;&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">&nbsp;check&nbsp;if&nbsp;we&nbsp;succeeded&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000; "><br />
</span>&nbsp;&nbsp;&nbsp;&nbsp;std::cout&lt;&lt;&nbsp;"open&nbsp;failed"&nbsp;&lt;&lt;&nbsp;std::endl;<br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;-1;<br />
&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;Mat&nbsp;img,&nbsp;img_gray;<br />
&nbsp;&nbsp;OrbFeatureDetector&nbsp;detector(7000);<br />
&nbsp;&nbsp;vector&lt;KeyPoint&gt;&nbsp;img_keypoints,&nbsp;car_keypoints;<br />
&nbsp;&nbsp;Mat&nbsp;img_descriptors,&nbsp;car_descriptors;<br />
<br />
&nbsp;&nbsp;input.read(img);<br />
&nbsp;&nbsp;Mat&nbsp;car;<br />
&nbsp;&nbsp;img(Rect(400,&nbsp;320,&nbsp;150,&nbsp;100)).copyTo(car);<br />
<br />
&nbsp;&nbsp;detector(car,&nbsp;Mat(),&nbsp;car_keypoints,&nbsp;car_descriptors);<br />
&nbsp;&nbsp;drawKeypoints(car,&nbsp;car_keypoints,&nbsp;car);<br />
&nbsp;&nbsp;<span style="color: #0000FF; ">for</span>(;;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>(!input.read(img))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">break</span>;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;detector(img,&nbsp;Mat(),&nbsp;img_keypoints,&nbsp;img_descriptors);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;drawKeypoints(img,&nbsp;img_keypoints,&nbsp;img);<br />
<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BFMatcher&nbsp;matcher;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vector&lt;DMatch&gt;&nbsp;matches;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matcher.match(car_descriptors,&nbsp;img_descriptors,&nbsp;matches);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vector&lt;Point2f&gt;&nbsp;car_points,&nbsp;img_points;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">for</span>(<span style="color: #0000FF; ">int</span>&nbsp;i=0;&nbsp;i&nbsp;&lt;&nbsp;matches.size();&nbsp;++i){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;car_points.push_back(car_keypoints[matches[i].queryIdx].pt);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;img_points.push_back(img_keypoints[matches[i].queryIdx].pt);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;std::cout&lt;&lt;"car&nbsp;points&nbsp;count&nbsp;=&nbsp;"&nbsp;&lt;&lt;&nbsp;car_points.size()&nbsp;&lt;&lt;&nbsp;std::endl;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>(car_points.size()&nbsp;&gt;=&nbsp;4){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matx33f&nbsp;H&nbsp;=&nbsp;findHomography(car_points,&nbsp;img_points,&nbsp;CV_RANSAC);<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vector&lt;Point&gt;&nbsp;car_border,&nbsp;img_border;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;car_border.push_back(Point(0,&nbsp;0));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;car_border.push_back(Point(0,&nbsp;car.rows));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;car_border.push_back(Point(car.cols,&nbsp;car.rows));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;car_border.push_back(Point(car.cols,&nbsp;0));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">for</span>&nbsp;(size_t&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;car_border.size();&nbsp;++i){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vec3f&nbsp;p&nbsp;=&nbsp;H&nbsp;*&nbsp;Vec3f(car_border[i].x,&nbsp;car_border[i].y,&nbsp;1);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;img_border.push_back(Point(p[0]/p[2],&nbsp;p[1]/p[2]));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;polylines(img,&nbsp;img_border,&nbsp;<span style="color: #0000FF; ">true</span>,&nbsp;CV_RGB(255,&nbsp;255,&nbsp;0));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mat&nbsp;img_matches;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;drawMatches(car,&nbsp;car_keypoints,&nbsp;img,&nbsp;img_keypoints,&nbsp;matches,&nbsp;img_matches);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;imshow("img_matches",&nbsp;img_matches);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">&nbsp;imshow("car",&nbsp;car);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000; ">//</span><span style="color: #008000; ">&nbsp;imshow("img",&nbsp;img);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000; "><br />
</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>(waitKey(27)&nbsp;&gt;=&nbsp;0)&nbsp;<span style="color: #0000FF; ">break</span>;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">&nbsp;the&nbsp;camera&nbsp;will&nbsp;be&nbsp;deinitialized&nbsp;automatically&nbsp;in&nbsp;VideoCapture&nbsp;destructor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000; "><br />
</span>&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;0;<br />
}</div>
</div>
<div>编译的makefile会麻烦一点：先写一个cmake的配置文件<span style="color: #28fe14; font-family: 'Andale Mono'; font-size: 12px; background-color: rgba(0, 0, 0, 0.901961);">CMakeLists.txt</span></div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->cmake_minimum_required(VERSION&nbsp;2.8)<br />
<br />
project(hello)<br />
<br />
find_package(OpenCV&nbsp;REQUIRED)<br />
<br />
include_directories(${OpenCV_INCLUDE_DIRS})<br />
<br />
add_executable(cv_hello&nbsp;hello.cpp)<br />
<br />
target_link_libraries(cv_hello&nbsp;${OpenCV_LIBS})</div>
</div>
<div><span style="color: #28fe14; font-family: 'Andale Mono'; font-size: 12px; background-color: rgba(0, 0, 0, 0.901961);"><br />
</span></div>
<div><font color="#28fe14" face="Andale Mono"><span style="font-size: 12px; background-color: rgba(0, 0, 0, 0.901961);">执行命令:cmake &nbsp;./ &amp;&amp; make</span></font></div>
<div>然后生成cv_hello，可以执行。</div>
<div>关键配置文件是stream.sdp文件，这个文件帮我减少了命令行的麻烦。内容如下：</div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->[stream.sdp]<br />
c=IN&nbsp;IP4&nbsp;127.0.0.1<br />
m=video&nbsp;5000&nbsp;RTP/AVP&nbsp;96<br />
a=rtpmap:96&nbsp;JPEG/4000000</div>
</div>
<div><br />
</div>
<div>全部内容结束。可以看到摄像头的视频内容了</div>
<div><br />
</div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/214835.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2017-04-12 15:50 <a href="http://www.cppblog.com/TianShiDeBaiGu/archive/2017/04/12/214835.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>人工智能分类笔记 《哥德尔-埃舍尔-巴赫》</title><link>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/03/13/214749.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Mon, 13 Mar 2017 04:46:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/03/13/214749.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/214749.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/03/13/214749.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/214749.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/214749.html</trackback:ping><description><![CDATA[@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
<div><span style="color: red;">稳定的分层：</span></div>
<div>数学家/物理学家常常会说：&#8220;c是个常量，p是个参量,v是个变量&#8221;。他们的意思是这三个都是可变的，但是存在一种可变的层次差别。c构成全局条件，p构成全局性更弱的一种条件---他可以在c固定时保持变动，最后v可以在c和p保持固定时变来变去的。</div>
<div>设想牙科医生不可能让病人的位置变来变去的，但是医生自己变动位置是有用的。其中的概念便是：c是病人，p是病人的牙齿，而v是医生本人。</div>
<div></div>
<div><span style="color: red;">框架和嵌套：</span></div>
<div>在框架语言中，可以说情景的心智表示包含着彼此嵌套的框架。</div>
<div>设想有若干个柜子，每个柜子上可以装若干个抽屉，这些抽屉可以放进&#8220;子框架&#8221;，你可以把别的柜子压缩后放进去，这个过程可以递归。</div>
<div>在思想层面，我们会把&#8220;人&#8221;的概念扭曲压缩。比如在羽毛球赛球场上，你会把人考虑成一个队员，你已经把&#8220;人&#8221;这个概念压缩到&#8220;羽毛球赛&#8221;中去了。</div>
<div>用框架进行知识表示的理论依赖于这样一个想法：世界是由半封闭的子系统构成的。</div>
<div></div>
<div></div>
<div><span style="color: red;">滑动：</span></div>
<div>我们会把想法进行变形，我们必须要适时的产生使得概念变形的能力，没有什么绝对不变的东西。也不能把事情弄得模凌两可的，以至于根本丧失意义。</div>
<div>我们会把圆形&#8220;滑动&#8221;为椭圆形，或者凹陷的圆形。但是不会把圆形&#8220;滑动&#8221;成三角形，虽然他们都是闭环图形。<br />
<br />
<span style="color: red;">跳跃性和全局后退：</span><br />
设想有一条狗，目标要获得一块骨头，前方有一面栅栏，栅栏有门。<br />
&#8220;新手&#8221;会直接冲向栅栏有骨头的位置，然后碰到栅栏过不去了，就会&#8220;旺旺。。&#8221;。&#8220;老手&#8221;会先跑到门口，绕过门口然后再跑向骨头。<br />
这里有一个思维跳跃性的过程，曲线救国的方式，在多次直接方式取得不好的后果后，高级的思维需要跳出原有的思维，后退几步来看待问题。这在深度学习上，是一种经验演变。但是他应该可以从思维的不同层次的滑动中推演出来。<br />
<div></div>
<div><span style="color: red;">演员系统：</span></div>
<div>框架+演员=符号。演员之间传递消息，但是消息的解释取决于演员自己的特性，于是符号的内容将由框架和演员共同决定.演员是信号的启发器</div>
<div></div>
<div><span style="color: red;">多重表示：</span></div>
<div>副总统是政府这部汽车的备用轮胎。概念骨架不仅必须存在于不同的抽象层次上，还需要存在于不同概念&#8220;维度&#8221;上。</div>
<div></div>
<div><span style="color: red;">关于人工智能的几个的问题：</span></div>
<div>1.程序能否写出优美的乐曲？</div>
<div>会的，但不是现在。音乐是情感的语言，精神世界不可低估。能有如此能力的&#8220;程序&#8221;必须得能自己走进这个世界，在纷繁的世界中与生活抗争，并每时每刻体验到自己的感受。他必须懂得暗夜里凉风带来的喜悦与孤独，懂得对于带来温暖爱抚地手掌的渴望，还要能体验到一个人死去后引起的心碎与生活。明了放弃与厌世，悲伤与失望，决心与胜利，虔诚与敬畏。能把希望/恐惧/烦恼/欢乐/宁静/不安等对立的情绪混合到一起。。。。</div>
<div>2.是否可以在低层次设置核心参数控制程序？</div>
<div>不能，如同人不会在意自己每天死掉几千个神经原一样，我们几乎没事，除非你要给大脑做手术折腾的太厉害。但这已经不属于低层次控制</div>
<div>3.人工智能是否存在超智能？</div>
<div>可能和规模有关，我们也许有一个临界点，也许人类已经位于零界点之上。有一天会达到全能自我认知，即笛卡尔的&#8220;我思故我在&#8221;将演变为&#8220;我在思我所思&#8221;。</div>
<div>也许人工智能有一天达到了人类的智能，但是他会进入下一阶段。我们可能还不知道那是什么样的。</div>
<div>4.是否存在能击败任何人的下棋程序？</div>
<div>可能已经有，但是现在还只是下棋。</div>
<div>跳出下棋，普遍的去看，真正的只能必然依赖于一种纵览全局的能力---即可以说是在程序中编入了一种&#8220;跳出系统外&#8221;的能力。一旦实现了这一步，你就无法再完全控制这个程序了，他将超过一个特定的临界点，那时你不得不与你造出来的东西打交道。</div>
</div>
<div><br />
</div>
<div>
<p style="margin: 0px; font-size: 12px; line-height: normal; font-family: '.PingFang SC'; color: #454545;"><span style="color: red;">智能的可抽取性</span></p>
<p style="margin: 0px; font-size: 12px; line-height: normal; font-family: 'Helvetica Neue'; color: #454545; min-height: 14px;"><br />
</p>
<p style="margin: 0px; font-size: 12px; line-height: normal; font-family: '.PingFang SC'; color: #454545;">为阐明大脑中发生的思维过程，有两个基本问题 &nbsp;</p>
<p style="margin: 0px; font-size: 12px; line-height: normal; font-family: '.PingFang SC'; color: #454545;">&nbsp;一个是解释低层次的神经发射通讯是如何导致高层次的符号激活通讯的，</p>
<p style="margin: 0px; font-size: 12px; line-height: normal; font-family: '.PingFang SC'; color: #454545;">另一个是自足地解释高层次的符号激活通讯<span style="line-height: normal; font-family: 'Helvetica Neue';">&#8212;&#8212;</span>建立一个不涉及低层神经事件的理论。</p>
<p style="margin: 0px; font-size: 12px; line-height: normal; font-family: '.PingFang SC'; color: #454545;">如果后者是可能的<span style="line-height: normal; font-family: 'Helvetica Neue';">&#8212;&#8212;</span>这是目前进行的所有人工智能研究的基础中的一个关键假设<span style="line-height: normal; font-family: 'Helvetica Neue';">&#8212;&#8212;</span>那么智能就可能实现于不同于大脑的其它硬件上。那将表明智能是一种可以从它所在的硬件中<span style="line-height: normal; font-family: 'Helvetica Neue';">"</span>抽取。出来的性质<span style="line-height: normal; font-family: 'Helvetica Neue';">&#8212;&#8212;</span>换句话说，智能将是一种软件性质。</p>
<p style="margin: 0px; font-size: 12px; line-height: normal; color: #454545;"><span style="font-family: '.PingFang SC';">这将意味着意识和智能这一现象的确和大多数极其复杂的自然现象一样是高层次的它们有自身的高层规律，这些归律依赖于低层，但又可以从低层中抽取出来。相反</span><font face="Helvetica Neue">，</font><font face=".PingFang SC">如果没有全部由神经原(或模拟神经原)组成的硬件就绝对无法实现符号触发模式的话，这将意味着智能是一种局限于人脑的现象，比起那种可以用一个具有若干不同层次的规律体系来说明的现象，对它的</font></p>
<p style="margin: 0px; font-size: 12px; line-height: normal; font-family: '.PingFang SC'; color: #454545;">释要困难得多。</p>
</div>
<div><br />
</div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/214749.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2017-03-13 12:46 <a href="http://www.cppblog.com/TianShiDeBaiGu/archive/2017/03/13/214749.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>swift2.3转swift3的替换脚本，可以处理很多问题</title><link>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/01/09/214581.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Mon, 09 Jan 2017 05:38:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/01/09/214581.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/214581.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/archive/2017/01/09/214581.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/214581.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/214581.html</trackback:ping><description><![CDATA[<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">/NSIndexPath/IndexPath/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/NSIndexPath/IndexPath/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/heightForRowAtIndexPath/heightForRowAt/g</span><span style="font-weight: bold;">'</span><br />
<span style="color: #008000; ">#</span><span style="color: #008000; ">find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;'s/CGRectMake/RectMake/g'</span><span style="color: #008000; "><br />
</span>find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/cellForRowAtIndexPath/cellForRowAt/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/forRowAtIndexPath/forRowAt/g</span><span style="font-weight: bold;">'</span><br />
<br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/didSelectRowAtIndexPath/didSelectRowAt/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/cellForItemAtIndexPath/cellForItemAt/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/shouldSelectItemAtIndexPath/shouldSelectItemAt/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/didSelectItemAtIndexPath/didSelectItemAt/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\(_\:NSURLSessionDataTask\!\,&nbsp;resp\:AnyObject\!\)/\(_,&nbsp;resp\)&nbsp;/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\(_,&nbsp;rspObj:AnyObject!\)/\(_,&nbsp;resp\)&nbsp;/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\(_,&nbsp;resp:AnyObject\!\)/\(_,&nbsp;resp\)&nbsp;/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/_:URLSessionDataTask!,&nbsp;responseObj:AnyObject!/_,&nbsp;responseObj/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\(_,&nbsp;error:NSError\!\)/\(_,&nbsp;error\)/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\(_:NSURLSessionDataTask!,&nbsp;error:NSError!\)/\(_,&nbsp;error\)/g</span><span style="font-weight: bold;">'</span><br />
<br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/func&nbsp;doAction\(_&nbsp;action:&nbsp;String,&nbsp;model:&nbsp;AnyObject\!,&nbsp;fromView:&nbsp;UIView\?\)/func&nbsp;doAction\(_&nbsp;action:&nbsp;String,&nbsp;model:&nbsp;Any\!,&nbsp;fromView:&nbsp;UIView\?\)/g</span><span style="font-weight: bold;">'</span><br />
<br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/CGPointZero/CGPoint.zero/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/CGFloat.max/\CGFloat\.greatestFiniteMagnitude/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.NoData/\.noData/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.Fail/\.fail/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/UIEdgeInsetsZero/UIEdgeInsets.zero/g</span><span style="font-weight: bold;">'</span><br />
<br />
<span style="color: #008000; ">#</span><span style="color: #008000; ">autoPinEdgeToSuperviewEdge</span><span style="color: #008000; "><br />
</span>find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.autoPinEdgeToSuperviewEdge\(\.Leading/\.autoPinEdge\(toSuperviewEdge\:&nbsp;\.leading/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.autoPinEdgeToSuperviewEdge\(\.Trailing/\.autoPinEdge\(toSuperviewEdge\:&nbsp;\.trailing/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.autoPinEdgeToSuperviewEdge\(\.Bottom/\.autoPinEdge\(toSuperviewEdge\:&nbsp;\.bottom/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.autoPinEdgeToSuperviewEdge\(\.Top/\.autoPinEdge\(toSuperviewEdge\:&nbsp;\.top/g</span><span style="font-weight: bold;">'</span><br />
<br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/codecToInstance\(/codec\(toInstance:/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/UIFont\.\.systemFont/UIFont\.systemFont/g</span><span style="font-weight: bold;">'</span><br />
<br />
<span style="color: #008000; ">#</span><span style="color: #008000; ">下面这两句处理的是不同的函数<br />
#find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;'s/deselectRowAtIndexPath\(/deselectRow\(at:/g'<br />
#find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;'s/deselectRowAtIndexPath\(/deselect\(at:/g'</span><span style="color: #008000; "><br />
</span><br />
<br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.locationInView\(/\.location\(&nbsp;in:/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/CGRectZero/CGRect.zero/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.dismissViewControllerAnimated\(/\.dismiss\(animated:&nbsp;/g</span><span style="font-weight: bold;">'</span><br />
<br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/LocalCache\.sharedCache\(\)\.cachedObjectForKey\(/LocalCache\.shared\(\)\.cachedObject\(forKey/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/LocalCache\.shared\(\)\.cachedObject\(forKey/LocalCache\.shared\(\)\.cachedObject\(forKey\:/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/willDisplayCell/willDisplay/g</span><span style="font-weight: bold;">'</span><br />
<br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/XRZPostLoadingView\.showSuccessfulWithTitle\(/XRZPostLoadingView\.showSuccessful\(withTitle\:/g</span><span style="font-weight: bold;">'</span><br />
<span style="color: #008000; ">#</span><span style="color: #008000; ">这个地方改了以后需要尾部添加括号，需要手动搜索NotificationCenter.default.post(name:NSNotification.Name(rawValue出来修改</span><span style="color: #008000; "><br />
</span>find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/NSNotificationCenter\.defaultCenter\(\)\.postNotificationName\(/NotificationCenter\.default\.post\(name\:\&nbsp;NSNotification.Name\(rawValue\:&nbsp;/g</span><span style="font-weight: bold;">'</span><br />
<br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.showTextWithTitle\(/\.showText\(withTitle\:/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.showSuccessWithTitle\(/\.showSuccessful\(withTitle\:/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\(task\:URLSessionDataTask\!\,\&nbsp;respon\:AnyObject\!\)/\(_\,\&nbsp;respon\)/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\(_,\&nbsp;reponseObj\:AnyObject\!\)/\(_\,\&nbsp;respon\)/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\(_\:URLSessionDataTask\!\,\&nbsp;responseObj\:AnyObject\!\)/\(_\,\&nbsp;respon\)/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\(_,&nbsp;responseObj:AnyObject!\)/\(_,&nbsp;responseObj\)/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/task:URLSessionDataTask!,&nbsp;error:NSError!/_,&nbsp;error/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\(task:URLSessionDataTask!,&nbsp;responseObj:AnyObject!\)/\(_,&nbsp;responseObj\)/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\(_\:URLSessionDataTask\!\,\&nbsp;error\:NSError\!\)/\(_\,\&nbsp;error\)/g</span><span style="font-weight: bold;">'</span><br />
<br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.popToRootViewControllerAnimated\(/\.popToRootViewController\(animated:&nbsp;\/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/removeAlert\(/let&nbsp;_&nbsp;=&nbsp;removeAlert\(/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.addObject\(/\.add\(/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.rac_newValueChannelWithNilValue\(/\.rac_newValueChannel\(withNilValue:/g</span><span style="font-weight: bold;">'</span><br />
<br />
<br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.NotMore/\.notMore/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.ChatRoom/\.chatRoom/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.Normal/\.normal/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/MarkTableViewDD\.normal/MarkTableViewDD\.Normal/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.showFailWithTitle\(/\.showFail\(withTitle\:\&nbsp;/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.heightFromHitModel\(/\.height\(fromModel\:\&nbsp;/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/model\:AnyObject\!\,/model\:Any\!\,/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/func\&nbsp;heightForModel\(_\&nbsp;model\:AnyObject\!\)-&gt;CGFloat/func\&nbsp;heightForModel\(_\&nbsp;model\:Any\!\)-&gt;CGFloat/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.showSuccessfulWithTitle\(/\.showSuccessful\(withTitle\:\&nbsp;/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.TouchUpInside\.touchUpInside/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.rac_signalForControlEvents\(/\.rac_signal\(for\:\&nbsp;/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\UIEdgeInsetsZero/\UIEdgeInsets.zero/g</span><span style="font-weight: bold;">'</span><br />
find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;<span style="font-weight: bold;">'</span><span style="font-weight: bold;">s/\.systemFontOfSize\(/\..systemFont(ofSize:\&nbsp;/g</span><span style="font-weight: bold;">'</span><br />
<br />
<span style="color: #008000; ">#</span><span style="color: #008000; ">find&nbsp;.&nbsp;-name&nbsp;*.swift&nbsp;|&nbsp;xargs&nbsp;perl&nbsp;-p&nbsp;-i&nbsp;-e&nbsp;'s/\.Normal/\.normal/g'<br />
</span></div>
@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);<img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/214581.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2017-01-09 13:38 <a href="http://www.cppblog.com/TianShiDeBaiGu/archive/2017/01/09/214581.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>所有证据都指向同一件事，反而令人怀疑   -------  一致性偏差</title><link>http://www.cppblog.com/TianShiDeBaiGu/archive/2016/07/12/213922.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Tue, 12 Jul 2016 06:21:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/archive/2016/07/12/213922.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/213922.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/archive/2016/07/12/213922.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/213922.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/213922.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 这个有科学和政治意义哦&nbsp;&nbsp;<a href='http://www.cppblog.com/TianShiDeBaiGu/archive/2016/07/12/213922.html'>阅读全文</a><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/213922.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2016-07-12 14:21 <a href="http://www.cppblog.com/TianShiDeBaiGu/archive/2016/07/12/213922.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>人工智能，龙宝小车 部分笔记</title><link>http://www.cppblog.com/TianShiDeBaiGu/archive/2016/07/11/213914.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Mon, 11 Jul 2016 07:30:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/archive/2016/07/11/213914.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/213914.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/archive/2016/07/11/213914.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/213914.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/213914.html</trackback:ping><description><![CDATA[&nbsp;<span style="color: red; font-family: 'Times New Roman'; font-size: 12px; background-color: #ffffff;">A 左手摸墙算法的描述。</span><br style="word-wrap: break-word; color: #666666; font-family: 宋体, Arial; font-size: 12px;" />
<ul style="word-wrap: break-word; margin: 0px; padding: 0px; list-style: none; color: #666666; font-family: 宋体, Arial; font-size: 12px;">
    <li style="word-wrap: break-word; margin: 0px; padding: 0px; list-style: disc outside;"><span style="font-family: 'Times New Roman';">当左手边没有墙时，左转前进一步；</span></li>
    <li style="word-wrap: break-word; margin: 0px; padding: 0px; list-style: disc outside;"><span style="font-family: 'Times New Roman';">当左手边有墙且前方没有墙时，前进一步；</span></li>
    <li style="word-wrap: break-word; margin: 0px; padding: 0px; list-style: disc outside;"><span style="font-family: 'Times New Roman';">当左手边有墙且前方也有墙时，右转前进一步；</span></li>
</ul>
<span style="color: #666666; font-family: 'Times New Roman'; font-size: 12px; background-color: #ffffff;">　　右手摸墙算法，只需将上面的&#8220;左&#8221;换作&#8220;右&#8221;，&#8220;右&#8221;换作&#8220;左&#8221;。</span>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff;"><br />
</span></font></div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff; color: red; font-family: 'Times New Roman';">B 摸墙算法存在的问题，路径冗余度搞高</span></font></div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff; font-family: 'Times New Roman';">比如在一个封闭房间中，左手摸墙算法和右手摸墙算法，使用的总能耗差异很大。&nbsp;</span></font></div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff; font-family: 'Times New Roman';">&nbsp; 这个问题需要用用遗传算法的思想剞劂。</span></font></div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff; font-family: 'Times New Roman';">多次使用左手和右手摸墙算法，依靠积累经验来得到概率结论，然后根据不同条件进行学习之后得知下一次采取哪种摸墙。</span></font></div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff;"><br />
</span></font></div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff; color: red; font-family: 'Times New Roman';">C 摸墙算法的性能改善</span></font></div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff; color: red; font-family: 'Times New Roman';">这个策略只是用与多次重复走一个迷宫的情况，对于走陌生的迷宫，不适用。</span></font></div>
<div><span style="color: #666666; font-family: 'Times New Roman'; font-size: 12px; background-color: #ffffff;">当作出一次移动时，在路径中查找先前是否经过相同的点，如果有那么就说明到这一步为止完成了一个圈子，</span><span style="color: #666666; font-family: 'Times New Roman'; font-size: 12px; background-color: #ffffff;">在遗传算法中，</span><span style="color: #666666; font-family: 'Times New Roman'; font-size: 12px; background-color: #ffffff;">把它从路径中除去。</span></div>
<div><span style="font-family: 'Times New Roman';">多次行动测试后，将会改善能耗效果，得到一点经验概率结果。</span></div>
<div><span style="font-family: 'Times New Roman';">去除圈子的算法是：</span></div>
<div><font face="Times New Roman">假设左手摸墙走，取得所有已经过路径记为dimension[all]</font></div>
<div><font face="Times New Roman">遍历dimension all to 0， 碰见重复的路径节点，证明，这个点所经历的左手摸墙路径是一个圈</font></div>
<div><font face="Times New Roman">将这个点标记，以后在这里跳过这个位置的左手摸墙而采用直走跳过这个节点。</font></div>
<div><font face="Times New Roman"><br />
</font></div>
<div><font face="Times New Roman">思考：如何给小车在开放空间中，做环形路径点的标记？</font></div>
<div><font face="Times New Roman"><br />
</font></div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff; color: red;">D 深度优先搜索算法：</span></font></div>
<div><span style="color: #666666; font-family: 宋体, Arial; font-size: 12px; background-color: #ffffff;">程序运行时将按照从上到下，从左到右的顺序遍历整棵树。</span><br style="word-wrap: break-word; color: #666666; font-family: 宋体, Arial; font-size: 12px;" />
<font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff;">对于真实环境的物理小车，需要为小车安装指南针或者陀螺仪才行。理论上加速度传感器也能做到，但是算法上也许要稍微复杂一点。</span></font></div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff;"><br />
</span></font></div>
<div><span style="color: #666666; font-family: 宋体, Arial; font-size: 12px; background-color: #ffffff;">深度优先算法按以下规则执行遍历：</span><br style="word-wrap: break-word; color: #666666; font-family: 宋体, Arial; font-size: 12px;" />
<ol style="word-wrap: break-word; margin: 0px; padding: 0px; list-style: none; color: #666666; font-family: 宋体, Arial; font-size: 12px;">
    <li style="word-wrap: break-word; margin: 0px; padding: 0px; list-style: decimal outside;">1，判断当前节点是否为目标节点，如是，返回成功。</li>
    <li style="word-wrap: break-word; margin: 0px; padding: 0px; list-style: decimal outside;">2，检查当前节点是否还有未访问过的子节点，若否goto 4。 &nbsp; &nbsp; =&gt; &nbsp; &nbsp; 4，检查当前节点是否有上层节点，若有访问上层节点，设为当前节点。goto 1。</li>
    <li style="word-wrap: break-word; margin: 0px; padding: 0px; list-style: decimal outside;">3，访问子节点，设为当前节点，设已访问。goto 1。</li>
    <li style="word-wrap: break-word; margin: 0px; padding: 0px; list-style: decimal outside;">5，返回失败。</li>
</ol>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px;"><br />
</span></font></div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; color: red;">E 广度优先搜索算法：</span></font></div>
<div>
<ol style="word-wrap: break-word; margin: 0px; padding: 0px; list-style: none; color: #666666; font-family: 宋体, Arial; font-size: 12px;">
    <li style="word-wrap: break-word; margin: 0px; padding: 0px; list-style: decimal outside;">
    <div class="para" label-module="para" style="font-size: 14px; word-wrap: break-word; color: #333333; margin-bottom: 15px; text-indent: 2em; line-height: 24px; zoom: 1; font-family: arial, 宋体, sans-serif;"><span style="font-weight: 700;">1、</span>从图中某个顶点V0出发，并访问此顶点；</div>
    <div class="para" label-module="para" style="font-size: 14px; word-wrap: break-word; color: #333333; margin-bottom: 15px; text-indent: 2em; line-height: 24px; zoom: 1; font-family: arial, 宋体, sans-serif;"><span style="font-weight: 700;">2、</span>从V0出发，访问V0的各个未曾访问的邻接点W1，W2，&#8230;,Wk;然后,依次从W1,W2,&#8230;,Wk出发访问各自未被访问的邻接点；</div>
    <div class="para" label-module="para" style="font-size: 14px; word-wrap: break-word; color: #333333; margin-bottom: 15px; text-indent: 2em; line-height: 24px; zoom: 1; font-family: arial, 宋体, sans-serif;"><span style="font-weight: 700;">3、</span>重复步骤2，直到全部顶点都被访问为止。</div>
    </li>
</ol>
</div>
</div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff;">广度优先的好处在于，如果有多个出口，那么第一个被找到的出口消耗时间最短，广度最小，也即路劲最短。</span></font></div>
<div><font color="#666666" face="宋体, Arial"><span style="font-size: 12px; background-color: #ffffff;">另一个额外的好处是，可以知道所有的出口。得到一个统计结果。<br />
</span></font>
<div><span style="color: #666666; font-family: 宋体, Arial; font-size: 12px; background-color: #ffffff;"><br />
</span></div>
<div><span style="color: #666666; font-family: 宋体, Arial; font-size: 12px; background-color: #ffffff;"><br />
</span></div>
</div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/213914.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2016-07-11 15:30 <a href="http://www.cppblog.com/TianShiDeBaiGu/archive/2016/07/11/213914.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>swift中对TableView的代理进行包装</title><link>http://www.cppblog.com/TianShiDeBaiGu/archive/2016/03/18/213066.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Fri, 18 Mar 2016 06:07:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/archive/2016/03/18/213066.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/213066.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/archive/2016/03/18/213066.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/213066.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/213066.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 写了太多tableView，发现每次都要实现TableView的两个代理太麻烦。我在swift层面做了一次封装。我想要每个使用tableView的地方，都不在需要单独实现一份tableViewDataSource和TableViewDelegate.下面是理想的使用实例:Code highlighting produced by Actipro CodeHighlighte...&nbsp;&nbsp;<a href='http://www.cppblog.com/TianShiDeBaiGu/archive/2016/03/18/213066.html'>阅读全文</a><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/213066.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2016-03-18 14:07 <a href="http://www.cppblog.com/TianShiDeBaiGu/archive/2016/03/18/213066.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>UIImage无锯齿缩放（无锯齿）,UIButton图片无锯齿缩放</title><link>http://www.cppblog.com/TianShiDeBaiGu/archive/2015/10/09/211979.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Fri, 09 Oct 2015 10:20:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/archive/2015/10/09/211979.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/211979.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/archive/2015/10/09/211979.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/211979.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/211979.html</trackback:ping><description><![CDATA[没查到相关资料 ，说起来其实也挺简单的，就是使用UIImage的初始化函数重新初始化<span style="font-size: 13px; background-color: #eeeeee;">-</span><span style="font-size: 13px; background-color: #eeeeee;">&nbsp;(UIImage&nbsp;</span><span style="font-size: 13px; background-color: #eeeeee;">*</span><span style="font-size: 13px; background-color: #eeeeee;">)imageWithScale:(CGFloat)scale{</span><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;[UIImage&nbsp;imageWithData:UIImageJPEGRepresentation(self,&nbsp;1)&nbsp;scale:scale];<br />}</div><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all">//swift的代码就不写了<br /><br />//获得的UIImage能够适应UIButton的无锯齿缩放<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--></div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/211979.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2015-10-09 18:20 <a href="http://www.cppblog.com/TianShiDeBaiGu/archive/2015/10/09/211979.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>swift 去除String首尾的空格，以及指定字符串</title><link>http://www.cppblog.com/TianShiDeBaiGu/archive/2015/06/11/210883.html</link><dc:creator>何清龙</dc:creator><author>何清龙</author><pubDate>Thu, 11 Jun 2015 09:22:00 GMT</pubDate><guid>http://www.cppblog.com/TianShiDeBaiGu/archive/2015/06/11/210883.html</guid><wfw:comment>http://www.cppblog.com/TianShiDeBaiGu/comments/210883.html</wfw:comment><comments>http://www.cppblog.com/TianShiDeBaiGu/archive/2015/06/11/210883.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/TianShiDeBaiGu/comments/commentRss/210883.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/TianShiDeBaiGu/services/trackbacks/210883.html</trackback:ping><description><![CDATA[@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
直接给一段调用实例：@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&amp;file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
-->var&nbsp;str&nbsp;=&nbsp;"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;\r&nbsp;\r\n&nbsp;\t&nbsp;Hello,&nbsp;\n&nbsp;playground&nbsp;&nbsp;\n&nbsp;&nbsp;\t&nbsp;\t&nbsp;\n&nbsp;\n\r&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;"<br />
let&nbsp;length&nbsp;=&nbsp;(str&nbsp;<span style="color: #0000FF; ">as</span>&nbsp;NSString).length<br />
let&nbsp;a&nbsp;=&nbsp;str.escapeHeadTailSpace()<br />
let&nbsp;b&nbsp;=&nbsp;str.stringEscapeHeadTail(strs:["\r",&nbsp;"\n",&nbsp;"\t",&nbsp;"\r\n",&nbsp;"&nbsp;"])</div>
</div>
<div><br />
</div>
<div>对应结果:</div>
<div>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #ff2600;">a::\t Hello, \n playground&nbsp; \n &nbsp;</p>
</div>
<div>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #ff2600;">b::Hello, \n playground</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #ff2600;"><br />
</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #ff2600;">处理原理是：针对一个字符串，每次按一个字节跳过给定的字符串，并返回新得到的字符串，反复迭代，直到原字符串中已经找不到给定的字符串。这样，包含在中间的字符是不去除的。</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #ff2600;">将得到的新字符串反转，同样在处理一遍。这样头尾部的排除字符串集都可以了。然后再将结果反转，得到原来顺序的字符串，即我们需要的结果.</p>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #ff2600;">单纯去除其中所有的某个字符集，有原生方法，不再次考虑</p>
</div>
<div>这是针对String的扩展：</div>
<div>
<div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;">extension&nbsp;String{<br />
&nbsp;&nbsp;&nbsp;&nbsp;func&nbsp;escapeSpaceTillCahractor()-&gt;String{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;self.stringEscapeHeadTail(strs:["\r",&nbsp;"&nbsp;",&nbsp;"\n"])<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;func&nbsp;escapeHeadStr(str:String)-&gt;(String,&nbsp;Bool){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;result&nbsp;=&nbsp;self&nbsp;<span style="color: #0000FF; ">as</span>&nbsp;NSString<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;findAtleastOne&nbsp;=&nbsp;<span style="color: #0000FF; ">false</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">while</span>(&nbsp;<span style="color: #0000FF; ">true</span>&nbsp;){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;range&nbsp;=&nbsp;result.rangeOfString(str)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>&nbsp;range.location&nbsp;==&nbsp;0&nbsp;&amp;&amp;&nbsp;range.length&nbsp;==&nbsp;1&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result&nbsp;=&nbsp;result.substringFromIndex(range.length)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;findAtleastOne&nbsp;=&nbsp;<span style="color: #0000FF; ">true</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<span style="color: #0000FF; ">else</span>{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">break</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;(result&nbsp;<span style="color: #0000FF; ">as</span>&nbsp;String,&nbsp;findAtleastOne)<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;func&nbsp;escapeSpaceTillCahractor(#strs:[String])-&gt;String{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;result&nbsp;=&nbsp;self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">while</span>(&nbsp;<span style="color: #0000FF; ">true</span>&nbsp;){<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;findAtleastOne&nbsp;=&nbsp;<span style="color: #0000FF; ">false</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">for</span>&nbsp;str&nbsp;<span style="color: #0000FF; ">in</span>&nbsp;strs&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;found:Bool&nbsp;=&nbsp;<span style="color: #0000FF; ">false</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(result,&nbsp;found)&nbsp;=&nbsp;result.escapeHeadStr(str)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>&nbsp;found&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;findAtleastOne&nbsp;=&nbsp;<span style="color: #0000FF; ">true</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">break</span>&nbsp;&nbsp;<span style="color: #008000; ">//</span><span style="color: #008000; ">for循环</span><span style="color: #008000; "><br />
</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>&nbsp;findAtleastOne&nbsp;==&nbsp;<span style="color: #0000FF; ">false</span>&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">break</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;result&nbsp;<span style="color: #0000FF; ">as</span>&nbsp;String<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;func&nbsp;reverse()-&gt;String{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;inReverse&nbsp;=&nbsp;""<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">for</span>&nbsp;letter&nbsp;<span style="color: #0000FF; ">in</span>&nbsp;self&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;println(letter)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inReverse&nbsp;=&nbsp;"\(letter)"&nbsp;+&nbsp;inReverse<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;inReverse<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;func&nbsp;escapeHeadTailSpace()-&gt;String{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;self.escapeSpaceTillCahractor().reverse().escapeSpaceTillCahractor().reverse()<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;func&nbsp;stringEscapeHeadTail(#strs:[String])-&gt;String{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;self.escapeSpaceTillCahractor(strs:strs).reverse().escapeSpaceTillCahractor(strs:strs).reverse()<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}</div>
</div><img src ="http://www.cppblog.com/TianShiDeBaiGu/aggbug/210883.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/TianShiDeBaiGu/" target="_blank">何清龙</a> 2015-06-11 17:22 <a href="http://www.cppblog.com/TianShiDeBaiGu/archive/2015/06/11/210883.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>