This article is from "Avatar" blog, please make sure to keep this source http://shamrock.blog.51cto.com/2079212/1564462JavaScript DOM Programming Learning notes-getting ELEMENT nodes
file, which has configsections and the specified sections block, it is important to note that the configsections must be in the first position of the configurationAfter the implementation of the above three steps, we can call it, hehe static void Main (string[] args) { Console.WriteLine (System.Configuration.ConfigurationManager.AppSettings ["Site"]); Console.WriteLine (WebConfigManager.Instance.DoMain); Console.WriteLine (WebConfigManager.Instance.WebName); }The results are as
1, Java code:
The main use of DOM to operate
Copy Code code as follows:
Package test;
Import java.io.IOException;
Import Javax.xml.parsers.DocumentBuilder;
Import Javax.xml.parsers.DocumentBuilderFactory;
Import javax.xml.parsers.ParserConfigurationException;
Import Javax.xml.transform.Transformer;
Import javax.xml.transform.TransformerConfigurationException;
Import javax.xml.transform.TransformerException;
Import Javax.xml.transform.TransformerFactory;
Import Javax.xml.tra
This article illustrates the Java method of deleting nodes in a binary tree using the merge deletion method. Share to everyone for your reference. The specific analysis is as follows:
The idea of realization is simple:
I: Find the node to deleteSecond: If the deleted node does not have a right subtree then the left subtree is linked to the parent nodeThird: If the deleted node has no left subtree then the right subtree is linked to the parent nodeFo
The example in this article describes how PHP adds nodes to XML. Share to everyone for your reference. The specific methods are as follows:
1. Contacts.xml Code
Copy Code code as follows:
2. PHP code
Copy Code code as follows:
$tel _node = null;
$doc = Xmldocfile (' Contacts.xml ');
$contact _node = $doc->root ();
$kids = $contact _node->children ();
while ($node = Array_shift ($kids)) {
if
Question: In a sorted list, how to delete duplicate nodes. For example, the following figure:
The detailed implementation code is as follows:
Delete duplicate node void deleteduplication (listnode** phead) {if (Phead = = NULL | | *phead = NULL) return;
listnode* Pprenode = NULL;
listnode* pnode = *phead;
while (Pnode!= NULL) {ListNode *pnext = pnode->m_pnext;
BOOL Needdelete = false;
if (pnext!= NULL pnext->m_nvalue
The leaf node of the binary tree is a special node which has neither Zuozi nor right subtree, so we can conveniently calculate the total number of leaf nodes by using recursion. Code uploaded to Https://github.com/chenyufeng1991/BinaryTreeLeafCount.
The core code is as follows:
int leafcount = 0;
void Leafcountbinarycount (node *node)
{
if (node = = NULL)
{return
;
}
if (node->lchild = null node->rchild = = null)
{
Ideas: Define four nodes, the front node prenode, the current node node, the next node NextNode, delete node Delnode, in the face of the deletion node to ensure that the Prenode connection nextnode to prevent fracture.
public static void Deleteduplication (Listnote root) {if (root==null) {return; Listnote prenode=null;//Front node Listnote node=root;//current node while (node!=null) {listnote NE
Xtnode=node.getnext ();//Next node Boolean needdelete=f
Using System;Using System.Drawing;Using System.Windows.Forms;
public class Form4:form{Private TreeView TreeView1;
Public FORM4 (){TreeView1 = new TreeView ();
This. SuspendLayout ();
Initialize TreeView1.Treeview1.allowdrop = true;Treeview1.dock = DockStyle.Fill;
ADD nodes to TreeView1.TreeNode node;for (int x = 0; x {Add a root node to treeView1.node = TREEVIEW1.NODES.ADD (String.Format ("node{0}", x*4));for (int y = 1; y {ADD a child node to the pre
Sometimes you don't need a tree control all nodes display a check box, and then you need to hide the checkbox for the corresponding node, the code reads as follows:
M_treecontrol is the CTreeCtrl variable associated with the tree control, Nrootitem is the root node defined by Htreeitem;
M_treecontrol.setitemstate (nrootitem,indextostateimagemask (0), tvis_stateimagemask);//Hide root node check box
If you need to hide the checkbox of a node in the
For nodes with no namespaces (NameSpace) in the XML file, such as
You can use JDOM XPath to search this node for any of the following code:
① List ② XPath xpath = XPath.newInstance("//blog_Content"); List
But if you are looking for a node with a namespace, such as
..............................................
Or use the previous two methods can not find the Blog_content node, even if it is written
list
or write about
list
The eleme
4. Modify config file vi hadoop-2.6.0/etc/hadoop/hdfs-site.xml, add (Hadoop user action)
5. Modify config file vi etc/hadoop/mapred-site.xml (Hadoop user action)
This file does not need to be copied in a copy (CD hadoop-2.6.0/) directory
CP Etc/hadoop/mapred-site.xml.template Etc/hadoop/mapred-site.xml
Add to
6. Modify config file vi etc/hadoop/yarn-site.xml, add (Hadoop user action)
7. Modi
1.1.Update updates that are logged by using the UPDATE statement. Maper Configuration:-id= "Updateperson" parametertype = "Com.test.mybatis3.pojo.Person">update t_person set Name=#{name},status=#{status} Where Id=#{id}update>Mapper interface Method:/**@param person @throws */void ThrowsUnit Test Code:New Person ();p Erson.setid ("Zhangsan");p erson.setname ("New Zhangsan");p Erson.setstatus (3 );p Ersonmapper.updateperson (person); Session.commit ();Operation Result:0 [main] DEBUG Com.test
In the SQL tree structure, many times, know the value of a node, you need to find all of the node's child nodes (including multi-level) of the function, then you need to use the following user-defined function.The table structure is as follows:
Id
Int
Dep_type
Int
Dep_code
varchar (50)
Dep_name
varchar (50)
Dep_dian
Int
Dep_fathid
I
1.1.Deleteuse the delete statement to delete the record. Mapper Configuration: Deleteperson: Deletes a record. - id = "Deleteperson" parametertype = " String ">Delete from T_person where Id=#{id}Delete> Mapper interface Method:/**@param @throws */void throwsUnit Test Code:Personmapper.deleteperson ("Wangwu"); Session.commit ();Operation Result:0 [main] DEBUG Com.test.mybatis3.mapper.PersonMapper.deletePerson-==> preparing:delete from T_person where id=?[Main] DEBUG Com.test.mybatis3.mapper.Per
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.