Search Results

Search found 9 results on 1 pages for 'jeje'.

Page 1/1 | 1 

  • Linq2XML: Get the count of elements where candidate has won2

    - by user287798
    I had an XML Document in the format below <Pronvice_Data> <Pronvice>PronviceA</Pronvice> <Registered_Voters>115852</Registered_Voters> <Sam_Kea>100</Sam_Kea> <Jeje>500</Jeje> <John_Doe>400</John_Doe> </Pronvice_Data> <Pronvice_Data> <Pronvice>PronviceA</Pronvice> <Registered_Voters>25852</Registered_Voters> <Sam_Kea>200</Sam_Kea> <Jeje>100</Jeje> <John_Doe>300</John_Doe> </Pronvice_Data> <Pronvice_Data> <Pronvice>PronviceC</Pronvice> <Registered_Voters>317684</Registered_Voters> <Sam_Kea>1000</Sam_Kea> <Jeje>1200</Jeje> <John_Doe>190</John_Doe> </Pronvice_Data> As suggested by help here,I used the code below to give me this format below C# Code: void Main() { XDocument xmlVectors2 = XDocument.Load(@"C:\\Province_Data.xml"); var elemList= from elem in xmlVectors2.Descendants("Province_Data") where elem.Elements().Count() > 1 select elem; foreach(XElement element in elemList) { XElement elem1= new XElement("Candidates", new XElement(element.Element("Sam_Kea").Name), new XElement(element.Element("Jeje").Name), new XElement(element.Element("John_Doe").Name) ); XElement elem2 = new XElement("Provinces", new XAttribute("Province", (string)element.Element("Province").Value), new XAttribute("Registered_Voters",element.Element("Registered_Voters").Value), new XElement ("Candidate", new XAttribute("Name",element.Element("Sam_Kea").Name), new XAttribute("Votes",element.Element("Sam_Kea").Value) ), new XElement ("Candidate", new XAttribute("Name",element.Element("Jeje").Name), new XAttribute("Votes",element.Element("Jeje").Value) ), new XElement ("Candidate", new XAttribute("Name",element.Element("John_Doe").Name), new XAttribute("Votes",element.Element("John_Doe").Value) )); } } New Format: <root> <Candidates> <Sam_Kea/> <Jeje/> <John_Doe/> </Candidates> <Provinces> <Province name='ProvinceA' Registered_Voters='115852'> <Candidate name='Sam_Kea' votes='100'/> <Candidate name='Jeje' votes='500'/> <Candidate name='John_Doe' votes='400'/> </Province> <Province name='ProvinceB' Registered_Voters='25852'> <Candidate name='Sam_Kea' votes='200'/> <Candidate name='Jeje' votes='100'/> <Candidate name='John_Doe' votes='300'/> </Province> <Province name='ProvinceC' Registered_Voters='317684'> <Candidate name='Sam_Kea' votes='1000'/> <Candidate name='Jeje' votes='1200'/> <Candidate name='John_Doe' votes='190'/> </Province> </Provinces> </root> How can i use the "foreach" in in my code to get the result in this link. http://stackoverflow.com/questions/2396203/get-the-count-of-elements-where-candidate-has-won

    Read the article

  • Start screen with bash command

    - by Jeje
    I need to start screen with some bash command to execute. Trying screen -S test -d -m bash -c './test.php' but have no result, screen didn't apear. Even more, let's that i need to start something like that vlc -I ncurses --http-reconnect http://ip/ --sout '#duplicate{dst=std{access=http{user=,pwd=},mux=ts,dst=:51001}}' --ttl=255 --loop --repeat

    Read the article

  • Virtual camera/direct show filter for network stream

    - by Jeje
    Hi guys, i'm working with Flash Live Encoder. It's using camera for streaming video. Support forum say's that i can create custom direct show filter and stream data that i need. I cann't understand how direct show filter will display in the source list of the live encoder. I've tryed to use some commercial virtual camera and it work's fine, but it cann't use source from network stream. Summary. I have a several network streams. I think that i must to create virtual camera for each one. But if i find examples with direct show filter on C#, i cann't find for virtual camera.

    Read the article

  • Redirected site files for desktop downloader

    - by Jeje
    Hi, i temporarily change place for static files on site. But this files must have access from old URL, i've create a script that make's redirect to the right place, but this files are downloading by third-part program. The problem is that program ignoring redirect. I tryed to use permanent redirecting but no success.

    Read the article

  • what is mistakes/errors in this code c++ tell me the correction ??

    - by jeje
    hello all here in this code the compiler print error : 132 C:.... `createlist' undeclared (first use this function) (Each undeclared identifier is reported only once for each function it appears in.) and repeat it again in all calls in main function :( what's the problem ?? plzzzz help me #include<iostream> #include<string> using namespace std; template <typename T> struct Node { T num; struct Node<T> *next; // to craet list nodes void createlist(Node<T> *p) { T data; for( ; ; ) // its containue until user want to stop { cout<<"enter data number or '#' to stop\n"; cin>>data; if(data == '#') { p->next =NULL; break; } else { p->num= data; p->next = new Node<T>; p=p->next; } } } //count list to use it in sort function int countlist (Node<T> *p) { int count=0; while(p->next != NULL) { count++; p=p->next; } return count; } // sort list void sort( Node<T> *p) { Node<T> *p1, *p2; //element 1 & 2 to compare between them int i, j , n; T temp; n= countlist(p); for( i=1; i<n ; i++) { // here every loop time we put the first element in list in p1 and the second in p2 p1=p; p2=p->next; for(j=1; j<=(n-i) ; j++) { if( p1->num > p2->num) { temp=p2->num; p2->num=p1->num; p1->num=temp; } } p1= p1->next; p2= p2->next; } } //add new number in any location the user choose void insertatloc(Node<T> *p) { T n; //read new num int loc; //read the choosen location Node<T> *locadd, *newnum, *temp; cout <<" enter location you want ..! \n"; cin>>loc; locadd=NULL; //make it null to checked if there is location after read it from user ot not while(p->next !=NULL) { if( p->next==loc) { locadd=p; break; } p=p->next; } if (locadd==NULL) {cout<<" cannot find the location\n";} else //if location is right {cout<<" enter new number\n"; // new number to creat also new location for it cin>>n; newnum= new Node/*<T>*/; newnum->num=n; temp= locadd->next; locadd->next=newnum; newnum->next=temp; } locadd->num=sort(locadd); // call sort function } // display all list nodes void displaylist (Node<T> *p) { while (p->next != NULL) { cout<<" the list contain:\n"; cout<<p->num<<endl; p=p->next; } } };//end streuct int main() { cout<<"*** Welcome in Linked List Sheet 2****\n"; // defined pointer for structer Node // that value is the address of first node struct Node<int>*mynodes= new struct Node<int>; // create nodes in mynodes list cout<<"\nCreate nodes in list"; createlist(mynodes); // insert node in location insertatloc(mynodes); /* count the number of all nodes nodescount = countlist(mynodes); cout<<"\nThe number of nodes in list is: "<<nodescount;*/ // sort nodes in list sort(mynodes); // Display nodes cout<<"\nDisplay all nodes in list:\n"; displaylist(mynodes); system("pause"); return 0; }

    Read the article

1