Transform polling requests into interrupts. Pull into push.
A simple, open, web-hook-based pubsub protocol & open source reference implementation.
Transform polling requests into interrupts. Pull into push.
A simple, open, web-hook-based pubsub protocol & open source reference implementation.
The old way…
By Udo G at Stack Overflow
from: http://stackoverflow.com/questions/5797852/in-node-js-how-do-i-include-functions-from-my-other-files If, despite all the other answers, you still want to traditionally include a file in a node.js source file, you can use this: <code>var fs = require('fs'); // file is included here: eval(fs.readFileSync('tools.js')+'');</code>
Please note that in most cases this is bad practice and you should instead write a module. However, there are rare situations, where pollution of your local context/namespace is what you really want.
|
|||||||||||||||||||
|
(update) having problems with this when using socket.io from external clients. So it may be worth looking at the alternatives described in the Shelley Powers book on NODE.js
original post
Here is now to set up a reverse proxy so that a node.js server is visible from the outside world. In our case we redirected any traffic with the subdirectory /nodejs/ to port 8124
for example, this web address http://zerokidz.com/nodejs/
Add the following to the /etc/apache2/sites-enabled/default file: (inside the section already set aside for the virtual host zerokidz)
ProxyPass /nodejs/ http://127.0.0.1:8124/ ProxyPassReverse /nodejs/ http://127.0.0.1:8124/ <Proxy *> Order deny,allow Allow from all </Proxy>
So it will look something like this:
<VirtualHost *:80> ServerName www.zerokidz.com ServerAlias zerokidz.com *.zerokidz.com DocumentRoot /home/tkzic/public_html/zerokidz # Nodejs reverse proxy rule # sends all traffic for zerokidz.com/nodejs # to the nodejs server on port 8124 ProxyPass /nodejs/ http://127.0.0.1:8124/ ProxyPassReverse /nodejs/ http://127.0.0.1:8124/ <Proxy *> Order deny,allow Allow from all </Proxy> </VirtualHost>
Then restart apache, of course
from algorithmiccomposer.com
http://algorithmiccomposer.com/2010/05/algorithmic-composition-markov-chains-in-max-msp.html
Examples of slow data streams.
There aren’t enough data points to use typically smoothing methods like moving average or logarithmic smoothing. Here are 2 ideas for increasing data points using repetition:
There are limits to the polling speed you can use with Max…
This is probably due to changes made in OBD-II protocol in 2002 specification.
Preliminary files are in:
/Automax
rpm3- reads rpm/speed from obd bluetooth
This patch demonstrates two methods of polling. For RPM and vehicle speed, the request codes and polling are linked and controlled by a single metro object which splits the polling time between the two codes.
The engine load is a simpler setup – with separate metros to do writing and reading.
If the polling speed is set too fast, the OBD port will crash and you have to reset everything. So on the 2001 Acura you can’t poll faster than 300 ms. – but on the 2006 Jetta you can poll at 100 ms. – which is much more realistic for doing engine simulation stuff…
waveguide engine2e-1 – gets rpm and sends to engine speed
I’m trying to organize the examples for measuring wheel speed. These patches need to be consolidated – and have the extraneous stuff stripped out. For example, just need a wii-mote detector without all the envelope stuff.
max teaching examples/tz examples
bicycle2.maxpat – need to clean up
wheelspeed.maxpat
waveguide engine3c bike.maxpat
notes: wheelspeed2.maxpat has some experiments with smoothing by converting to signal in order to get more data points.