node

what is the purpose of the 'right' value in a nested tree?

If I'm looking for nested nodes of a parent, I'd query for children like this: parent.left < child.left This is always true though: child.right < parent.right So why do all examples I've found run a between query? thanks, Matt ...

Advice on creating a micro-framework in JavaScript

Hi, I'd like to know what are the steps required to create a framework on top of node.js. I believe this can be a good way to learn, that's why I'm doing this! I've been checking other micro-frameworks and bigger frameworks but I'm not being able to understand where to start. I'd like your advice on this. Thank you. Edit: MVC Framewor...

Accessing a XML node directly via a key

$xml = simplexml_load_file($xmlPath); $items = $xml->list->item; ... echo $items[$currentIndex]->asXML(); When I print out $currentIndex on each iteration, I get 0, 1, 2, 3, 4, etc. When I hard code $items[0]->asXML(); $items[1]->asXML(); $items[2]->asXML(); etc. I get the data I want. But when I loop like I do in the first code segme...

How do I delete a node from linked list? c++

How can I delete a node (between two nodes) from a single linked list without passing any parameters to the class function? For example, I have a list of 6 nodes with one head node and i want to delete 2 of them (without prior knowledge of their address or position) from a class function, how would i do that? void WordList::deleteNod...

Adding a node with jQuery in a Firefox extension

Hi guys, I suspect that jQuery is not working ok in my extension... I'm using version 1.3.2, loaded with the following rows: var loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] .getService(Components.interfaces.mozIJSSubScriptLoader); loader.loadSubScript("chrome://myext/content/lib/jquery.js", myext);...

C# treeview node

I have a treeview1: treenode-- treenode1-- treenode2 treenode3 You can select only node2 and node3 if you want to display them parameters. How can i block selecting node and node1? I try like that,but than you can select all nodes: private void treeView1_Aft...

AMQP/RabbitMQ or Node.js for live web applications?

I want to build a live application that supports server-push (chat, feeds, live notification and collaboration etc). I have looked into Node.js and found it quite interesting and appropriate for such things. I have also looked into AMQP/RabbitMQ, but I don't get these quite. My questions: How does AMQP/RabbitMQ compare to Node.js? C...

couchdb design views, updating fields on doc creation

Is it possible to have couch update or change fields on the fly when you create/update a doc? For example in the design view.... validate_doc_update: function(newDoc, oldDoc, userCtx) { } Within that function I can throw errors like: if(!newDoc.user_email && !newDoc.user_name && !newDoc.user_password){ throw({forbidden : 'all fi...

Javascript frameworks used on server side to extend Javascript core?

There are a lot of frameworks for the frontend: jQuery Prototype Mootools YUI ExtJS Dojo Could these be used on the server side to extend Javascript native classes for example: object2 = object1.clone(); And is this a good way of extending Javascript? Cause I don't want to create every basic function I need but lacks from Javascr...

How to use YUI3 on node?

I can't get YUI3 to work on node. I have installed all dependencies according to this site: http://github.com/yui/nodejs-yui3. Here is my code: var jsdom = require("jsdom").jsdom, window = jsdom("<html><head></head><body>hello world</body></html>").createWindow(); var puts = require("sys").puts; var YUI = require("yui3").YUI; v...

Drupal / CKEditor and input filtering, how to return clean value?

I have a Drupal set up with CKEditor and CCK, with a custom node which has some additional fields using CKEditor, one field being 'related_news'. I'm trying to figure out the best practice for returning that data safely. What I have right now is: $node = noad_load(35); <h3>Related News</h3> <?php print $node->field_related_news['0']['v...

Sleep will stop Nginx since it's an event-based server?

I think if you have setTimeout=1 then the node server will be unavailable for all requests in 1 second since it's event-based, non-threaded web server (correct me if I'm wrong). I've heard that Nginx is also an event-based web server. Doesn't that mean that if I have sleep 1 then it would be halted for all requests in 1 second? ...

Check if variable is a valid node element

How can I change a JS element to see if it is a node or an empty variable? ...

Node.js, process and threads question

Does process have at least one thread running? If so, then the Node.js will by default have 1 main thread and 1 event loop thread running? ...

Deactivate INFO messages for YUI3 on node.js?

I'm using YUI3 on node.js but I get all these INFO messages. How do I deactivate them? ...

Ajax driven timeline-style blog (in Drupal)

I have created a blog in drupal using CCK and taxonomy. I wish to display my posts in a timeline, according to the posted date (using views). So far I have created a listing of the post titles on a timeline. I now want to display the posts using ajax, wherein clicking on a post title will load the content of that node on the same page. G...

Stream with Node.js doesn't work

I know that with Node.js you can stream data. But why doesn't this code work: var sys = require('sys'), http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.write("hello"); res.write("world"); }).listen(80); Seems that I have to have res.end() after the las...

node.js: Enumerating socket clients...

Hi, I'm trying to create a server app in node.js, where multiple clients connect, and then one sends data, and that data gets send to another specific client. Which client it gets sent to is determined by a 'user id' that all clients will send after they connect. How can I keep track of clients as they connect? How can I find my specif...

Javascript FAB framework on Node.js

I've seen a slide that presented Fab, a node.js framework. Is this JavaScript? Could someone explain what is going on in that code? I'm all lost. ...

Adding servers to a service

I'm building an architecture in that web servers dispatches jobs to background worker nodes in a random way so the load is balanced. How could my web servers know that I've added a worker node? Thanks! ...