﻿<?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>BlogJava-重剑无锋-文章分类-grasp</title><link>http://www.blogjava.net/morgan/category/52605.html</link><description /><language>zh-cn</language><lastBuildDate>Sun, 23 Sep 2012 09:56:20 GMT</lastBuildDate><pubDate>Sun, 23 Sep 2012 09:56:20 GMT</pubDate><ttl>60</ttl><item><title>bat 脚本学习</title><link>http://www.blogjava.net/morgan/articles/bat.html</link><dc:creator>morgan</dc:creator><author>morgan</author><pubDate>Mon, 17 Sep 2012 15:18:00 GMT</pubDate><guid>http://www.blogjava.net/morgan/articles/bat.html</guid><wfw:comment>http://www.blogjava.net/morgan/comments/387946.html</wfw:comment><comments>http://www.blogjava.net/morgan/articles/bat.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/morgan/comments/commentRss/387946.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/morgan/services/trackbacks/387946.html</trackback:ping><description><![CDATA[&nbsp; &nbsp; &nbsp; &nbsp; 做windchill克制化的时候，部署代码很复杂，需要根据情况执行很多命令，所以通过bat批处理可以有效避免。bat批处理就是一条一条的命令。轻巧灵活，功能强大，如下记录一些常用的用法。<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; @echo off<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 不回显命令。<br />&nbsp; &nbsp; &nbsp; &nbsp; echo&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 显示后面的字符串<br />&nbsp; &nbsp; &nbsp; &nbsp; if&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if 1==1 echo helloworld &nbsp;判断1==1是否成立，如果成立，则显示helloworld。<br />&nbsp; &nbsp; &nbsp; &nbsp; for<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp;for %%i in (t*.*) do echo %%i &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;显示当前文件夹下以t开头的文件。<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2 &nbsp;for /d %%i in (c*.*) do echo %%i &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;显示当前文件夹下以c开头的文件夹。<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3 &nbsp;for /r d:\ %%i in (c*.*) do echo %%i &nbsp; &nbsp; &nbsp; 显示D盘下以及子文件夹下所有以C开头的文件。<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4 &nbsp;for /r /d %%i in (c*.*) do echo %%i &nbsp; &nbsp; &nbsp; &nbsp; 显示D盘下以及子文件夹下面所有以C开头的文件夹。<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5 &nbsp;for /L %%i in (1,1,5) do echo %%i &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 显示以1开始，5结束，step为1的序列。<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6 &nbsp;for /f %%i in (a.txt) do echo %%i &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;显示a.txt文件中的所有内容 &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6 &nbsp;for /f "tokens=4,* delims=\" %%i in (a.txt) do echo %%i\%%j &gt;&gt; b.txt<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 读取当前目录下a.txt文件中的内容，并且每行以\分割，最后返回第四列以及以后每一列的内容，全部写入到b.txt文件中。<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7 &nbsp;for /r d:\project\src %%i in (*.java) do javac %%i 2&gt;&gt;temp.log<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 编译d:\project\src目录下面所有的java文件，并且编译信息输出到temp.log目录。<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; del&nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; del a.txt &nbsp; &nbsp; 删除当前目录下的a.txt文件。<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;del %0 &nbsp; &nbsp; &nbsp; 删除当前的批处理文件。<br />&nbsp; &nbsp; &nbsp; &nbsp; &gt; &gt;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &gt; 将内容输出到后面的文件。覆盖之前的内容。<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &gt;&gt; 将前面命令的内容写到后面的文件，但是写入的方式是追加写入。不覆盖之前的内容。&nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; |<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 将前一个命令的输出内容作为后一个命令的输入。&nbsp; &nbsp; &nbsp;&nbsp;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; 以上都是基础内容，但是掌握好以后，写一个病毒程序出来已经完全没问题了。更深入的使用请研究<span style="color: #333333; font-family: Arial; line-height: 26px; text-align: left; background-color: #ffffff; ">Bat.Worm.Muma</span>&nbsp;病毒代码，此代码构思精巧，<br />&nbsp;不得不佩服此病毒的作者。在此致敬。<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<img src ="http://www.blogjava.net/morgan/aggbug/387946.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/morgan/" target="_blank">morgan</a> 2012-09-17 23:18 <a href="http://www.blogjava.net/morgan/articles/bat.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>软件开发的基本方法---读软件工程思想(林锐)有感</title><link>http://www.blogjava.net/morgan/articles/method.html</link><dc:creator>morgan</dc:creator><author>morgan</author><pubDate>Thu, 13 Sep 2012 11:04:00 GMT</pubDate><guid>http://www.blogjava.net/morgan/articles/method.html</guid><wfw:comment>http://www.blogjava.net/morgan/comments/387671.html</wfw:comment><comments>http://www.blogjava.net/morgan/articles/method.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/morgan/comments/commentRss/387671.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/morgan/services/trackbacks/387671.html</trackback:ping><description><![CDATA[&nbsp; &nbsp; &nbsp; &nbsp; 近期的努力学习，一直希望能突破一个瓶颈，就是熟练工，目前感觉到自己就是一个熟练工，对于工作中所接触到的技术，基本的API都知道，完成工作也比较顺利，按照以前在华为外包做开发的经历，有领导明言，开发就是倒腾一堆API么。我想，开发如果仅仅是倒腾一堆API的话，那么这种工作没有任何意义，因为这一堆API的倒腾最终会实现自动化，就算不能，我们开发人员也只是倒腾API的工具，没有任何价值而言，正因为如此，近期才会有突破这个瓶颈的强烈欲望，希望通过摆脱对工具的依赖，找出技术的本质，达到进一步的提高。<br />&nbsp; &nbsp; &nbsp; &nbsp; 今天无意间读到林锐博士写的一本书--&lt;&lt;软件工程思想&gt;&gt;，随便翻了一下，看到其中有一段关于软件开发的基本策略，现记录如下。<br />&nbsp; &nbsp; &nbsp; &nbsp; 软件开发的基本策略有三种，复用，分而治之，优化-折中。<br />&nbsp; &nbsp; &nbsp; &nbsp; 复用，就是我们可以利用前人开发的成熟功能或模块进行组装调用，来实现我们在开发工作中需要的功能，但是仅仅这么复用下去的话，那么我们也不会有进步，也不会有创新，个人价值从何体现？所以我们需要在复用的同时，对成熟模块进行优化，理解它的工作原理，从而达到更好的使用，以及站在更高的层面来实现成熟模块的功能，还有对现有系统也要进行优化。此外，复用还需要注意的是，复用是我们拿别人的东西，同样，我们做的东西，也要方便别人来拿着用才可以。这样才能实现最大价值。<br />&nbsp; &nbsp; &nbsp; &nbsp; 分而治之，好像很多地方都有提到这个名词，我在算法书上也有见过类似的思想。将一个复杂的功能分解成很多个简单的功能，然后逐一击破，最后将每个简单功能的实现组合起来，就是这个复杂功能的实现了。但是分解问题的过程需要注意的是，分解并不是简单的拆卸，要确保分解后的功能，最后归并，还是原来的复杂问题才可以。<br />&nbsp; &nbsp; &nbsp; &nbsp; 优化-折中，优化工作并不是可有可无的工作，而是我们必须要做的事情，当优化工作中遇到困难时，我们可以选择折中方案，但是该方案的前提是不能损失其他功能。<img src ="http://www.blogjava.net/morgan/aggbug/387671.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/morgan/" target="_blank">morgan</a> 2012-09-13 19:04 <a href="http://www.blogjava.net/morgan/articles/method.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>博客开篇</title><link>http://www.blogjava.net/morgan/articles/387543.html</link><dc:creator>morgan</dc:creator><author>morgan</author><pubDate>Wed, 12 Sep 2012 06:13:00 GMT</pubDate><guid>http://www.blogjava.net/morgan/articles/387543.html</guid><wfw:comment>http://www.blogjava.net/morgan/comments/387543.html</wfw:comment><comments>http://www.blogjava.net/morgan/articles/387543.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/morgan/comments/commentRss/387543.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/morgan/services/trackbacks/387543.html</trackback:ping><description><![CDATA[&nbsp; &nbsp; &nbsp;近期回顾了两篇文章，&lt;&lt;<a href="http://blog.csdn.net/g9yuayon/article/details/1437195">银弹和我们的职业</a>&gt;&gt;和&lt;&lt;<a href="http://blog.csdn.net/Dreamcode/article/details/5925013">无剑胜有剑,软件大师之路的探索</a>&gt;&gt;。<br />&nbsp; &nbsp; &nbsp;通过银弹的介绍，了解到编程的本质困难不在哪种语言可以实现什么样的功能，也不是哪种的语言的什么语法等等，而是在于抽象结构的规范，设计结构等。文中的例子很贴切，如果拿摄影来比编程的话，摄影的本质困难在于艺术感觉，而不是使用何种相机。<br />&nbsp; &nbsp; &nbsp;对于第二篇的描述，主要讲述了编程和武侠中的剑术是相通的，最起码理念一致。我们往往使用了很好很强大的工具，但是因为没有深入了解工具，最后沦落成了工具的工具，不得不说，这是一个技术人员的悲哀。所以这篇文章强调了基础知识，基础理论的掌握，做到厚积薄发，才能更有效的使用工具，对于我们编程，有一个更高层次的把控。<br /><br />&nbsp; &nbsp; &nbsp; 所以通过这两篇文章的回顾，算是温故知新，对几年工作的总结，发现如果再不悬崖勒马，最后的结果就是自己变成工具的工具了。这也是这个博客出现的缘由了。这个博客更新应该比较慢，但是每一篇都是经过深思熟虑才会分享出来。<br /><br />&nbsp; &nbsp; &nbsp; 工作比较忙，先写到这里。算是一个开篇的记录。希望能坚持下来，写一个比较好的博客，分享自己的成长，不要做虎头蛇尾的事情。<img src ="http://www.blogjava.net/morgan/aggbug/387543.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/morgan/" target="_blank">morgan</a> 2012-09-12 14:13 <a href="http://www.blogjava.net/morgan/articles/387543.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>