您的位置:首页 > 编程语言

编程笔记1

2015-07-05 21:52 330 查看
使用了eclipse编了一个小程序放在D:\JavaProject\JOB下,记录下比较重要的代码段:

String encoding="utf-8";
File file=new File(filePath);
if(file.isFile()&&file.exists()){
InputStreamReader read=new InputStreamReader(
new FileInputStream(file),encoding);
BufferedReader buffread=new BufferedReader(read);
//txt文件写入


String[] split=lineTxt.split(", ");
//字符流的分割


BigDecimal db0 = new BigDecimal(lineArray[row][0]);
doubleArray[row][0]=Double.valueOf(db0.toPlainString());
//对1.1e1之类的数值转为double型或float
private static void OutPutToFile(StringBuffer stringbuffer,String fn){
File file = new File("output_"+fn+".txt");
try {
if (file.exists()) file.delete();
BufferedWriter bw = new BufferedWriter(new FileWriter(file));
bw.write(stringbuffer.toString());
System.out.println("FILE DONE:"+"output_"+fn+".txt");
bw.flush();
bw.close();
}catch (IOException e) {
e.printStackTrace();
}
//输入txt文件中  StringBuffer out = new StringBuffer(); OutPutToFile(out,fileName);


try { Thread.sleep ( 1000 ) ; } catch (InterruptedException ie){System.out.println("。。。。。。");} //暂停1000ms


eclipse生成console运行的exe文件:

Help>Install new Software…>FatJar - http://kurucz-grafika.de/fatjar

然后使用exe4j(E:\Program Files (x86)\exe4j)来生成exe

php:

D:\PHPProj下,安装了tomcat,httpd,php,mysql(E:\Program Files (x86)\MySQL),已经配置了httpd 的虚拟目录,VirtualHost

#设置虚拟目录,指向D:\PHPProj\PHPWeb
#D:\PHPProj\httpd-2.2.25-win32-x86\conf\httpd.conf
<IfModule dir_module>
DirectoryIndex index.html Index.php
Alias /mainWeb "D:\PHPProj\PHPWeb"
<Directory "D:\PHPProj\PHPWeb">
AllowOverride  None
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</IfModule>
DocumentRoot "D:\PHPProj\PHPWeb"


#test:Spider
#D:\PHPProj\httpd-2.2.25-win32-x86\conf\extra\httpd-vhosts.conf
<VirtualHost 127.0.0.1:80>
DocumentRoot "D:\PHPProj\PHPWeb\BAIDUSpider"
ServerName Spider
ErrorLog "logs/Spider-error.log"
CustomLog "logs/Spider-access.log" common
</VirtualHost>


若Apache服务器软件不想用了,想要卸载,需要先卸载apache服务(切记,若直接删除安装路径的文件夹,会有残余文件在电脑,可能会造成不必要的麻烦)

在CMD命令窗口,输入如下(建议先停止服务再删除):

sc delete apache

apache是Apache服务器的服务名
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: