linux修改系統時間常用命令
設置時間偉2008年8月8號12:00# date -s "2008-08-08 12:00:00"
修改完后,記得執行clock -w,把系統時間寫入CMOS
posted @ 2016-05-05 17:27 楊軍威 閱讀(161) | 評論 (0) | 編輯 收藏
java學習
posted @ 2016-05-05 17:27 楊軍威 閱讀(161) | 評論 (0) | 編輯 收藏
<script type="text/javascript" >
(function(){
i=10;
function aa(){
i=2;
}
aa();
alert(i);
})();
(function(){
i=10;
function aa(){
var i=2;
}
aa();
alert(i);
})();
</script>
posted @ 2016-04-29 16:29 楊軍威 閱讀(768) | 評論 (0) | 編輯 收藏
posted @ 2014-12-07 20:16 楊軍威 閱讀(170) | 評論 (0) | 編輯 收藏
posted @ 2014-12-07 20:15 楊軍威 閱讀(208) | 評論 (0) | 編輯 收藏
posted @ 2014-12-06 16:48 楊軍威 閱讀(195) | 評論 (0) | 編輯 收藏
posted @ 2014-12-06 16:47 楊軍威 閱讀(202) | 評論 (0) | 編輯 收藏
posted @ 2014-12-06 16:47 楊軍威 閱讀(153) | 評論 (0) | 編輯 收藏
posted @ 2014-12-06 16:45 楊軍威 閱讀(174) | 評論 (0) | 編輯 收藏
/**
* 任務實體類
*/
@Entity
@Table(name = "t_task")
public class Task implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private Long id;
private String name;
//計劃開始時間
private Date plan_startTime;
private Project project;
//父任務
private Task parent;
// 子任務
private Set<Task> children = new HashSet<Task>();
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Temporal(TemporalType.TIMESTAMP)
public Date getPlan_startTime() {
return plan_startTime;
}
public void setPlan_startTime(Date plan_startTime) {
this.plan_startTime = plan_startTime;
}
@ManyToOne(optional = false, cascade = {CascadeType.REFRESH, CascadeType.MERGE})
@JoinColumn(name = "projectId")
public Project getProject() {
return project;
}
public void setProject(Project project) {
this.project = project;
}
@ManyToOne(cascade = {CascadeType.REFRESH, CascadeType.MERGE})
@JoinColumn(name = "parentId")
public Task getParent() {
return parent;
}
public void setParent(Task parent) {
this.parent = parent;
}
@OrderBy("id ASC")
@OneToMany(mappedBy = "parent", fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
public Set<Task> getChildren() {
return children;
}
public void setChildren(Set<Task> children) {
this.children = children;
}
}
posted @ 2013-11-07 14:40 楊軍威 閱讀(501) | 評論 (0) | 編輯 收藏
@Retention(RetentionPolicy.RUNTIME)
public @interface MyAnnotation {
public String key();
public String value();
}
@MyAnnotation(key = "k", value = "v")
public class UserAnnotation {
@MyAnnotation(key = "km", value = "vm")
public void sayHello() {
System.out.println("111");
}
public static void main(String[] args) throws Exception {
Class<?> cla = Class
.forName("com.kaishengit.annotation.UserAnnotation");
Method[] methods = cla.getMethods();
boolean flag = cla.isAnnotationPresent(MyAnnotation.class);
System.out.println(flag);
if (flag) {
MyAnnotation mya = (MyAnnotation) cla
.getAnnotation(MyAnnotation.class);
System.out.println(mya.key() + "====" + mya.value());
}
Set<Method> set = new HashSet<Method>();
for (int i = 0; i < methods.length; i++) {
boolean otherflag = methods[i]
.isAnnotationPresent(MyAnnotation.class);
if (otherflag) {
set.add(methods[i]);
System.out.println(methods[i].getName());
}
}
for (Method method : set) {
MyAnnotation name = method.getAnnotation(MyAnnotation.class);
System.out.println(name.key());
System.out.println("value===:" + name.value());
}
}
}
posted @ 2013-09-11 17:22 楊軍威 閱讀(199) | 評論 (0) | 編輯 收藏