mariadb 自启动+远程
mariadb 自启动:>>systemctl enable mariadb;
>>flush privileges;
mariadb 开远程:>>grant all privileges on *.* to 'root'@'%' identified by '密码';
>>flush privileges;
mariadb 大小写敏感:etc/my.cnf.d/mariadb-server.cnf 添加[mysqld]下添加lower-case-table-names=1
class打war包
进入项目根目录
>>jar -cvf 项目.war *
cssTD强制换行-针对整个单子和IP地址
<td style="word-wrap:break-word;word-break:break-all;">
easyui-tip
$(this).datagrid('tooltip', [ '字段','内容' ]);
datagrid数据onloadsuccess成功后执行。
eclipse替换正则
^hello 以hello开头
hello$ 以hello结尾
<title>.* 以<title>开头
.*?</title> 以</title>结尾
<title>.*?</title> 以<title>开头 以</title>结尾
mysql备份
先 CD 到系统mysql的bin目录下,执行命令
mysqldump -P3306 -uroot -p密码 数据库名 > C:\数据库名.sql
textarea不换行
textarea{
white-space:pre-wrap; /* css3.0 /
white-space:-moz-pre-wrap; / Firefox /
white-space:-o-pre-wrap; / Opera 7 /
word-wrap:break-word; / Internet Explorer 5.5+ */
}
zip4jwintoluix乱码
/**
* 判断zip文件是utf解压还是gbk解压
* @param zipFile
* @param fileName
* @return
*/
1.if(isGBKZipFile(zipFile)){
zFile.setFileNameCharset("GBK");
}else{
zFile.setFileNameCharset("UTF-8");
}
2.public static boolean isGBKZipFile(File zipFile) {
FileInputStream fis = null;
ZipInputStream zis = null;
try {
fis = new FileInputStream(zipFile);
zis = new ZipInputStream(new BufferedInputStream(fis));
ZipEntry entry = null;
while ((entry = zis.getNextEntry()) != null) {
}
return false;
}catch(Exception e) {
e.printStackTrace();
return true;
}finally{
try {
fis.close();
zis.close();
} catch (Exception e2) {
// TODO: handle exception
}
}
}
复选框单选判定
$("input:checkbox").click(getboolean);
function getboolean(){
var that = $(this);
var id = that.attr("id");
if(that.is(":checked")){
$("input[name='"+that.attr("name")+"']").each(function(th){
var id1 =$(this).attr("id");
if(id!=id1){
$(this).removeAttr("checked");
}
});
}
}
文件名特殊字符正则
private boolean regbool(String str){
String reg ="[\\\\/:*?\"<>|]";
Pattern p =Pattern.compile(reg);
Matcher m = p.matcher(str);
return m.find();
// String r[] = {"\\","/","*","?","\"","<",">","|"};
// for(int i=0;i<r.length;i++){
// if(str.contains(r[i])){
// return true;
// }
// }
// return false;
}
#############################
var reg = new RegExp('[\\\\/:*?"<>|]');
var rows = $('#datagrid').datagrid('getRows');
for(var i = 0; i < rows.length; i++){
var filename = rows[i].name;
if(reg.test(filename)){
$.messager.alert('提示',filename+'的文件名含有括号内(\/:*?"<>|)的特殊字符,windows系统无法识别!');
return ;
}
}
#####################
var pat =/[\\ /:*?"<>|]/;
if(pat.test(testNmae)){
$.messager.alert('提示', "名称不合法。包含:\/\\:*?\"<>|或空格", 'info');
return false;
}
encodeURIComponent
decodeURIComponent
页面encodeURIComponent和解码
encodeURIComponent
decodeURIComponent
java:
URLEncoder.encode(filename,"utf-8")