function closeWindow(){
var userAgent = navigator.userAgent;
if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Presto") != -1) {
window.location.replace("about:blank");
}else {
window.opener= null;
window.open("", "_self");
window.close();
}
}
2.nginx 的測試,啟動,停止與重啟
測試:nginx -t (可檢驗配置文件等內(nèi)容是否正確)
啟動:直接點擊Nginx目錄下的nginx.exe 或者 cmd運行start nginx
關(guān)閉:nginx -s stop 或者 nginx -s quit (stop表示立即停止nginx,不保存相關(guān)信息 quit表示正常退出nginx,并保存相關(guān)信息)
重啟:nginx -s reload
3.Restrictions.ilke與Restrictions.like的區(qū)別
前者可以忽略大小寫查詢 而后者類似于sql中的 like
如果是使用HQL,可以使用lower或者upper函數(shù)來實現(xiàn)4.hibernate實現(xiàn)模糊查詢的方法:(來源:http://newleague.iteye.com/blog/953499)
(1)第一種方式:QBC查詢(Expression.like)
String name= "", info = "";
if (sub != null && sub.getSubname() != null) {
name= sub.getSubname();
}
if (sub != null && sub.getSubinfo() != null) {
info= sub.getSubinfo();
}
Criteria cr= session.createCriteria(Subject.class);
cr.add(Expression.like("subname","%"+name+"%"));
cr.add(Expression.like("subinfo","%"+info+"%"));
(2)第二種方式:QBC查詢(Restrictions.ilike)
cr.add(Restrictions.or(Restrictions.ilike("postTitle", getKeyword(),
MatchMode.ANYWHERE), Restrictions.ilike("postContent", getKeyword(),
MatchMode.ANYWHERE)));
(3)第三種方式:HQL查詢語句
String sql="";
sql= "from Pfapp where name like :subname ";
Query query= session.createQuery(sql);
query.setString("subname","%"+subnamevalue+"%");
5.使用Jsoup獲取手機(jī)歸屬地信息
package test.data;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
public class GetData {
public static void main(String[] args) throws Exception{
String result= getLocation("18385552222");
//根據(jù)返回的文本內(nèi)容,獲取手機(jī)歸屬地信息 System.out.println(result.replace("<!-- <td></td> -->", "").replace(" ", " "));
}
public static String getLocation(String phoneNum) throws Exception{
//從ip138網(wǎng)站請求并且獲取信息 String url = "http://www.ip138.com:8080/search.asp";
//匹配返回的字符串標(biāo)簽 String titleCssQuery = "td.tdc2";
//傳參數(shù),action=mobile&moblie=手機(jī)號 Document document = Jsoup.connect(url).data("action", "mobile").data("mobile", phoneNum).get();
if(null == document){
return "";
}
//對返回的頁面內(nèi)容進(jìn)行指定標(biāo)簽的獲取 Elements totalElement = document.select(titleCssQuery);
String ele= totalElement.eq(1).html();
return ele;
}
}
當(dāng)前標(biāo)題:每日記載內(nèi)容總結(jié)35-創(chuàng)新互聯(lián)
網(wǎng)站網(wǎng)址:http://jinyejixie.com/article20/coepco.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站、App開發(fā)、微信小程序、軟件開發(fā)、營銷型網(wǎng)站建設(shè)、網(wǎng)站收錄
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容