??xml version="1.0" encoding="utf-8" standalone="yes"?>սذװ:C++博客-天的白?/title><link>//www.pppqb.icu/TianShiDeBaiGu/</link><description>l我一个EMACSQ我不需要操作系l?/description><language>zh-cn</language><lastBuildDate>Mon, 23 Sep 2019 15:24:37 GMT</lastBuildDate><pubDate>Mon, 23 Sep 2019 15:24:37 GMT</pubDate><ttl>60</ttl><item><title>MIT视频学习W记Q《线性代数》,1.求解U?U性就是直U的意?方程l?/title><link>//www.pppqb.icu/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>//www.pppqb.icu/TianShiDeBaiGu/archive/2018/12/26/216143.html</guid><wfw:comment>//www.pppqb.icu/TianShiDeBaiGu/comments/216143.html</wfw:comment><comments>//www.pppqb.icu/TianShiDeBaiGu/archive/2018/12/26/216143.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.pppqb.icu/TianShiDeBaiGu/comments/commentRss/216143.html</wfw:commentRss><trackback:ping>//www.pppqb.icu/TianShiDeBaiGu/services/trackbacks/216143.html</trackback:ping><description><![CDATA[     摘要: 其实知识Ҏ什么困隄Q就是编辑器中输入这些公式稍微有炚w烦。卸载这边可以给大家参考,我本地整理的不一定都会发上来?U性代C的矩阉|什么? 一般是指n元一ơ方E组Q未知数和元相同? row picture, 行图?  对于三维方程l来_是一个^? column pictureQ列囑փ, 对于三维方程l来_是一个向量(?..  <a href='//www.pppqb.icu/TianShiDeBaiGu/archive/2018/12/26/216143.html'>阅读全文</a><img src ="//www.pppqb.icu/TianShiDeBaiGu/aggbug/216143.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.pppqb.icu/TianShiDeBaiGu/" target="_blank">何清?/a> 2018-12-26 12:51 <a href="//www.pppqb.icu/TianShiDeBaiGu/archive/2018/12/26/216143.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于使用java各种架构的小l?/title><link>//www.pppqb.icu/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>//www.pppqb.icu/TianShiDeBaiGu/archive/2017/07/15/215109.html</guid><wfw:comment>//www.pppqb.icu/TianShiDeBaiGu/comments/215109.html</wfw:comment><comments>//www.pppqb.icu/TianShiDeBaiGu/archive/2017/07/15/215109.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.pppqb.icu/TianShiDeBaiGu/comments/commentRss/215109.html</wfw:commentRss><trackback:ping>//www.pppqb.icu/TianShiDeBaiGu/services/trackbacks/215109.html</trackback:ping><description><![CDATA[<div class="dpun">java开发搞了两个月了,׃前后端都要打通,发现了一些以前没注意的问题?/div> <div class="dpun">对于常规的前后端开发方案,q篇文章提到了方案选择Q?a >//blog.csdn.net/yeyincai/article/details/51470475</a></div> <div class="dpun"><img src="//img.blog.csdn.net/20160521171827061?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" align="middle" alt="" /></div> <div class="dpun">我自ql验是这些:</div> <div class="dpun">RPC+ModelQ采用grpc+protobuf的方案,在android和ios之间都很方便通信Q比起传l的HTTP(s)+JSON方式Q开发效率和q行效率都要高很多,不过门槛比较高一点,工作两年的程序员应该能比较顺畅的入门Q主要是ios端配|方面稍微麻烦一些?/div> <div class="dpun"><br /> </div> <div class="dpun">IPCQandroid多个应用间的通信Q测试过了aidl的方式,目前开发v来比较麻烦,报错pȝ做得太差?没有扑ֈ合适的插g工具处理在android studio中的问题。估计后面干脆改成grpc的方式看看效果如何?/div> <div class="dpun"><br /> </div> <div class="dpun">镉K接:打算使用nettyQ还要看看开发的难易E度?/div> <div class="dpun"><br /> </div> <div class="dpun">开发模式:看样子MVC真的已经q时了?nbsp;</div> <div class="dpun">1. ios和android 都可以用MVVMQ比MVC解耦能力强得多?/div> <div class="dpun">2.服务器上QESB容器外加OSGil成SOAQ也要方便很多?/div> <div class="dpun">3.linux客户端,QT半残废,XwindowL包装Q已l是gnome?/div> <div class="dpun"><br /> </div> <div class="dpun">SQLQ持久层和缓存层一般都是注册和保存数据使用</div> <div class="dpun"><span style="color: #000000; font-family: 'Microsoft YaHei';">1.注册ҎQ鉴于zookeeper坑太多,偏向于选择consulQconsul不像zookeeperq么抽象Q封装了服务化的http  apiQ非常方便调用,q且增加了对服务健康查?/span></div> <div class="dpun"><font color="#999999" face="Microsoft YaHei"><span style="color: #000000;">2.Z么不选用redisQ没深入研究redis。个为codisҎQ豆瓣开发的分布式缓存)能够满实际场景的需求?/span></font></div> <div class="dpun"><font color="#999999" face="Microsoft YaHei"><br /> </font></div><img src ="//www.pppqb.icu/TianShiDeBaiGu/aggbug/215109.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.pppqb.icu/TianShiDeBaiGu/" target="_blank">何清?/a> 2017-07-15 13:09 <a href="//www.pppqb.icu/TianShiDeBaiGu/archive/2017/07/15/215109.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>tegra-tx1W记Qgstreamer抓取板蝲摄像头视频内容,q传lopencv代码层进行识别?/title><link>//www.pppqb.icu/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>//www.pppqb.icu/TianShiDeBaiGu/archive/2017/04/12/214835.html</guid><wfw:comment>//www.pppqb.icu/TianShiDeBaiGu/comments/214835.html</wfw:comment><comments>//www.pppqb.icu/TianShiDeBaiGu/archive/2017/04/12/214835.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.pppqb.icu/TianShiDeBaiGu/comments/commentRss/214835.html</wfw:commentRss><trackback:ping>//www.pppqb.icu/TianShiDeBaiGu/services/trackbacks/214835.html</trackback:ping><description><![CDATA[@import url(//www.pppqb.icu/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); Cq个板子有好久了Q去q放着没心思搞Q今天觉得该q点事了? <div class="dpun">我的目标是要使用tx1上的摄像头来抓取视频帧ƈ做识别?br /> <div class="dpun">首先Qjetson tx-1的板载摄像头是不提供默认v4l2的驱动的Q所以我自己l它找了驱动Q但是这个驱动是Zgstreamer的?/div> </div> <div class="dpun">所以,我整合了一套gstreamer的管道命令,如下Q?/div> <div class="dpun"> <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 class="dpun"><br /> </div> <div class="dpun">q段代码把摄像头上的内容抓取q压~ؓ960p?0帧的h264格式的视频流Qƈ通过udp协议丢出到板卡的5000L口上?/div> <div class="dpun">以上是gstreamer的服务器端,接下来,可以内Ҏ取下来看看?/div> <div class="dpun"><br /> </div> <div class="dpun">客户端的命o我就不写了,直接使用代码。这D代码是从youtube上的jetson的openCV教程l装来的Q自己找了一下opencv处理gstreamer的APIQ搭上就可以用?/div> <div class="dpun"><br /> </div> <div class="dpun"> <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 /> //www.CodeHighlighter.com/<br /> <br /> -->#include <opencv2/highgui/highgui.hpp><br /> #include <opencv2/opencv.hpp><br /> #include <opencv2/imgproc/imgproc.hpp><br /> #include <opencv2/features2d/features2d.hpp><br /> #include <opencv2/calib3d/calib3d.hpp><br /> <br /> <span style="color: #0000FF; ">using</span> <span style="color: #0000FF; ">namespace</span> cv;<br /> <br /> <span style="color: #0000FF; ">int</span> main(<span style="color: #0000FF; ">int</span>, <span style="color: #0000FF; ">char</span>**)<br /> {<br />   VideoCapture input("./stream.sdp");<br />   <span style="color: #0000FF; ">if</span>(!input.isOpened()){  <span style="color: #008000; ">//</span><span style="color: #008000; "> check if we succeeded                                                                                                                                                                     </span><span style="color: #008000; "><br /> </span>    std::cout<< "open failed" << std::endl;<br />     <span style="color: #0000FF; ">return</span> -1;<br />   }<br /> <br />   Mat img, img_gray;<br />   OrbFeatureDetector detector(7000);<br />   vector<KeyPoint> img_keypoints, car_keypoints;<br />   Mat img_descriptors, car_descriptors;<br /> <br />   input.read(img);<br />   Mat car;<br />   img(Rect(400, 320, 150, 100)).copyTo(car);<br /> <br />   detector(car, Mat(), car_keypoints, car_descriptors);<br />   drawKeypoints(car, car_keypoints, car);<br />   <span style="color: #0000FF; ">for</span>(;;)<br />     {<br />       <span style="color: #0000FF; ">if</span>(!input.read(img))<br />         <span style="color: #0000FF; ">break</span>;<br />       detector(img, Mat(), img_keypoints, img_descriptors);<br />       drawKeypoints(img, img_keypoints, img);<br /> <br /> <br />       BFMatcher matcher;<br />       vector<DMatch> matches;<br />       matcher.match(car_descriptors, img_descriptors, matches);<br /> <br />       vector<Point2f> car_points, img_points;<br />       <span style="color: #0000FF; ">for</span>(<span style="color: #0000FF; ">int</span> i=0; i < matches.size(); ++i){<br />         car_points.push_back(car_keypoints[matches[i].queryIdx].pt);<br />         img_points.push_back(img_keypoints[matches[i].queryIdx].pt);<br />       }<br />       std::cout<<"car points count = " << car_points.size() << std::endl;<br /> <br />       <span style="color: #0000FF; ">if</span>(car_points.size() >= 4){<br />         Matx33f H = findHomography(car_points, img_points, CV_RANSAC);<br /> <br />         vector<Point> car_border, img_border;<br />         car_border.push_back(Point(0, 0));<br />         car_border.push_back(Point(0, car.rows));<br />         car_border.push_back(Point(car.cols, car.rows));<br />         car_border.push_back(Point(car.cols, 0));<br />         <span style="color: #0000FF; ">for</span> (size_t i = 0; i < car_border.size(); ++i){<br />           Vec3f p = H * Vec3f(car_border[i].x, car_border[i].y, 1);<br />           img_border.push_back(Point(p[0]/p[2], p[1]/p[2]));<br />         }<br />         polylines(img, img_border, <span style="color: #0000FF; ">true</span>, CV_RGB(255, 255, 0));<br />         Mat img_matches;<br />         drawMatches(car, car_keypoints, img, img_keypoints, matches, img_matches);<br />         imshow("img_matches", img_matches);<br />       }<br />       <span style="color: #008000; ">//</span><span style="color: #008000; "> imshow("car", car);                                                                                                                                                                                           <br />       </span><span style="color: #008000; ">//</span><span style="color: #008000; "> imshow("img", img);                                                                                                                                                                                           </span><span style="color: #008000; "><br /> </span>      <span style="color: #0000FF; ">if</span>(waitKey(27) >= 0) <span style="color: #0000FF; ">break</span>;<br />     }<br />   <span style="color: #008000; ">//</span><span style="color: #008000; "> the camera will be deinitialized automatically in VideoCapture destructor                                                                                                                                         </span><span style="color: #008000; "><br /> </span>  <span style="color: #0000FF; ">return</span> 0;<br /> }</div> </div> <div class="dpun">~译的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 class="dpun"> <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 /> //www.CodeHighlighter.com/<br /> <br /> -->cmake_minimum_required(VERSION 2.8)<br /> <br /> project(hello)<br /> <br /> find_package(OpenCV REQUIRED)<br /> <br /> include_directories(${OpenCV_INCLUDE_DIRS})<br /> <br /> add_executable(cv_hello hello.cpp)<br /> <br /> target_link_libraries(cv_hello ${OpenCV_LIBS})</div> </div> <div class="dpun"><span style="color: #28fe14; font-family: 'Andale Mono'; font-size: 12px; background-color: rgba(0, 0, 0, 0.901961);"><br /> </span></div> <div class="dpun"><font color="#28fe14" face="Andale Mono"><span style="font-size: 12px; background-color: rgba(0, 0, 0, 0.901961);">执行命o:cmake  ./ && make</span></font></div> <div class="dpun">然后生成cv_helloQ可以执行?/div> <div class="dpun">关键配置文g是stream.sdp文gQ这个文件帮我减了命o行的ȝ。内容如下:</div> <div class="dpun"> <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 /> //www.CodeHighlighter.com/<br /> <br /> -->[stream.sdp]<br /> c=IN IP4 127.0.0.1<br /> m=video 5000 RTP/AVP 96<br /> a=rtpmap:96 JPEG/4000000</div> </div> <div class="dpun"><br /> </div> <div class="dpun">全部内容l束。可以看到摄像头的视频内容了</div> <div class="dpun"><br /> </div><img src ="//www.pppqb.icu/TianShiDeBaiGu/aggbug/214835.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.pppqb.icu/TianShiDeBaiGu/" target="_blank">何清?/a> 2017-04-12 15:50 <a href="//www.pppqb.icu/TianShiDeBaiGu/archive/2017/04/12/214835.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>人工分类W记 《哥德尔-埃舍?巴赫?/title><link>//www.pppqb.icu/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>//www.pppqb.icu/TianShiDeBaiGu/archive/2017/03/13/214749.html</guid><wfw:comment>//www.pppqb.icu/TianShiDeBaiGu/comments/214749.html</wfw:comment><comments>//www.pppqb.icu/TianShiDeBaiGu/archive/2017/03/13/214749.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.pppqb.icu/TianShiDeBaiGu/comments/commentRss/214749.html</wfw:commentRss><trackback:ping>//www.pppqb.icu/TianShiDeBaiGu/services/trackbacks/214749.html</trackback:ping><description><![CDATA[@import url(//www.pppqb.icu/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); <div class="dpun"><span style="color: red;">E_的分层:</span></div> <div class="dpun">数学?物理学家常常会说Q?#8220;c是个帔RQp是个参量,v是个变量”。他们的意思是q三个都是可变的Q但是存在一U可变的层次差别。c构成全局条gQp构成全局性更q一U条?--他可以在c固定时保持变动,最后v可以在c和p保持固定时变来变ȝ?/div> <div class="dpun">设想牙科ȝ不可能让病h的位|变来变ȝQ但是医生自己变动位|是有用的。其中的概念便是Qc是病人,p是病人的牙Q而v是医生本人?/div> <div class="dpun"></div> <div class="dpun"><span style="color: red;">框架和嵌套:</span></div> <div class="dpun">在框架语a中,可以说情景的心智表示包含着彼此嵌套的框架?/div> <div class="dpun">设想有若q个柜子Q每个柜子上可以装若q个抽屉Q这些抽屉可以放q?#8220;子框?#8221;Q你可以把别的柜子压~后放进去,q个q程可以递归?/div> <div class="dpun">在思想层面Q我们会?#8220;?#8221;的概忉|曲压~。比如在毛球赛球场上,你会把h考虑成一个队员,你已l把“?#8221;q个概念压羃?#8220;毛球赛”中去了?/div> <div class="dpun">用框架进行知识表C的理论依赖于这样一个想法:世界是由半封闭的子系l构成的?/div> <div class="dpun"></div> <div class="dpun"></div> <div class="dpun"><span style="color: red;">滑动Q?/span></div> <div class="dpun">我们会把xq行变ŞQ我们必要适时的生得概念变形的能力Q没有什么绝对不变的东西。也不能把事情弄得模凌两可的Q以至于Ҏ丧失意义?/div> <div class="dpun">我们会把圆Ş“滑动”为椭圆ŞQ或者凹L圆Ş。但是不会把圆Ş“滑动”成三角ŞQ虽然他们都是闭环图形?br /> <br /> <span style="color: red;">跌性和全局后退Q?/span><br /> 设想有一条狗Q目标要获得一块骨_前方有一面栅栏,栅栏有门?br /> “新手”会直接冲向栅栏有骨头的位|,然后到栅栏q不MQ就?#8220;旺旺。?#8221;?#8220;老手”会先跑到门口Q绕q门口然后再跑向骨头?br /> q里有一个思维跌性的q程Q曲U救国的方式Q在多次直接方式取得不好的后果后Q高U的思维需要蟩出原有的思维Q后退几步来看待问题。这在深度学习上Q是一U经验演变。但是他应该可以从思维的不同层ơ的滑动中推演出来?br /> <div class="dpun"></div> <div class="dpun"><span style="color: red;">演员pȝQ?/span></div> <div class="dpun">框架+演员=W号。演员之间传递消息,但是消息的解释取决于演员自己的特性,于是W号的内容将由框架和演员共同军_.演员是信L启发?/div> <div class="dpun"></div> <div class="dpun"><span style="color: red;">多重表示Q?/span></div> <div class="dpun">副ȝ是政府这部汽车的备用轮胎。概念骨架不仅必d在于不同的抽象层ơ上Q还需要存在于不同概念“l度”上?/div> <div class="dpun"></div> <div class="dpun"><span style="color: red;">关于人工的几个的问题Q?/span></div> <div class="dpun">1.E序能否写出优美的乐Ԍ</div> <div class="dpun">会的Q但不是现在。音乐是情感的语aQ精世界不可低估。能有如此能力的“E序”必须得能自己走进q个世界Q在UL的世界中与生zL争,q每时每M验到自己的感受。他必须懂得暗夜里凉风带来的喜悦与孤独,懂得对于带来温暖爱抚地手掌的渴望Q还要能体验C个hd后引L心碎与生zR明了放弃与厌世Q悲伤与失望Q决心与胜利Q虔诚与敬畏。能把希?恐惧/烦恼/Ƣ乐/宁静/不安{对立的情A混合C赗。。?/div> <div class="dpun">2.是否可以在低层次讄核心参数控制E序Q?/div> <div class="dpun">不能Q如同h不会在意自己每天L几千个神l原一P我们几乎没事Q除非你要给大脑做手术折腄太厉実뀂但q已l不属于低层ơ控?/div> <div class="dpun">3.人工是否存在智能?</div> <div class="dpun">可能和规模有养I我们也许有一个界点Q也思hcdl位于零界点之上。有一天会辑ֈ全能自我认知Q即W卡的“我思故我在”演变ؓ“我在思我所?#8221;?/div> <div class="dpun">也许人工有一天达C人类的智能,但是他会q入下一阶段。我们可能还不知道那是什么样的?/div> <div class="dpun">4.是否存在能击败Q何h的下程序?</div> <div class="dpun">可能已经有,但是现在q只是下?/div> <div class="dpun">跛_下棋Q普遍的ȝQ真正的只能必然依赖于一U纵览全局的能?--卛_以说是在E序中编入了一U?#8220;跛_pȝ?#8221;的能力。一旦实Cq一步,你就无法再完全控制这个程序了Q他超q一个特定的临界点,那时你不得不与你造出来的东西打交道?/div> </div> <div class="dpun"><br /> </div> <div class="dpun"> <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;">为阐明大脑中发生的思维q程Q有两个基本问题  </p> <p style="margin: 0px; font-size: 12px; line-height: normal; font-family: '.PingFang SC'; color: #454545;"> 一个是解释低层ơ的经发射通讯是如何导致高层次的符hz通讯的,</p> <p style="margin: 0px; font-size: 12px; line-height: normal; font-family: '.PingFang SC'; color: #454545;">另一个是自地解释高层次的符hz通讯<span style="line-height: normal; font-family: 'Helvetica Neue';">——</span>建立一个不涉及低层经事g的理论?/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';">——</span>q是目前q行的所有h工智能研I的基础中的一个关键假?span style="line-height: normal; font-family: 'Helvetica Neue';">——</span>那么可能实C不同于大脑的其它g上。那表明智能是一U可以从它所在的g?span style="line-height: normal; font-family: 'Helvetica Neue';">"</span>抽取。出来的性质<span style="line-height: normal; font-family: 'Helvetica Neue';">——</span>换句话说Q智能将是一UY件性质?/p> <p style="margin: 0px; font-size: 12px; line-height: normal; color: #454545;"><span style="font-family: '.PingFang SC';">q将意味着意识和智能这一现象的确和大多数极其复杂的自然现象一h高层ơ的它们有自w的高层规律Q这些归律依赖于低层Q但又可以从低层中抽取出来。相?/span><font face="Helvetica Neue">Q?/font><font face=".PingFang SC">如果没有全部ql原(或模拟神l原)l成的硬件就l对无法实现W号触发模式的话Q这意味着是一U局限于的现象,比v那种可以用一个具有若q不同层ơ的规律体系来说明的现象Q对它的</font></p> <p style="margin: 0px; font-size: 12px; line-height: normal; font-family: '.PingFang SC'; color: #454545;">释要困难得多?/p> </div> <div class="dpun"><br /> </div><img src ="//www.pppqb.icu/TianShiDeBaiGu/aggbug/214749.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.pppqb.icu/TianShiDeBaiGu/" target="_blank">何清?/a> 2017-03-13 12:46 <a href="//www.pppqb.icu/TianShiDeBaiGu/archive/2017/03/13/214749.html#Feedback" target="_blank" style="text - սƵ2019|սع//www.pppqb.icu/TianShiDeBaiGu/archive/2017/01/09/214581.html何清?/dc:creator>何清?/author>Mon, 09 Jan 2017 05:38:00 GMT//www.pppqb.icu/TianShiDeBaiGu/archive/2017/01/09/214581.html//www.pppqb.icu/TianShiDeBaiGu/comments/214581.html//www.pppqb.icu/TianShiDeBaiGu/archive/2017/01/09/214581.html#Feedback0//www.pppqb.icu/TianShiDeBaiGu/comments/commentRss/214581.html//www.pppqb.icu/TianShiDeBaiGu/services/trackbacks/214581.htmlfind . -name *.swift | xargs perl -p -i -e '/NSIndexPath/IndexPath/g'
find . -name *.swift | xargs perl -p -i -e 's/NSIndexPath/IndexPath/g'
find . -name *.swift | xargs perl -p -i -e 's/heightForRowAtIndexPath/heightForRowAt/g'
#find . -name *.swift | xargs perl -p -i -e 's/CGRectMake/RectMake/g'
find . -name *.swift | xargs perl -p -i -e 's/cellForRowAtIndexPath/cellForRowAt/g'
find . -name *.swift | xargs perl -p -i -e 's/forRowAtIndexPath/forRowAt/g'

find . -name *.swift | xargs perl -p -i -e 's/didSelectRowAtIndexPath/didSelectRowAt/g'
find . -name *.swift | xargs perl -p -i -e 's/cellForItemAtIndexPath/cellForItemAt/g'
find . -name *.swift | xargs perl -p -i -e 's/shouldSelectItemAtIndexPath/shouldSelectItemAt/g'
find . -name *.swift | xargs perl -p -i -e 's/didSelectItemAtIndexPath/didSelectItemAt/g'
find . -name *.swift | xargs perl -p -i -e 's/\(_\:NSURLSessionDataTask\!\, resp\:AnyObject\!\)/\(_, resp\) /g'
find . -name *.swift | xargs perl -p -i -e 's/\(_, rspObj:AnyObject!\)/\(_, resp\) /g'
find . -name *.swift | xargs perl -p -i -e 's/\(_, resp:AnyObject\!\)/\(_, resp\) /g'
find . -name *.swift | xargs perl -p -i -e 's/_:URLSessionDataTask!, responseObj:AnyObject!/_, responseObj/g'
find . -name *.swift | xargs perl -p -i -e 's/\(_, error:NSError\!\)/\(_, error\)/g'
find . -name *.swift | xargs perl -p -i -e 's/\(_:NSURLSessionDataTask!, error:NSError!\)/\(_, error\)/g'

find . -name *.swift | xargs perl -p -i -e 's/func doAction\(_ action: String, model: AnyObject\!, fromView: UIView\?\)/func doAction\(_ action: String, model: Any\!, fromView: UIView\?\)/g'

find . -name *.swift | xargs perl -p -i -e 's/CGPointZero/CGPoint.zero/g'
find . -name *.swift | xargs perl -p -i -e 's/CGFloat.max/\CGFloat\.greatestFiniteMagnitude/g'
find . -name *.swift | xargs perl -p -i -e 's/\.NoData/\.noData/g'
find . -name *.swift | xargs perl -p -i -e 's/\.Fail/\.fail/g'
find . -name *.swift | xargs perl -p -i -e 's/UIEdgeInsetsZero/UIEdgeInsets.zero/g'

#autoPinEdgeToSuperviewEdge
find . -name *.swift | xargs perl -p -i -e 's/\.autoPinEdgeToSuperviewEdge\(\.Leading/\.autoPinEdge\(toSuperviewEdge\: \.leading/g'
find . -name *.swift | xargs perl -p -i -e 's/\.autoPinEdgeToSuperviewEdge\(\.Trailing/\.autoPinEdge\(toSuperviewEdge\: \.trailing/g'
find . -name *.swift | xargs perl -p -i -e 's/\.autoPinEdgeToSuperviewEdge\(\.Bottom/\.autoPinEdge\(toSuperviewEdge\: \.bottom/g'
find . -name *.swift | xargs perl -p -i -e 's/\.autoPinEdgeToSuperviewEdge\(\.Top/\.autoPinEdge\(toSuperviewEdge\: \.top/g'

find . -name *.swift | xargs perl -p -i -e 's/codecToInstance\(/codec\(toInstance:/g'
find . -name *.swift | xargs perl -p -i -e 's/UIFont\.\.systemFont/UIFont\.systemFont/g'

#下面q两句处理的是不同的函数
#find . -name *.swift | xargs perl -p -i -e 's/deselectRowAtIndexPath\(/deselectRow\(at:/g'
#find . -name *.swift | xargs perl -p -i -e 's/deselectRowAtIndexPath\(/deselect\(at:/g'



find . -name *.swift | xargs perl -p -i -e 's/\.locationInView\(/\.location\( in:/g'
find . -name *.swift | xargs perl -p -i -e 's/CGRectZero/CGRect.zero/g'
find . -name *.swift | xargs perl -p -i -e 's/\.dismissViewControllerAnimated\(/\.dismiss\(animated: /g'

find . -name *.swift | xargs perl -p -i -e 's/LocalCache\.sharedCache\(\)\.cachedObjectForKey\(/LocalCache\.shared\(\)\.cachedObject\(forKey/g'
find . -name *.swift | xargs perl -p -i -e 's/LocalCache\.shared\(\)\.cachedObject\(forKey/LocalCache\.shared\(\)\.cachedObject\(forKey\:/g'
find . -name *.swift | xargs perl -p -i -e 's/willDisplayCell/willDisplay/g'

find . -name *.swift | xargs perl -p -i -e 's/XRZPostLoadingView\.showSuccessfulWithTitle\(/XRZPostLoadingView\.showSuccessful\(withTitle\:/g'
#q个地方改了以后需要尾部添加括P需要手动搜索NotificationCenter.default.post(name:NSNotification.Name(rawValue出来修改
find . -name *.swift | xargs perl -p -i -e 's/NSNotificationCenter\.defaultCenter\(\)\.postNotificationName\(/NotificationCenter\.default\.post\(name\:\ NSNotification.Name\(rawValue\: /g'

find . -name *.swift | xargs perl -p -i -e 's/\.showTextWithTitle\(/\.showText\(withTitle\:/g'
find . -name *.swift | xargs perl -p -i -e 's/\.showSuccessWithTitle\(/\.showSuccessful\(withTitle\:/g'
find . -name *.swift | xargs perl -p -i -e 's/\(task\:URLSessionDataTask\!\,\ respon\:AnyObject\!\)/\(_\,\ respon\)/g'
find . -name *.swift | xargs perl -p -i -e 's/\(_,\ reponseObj\:AnyObject\!\)/\(_\,\ respon\)/g'
find . -name *.swift | xargs perl -p -i -e 's/\(_\:URLSessionDataTask\!\,\ responseObj\:AnyObject\!\)/\(_\,\ respon\)/g'
find . -name *.swift | xargs perl -p -i -e 's/\(_, responseObj:AnyObject!\)/\(_, responseObj\)/g'
find . -name *.swift | xargs perl -p -i -e 's/task:URLSessionDataTask!, error:NSError!/_, error/g'
find . -name *.swift | xargs perl -p -i -e 's/\(task:URLSessionDataTask!, responseObj:AnyObject!\)/\(_, responseObj\)/g'
find . -name *.swift | xargs perl -p -i -e 's/\(_\:URLSessionDataTask\!\,\ error\:NSError\!\)/\(_\,\ error\)/g'

find . -name *.swift | xargs perl -p -i -e 's/\.popToRootViewControllerAnimated\(/\.popToRootViewController\(animated: \/g'
find . -name *.swift | xargs perl -p -i -e 's/removeAlert\(/let _ = removeAlert\(/g'
find . -name *.swift | xargs perl -p -i -e 's/\.addObject\(/\.add\(/g'
find . -name *.swift | xargs perl -p -i -e 's/\.rac_newValueChannelWithNilValue\(/\.rac_newValueChannel\(withNilValue:/g'


find . -name *.swift | xargs perl -p -i -e 's/\.NotMore/\.notMore/g'
find . -name *.swift | xargs perl -p -i -e 's/\.ChatRoom/\.chatRoom/g'
find . -name *.swift | xargs perl -p -i -e 's/\.Normal/\.normal/g'
find . -name *.swift | xargs perl -p -i -e 's/MarkTableViewDD\.normal/MarkTableViewDD\.Normal/g'
find . -name *.swift | xargs perl -p -i -e 's/\.showFailWithTitle\(/\.showFail\(withTitle\:\ /g'
find . -name *.swift | xargs perl -p -i -e 's/\.heightFromHitModel\(/\.height\(fromModel\:\ /g'
find . -name *.swift | xargs perl -p -i -e 's/model\:AnyObject\!\,/model\:Any\!\,/g'
find . -name *.swift | xargs perl -p -i -e 's/func\ heightForModel\(_\ model\:AnyObject\!\)->CGFloat/func\ heightForModel\(_\ model\:Any\!\)->CGFloat/g'
find . -name *.swift | xargs perl -p -i -e 's/\.showSuccessfulWithTitle\(/\.showSuccessful\(withTitle\:\ /g'
find . -name *.swift | xargs perl -p -i -e 's/\.TouchUpInside\.touchUpInside/g'
find . -name *.swift | xargs perl -p -i -e 's/\.rac_signalForControlEvents\(/\.rac_signal\(for\:\ /g'
find . -name *.swift | xargs perl -p -i -e 's/\UIEdgeInsetsZero/\UIEdgeInsets.zero/g'
find . -name *.swift | xargs perl -p -i -e 's/\.systemFontOfSize\(/\..systemFont(ofSize:\ /g'

#find . -name *.swift | xargs perl -p -i -e 's/\.Normal/\.normal/g'
@import url(//www.pppqb.icu/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

]]>
所有证据都指向同一件事Q反而o人怀? ------- 一致性偏?/title><link>//www.pppqb.icu/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>//www.pppqb.icu/TianShiDeBaiGu/archive/2016/07/12/213922.html</guid><wfw:comment>//www.pppqb.icu/TianShiDeBaiGu/comments/213922.html</wfw:comment><comments>//www.pppqb.icu/TianShiDeBaiGu/archive/2016/07/12/213922.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.pppqb.icu/TianShiDeBaiGu/comments/commentRss/213922.html</wfw:commentRss><trackback:ping>//www.pppqb.icu/TianShiDeBaiGu/services/trackbacks/213922.html</trackback:ping><description><![CDATA[     摘要: q个有科学和政治意义?nbsp; <a href='//www.pppqb.icu/TianShiDeBaiGu/archive/2016/07/12/213922.html'>阅读全文</a><img src ="//www.pppqb.icu/TianShiDeBaiGu/aggbug/213922.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.pppqb.icu/TianShiDeBaiGu/" target="_blank">何清?/a> 2016-07-12 14:21 <a href="//www.pppqb.icu/TianShiDeBaiGu/archive/2016/07/12/213922.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>人工Q龙宝小?部分W记 - սƵ2019|սع//www.pppqb.icu/TianShiDeBaiGu/archive/2016/07/11/213914.html何清?/dc:creator>何清?/author>Mon, 11 Jul 2016 07:30:00 GMT//www.pppqb.icu/TianShiDeBaiGu/archive/2016/07/11/213914.html//www.pppqb.icu/TianShiDeBaiGu/comments/213914.html//www.pppqb.icu/TianShiDeBaiGu/archive/2016/07/11/213914.html#Feedback0//www.pppqb.icu/TianShiDeBaiGu/comments/commentRss/213914.html//www.pppqb.icu/TianShiDeBaiGu/services/trackbacks/213914.htmlA 左手摸墙法的描q?/span>
  • 当左手边没有墙时Q左转前q一步;
  • 当左手边有墙且前Ҏ有墙Ӟ前进一步;
  • 当左手边有墙且前方也有墙Ӟ双{前进一步;
  x摸墙法Q只需上面的“?#8221;换作“?#8221;Q?#8220;?#8221;换作“?#8221;?/span>

B 摸墙法存在的问题,路径冗余度搞?/span>
比如在一个封闭房间中Q左手摸墙算法和x摸墙法Q用的总能耗差异很大?nbsp;
  q个问题需要用用遗传算法的思想剞劂?/span>
多次使用左手和右手摸墙算法,依靠U篏l验来得到概率结论,然后Ҏ不同条gq行学习之后得知下一ơ采取哪U摸墙?/span>

C 摸墙法的性能改善
q个{略只是用与多次重复C个迷宫的情况Q对于走陌生的迷宫,不适用?/span>
当作Zơ移动时Q在路径中查扑օ前是否经q相同的点,如果有那么就说明到这一步ؓ止完成了一个圈子,在遗传算法中Q?/span>把它从\径中除去?/span>
多次行动试后,会改善能耗效果,得到一点经验概率结果?/span>
去除圈子的算法是Q?/span>
假设左手摸墙赎ͼ取得所有已l过路径Cؓdimension[all]
遍历dimension all to 0Q?见重复的\径节点,证明Q这个点所l历的左手摸墙\径是一个圈
这个点标记Q以后在q里跌q个位置的左手摸墙而采用直走蟩q这个节炏V?/font>

思考:如何l小车在开攄间中Q做环Ş路径点的标记Q?/font>

D 深度优先搜烦法Q?/span>
E序q行时将按照从上CQ从左到右的序遍历整棵树?/span>
对于真实环境的物理小车,需要ؓR安装指南针或者陀ZA才行。理Z加速度传感器也能做刎ͼ但是法上也许要E微复杂一炏V?/span>

深度优先法按以下规则执行遍历:
  1. 1Q判断当前节Ҏ否ؓ目标节点Q如是,q回成功?/li>
  2. 2Q检查当前节Ҏ否还有未讉Kq的子节点,若否goto 4?    =>     4Q检查当前节Ҏ否有上层节点Q若有访问上层节点,设ؓ当前节点。goto 1?/li>
  3. 3Q访问子节点Q设为当前节点,讑ַ讉K。goto 1?/li>
  4. 5Q返回失败?/li>

E q度优先搜烦法Q?/span>
  1. 1?/span>从图中某个顶点V0出发Qƈ讉K此顶点;
    2?/span>从V0出发Q访问V0的各个未曾访问的L点W1QW2Q?#8230;,Wk;然后,依次从W1,W2,…,Wk出发讉K各自未被讉K的邻接点Q?/div>
    3?/span>重复步骤2Q直到全部顶炚w被访问ؓ止?/div>
q度优先的好处在于,如果有多个出口,那么W一个被扑ֈ的出口消耗时间最短,q度最,也即路劲最短?/span>
另一个额外的好处是,可以知道所有的出口。得C个统计结果?br />




]]>
swift中对TableView的代理进行包?/title><link>//www.pppqb.icu/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>//www.pppqb.icu/TianShiDeBaiGu/archive/2016/03/18/213066.html</guid><wfw:comment>//www.pppqb.icu/TianShiDeBaiGu/comments/213066.html</wfw:comment><comments>//www.pppqb.icu/TianShiDeBaiGu/archive/2016/03/18/213066.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.pppqb.icu/TianShiDeBaiGu/comments/commentRss/213066.html</wfw:commentRss><trackback:ping>//www.pppqb.icu/TianShiDeBaiGu/services/trackbacks/213066.html</trackback:ping><description><![CDATA[     摘要: 写了太多tableViewQ发现每ơ都要实现TableView的两个代理太ȝ。我在swift层面做了一ơ封装?我想要每个用tableView的地方,都不在需要单独实C份tableViewDataSource和TableViewDelegate. 下面是理想的使用实例: Code highlighting produced by Actipro CodeHighlighte...  <a href='//www.pppqb.icu/TianShiDeBaiGu/archive/2016/03/18/213066.html'>阅读全文</a><img src ="//www.pppqb.icu/TianShiDeBaiGu/aggbug/213066.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.pppqb.icu/TianShiDeBaiGu/" target="_blank">何清?/a> 2016-03-18 14:07 <a href="//www.pppqb.icu/TianShiDeBaiGu/archive/2016/03/18/213066.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>UIImage无锯齿羃放(无锯齿),UIButton囄无锯齿羃?/title><link>//www.pppqb.icu/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>//www.pppqb.icu/TianShiDeBaiGu/archive/2015/10/09/211979.html</guid><wfw:comment>//www.pppqb.icu/TianShiDeBaiGu/comments/211979.html</wfw:comment><comments>//www.pppqb.icu/TianShiDeBaiGu/archive/2015/10/09/211979.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.pppqb.icu/TianShiDeBaiGu/comments/commentRss/211979.html</wfw:commentRss><trackback:ping>//www.pppqb.icu/TianShiDeBaiGu/services/trackbacks/211979.html</trackback:ping><description><![CDATA[没查到相兌?Q说h其实也挺单的Q就是用UIImage的初始化函数重新初始?span style="font-size: 13px; background-color: #eeeeee;">-</span><span style="font-size: 13px; background-color: #eeeeee;"> (UIImage </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">    <span style="color: #0000FF; ">return</span> [UIImage imageWithData:UIImageJPEGRepresentation(self, 1) 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 />//www.CodeHighlighter.com/<br /><br />--></div><img src ="//www.pppqb.icu/TianShiDeBaiGu/aggbug/211979.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.pppqb.icu/TianShiDeBaiGu/" target="_blank">何清?/a> 2015-10-09 18:20 <a href="//www.pppqb.icu/TianShiDeBaiGu/archive/2015/10/09/211979.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>swift 去除String首尾的空|以及指定字符?/title><link>//www.pppqb.icu/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>//www.pppqb.icu/TianShiDeBaiGu/archive/2015/06/11/210883.html</guid><wfw:comment>//www.pppqb.icu/TianShiDeBaiGu/comments/210883.html</wfw:comment><comments>//www.pppqb.icu/TianShiDeBaiGu/archive/2015/06/11/210883.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.pppqb.icu/TianShiDeBaiGu/comments/commentRss/210883.html</wfw:commentRss><trackback:ping>//www.pppqb.icu/TianShiDeBaiGu/services/trackbacks/210883.html</trackback:ping><description><![CDATA[@import url(//www.pppqb.icu/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); 直接l一D调用实例:@import url(//www.pppqb.icu/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); <div class="dpun"> <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 /> //www.CodeHighlighter.com/<br /> <br /> -->var str = "       \n   \r \r\n \t Hello, \n playground  \n  \t \t \n \n\r   \n    "<br /> let length = (str <span style="color: #0000FF; ">as</span> NSString).length<br /> let a = str.escapeHeadTailSpace()<br /> let b = str.stringEscapeHeadTail(strs:["\r", "\n", "\t", "\r\n", " "])</div> </div> <div class="dpun"><br /> </div> <div class="dpun">对应l果:</div> <div class="dpun"> <p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #ff2600;">a::\t Hello, \n playground  \n  </p> </div> <div class="dpun"> <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;">处理原理是:针对一个字W串Q每ơ按一个字节蟩q给定的字符Ԍq返回新得到的字W串Q反复P代,直到原字W串中已l找不到l定的字W串。这P包含在中间的字符是不去除的?/p> <p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #ff2600;">得到的新字W串反{Q同样在处理一遍。这样头N的排除字W串集都可以了。然后再结果反转,得到原来序的字W串Q即我们需要的l果.</p> <p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: #ff2600;">单纯去除其中所有的某个字符集,有原生方法,不再ơ考虑</p> </div> <div class="dpun">q是针对String的扩展:</div> <div class="dpun"> <div style="background-color: #eeeeee; font-size: 13px; border-left-color: #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;">extension String{<br />     func escapeSpaceTillCahractor()->String{<br />         <span style="color: #0000FF; ">return</span> self.stringEscapeHeadTail(strs:["\r", " ", "\n"])<br />     }<br />     func escapeHeadStr(str:String)->(String, Bool){<br />         var result = self <span style="color: #0000FF; ">as</span> NSString<br />         var findAtleastOne = <span style="color: #0000FF; ">false</span><br />         <span style="color: #0000FF; ">while</span>( <span style="color: #0000FF; ">true</span> ){<br />             var range = result.rangeOfString(str)<br />             <span style="color: #0000FF; ">if</span> range.location == 0 && range.length == 1 {<br />                 result = result.substringFromIndex(range.length)<br />                 findAtleastOne = <span style="color: #0000FF; ">true</span><br />             }<span style="color: #0000FF; ">else</span>{<br />                 <span style="color: #0000FF; ">break</span><br />             }<br />         }<br />         <span style="color: #0000FF; ">return</span> (result <span style="color: #0000FF; ">as</span> String, findAtleastOne)<br />     }<br />     func escapeSpaceTillCahractor(#strs:[String])->String{<br />         var result = self<br />         <span style="color: #0000FF; ">while</span>( <span style="color: #0000FF; ">true</span> ){<br />             var findAtleastOne = <span style="color: #0000FF; ">false</span><br />             <span style="color: #0000FF; ">for</span> str <span style="color: #0000FF; ">in</span> strs {<br />                 var found:Bool = <span style="color: #0000FF; ">false</span><br />                 (result, found) = result.escapeHeadStr(str)<br />                 <span style="color: #0000FF; ">if</span> found {<br />                     findAtleastOne = <span style="color: #0000FF; ">true</span><br />                     <span style="color: #0000FF; ">break</span>  <span style="color: #008000; ">//</span><span style="color: #008000; ">for循环</span><span style="color: #008000; "><br /> </span>                }<br />             }<br />             <span style="color: #0000FF; ">if</span> findAtleastOne == <span style="color: #0000FF; ">false</span> {<br />                 <span style="color: #0000FF; ">break</span><br />             }<br />         }<br />         <span style="color: #0000FF; ">return</span> result <span style="color: #0000FF; ">as</span> String<br />     }<br />     func reverse()->String{<br />         var inReverse = ""<br />         <span style="color: #0000FF; ">for</span> letter <span style="color: #0000FF; ">in</span> self {<br />             println(letter)<br />             inReverse = "\(letter)" + inReverse<br />         }<br />         <span style="color: #0000FF; ">return</span> inReverse<br />     }<br /> <br />     func escapeHeadTailSpace()->String{<br />         <span style="color: #0000FF; ">return</span> self.escapeSpaceTillCahractor().reverse().escapeSpaceTillCahractor().reverse()<br />     }<br /> <br />     func stringEscapeHeadTail(#strs:[String])->String{<br />         <span style="color: #0000FF; ">return</span> self.escapeSpaceTillCahractor(strs:strs).reverse().escapeSpaceTillCahractor(strs:strs).reverse()<br />     }<br /> }</div> </div><img src ="//www.pppqb.icu/TianShiDeBaiGu/aggbug/210883.html" width = "1" height = "1" /><br><br><div align=right><a href="//www.pppqb.icu/" title="սƵ2019">սƵ2019</a></div>]]></description></item></channel></rss> <script>(function(){ var src = (document.location.protocol == "") ? "//js.passport.qihucdn.com/11.0.1.js?9ed1f3a8f9c3ff069b7b95c01474c743":"https://jspassport.ssl.qhimg.com/11.0.1.js?9ed1f3a8f9c3ff069b7b95c01474c743"; document.write('<script src="' + src + '" id="sozz"><\/script>'); })(); </script>