node

Javascript: Preserving event hooks and state by updating DOM with only changed nodes or minimum number of potentially changed nodes?

So for example if we have a flash video already buffered and playing, or an autocomplete active with input, focus, and a dropdown visible (and maybe even loading something) but only have HTML of the full document and a copy of the HTML earlier, how can we merge them into the live DOM without the user's state being interrupted? Ordinaril...

Could node.js replace ruby/rails completely in the future?

Im not very updated in the event-driven/concurrency area in node.js. I wonder, is it possible that node.js would replace ruby/rails completely in the future? Or is it more like an extension to ruby/rails for the real time features? ...

How to keep Node.js from splitting socket messages into smaller chunks

I've got a chat program which pushes JSON data from Apache/PHP to Node.js, via a TCP socket: // Node.js (Javascript) phpListener = net.createServer(function(stream) { stream.setEncoding("utf8"); stream.on("data", function(txt) { var json = JSON.parse(txt); // do stuff with json } } phpListener.listen("88...

[Drupal] using a specific node ID to call a template file

The standard template for a node in Drupal is node.tpl.php It's possible to call a different template for a content-type, like 'newsitem'. You will call it like this : node-newsitem.tpl.php. I was wondering if there's a way to call a specific Node ID? node-34.tpl.php does not work. Thanks ...

What is a proper way to write and implement a node/tree interface?

I am trying to write and implement a simple node/tree interface in PHP. Something along these lines: interface node { public function setParent(node $node); // can be null public function removeChild(node $node); // should not be null public function addChild(node $node); // should not be null } The implementation details...

How to append to a file in Node?

Hello there, I am trying to append a string to a log file. However writeFile will erase the content each time before writing the string. fs.writeFile('log.txt', 'Hello Node', function (err) { if (err) throw err; console.log('It\'s saved!'); }); // => message.txt erased, contains only 'Hello Node' Any idea how to do this the easy ...

selective node update to cached xml feed and/or feedreader

Over at rsscache they offer a mechanism that caches your website's feed. They claim that if a new node gets added to your feed, instead of flushing and refilling the entire cache(for the current user, they proably do for new users), they only send the new node to the current users newsreader, and the reader adds it within the other nodes...

How can I modify a CCK fields display via a module?

Hi. I'm working on a drupal module, and one thing that it needs to do is modify the display of cck file fields automatically (using template files is not an option). For example, this array: $node->field_images[0]['view']; That is what I would like to get into. The 'view' part will output an image based on the display settings for ...

Maximum number of attributes a node has in a XML document

We are interested in finding maximum number of attributes a node has in a XML document. My code is below using C#: XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(@"C:\ABC.xml"); XmlNode root = xmlDoc.DocumentElement; int nodeAttrCount = 0; foreach (XmlNode node in root) ...

WPF C# Get Root Node of TreeView

I have a TreeView that is binded through a HierarchicalDataTemplate <HierarchicalDataTemplate x:Key="HierachrTree" DataType="{x:Type src:Ordner}" ItemsSource="{Binding UnterOrdner}"> <TextBlock Text="{Binding OrdnerName}"/> </HierarchicalDataTemplate> Thats my TreeView: <TreeView Name="DokumentBrowser" Ite...

Drupal 6 - Get node->links in blocks

I want to display $node->links in a block, but node_load only loads the node object without the links. How do I get the links? ...

How to create a 'blog settings' tab in drupal to move all blog related edit forms to one place

I dont know if im asking the impossible, but i want to have a tab in my user edit area that houses all blog related items (ie blog theme, blog info, user blogroll) as opposed to them being inside the user/%/edit and user/%/edit profile. Im putting together a multi-user site and this is crucial for user-friendliness. Thanks for any idea...

Node template for blog teaser node

I'm trying to create a teaser node template to display all Blog teasers. For the page tpl I have page-blogs.tpl.php For the Blog node tpl I have node-blog.tpl.php (This one is looping to display all the blog teasers) Now how do I create a node template to surround the node teasers? My URL for the page with all the blog teasers is: /blog...

Drupal not updating data for content page

Hi, I am using Drupal 6.19 to build a simple website with its own theme and layout. I also added and updated content regularly till I ran into a typical problem yesterday. There was a node-24 with a url alias of 'projects/india/current'. It is a content of type 'page'. As soon as I updated the content for this node, the data was not save...

XLinq: Remove certain XElements from a xml file which are saved in a LIst<XElement>

Hello, I can not remove nodes while I iterate them thats ok.´ I have a List with Guid`s in it. I want to delete all XElements in that xml file where the XElement has a Guid of that List thats my xml file: <?xml version="1.0" encoding="utf-8"?> <Departments> <Department Id="2d55ba71-a2ab-44a1-a697-f57bbd238c7f" /> <Department Id=...

http.ServerRequest.prototype

I want to add my own method to http.ServerRequest object. But http.ServerRequest is null. I tried requset.prototype.testtest = function() { console.log('aaaaa'); }; in server callback. It answers 'TypeError: Cannot set property 'testtest' of undefined'. How to add method to ServerRequest objects? ...

How to select a node's first child name? XPath

Hello, I have an XML from which I have to select the name of the child of one of the nodes. I'm kind of a beginner in this, so I didn't find the Xpath expression to do it. I know the level of the node (example Name from /Employee/Department/) but Department has children nodes of unknown names. I have to select the first child of Departme...

After creating a node in Jstee, it dissapears.

Node creation triggered by a function in the thickbox window, after creation the node dissapears. Why could it be happening? Here is my code listing: $("#treeDiv").jstree("create", "#node_133", "last", { "attr" : { "rel" : $("#nodetype option:selected").val().replace("add_","") }, "...

Remove XML node when child node meets certain requirements

Hello all I have the following xml: <listaGiros> <giro> <idGiro type="int">89</idGiro> <nombreGiro type="varchar">foo</nombreGiro> </giro> <giro> <idGiro type="int">78</idGiro> <nombreGiro type="varchar">apple</nombreGiro> </giro> <giro> <idGiro type="int">10</idGiro> ...

Python: Strange behaviour of recursive function with keyword arguments

Hi folks, I've written a small snippet that computes the path length of a given node (e.g. its distance to the root node): def node_depth(node, depth=0, colored_nodes=set()): """ Return the length of the path in the parse tree from C{node}'s position up to the root node. Effectively tests if C{node} is inside a circle a...