nodes

SQL join using CSV values ? Using Xml maybe ?

Hi, I'm trying to join two SQL tables, parent (which I have complete design control over) and child (which I cannot change). I have changed the parent table so that it has a varchar column, containing a CSV list of the ids of the child records. I would now like to do a select returning one row per parent, and some counters re. the child...

Speeding up xpath

Hello, i have a 1000 entry document whose format is something like <Example> <Entry> <n1></n1> <n2></n2> </Entry> <Entry> <n1></n1> <n2></n2> </Entry> <!--and so on--> There are more than 1000 Entry nodes here. I am writing a Java program which basically gets all the...

PHP Moving mySQL Tree Node

I am having trouble trying to move sub nodes or parent nodes up or down... not that good at math. CREATE TABLE IF NOT EXISTS `pages` ( `page-id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, page-left mediumint(8) unsigned NOT NULL, page-right smallint(8) unsigned NOT NULL, page-title text NOT NULL, page-content te...

Get graphviz to draw nodes above edges.

Is there any way to force graphviz to always draw the nodes above edges even if the edge is drawn over (or preferably under) the node? So far I have tried ordering them and different layer options but not found a way that works. ...

PHP simpleXML parsing

I need currency conversion, euro to dollar. The European Central bank provides the rates here: http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml I can get the USD rate by using the first node, but what if they change the order? Do I need something more reliable? I have no idea how.. $xml = @simplexml_load_file('http://www.ecb...

construct graph from python set type.

The short question, is there an off the self function to make a graph from a collection of python sets? The longer question: I have several python sets. They each overlap or some are sub sets of others. I would like to make a graph (as in nodes and edges) nodes are the elements in the sets. The edges are intersection of the sets with wei...

Combinations into pairs

I'm working on a directed network problem and trying to compute all valid paths between two points. I need a way to look at paths up to 30 "trips" (represented by an [origin, destination] pair) in length. The full route is then composed of a series of these pairs: route = [[start, city2], [city2, city3], [city3, city4], [city4, city5], ...

recipe for adding Drupal node records.

I am looking for a recipe for adding Drupal node records. I have identified three tables. node_revisions nid=249 - vid + 1? vid=248 - auto-increment node: nid=250 - vid + 1? vid=249 - auto-increment content_type_my_content vid=248 - from node_revisions table? nid=249 - from node table? Am I on right track? Is there some helpe...

Drupal node reference

I am using two content types - test_parent & test_child In test_child there are two fields, both of type datetime And in test_parent there are two fields, week_no & 7 node references I am using node_save to save a new node. After saving a node of parent type, and then saving the node of child type, i want to update the node it into the ...

Creating nodes programatically in Drupal 6

Hey, I have been searching for how to create nodes in Drupal 6. I found some entries here on stackoverflow, but the questions seemed to either be for older versions or the solutions did not work for me. Ok, so here is my current process for trying to create $node = new stdClass(); $node->title = "test title"; $node->body = "test body...

Framework to draw Edges and Nodes using GWT

I am searching for framework to draw Edges and Nodes. I want to create a visual graph and It should be draggable. I tried http://code.google.com/p/gwt-diagrams but this project is down. What is your suggestion? ...

How to reverse childnodes of a XML nodes using C#

I want to set reverse order of child nodes of given XML nodes. How to do this??? <Parent> <Child1> </Child1> <Child2> </Child2> </Parent> OUTPUT: <Parent> <Child2> </Child2> <Child1> </Child1> </Parent> EDIT: I have simple XML file like above. XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(value); XmlElement docE...

Using XSD to validate node count

I don't think this is possible but I thought I'd throw it out there. Given this XML: <people count="3"> <person>Bill</person> <person>Joe</person> <person>Susan</person> </people> Is it possible in an XSD to force the @count attribute value to be the correct count of defined elements (in this case, the person elem...

Looking for a solid and scalable library to render undirected graph.

I'll need to throw in about 400 millions of nodes. Preferable languages are java, php, .net, ruby or python. Anything alse will do the same. :D Any ideas? ...

how to avoid 'out of memory' errors when programmatically generating a lot of nodes in drupal?

I'm creating about 150 nodes programmatically and running into 'out of memory' errors when doing it all in a single request. (I have a menu callback that generates the nodes and calls node_save() on them.) Example: for($i=0; $i<150; $i++) { $node = new stdClass(); $node->title="Foo $i"; $node->field_myfield[0]['value'] = ...

Sort XML nodes with PHP

I have a serialized string comming in with POST: $imgdata = $_POST['imgdata']; // li[]=2&li[]=3&li[]=1&li[]=4 In this example 001 is reordered after 003 How can I update my XML file with this new order? I think I need simpleXML or xpath. Here are my thoughts: // 1. load xml string $xml = simplexml_load_file('test.xml'); /* <?xml vers...

xsl:variable contains nodeset. How to output nth node of variable?

I am transforming an XML document. There is an attribute @prettydate that is a string similar to "Friday, May 7, 2010". I want to split that string and add links to the month and the year. I am using the exslt:strings module and I can add any other necessary EXSLT module. This is my code so far: <xsl:template match="//calendar"> ...

Searching custom nodes' by field in Drupal?

Hello- Using Drupal on a project which I made custom node types in using the CCK. I want to be able to search the specific node based on a custom field the node has. So let's say I have this node type Article which has a field "myfield", I want to be able to search for Articles based on the myfield field. I understand the default searc...

nextSibling issues...

Ok, this has been killing me all night, I mean I've been working on this code for atleast 8 hours now. What is the problem with this, argggg. I am trying to update all <span id="column_[row index number]_[column index number]_[layout position number]"> to increment it by one up until the next id="row_[row index number]" tr element, The...

Drawing graphs on java

I want to draw graphs (nodes and edges) in Java. However, since I don't know how to go about it, I would like to have some advice before starting. How should I do this? use Graphics2D package, right? How about the labels for the nodes? should I use something like drawString and handle all the "centering" manually or create a JLabel fo...