[nodejs] Re: Question is this possible

2016-10-06 Thread thebluearchernc





Well i am new at this so no i did not know i did not need separate ports   
but you are correct  i wish to show part of the page on each devices  with 
the devices lined up to make a larger display  sort like this image with 
each display containing a section of the dash

any pointers to where to begin will be greatly appreciated  at this point i 
do not know the exact amount of display i will need  just want to make sure 
this can be done. 





On Thursday, October 6, 2016 at 10:41:41 AM UTC-4, Zlatko wrote:
>
> Having 5 devices connect to different ports is fine, not a problem, but 
> *why* do you want separate ports?
>
> You can have a single page and have it split into sections and have them 
> all update. You can, at the same time, have 5 things connected somewhere. 
> You can even make a link between those connections and the sections on the 
> page.
>
> But what you're describing is very vague, so whether your specific idea is 
> possible cannot yet be answered. However, create a digital dash for an 
> automobile definitely can be made, with Node or whatever else. (I know 
> because I was working at a connected car startup and we did these things 
> with Node).
>
> So - about that page. Where do you wanna show this dashboard - on each 
> android device or each device gets its own "section" of the page? I'm 
> assuming you want to link 5 devices to the 5 page sections - why do you 
> need separate ports? You can have a single app listening on single port, 
> but keeping track at which and how many devices are connected. And you can 
> have the app also keep track of those "sections" of the page, and update 
> accordingly.
>
> So, share more details for more detailed answer, please.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/792861dd-9f4c-4d5c-9826-cc0aba425a4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] node.js and Java - which approach?

2016-10-06 Thread adam
Hi

Since you already have much Java in the project you may want to look into 
vertx.  It is very similar to node but runs on nvm.  I won't say too much more 
as this is a node group .  But it may be worth considering.


Adam

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/996a093a-127c-4e8d-acc4-0271db24977d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] Re: Returning binary data

2016-10-06 Thread Sergey Jamy
Try this http://msgpack.org/


Could anyone help me with the following please?
>
> How can I return a stream of bits which represents an array of double 
> precision numbers?
>
> For example, if I wanted to return two values each equal to 
> 0.3 I could do the following in nodejs:
>
> app.get('/GetBinaryData', function(req, res)
>{
> var buf = new Buffer(16);
>  
> buf[0] = 0x55;
> buf[1] = 0x55;
> buf[2] = 0x55;
> buf[3] = 0x55;
> buf[4] = 0x55;
> buf[5] = 0x55;
> buf[6] = 0xd5;
> buf[7] = 0x3f;
>
> buf[8] = 0x55;
> buf[9] = 0x55;
> buf[10] = 0x55;
> buf[11] = 0x55;
> buf[12] = 0x55;
> buf[13] = 0x55;
> buf[14] = 0xd5;
> buf[15] = 0x3f;
>
> res.send(buf);
>}
>);
>
> At the client side I receive the stream and read 8 bits at a time to get 
> the two values.
>
> I understand there may be endian issues, but ignoring them the questions 
> simplifies to:
>
> If I want to send the content of this array:
>
> var array = [7.1,5.2,13.3,300.4];
>
> to a client from nodejs as binary data how can I do it? 
>
> (can be floats if necessary. Maybe there's a entirely better way I am 
> unaware of, that would be great).
>
> Thanks fro any help,
> Mitch.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/9b9583fb-8d56-4be9-a79c-376912a96b7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] Re: Returning binary data

2016-10-06 Thread Mitchell Hockley
No worries, solved now.

On Tuesday, October 4, 2016 at 6:22:57 AM UTC+1, Mitchell Hockley wrote:
>
> Could anyone help me with the following please?
>
> How can I return a stream of bits which represents an array of double 
> precision numbers?
>
> For example, if I wanted to return two values each equal to 
> 0.3 I could do the following in nodejs:
>
> app.get('/GetBinaryData', function(req, res)
>{
> var buf = new Buffer(16);
>  
> buf[0] = 0x55;
> buf[1] = 0x55;
> buf[2] = 0x55;
> buf[3] = 0x55;
> buf[4] = 0x55;
> buf[5] = 0x55;
> buf[6] = 0xd5;
> buf[7] = 0x3f;
>
> buf[8] = 0x55;
> buf[9] = 0x55;
> buf[10] = 0x55;
> buf[11] = 0x55;
> buf[12] = 0x55;
> buf[13] = 0x55;
> buf[14] = 0xd5;
> buf[15] = 0x3f;
>
> res.send(buf);
>}
>);
>
> At the client side I receive the stream and read 8 bits at a time to get 
> the two values.
>
> I understand there may be endian issues, but ignoring them the questions 
> simplifies to:
>
> If I want to send the content of this array:
>
> var array = [7.1,5.2,13.3,300.4];
>
> to a client from nodejs as binary data how can I do it? 
>
> (can be floats if necessary. Maybe there's a entirely better way I am 
> unaware of, that would be great).
>
> Thanks fro any help,
> Mitch.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/a9400775-4173-41ee-9e45-063bae9a0247%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] how to link to installed node packages / modules from another dir

2016-10-06 Thread Zlatko
As Ryan said, you can install the "shared" modules at a common parent 
directory. So if you have /*dir1/app1 *and /*dir2/app2*, you *could* have a 
/node_modules folder with those shared directories.

However, it seems like a bad practice, updating one app might break the 
other. Are you trying to save disk space with this or reduce install time 
or something else entirely?

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/dbfa8e78-ad12-4738-ae2c-63d3919e0772%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] kue scheduler error handling

2016-10-06 Thread vadiraj bidarahalli
I am usinh kue for scheduling jobs that run at specific intervlas like 
daily, weekly, monthly etc...
Also from the ui when a campaign is created , a job is created and pushed 
to the kue.
Now my problem is whenever there is a problem with redis connection, the 
functions like kue.create, kue.get, kue.delete  never return error and are 
somehow lost forever,
I have no way of telling the user, "hey, there is some technical problem. 
the campaign could not be scheduled".
Here is a part of my code..  The one i am talking about is the part of code 
that says 'Job Creation failed'  .. if there is a problem with redis 
connection, the save() function never calls back and my promise keeps 
hanging.. neither resolved nor rejected

 var campaignObj = {
  title: row.title,
  id: row.id,
  emailList: campaignJSON.emailList,
  clientId: row.clientId,
  emailText: step.emailText,
  startDate: campaignJSON.startDate,
  endDate: campaignJSON.endDate,
  stepIndex: idx,
  type: 'delay'
};

var newJobStep;

console.log('the step is', step);

if ([undefined, null, 'null'].indexOf(step.jobId) !== -1) {
  //newly added delay campaign
  //schedule the step
  newJobStep = jobQueue.create('campaign-jobs', 
campaignObj).delay(stepDelay).removeOnComplete(true)
.save(function(err) {

  if (err) {
console.log('Job creation failed');
if (idx === campaignJSON.steps.length - 1) {
  defered.reject('Error creating the job for the step ', 
idx + 1);
}
  } else {
step.jobId = newJobStep.id;
console.log('saving json', campaignJSON.steps[idx]);
self.saveCampaignJSON(campaignJSON, row.id);
if (idx === campaignJSON.steps.length - 1) {
  defered.resolve();
}
  }
});


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/0c589a6a-9465-45d8-a660-150a11fe27e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] Re: Returning binary data

2016-10-06 Thread Zlatko
Maybe Buffer.from(arrayBuffer) seems like it could help?

https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length

Basically a buffer from a typed array. Then stream that to client. 

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/80a2b5e3-abe2-40f4-9668-8f4ff3e988ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] errros installing mongo client with NPM

2016-10-06 Thread adam
Hi Node users,

Very new to node.js, I am trying to use node with mongo, but getting NPM 
errors when installing mongodb.

I am using ubuntu 12.04. I installed node using ubunut apt-get.  Node 
version is v0.6.12 according to node --version.

npm install mongodb  :

npm http GET http://registry.npmjs.org/mongodb
npm http 304 http://registry.npmjs.org/mongodb
npm http GET http://registry.npmjs.org/mongodb-core/1.2.31
npm http GET http://registry.npmjs.org/readable-stream/1.0.31
npm http GET http://registry.npmjs.org/es6-promise/3.0.2
npm http 304 http://registry.npmjs.org/mongodb-core/1.2.31
npm http 304 http://registry.npmjs.org/readable-stream/1.0.31
npm http 304 http://registry.npmjs.org/es6-promise/3.0.2
npm http GET http://registry.npmjs.org/core-util-is
npm http GET http://registry.npmjs.org/isarray/0.0.1
npm http GET http://registry.npmjs.org/string_decoder
npm http GET http://registry.npmjs.org/inherits
npm http 304 http://registry.npmjs.org/core-util-is
npm http 304 http://registry.npmjs.org/isarray/0.0.1
npm http 304 http://registry.npmjs.org/string_decoder
npm http 304 http://registry.npmjs.org/inherits
npm http GET http://registry.npmjs.org/bson
npm http 304 http://registry.npmjs.org/bson
npm ERR! error installing mongodb-core@1.2.31
npm ERR! error installing mongodb@2.1.3

npm ERR! Error: No compatible version found: bson@'>=0.4.20- <0.5.0-'
npm ERR! Valid install targets:
npm ERR! 
["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.8","0.0.9","0.1.0","0.1.1","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7"]
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR! at next_ (/usr/share/npm/lib/cache.js:438:17)
npm ERR! at next (/usr/share/npm/lib/cache.js:415:44)
npm ERR! at /usr/share/npm/lib/cache.js:408:5
npm ERR! at saved 
(/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR! at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR! 
npm ERR! or use
npm ERR! reportbug --attach /home/adam/node_modules/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 3.13.0-93-generic
npm ERR! command "node" "/usr/bin/npm" "install" "mongodb"
npm ERR! cwd /home/adam/node_modules
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: bson@'>=0.4.20- <0.5.0-'
npm ERR! message Valid install targets:
npm ERR! message 
["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.8","0.0.9","0.1.0","0.1.1","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7"]
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR! /home/adam/node_modules/npm-debug.log
npm not ok

Any help would be great!

-Adam


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/21f91357-ec36-4f11-b22c-aeac56a2943b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Help a newbie with loading a new page

2016-10-06 Thread Ryan Schmidt

> On Oct 1, 2016, at 3:31 PM, Rich Podraza  wrote:
> 
> I'm new to web development (have a C++/Java background) I'm looking for some 
> help with some simple modification I'm making to the node-login project as an 
> exercise.
> 
> I hope I can describe my problem helpfully without posting a bunch of code 
> here. I've added a button to the home page (modifying the home.jade) that is 
> supposed to navigate to a new page I've made called "about". I've added an 
> about.jade, and the get handler in routes.js. I've added the button handling 
> code in homeController.js.
> 
> So my button doesn't work. However, I can manually navigate to 
> localhost:3000/about and the page loads fine. When I set breakpoints I can 
> see that both clicking the button and navigating manually result in the 
> routes.js get function executing and calling render for my about page. I can 
> also see with the Firefox debug network activity log that I get a response 
> with the expected HTML for my GET about, and the HTML is the same for both 
> methods.
> 
> The only difference I can see is with the manual navigation method that 
> works, I also get a bunch of GET exchanges for some scripts included in 
> about.jade. With the button method, those don't fire. The log stops with GET 
> about.
> 
> Any ideas? I'm not sure where to look. Any other info I can provide? 

I'm not sure how to help you, without seeing your code.

Maybe let's start with...

What is the code you added to the jade template?

What is the HTML that was generated by that addition?


-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/59773DFA-2CCD-4D40-853C-885FB9073F34%40ryandesign.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] Digest for nodejs@googlegroups.com - 3 updates in 3 topics

2016-10-06 Thread Nuku Ameyibor
You could use messagepack to pack the data and then unpack the data when it
gets to the client side .
there are packing and unpacking libraries for both nodejs and javascript .


On Wed, Oct 5, 2016 at 3:25 AM,  wrote:

> nodejs@googlegroups.com
> 
>  Google
> Groups
> 
> 
> Topic digest
> View all topics
> 
>
>- Returning binary data <#m_7929592598772990244_group_thread_0> - 1
>Update
>- how to link to installed node packages / modules from another dir
><#m_7929592598772990244_group_thread_1> - 1 Update
>- Question is this possible <#m_7929592598772990244_group_thread_2> - 1
>Update
>
> Returning binary data
> 
> Mitchell Hockley : Oct 03 08:10AM -0700
>
> Could anyone help me with the following please?
>
> How can I return a stream of bits which represents an array of double
> precision numbers?
>
> For example, if I wanted to return two values each equal to
> 0.3
> I could do the following in nodejs:
>
> app.get('/GetBinaryData', function(req, res)
> {
> var buf = new Buffer(16);
>
> buf[0] = 0x55;
> buf[1] = 0x55;
> buf[2] = 0x55;
> buf[3] = 0x55;
> buf[4] = 0x55;
> buf[5] = 0x55;
> buf[6] = 0xd5;
> buf[7] = 0x3f;
>
> buf[8] = 0x55;
> buf[9] = 0x55;
> buf[10] = 0x55;
> buf[11] = 0x55;
> buf[12] = 0x55;
> buf[13] = 0x55;
> buf[14] = 0xd5;
> buf[15] = 0x3f;
>
> res.send(buf);
> }
> );
>
> At the client side I receive the stream and read 8 bits at a time to get
> the two values.
>
> I understand there may be endian issues, but ignoring them the questions
> simplifies to:
>
> If I want to send the content of this array:
>
> var array = [7.1,5.2,13.3,300.4];
>
> to a client from nodejs as binary data how can I do it?
>
> (can be floats if necessary. Maybe there's a entirely better way I am
> unaware of, that would be great).
>
> Thanks fro any help,
> Mitch.
> Back to top <#m_7929592598772990244_digest_top>
> how to link to installed node packages / modules from another dir
> 
> Ryan Graham : Oct 04 12:41AM
>
> Dependencies are loaded relative to the location of the code, not your
> current working directory. If you have code in foo/dir1/proc1.js and code
> in foo/dir2/proc2.js, they will both see modules in foo/node_modules
> regardless of which directory you run them from (eg. `cd /bar/dir3; node
> /foo/dir1/proc1.js`). Does that help?
>
> ~Ryan
>
>
> --
>
> ~Ryan
> Back to top <#m_7929592598772990244_digest_top>
> Question is this possible
> 
> thebluearchernc : Oct 03 08:41AM -0700
>
> say i have 5 android devices i want each to connect to a different web
> port and i want the webserver to update each devices page .
>
> basically i want to take a single page split it in to say 5 sections and
> each section is update at the same time making a matrix display of sorts.
>
> the idea is to create a digital dash board for an automobile
>
>
> thanks Ross
> Back to top <#m_7929592598772990244_digest_top>
> You received this digest because you're subscribed to updates for this
> group. You can change your settings on the group membership page
> 
> .
> To unsubscribe from this group and stop receiving emails from it send an
> email to nodejs+unsubscr...@googlegroups.com.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAOo93%3D_Sz5gcqSR-NKfQZ6aBeSB4bxpHo0GhB8_KSG1ZWmfnNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] Re: Question is this possible

2016-10-06 Thread Zlatko
Having 5 devices connect to different ports is fine, not a problem, but 
*why* do you want separate ports?

You can have a single page and have it split into sections and have them 
all update. You can, at the same time, have 5 things connected somewhere. 
You can even make a link between those connections and the sections on the 
page.

But what you're describing is very vague, so whether your specific idea is 
possible cannot yet be answered. However, create a digital dash for an 
automobile definitely can be made, with Node or whatever else. (I know 
because I was working at a connected car startup and we did these things 
with Node).

So - about that page. Where do you wanna show this dashboard - on each 
android device or each device gets its own "section" of the page? I'm 
assuming you want to link 5 devices to the 5 page sections - why do you 
need separate ports? You can have a single app listening on single port, 
but keeping track at which and how many devices are connected. And you can 
have the app also keep track of those "sections" of the page, and update 
accordingly.

So, share more details for more detailed answer, please.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/70031fa8-fcc4-4947-b7ff-bc39635e5f46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.