关于如何用eclipse上班看小说

其实这个文章代表了俺的罪孽...

俗话说:好逸恶劳是罪孽啊

....我的时间啊...

---------------------------------------------------------------------------------

1 需求分析:
a  功能需求:在上班的时候很无聊,没有事情做又不能随便干点啥,想看小说有容易入神后被项目经理发现,实在是老太太磕麦芽糖,实在很不爽,我们需要一个可以光明正大的看小说的工具

b 环境需求:windows xp,vista容易卡,在切换到其他程序时,容易卡死而吐血身亡
2 可行性分析:
a 技术可行性:目前小说txt版本资源十分富足,而且txt桌面阅读程序更是......茅草一般多
b 财务可行性:没有成本
c 经济可行性:看小说还挣工资,非常可行
d 风险因素及对策: 被公司领导发现的风险,对策:今天的目标就是不让发现!!被发现了就去撞墙吧!

3 详细设计
 针对需求低暴露高隐蔽性的特点,又要保证读者相对的舒适和放心度.
我们 的 运行环境采用eclipse.
eclipse 是目前java程序员使用比较多的IDE,而且支持插件管理使用,可以自由扩展功能,实在是太适合看小说啦

4 具体实现
a 首先选择合适的插件,如果各位打算自己实现,我最多就吐吐口水而已...
最终选择插件 notepad
下载地址:http://sourceforge.net/projects/eclipsenotepad/
此插件支持编辑文字,和自动换行,完全满足偶们的需要
b 添加插件.把下好的压缩包解压缩,将plugin和feature两个文件夹复制到eclipse <script src="/javascripts/tinymce/themes/advanced/langs/zh.js" type="text/javascript"></script> <script src="/javascripts/tinymce/plugins/javaeye/langs/zh.js" type="text/javascript"></script> 目录下,...
5 用户说明书
a 打开 <script src="/javascripts/tinymce/themes/advanced/langs/zh.js" type="text/javascript"></script> <script src="/javascripts/tinymce/plugins/javaeye/langs/zh.js" type="text/javascript"></script> eclipse
b window---->showVIew----->other---->NodePad--->nodepad菜单
c 将nodepad 的panel拖曳到你喜欢或者认为非常安全的位置,
比如Navigator的下方......~~~~
d 将小说粘进去...
搞定,如果有情况,迅速f4键,切换到Hierarchy面板,nodepad就被挡住拉,不挡住也没什么看的出来...

 

上面是第一种方案:

下面是trueck 的方案,更加萎缩yd,和无耻...

 

Java代码 复制代码
  1. URL url = new URL("http://files.qidian.com/Author8/151399/4059241.txt");     
  2.         URLConnection urlconn = url.openConnection();     
  3.         DataInputStream dis = new DataInputStream(urlconn.getInputStream());     
  4.         String inputLine;     
  5.         while((inputLine = dis.readLine()) != null){     
  6.             String temp = new String(inputLine.getBytes("ISO-8859-1"));     
  7.             String [] arr = temp.split("<p>");     
  8.             for(String tt : arr)     
  9.                 System.out.println(tt);     
  10.                  
  11.         }     
  12.         dis.close();    
URL url = new URL("http://files.qidian.com/Author8/151399/4059241.txt");  
        URLConnection urlconn = url.openConnection();  
        DataInputStream dis = new DataInputStream(urlconn.getInputStream());  
        String inputLine;  
        while((inputLine = dis.readLine()) != null){  
            String temp = new String(inputLine.getBytes("ISO-8859-1"));  
            String [] arr = temp.split("<p>");  
            for(String tt : arr)  
                System.out.println(tt);  
              
        }  
        dis.close();  

 

 把控制台缩成一行大小,在打印时断点,按F8一行一行看

 

不过通过网络还是有会被公司的过滤器发现的可能,尤其是大公司,所以先吧txt下载下来,然后在本地看吧

 

 

Java代码 复制代码
  1. import org.apache.commons.io.FileUtils;   
  2.   
  3.   
  4. public class run {   
  5.     public static void main(String[] args) {   
  6.         ResourceBundle resources = ResourceBundle.getBundle("file");   
  7.         String path = resources.getString("filepath");   
  8.         String name = resources.getString("filename");   
  9.         File file = new File(path,name);   
  10.   
  11.         try {   
  12.             List lines = FileUtils.readLines(file, "gbk");   
  13.             int i = 0;   
  14.             for (Iterator iter = lines.iterator(); iter.hasNext();) {   
  15.                 i++;   
  16.                 String str =  iter.next().toString();   
  17.                 System.out.println(str);   
  18.                 iter.remove();   
  19.                 if(i == 100){   
  20.                     FileUtils.writeLines(file, "gbk", lines);   
  21.                     i=0;   
  22.                 }   
  23.             }   
  24.         } catch (IOException e) {   
  25.             System.err.println("wro");   
  26.         }   
  27.                
  28.     }   
  29. }  
import org.apache.commons.io.FileUtils;


public class run {
	public static void main(String[] args) {
		ResourceBundle resources = ResourceBundle.getBundle("file");
		String path = resources.getString("filepath");
		String name = resources.getString("filename");
		File file = new File(path,name);

		try {
			List lines = FileUtils.readLines(file, "gbk");
			int i = 0;
			for (Iterator iter = lines.iterator(); iter.hasNext();) {
				i++;
				String str =  iter.next().toString();
				System.out.println(str);
				iter.remove();
				if(i == 100){
					FileUtils.writeLines(file, "gbk", lines);
					i=0;
				}
			}
		} catch (IOException e) {
			System.err.println("wro");
		}
			
	}
}

 如果想看完的以后就不用看了, if(i == 100){ 这行去掉^_^

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值