编程笔记1

4 篇文章 0 订阅

使用了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服务器的服务名

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值