数据库表字段含有下划线
field_name
Java 对象属性使用驼峰命名规则
fieldName
MyBatis 注解(错误)
@Select("select field_name from table_name")
MyBatis 注解(正确)
@Select("select field_name as fieldName from table_name")
Zhizheng Zhang's Notes
field_name
fieldName
@Select("select field_name from table_name")
@Select("select field_name as fieldName from table_name")
window.parent.document.getElementById('elementId')
$('#elementId', window.parent.document)
原 tomcat 版本 7.0.82,新 tomcat 版本 7.0.52。
采用覆盖安装方式。
通过浏览器访问 tomcat 中部署的 web 程序 jsp 页面,报错信息如下:
java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagInfo
删除 work/Catalina/localhost/<web 程序名称> 目录后,刷新浏览器,页面访问正常。
Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. Each virtual terminal provides the functions of the DEC VT100 terminal and, in addition, several control functions from the ANSI X3.64 (ISO 6429) and ISO 2022 standards (e.g., insert/delete line and support for multiple character sets). There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows the user to move text regions between windows. When screen is called, it creates a single window with a shell in it (or the specified command) and then gets out of your way so that you can use the program as you normally would. Then, at any time, you can create new (full-screen) windows with other programs in them (including more shells), kill the current window, view a list of the active windows, turn output logging on and off, copy text between windows, view the scrollback history, switch between windows, etc. All windows run their programs completely independent of each other. Programs continue to run when their window is currently not visible and even when the whole screen session is detached from the users terminal.
# 在 server1 上生成公钥和私钥,下面演示使用 dsa 加密算法,还有 rsa 等加密算法,具体使用哪种请综合安全性等自行选择
user@server1:~$ ssh-keygen -t dsa
user@server1:~$ ls ~/.ssh
# id_dsa.pub # 公钥
# id_dsa # 私钥
# server1 对 server1 免密
user@server1:~$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
user@server1:~$ chmod 600 ~/.ssh/authorized_keys
user@server1:~$ chmod 700 ~/.ssh
# server2 对 server1 免密
user@server1:~$ scp ~/.ssh/id_dsa.pub user@server2:/home/user/.ssh
user@server1:~$ ssh user@server2
user@server2:~$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
user@server2:~$ chmod 600 ~/.ssh/authorized_keys
user@server2:~$ chmod 700 ~/.ssh
# server3 对 server1 免密
user@server1:~$ scp ~/.ssh/id_dsa.pub user@server3:/home/user/.ssh
user@server1:~$ ssh user@server3
user@server3:~$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
user@server3:~$ chmod 600 ~/.ssh/authorized_keys
user@server3:~$ chmod 700 ~/.ssh
# 在 server1 上测试免密效果,以下直接登录,无需密码
user@server1:~$ ssh user@server1
user@server1:~$ ssh user@server2
user@server1:~$ ssh user@server3
Ganymed SSH-2 for Java 是一个纯 Java 实现的 SHH2 库,使用它可以通过用户密码登录服务器,那么是否可以免密登录呢?答案是可以的,而且支持 SFTP。
String ip = "192.168.1.201";
int port = 22;
String username = "user";
String password = "passwrod";
Connection conn = new Connection(ip, port);
conn.connect();
boolean isAuthenticated = conn.authenticateWithPassword(username, password);
if (isAuthenticated){
// 登录成功
} else {
// 登录失败
}
libavcodec may be vulnerable or is not supported, and should be updated to play video
./configure --prefix=/usr/local/ffmpeg ...
make
make install
vi /etc/ld.so.conf
# 添加一行
# /usr/local/ffmpeg/lib
ldconfig
在地址栏中输入 about:config,将 media.libavcodec.allow-obsolete 的值由 false 修改为 true,重启浏览器。
系统原来带的是 libavcodec 53(53.35.0),现在安装 libavcodec 55(55.34.1)
apt-get install -t wheezy-backports libavcodec55
package com.test.bean;
public class User {
private Integer id;
private String name;
public User() {
super();
}
public User(Integer id, String name) {
super();
this.id = id;
this.name = name;
}
public Integer getId() {
return id;
}
public void setNId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
jquery select2 设置初始值主要有两种方法,以下两种方法中,均设置 option 列表中第一个 option 为选中项。
<select id="s2id">
<option value="value1" selected="selected">text 1</option>
<option value="value2">text 2</option>
</select>
$('#s2id').select2();
<select id="s2id">
<option value="value1">text 1</option>
<option value="value2">text 2</option>
</select>
var val1 = $('#s2id option:eq(0)').val();
$('#s2id').select2().select2('val', val1);
在 blog 正文下面添加前一篇和后一篇按钮,遇到浏览器兼容问题。
代码
<div class="pagination clearfix">
<ul class="pull-right">
{% if page.previous %}
<li class="prev"><a class="fa fa-arrow-circle-left" href="{{ BASE_PATH }}{{ page.previous.url }}" title="{{ page.previous.title }}">前一篇</a></li>
{% else %}
<li class="prev disabled"><a class="fa fa-arrow-circle-left">前一篇</a></li>
{% endif %}
<li><a class="fa fa-th" href="{{ BASE_PATH }}{{ site.JB.archive_path }}">所有文档</a></li>
{% if page.next %}
<li class="next"><a href="{{ BASE_PATH }}{{ page.next.url }}" title="{{ page.next.title }}">后一篇<span class="fa fa-arrow-circle-right"></span></a></li>
{% else %}
<li class="next disabled"><a>后一篇<span class="fa fa-arrow-circle-right"></span></a>
{% endif %}
</ul>
</div>
期望结果