• Java开发IDE工具eclipse 中OpenExplorer_1.3.0.v201107191404.jar

    Java开发IDE工具eclipse 中OpenExplorer_1.3.0.v201107191404.jar

    0
    84
    5KB
    2021-09-18
    7
  • iOS移动设备管理协议命令参考(2018翻译版)

    iOS移动设备管理协议命令参考(2018翻译版)文档是对 2011 年 Black Hat USA 发布的白皮书的后续。本质上它是更新后的附录 A,其中列出了(以非常简 化的形式)Apple iOS MDM 系统使用的各种命令的描述。

    0
    0
    643KB
    2018-04-03
    5
  • iOS移动设备管理协议(2018翻译版)

    目前对于iOS MDM管理协议的文档少之又少,国内中文版本基本没有,有的都是基于2014年我在我的技术博客上发的关于MDM开发的一些文档,这些文档被很多技术博客转载,于此,我在本月决定翻译一下,仅能找到的《BH_US_11_Schuetz_InsideAppleMDM_WP.pdf》这个PDF文档,在此也贡献给开源社区。

    0
    195
    1.01MB
    2018-03-31
    34
  • Android制作9.png图片工具及步骤详解

    Android制作9.png图片工具及步骤详解(工具、文档齐全,移动互联百科博客提供)

    3
    1311
    7.16MB
    2014-08-05
    49
  • 基于JFinal的开源博客系统JFinal_Blog2.0版本

    JFinal_Blog是基于JFinal1.5开源系统搭建的博客系统,以91zcm.com 网站作为模板和演示demo,目前已经加入了OSC开源项目和Github。 一、V2.0 版本新增功能点及bug修复情况: 1、添加百度Ping服务; 2、添加百度SiteMap服务; 3、解决Lucene全文检索出现"too many open files "的bug问题; 4、解决Linux中tomcat容器乱码问题(URLEncoding="UTF-8"); 二、开源地址: 1、OSC介绍:http://www.oschina.net/p/jfinal_blog 2、GIT版本:http://git.oschina.net/jianggege/jfinal_91zcm 3、Github地址:https://github.com/keaijohnee/91zcm 5、演示站点:http://www.91zcm.com/ 感谢大家对于JFinal_Blog的支持!

    4
    237
    11.16MB
    2014-06-18
    10
  • Apache Lucene全文检索和IKAnalyzer分词工具类

    说明:依赖jar包:lucene-core-2.3.2.jar、IKAnalyzer3.2.8.jar。 一、LuceneUtil 工具类代码: package com.zcm.lucene; import java.io.File; import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; import java.util.List; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.Term; import org.apache.lucene.queryParser.MultiFieldQueryParser; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.Hits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.wltea.analyzer.IKSegmentation; import org.wltea.analyzer.Lexeme; /** * Apache Lucene全文检索和IKAnalyzer分词工具类 * <p>Company: 91注册码</p> * time:2014-04-22 * @author www.91zcm.com * @date * @version 1.1 */ public class LuceneUtil { /**索引创建的路径**/ private static String LucenePath = "d://index"; /** * 创建索引 * @throws Exception */ public static int createIndex(List<?> list) throws Exception{ /**这里放索引文件的位置**/ File indexDir = new File(LucenePath); Analyzer luceneAnalyzer = new StandardAnalyzer(); /**注意最后一个boolean类型的参数:表示是否重新创建,true表示新创建(以前存在时回覆盖)**/ IndexWriter indexWriter = new IndexWriter(indexDir, luceneAnalyzer,true); for (int i = 0; i < list.size(); i++) { LuceneVO vo = (LuceneVO)list.get(i); Document doc = new Document(); Field FieldId = new Field("aid", String.valueOf(vo.getAid()),Field.Store.YES, Field.Index.NO); Field FieldTitle = new Field("title", vo.getTitle(), Field.Store.YES,Field.Index.TOKENIZED,Field.TermVector.WITH_POSITIONS_OFFSETS); Field FieldRemark = new Field("remark", vo.getRemark(), Field.Store.YES,Field.Index.TOKENIZED,Field.TermVector.WITH_POSITIONS_OFFSETS); doc.add(FieldId); doc.add(FieldTitle); doc.add(FieldRemark); indexWriter.addDocument(doc); } /**查看IndexWriter里面有多少个索引**/ int num = indexWriter.docCount(); System.out.println("总共------》" + num); indexWriter.optimize(); indexWriter.close(); return num; } /** * IKAnalyzer分词 * @param word * @return * @throws IOException */ public static List<String> tokenWord(String word) throws IOException{ List<String> tokenArr = new ArrayList<String>(); StringReader reader = new StringReader(word); /**当为true时,分词器进行最大词长切分**/ IKSegmentation ik = new IKSegmentation(reader, true); Lexeme lexeme = null; while ((lexeme = ik.next()) != null){ tokenArr.add(lexeme.getLexemeText()); } return tokenArr; } /** * 创建索引(单个) * @param list * @throws Exception */ public static void addIndex(LuceneVO vo) throws Exception { /**这里放索引文件的位置**/ File indexDir = new File(LucenePath); Analyzer luceneAnalyzer = new StandardAnalyzer(); IndexWriter indexWriter = new IndexWriter(indexDir, luceneAnalyzer, false); /**增加document到索引去 **/ Document doc = new Document(); Field FieldId = new Field("aid", String.valueOf(vo.getAid()),Field.Store.YES, Field.Index.NO); Field FieldTitle = new Field("title", vo.getTitle(), Field.Store.YES,Field.Index.TOKENIZED,Field.TermVector.WITH_POSITIONS_OFFSETS); Field FieldRemark = new Field("remark", vo.getRemark(), Field.Store.YES,Field.Index.TOKENIZED,Field.TermVector.WITH_POSITIONS_OFFSETS); doc.add(FieldId); doc.add(FieldTitle); doc.add(FieldRemark); indexWriter.addDocument(doc); /**optimize()方法是对索引进行优化 **/ indexWriter.optimize(); indexWriter.close(); } /** * 创建索引(多个) * @param list * @throws Exception */ public static void addIndexs(List<?> list) throws Exception { /**这里放索引文件的位置**/ File indexDir = new File(LucenePath); Analyzer luceneAnalyzer = new StandardAnalyzer(); IndexWriter indexWriter = new IndexWriter(indexDir, luceneAnalyzer,false); /**增加document到索引去 **/ for (int i=0; i<list.size();i++){ LuceneVO vo = (LuceneVO)list.get(i); Document doc = new Document(); Field FieldId = new Field("aid", String.valueOf(vo.getAid()),Field.Store.YES, Field.Index.NO); Field FieldTitle = new Field("title", vo.getTitle(), Field.Store.YES,Field.Index.TOKENIZED,Field.TermVector.WITH_POSITIONS_OFFSETS); Field FieldRemark = new Field("remark", vo.getRemark(), Field.Store.YES,Field.Index.TOKENIZED,Field.TermVector.WITH_POSITIONS_OFFSETS); doc.add(FieldId); doc.add(FieldTitle); doc.add(FieldRemark); indexWriter.addDocument(doc); } /**optimize()方法是对索引进行优化 **/ indexWriter.optimize(); indexWriter.close(); } /** * 更新索引(单个) * @param list * @throws Exception */ public static void updateIndex(LuceneVO vo) throws Exception { /**这里放索引文件的位置**/ File indexDir = new File(LucenePath); Analyzer luceneAnalyzer = new StandardAnalyzer(); IndexWriter indexWriter = new IndexWriter(indexDir, luceneAnalyzer,false); /**增加document到索引去 **/ Document doc = new Document(); Field FieldId = new Field("aid", String.valueOf(vo.getAid()),Field.Store.YES, Field.Index.NO); Field FieldTitle = new Field("title", vo.getTitle(), Field.Store.YES,Field.Index.TOKENIZED,Field.TermVector.WITH_POSITIONS_OFFSETS); Field FieldRemark = new Field("remark", vo.getRemark(), Field.Store.YES,Field.Index.TOKENIZED,Field.TermVector.WITH_POSITIONS_OFFSETS); doc.add(FieldId); doc.add(FieldTitle); doc.add(FieldRemark); Term term = new Term("aid",String.valueOf(vo.getAid())); indexWriter.updateDocument(term, doc); /**optimize()方法是对索引进行优化 **/ indexWriter.optimize(); indexWriter.close(); } /** * 创建索引(多个) * @param list * @throws Exception */ public static void updateIndexs(List<?> list) throws Exception { /**这里放索引文件的位置**/ File indexDir = new File(LucenePath); Analyzer luceneAnalyzer = new StandardAnalyzer(); IndexWriter indexWriter = new IndexWriter(indexDir, luceneAnalyzer,false); /**增加document到索引去 **/ for (int i=0; i<list.size();i++){ LuceneVO vo = (LuceneVO)list.get(i); Document doc = new Document(); Field FieldId = new Field("aid", String.valueOf(vo.getAid()),Field.Store.YES, Field.Index.NO); Field FieldTitle = new Field("title", vo.getTitle(), Field.Store.YES,Field.Index.TOKENIZED,Field.TermVector.WITH_POSITIONS_OFFSETS); Field FieldRemark = new Field("remark", vo.getRemark(), Field.Store.YES,Field.Index.TOKENIZED,Field.TermVector.WITH_POSITIONS_OFFSETS); doc.add(FieldId); doc.add(FieldTitle); doc.add(FieldRemark); Term term = new Term("aid",String.valueOf(vo.getAid())); indexWriter.updateDocument(term, doc); } /**optimize()方法是对索引进行优化 **/ indexWriter.optimize(); indexWriter.close(); } /** * 创建索引(单个) * @param list * @throws Exception */ public static void deleteIndex(LuceneVO vo) throws Exception { /**这里放索引文件的位置**/ File indexDir = new File(LucenePath); Analyzer luceneAnalyzer = new StandardAnalyzer(); IndexWriter indexWriter = new IndexWriter(indexDir, luceneAnalyzer,false); Term term = new Term("aid",String.valueOf(vo.getAid())); indexWriter.deleteDocuments(term); /**optimize()方法是对索引进行优化 **/ indexWriter.optimize(); indexWriter.close(); } /** * 创建索引(多个) * @param list * @throws Exception */ public static void deleteIndexs(List<?> list) throws Exception { /**这里放索引文件的位置**/ File indexDir = new File(LucenePath); Analyzer luceneAnalyzer = new StandardAnalyzer(); IndexWriter indexWriter = new IndexWriter(indexDir, luceneAnalyzer,false); /**删除索引 **/ for (int i=0; i<list.size();i++){ LuceneVO vo = (LuceneVO)list.get(i); Term term = new Term("aid",String.valueOf(vo.getAid())); indexWriter.deleteDocuments(term); } /**optimize()方法是对索引进行优化 **/ indexWriter.optimize(); indexWriter.close(); } /** * 检索数据 * @param word * @return */ public static List<LuceneVO> search(String word) { List<LuceneVO> list = new ArrayList<LuceneVO>(); Hits hits = null; try { IndexSearcher searcher = new IndexSearcher(LucenePath); String[] queries = {word,word}; String[] fields = {"title", "remark"}; BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD, BooleanClause.Occur.SHOULD}; Query query = MultiFieldQueryParser.parse(queries, fields, flags, new StandardAnalyzer()); if (searcher != null) { /**hits结果**/ hits = searcher.search(query); LuceneVO vo = null; for (int i = 0; i < hits.length(); i++) { Document doc = hits.doc(i); vo = new LuceneVO(); vo.setAid(Integer.parseInt(doc.get("aid"))); vo.setRemark(doc.get("remark")); vo.setTitle(doc.get("title")); list.add(vo); } } } catch (Exception ex) { ex.printStackTrace(); } return list; } } 二、Lucene用到的JavaBean代码: package com.zcm.lucene; /** * Apache Lucene全文检索用到的Bean * <p>Company: 91注册码</p> * time:2014-04-22 * @author www.91zcm.com * @date * @version 1.1 */ public class LuceneVO { private Integer aid; /**文章ID**/ private String title; /**文章标题**/ private String remark; /**文章摘要**/ public Integer getAid() { return aid; } public void setAid(Integer aid) { this.aid = aid; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getRemark() { return remark; } public void setRemark(String remark) { this.remark = remark; } } 备注:源码来源于www.91zcm.com 开源博客中的全文检索代码。(http://www.91zcm.com/)

    5
    353
    1.71MB
    2014-04-22
    50
  • 基于JFinal的开源博客系统JFinal_Blog1.1版本

    JFinal_Blog是基于JFinal1.5开源系统搭建的博客系统,以91zcm.com 网站作为模板和演示事例,目前已经加入了开源行列。 JFinal_Blog 1.1版本发布新增功能点: 1、将数据库连接池由C3P0升级为Druid实现; 2、废弃WEB-INF下的数据库连接配置,改用conf下的config.properties来实现配置; 3、将上一个版本留下的SQL模糊Like搜索功能修改为Lucene实现; 4、添加EhCache支持,对首页、列表、标签等叶面做数据缓存; 5、添加"91专题"栏目,将重点添加一些专题文章来提高搜索引擎的收录数量; 6、修复kindeditor上传图片、文件出现404错误的bug; 7、将MyEclipse中运行的启动类独立成com.zcm.starter.Starter.java方便启动。 介绍地址:http://www.91zcm.com/free/429.html(91注册码)

    5
    682
    11.25MB
    2014-04-19
    32
  • 基于JFinal的开源博客系统

    本程序是基于JFinal 1.5做的一个小站,代码没有使用什么特别的东西,用到了@JFinal作者提到的FakeStaticHandler来伪静态,其他的没什么。小站刚开 始使用Lucene来作为全文检索,后面又改成了SQL like匹配,估计要被广大人民喷了。。 后面有时间一定改成Lucene来实现全文检索和分词。 开源说明: 1、小站模板是仿照百度搜索结果自己用table布局来写的顺便练习一下css; 2、部分页面(例如:首页)可以实现缓存,在utils包下面有CacheManager.java可以使用; 3、感谢@JFinal作者的开源精神,JFinal真的很不错,很简单,功能强大,方便开发者; 4、演示地址:http://www.91zcm.com/

    5
    143
    7.34MB
    2014-01-10
    9
  • Java实现AES加密和解密算法

    本文就简单介绍如何通过JAVA实现AES加密: /** * 测试AES加密和解密 * @param args */ public static void main(String[] args) { /**数据初始化**/ String content = "http://www.mbaike.net"; String password = "1234567890"; /**加密(1)**/ System.out.println("加密前:" + content); byte[] encryptResult = encrypt(content, password); String encryptResultStr = parseByte2HexStr(encryptResult); System.out.println("加密后:" + encryptResultStr); /**解密(2)**/ byte[] decryptFrom = parseHexStr2Byte(encryptResultStr); byte[] decryptResult = decrypt(decryptFrom,password); System.out.println("解密后:" + new String(decryptResult)); } } 说明如下: 在demo中使用了两个转换方法,及二进制转化成十六进制,和十六进制转化成二进制; 我们在AES加密的时候需要使用一个加密算的公共密钥来实现加密和解密; 加密后的字节数组不能直接转化为字符串,需要我们通过给出的两个方法转化;

    4
    4075
    46KB
    2013-11-05
    39
  • Java调用uploadify实现文件上传Demo实现

    Java调用uploadify实现文件上传Demo实现,文档参见:http://www.mbaike.net/java/1940.html

    0
    75
    41KB
    2013-11-01
    10
  • 分享王者

    成功上传51个资源即可获取
关注 私信
上传资源赚积分or赚钱