//想看什么电子书,先去新浪读书搜索,然后填入对应的参数即可
//http://vip.book.sina.com.cn/
//电子书参数
$array_book[0] = 38884; //小说id
$array_book[1] = 22172; //章节起始id
$array_book[2] = 32533; //章节结束id
$array_book[3] = '中国特种部队生存实录:狼牙'; //小说名字
//匹配参数
$title_pre = "/<h1>(.*?)<\/h1>/"; //标题部分
$contents_pre = "/<div id=\"contTxt\" class=\"contTxt1\">(.*?)<\/div>/"; //内容部分
//生成电子书
for( $i = $array_book[1]; $i <= $array_book[2]; $i++){
$url = "http://vip.book.sina.com.cn/book/chapter_{$array_book[0]}_{$i}.html";
$html = file_get_contents($url);
preg_match_all($title_pre,$html,$title);
......
#找到:
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
#添加PHP Files Type:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
编辑: ee /usr/local/etc/apache22/httpd.conf
添加PHP支持模块(很奇怪,难道在装Apache或者PHP的时候自己添加的?我没有进行添加操作..):
LoadModule php5_module libexec/apache22/libphp5.so
找到 /usr/local/www/apache22/data目录
在这个目录里面些一个PHP测试页面
<?php
phpinfo();
?>
随后 http://localhost/index.php 测试phpinfo();函数
OK完成 ......
使用jspf
在开发中写jsp页面时,通常都要通过如下方式在jsp文件头部引入我们需要的标签库,如:jsp核心标签库JSTL,Struts 中的自定义标签,时而还有我们自己写的自定义标签:
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
如果,每个jsp页面文件中都需要数十个或更多标签,那么每个jsp文件页面中都如上引入,是不是很麻烦呢?!
今天教大家一个偷懒的办法(记得,刚开始学习软件开发时,一位老师说:有时候,你要学会偷懒!)
下面,切入主题:
你可以在你的WEB工程目录:/WEB-INF/jspf/,建立一个common.jspf文件:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://stru ......
1. JRE 安裝 (可從 http://java.sun.com/下載)
Java SE Runtime Environment (JRE) JRE 6 Update 17
2. JDK安裝 (可從 http://java.sun.com/下載)
Java SE Development Kit (JDK) JDK 6 Update 17
3.JDK Enviroment Variables 設置
JAVA_HOME C:\Java\jdk1.6.0_04
CALLSSPATH .;
Path %JAVA_HOME%\bin
4. 測試是否設定成功
cmd->運行 javac or 運行 java -version
5.tomcat 6.20 (可從 http://www.apache.org/ 下載)
& ......
在编译android code 出现版本不对的问题:
描述如下:
You are attempting to build with the incorrect version
of java.
Your version is: java version "1.6.0_17".
The correct version is: 1.5.
Please follow the machine setup instructions at
http://source.android.com/download
网上有人提供解决方法如下,目的是安装1.5版本的jdk:
$ sudo apt-get install sun-java5-jdk flex
$ sudo update-java-alternatives -s java-1.5.0-sun
我的发现的解决方法是:
编辑: ~/mydroid/build/core/main.mk
修改
java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.5[\. "$$]')
javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.5[\. "$$]')
为
java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]') ......
public class Test {
public static void main(String args[]) {
int i;
int j;
for (i = 1; i <= 9; i++) {
for (j = 1; j <= i; j++) {
if (j * i <= 9)
System.out.print(j + "*" + i + "=" + (j * i) + " ");
else
System.out.print(j + "*" + i + "=" + (j * i) + " ");
}
System.out.println();
}
for (i = 1, j = 1; i <= 9 && j <= 9; j++) {
if (j > i) {
i++;
System.out.println();
j = 1;
}
if (j * i <= 9)
System.out.print(j + "*" + i + "=" + (j * i) + " ");
else
System.out.pri ......