วันอังคารที่ 18 ตุลาคม พ.ศ. 2554

วันจันทร์ที่ 17 ตุลาคม พ.ศ. 2554

Reset root password ของ MySQL | howforge.com

Reset root password ของ MySQL | howforge.com:

'via Blog this'

เรามาดูวิธี reset root password ของ mysql กัน ทำดังนี้

  1. เ พิ่ม "skip-grant-tables" ลงใน file my.cnf โดยปกติทั่วไปจะเก็บอยู่ที่ /etc/my.cnf โดยเพิ่มในส่วนของ [mysqld] สำคัญมากห้ามลืม อย่าใส่ผิดที่ ไม่ัอย่างนั้นจะไม่สามารถ reset password ได้
  2. สั่ง restart mysql service ซะ ในที่นี้ ผมใช้ RH base เป็นหลัก ใครใช้อย่างไหน ก็ restart อย่างนั้นล่ะ
    ถ้าเป็น RH สั่งแบบนี้
    # /etc/init.d/mysqld restart

    หรือแบบนี้

    # service mysql restar

Running JAX-WS with Tomcat « Technical blog

Running JAX-WS with Tomcat « Technical blog:

'via Blog this'

วันพฤหัสบดีที่ 13 ตุลาคม พ.ศ. 2554

Vaain-Tree Lazy HierachicalContainer







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Have a tree with some unexpanded root items
final Tree tree = new Tree("My Tree");
tree.addItem("One Node");
tree.addItem("Another Node");
tree.addItem("Third Node");

// When an item is expanded, add some children
tree.addListener(new Tree.ExpandListener() {
int childCounter = 0;

public void nodeExpand(ExpandEvent event) {
// No children for the first node
if (event.getItemId().equals("One Node")) {
tree.setChildrenAllowed(event.getItemId(), false);

getWindow().showNotification("No children");
} else {
// Add a few new child nodes to the expanded node
for (int i=0; i < 3; i++) {
String childId = "Child " + (++childCounter);
tree.addItem(childId);
tree.setParent(childId, event.getItemId());
}

getWindow().showNotification("Added nodes");
}
}
});

// When an item is collapsed, remove all children
tree.addListener(new Tree.CollapseListener() {
public void nodeCollapse(CollapseEvent event) {
// Remove all children of the collapsing node
removeItemsRecursively(tree, event.getItemId());

getWindow().showNotification("Removed nodes");
}

void removeItemsRecursively(Tree tree, Object item) {
// Find all child nodes of the node
Collection children = tree.getChildren(item);
if (children == null)
return;

// The list is unmodifiable so must copy to another list
LinkedList children2 = new LinkedList();
for (Iterator i = children.iterator(); i.hasNext();)
children2.add((String) i.next());

// Remove the children of the collapsing node
for (Iterator i = children2.iterator(); i.hasNext();) {
String child = i.next();
removeItemsRecursively(tree, child);
tree.removeItem(child);
}
}
});

layout.addComponent(tree);



PagedTable Add-on - vaadin.com

PagedTable Add-on - vaadin.com:

'via Blog this'