Re: [nodejs] error writing binary data to TCP socket.

2018-01-07 Thread Matt Sergeant
This has been fixed since. I don't know when. I have Node 9.3 and it produces a Buffer. On Tue, Jan 2, 2018 at 4:18 PM, Stephen James wrote: > Using electron I am trying to write out some bytes on a TCP socket. I am > using Buffer.from to convert to buffer before calling write, but am still > ge

Re: [nodejs] Export data to PDF / DOCX

2017-05-09 Thread Matt
On Sun, May 7, 2017 at 5:51 AM, Witold Szczerba wrote: > P.S. When I said creating the templates in DOCX, I meant using the > LibreOffice. Since it is going to be used to render, you will see exactly > how it is going to look like. As a bonus, non technical stuff can create > and maintain these

Re: [nodejs] Export data to PDF / DOCX

2017-05-06 Thread Matt
Try using node-phantom-simple (or one of the drivers, like slimerjs). It will look exactly like it would in a browser, even supporting SVG graphs. For images you can even generate data: URLs so you only need to load a single HTML file. On Thu, May 4, 2017 at 4:47 AM, Deep SiderZ wrote: > Hi ever

Re: [nodejs] Redirect solution

2017-03-19 Thread Matt
You could build something with this: https://www.npmjs.com/package/country-detector On Thu, Mar 16, 2017 at 6:02 AM, Todd Lane wrote: > Hi, > > Newbie here. > > I am wondering if there is a module that can handle redirects based on ip > address as well as the ability to redirect based on a users

Re: [nodejs] Update a webpage every 'x' seconds?

2017-03-17 Thread Matt
This isn't Node.js related. There's a billion ways to do it these days, from the simple use of jQuery and updating the DOM, to using a framework like Angular, Ember, or something like React. You just either periodically query the backend using setTimeout, or use WebSockets via one of the many great

Re: [nodejs] Massive node.js Project - Where to Recruit?

2017-03-09 Thread Matt
If you're recruiting without pay, then the usual resources are out. You're going to have to rely on your network, friends, etc. There's nothing special about Node for this. On Mon, Mar 6, 2017 at 6:18 PM, le coder wrote: > I have a massive node.js project, originally it was in c++ (about a decad

Re: [nodejs] encoding while parsing - polish symbols

2017-02-06 Thread Matt
You'll need Iconv to convert from whatever encoding the file is in (most likely "ISO 8859-2") to UTF-8 first. Something like this instead of the last line above: var Iconv = require('iconv').Iconv; var iconv = new Iconv('latin2', 'utf-8'); stream.pipe(iconv).pipe(csvStream); On Mon, Feb 6, 2017

Re: [nodejs] How to synchronize flipkart api datepicker REAL TIME?

2017-02-05 Thread Matt
This question isn't really a Node.js question - it's about the API you're using. You might want to ask flipkart support. To do real-time communication between Node.js server and Browser, look into socket.io. On Wed, Jan 25, 2017 at 8:13 AM, Akash Biswas wrote: > Hi Guys, > > I Integrated Flipka

Re: [nodejs] execve in node

2017-01-17 Thread Matt
ync? > > On Mon, Jan 16, 2017 at 09:11 Daniel Risacher wrote: > >> I find deep irony in your answer, in that I was trying to rewrite a >> simple script that I'd already written in perl with a nodejs version to >> eliminate the perl dependency. >> >> >

Re: [nodejs] execve in node

2017-01-12 Thread Matt
No there's no equivalent to it, mostly because Windows has no way to do it. Maybe try perl instead. On Fri, Jan 6, 2017 at 5:08 PM, Daniel Risacher wrote: > Is it possible to execute another program in the manner of execve(2)? > > I.e. as the man page says, "execve() does not return on success,

Re: [nodejs] node-mail + haraka

2016-11-30 Thread Matt
ch is what a webmail talks to (mostly). Matt. On Thu, Nov 17, 2016 at 8:18 PM, Егор Ильин wrote: > Okay, can you give advice how to build mail server with Haraka, if I want > to join it with web-interface? I haven't any expirience with MTA, I'm just > react developer. > &g

Re: [nodejs] JAR like format for nodejs

2016-10-23 Thread Matt
Aside from the other tips, have you considered using a filesystem that supports transparent compression? I have no idea what system you are deploying to, but NTFS, ZFS and Btrfs support this. On Thu, Oct 13, 2016 at 10:12 AM, Jan Flyborg wrote: > Hi, > > I am wondering if there are any plans to

Re: [nodejs] EMFILE error on bulk data insert through HTTP-REQUEST

2016-07-23 Thread Matt
What is your limit set to? Most node apps need the limit increased due to the process model. I set mine to 6400 usually via "ulimit -n 6400" before starting the app. On Sat, Jul 23, 2016 at 2:08 PM, Ryan Graham wrote: > This was also posted on stackoverflow earlier (where I posted my reply). >

Re: [nodejs] Re: child_process and scaling

2016-05-26 Thread Matt
Check out node-canvas for the rendering, then you won't need any child processes. https://github.com/Automattic/node-canvas On Sat, May 21, 2016 at 8:20 AM, Zlatko Đurić wrote: > You should try it. But the bottom line is, in a thousand-reqs-per-sec > scenario, you'll almost always hit a bottlen

Re: [nodejs] dns.resolve only tries the first nameserver in /etc/resolv.conf??

2016-05-06 Thread Matt
Yes, make your internal nameserver also be recursive/caching and remove the second line. How you do that depends on what software you're using for DNS. On Thu, May 5, 2016 at 11:50 PM, Yun Feng Ma wrote: > 在此输入代码... > > > > 在 2016年5月6日星期五 UTC+8上午9:43:50,Ben Noordhuis写道: > >> On Thu, May 5, 2016

Re: [nodejs] Using UTF-8-Validate

2016-04-25 Thread Matt
'utf-8-validate').isValidUTF8; > const buf1 = new Buffer('buffer'); > > console.log(buf1.toString()); > > if (isValid(buf1)){ > console.log('true') > > } > else { > console.log('false') > > }; > > > On Thursd

Re: [nodejs] Using UTF-8-Validate

2016-04-21 Thread Matt
In the above example, you just use: if (isValid(buf)) { ... } On Thu, Apr 21, 2016 at 4:20 PM, Bryon Trott wrote: > Hello, > I am new to node.js I am trying to use the module UTF-8-Validate to check > a simple test buffer. > https://www.npmjs.com/package/utf-8-validate > > However I am not sur

Re: [nodejs] Nodejs Search Engine

2016-04-18 Thread Matt
I sometimes wonder if people even try and google their problems these days... Fifth entry on the first page for "mongodb full text search": https://www.compose.io/articles/full-text-search-with-mongodb-and-node-js/ On Sun, Apr 17, 2016 at 7:10 AM, Duy Nguyen wrote: > Hi, > > I'm working on my s

Re: [nodejs] Nodejs for community site?

2016-04-16 Thread Matt
This kind of CPU use is trivial, and is zero issue for web apps. You can loop through 10k entries in a form field in microseconds. The things you might need to farm out to a queue are more traditionally CPU heavy computations, like large matrix calculations. A typical example in our (ideal.com) a

Re: [nodejs] Offline documentation (html or pdf), possible?

2016-03-25 Thread Matt
I'd love it so much much if Node shipped with man pages, so I could type "man node-fs" to get the fs man page. But I'm pretty sure I'd have to submit the pull request to make that happen :) On Thu, Mar 24, 2016 at 11:21 PM, Harry wrote: > Hello, > > Can the full html or pdf documentation be prov

Re: [nodejs] Question on Payment Gateways

2016-03-23 Thread Matt
rm necessary to complete an online credit card > transaction? > > Referral URL link is available at: 1. > https://github.com/ltc-hotspot/--Node-for-Authorize-net > > On Mon, Mar 21, 2016 at 3:44 PM, Matt wrote: > > One is a wrapper which allows you to specify different payment pr

Re: [nodejs] A few newbie questions on Nodejs

2016-03-23 Thread Matt
d rotation speed. An array of disks? Maybe. A disk with a cache? Possibly. See how complex this question gets? > Example: Suppose I have written a file-serving Node app that serves files > from the local hard-disk, making it strongly an I/O-bound app. > Assuming no caching. But why woul

Re: [nodejs] Question on Payment Gateways

2016-03-21 Thread Matt
latter only lets you use authorize.net. Not many people ever switch payment providers once they have one setup, but there are situations where you might want to support alternatives - e.g. paypal and credit cards (e.g. via Stripe). On Sun, Mar 20, 2016 at 11:40 PM, Ltc Hotspot wrote: > Matt: >

Re: [nodejs] Question on Payment Gateways

2016-03-20 Thread Matt
Can you be more specific in your question? You basically asked "what's the difference between X and X". Which of course there is none. You probably don't even need a wrapper, to be honest. Just pick a payment processor (e.g. Stripe or Paypal) and implement payment. It's not that hard. On Sun, Mar

Re: [nodejs] How to have childprocess.stdout printed without delay

2016-02-19 Thread Matt
Convince the command not to buffer. It is probably written such that if it thinks stdout is a tty it line-buffers, but if stdout is a pipe it block-buffers. In perl you do this via "$|++". The app may have a command-line flag for it if you're lucky. On Tue, Feb 16, 2016 at 5:50 PM, Hoa Phan wrot

Re: [nodejs] Buffer.write - Is there an efficient way to get the last index of the string that was written to the buffer

2016-01-24 Thread Matt
Because the string could contain non-ascii data, you'd have to create a buffer from the string to get that position. Be aware that the position could be in the middle of a character, so you'll have to deal with that. You can use Buffer.byteLength(thestring) == buf.write(thestring) to find out if t

Re: [nodejs] How to capture network calls in node js?

2015-10-23 Thread Matt
http://www.juliengilli.com/2013/05/26/Using-Node.js-NODE_DEBUG-for-fun-and-profit/ Matt. On Fri, Oct 23, 2015 at 3:05 AM, Prabhu Venkat wrote: > In firebug addon for firefox there is a tab named 'Net' which captures all > the network calls made when we hit an URL from the browser > > I can re

Re: [nodejs] need help debugging server app that silently stops

2015-09-30 Thread Matt
Have you tried setting NODE_DEBUG? http://www.juliengilli.com/2013/05/26/Using-Node.js-NODE_DEBUG-for-fun-and-profit/ On Tue, Sep 29, 2015 at 8:36 AM, Michael Mathy < michael.ma...@quickelsoft.com> wrote: > Hello Mark > > Could you post your code so that we can check ? > > > Michael Mathy > *Qui

Re: [nodejs] UTF8 encoding issue

2015-09-30 Thread Matt
I think you've really misunderstood the PDF format. PDF is a binary format (it can contain images with zero codepoints). There's nothing that can read PDFs that expects them in UTF8 format. You may have destroyed the PDFs completely by storing them as Latin-1, but given how flexible Latin-1 is you

Re: [nodejs] performance issue with express-validator

2015-08-12 Thread Matt
On Sun, Aug 9, 2015 at 2:27 PM, Sebastian M Cheung < minsche...@googlemail.com> wrote: > After adding express-validator, the app slows down dramatically: why is > that? > One would assume, because node-validator is slow. I'm not sure what other answer you could expect... What level of slow down

Re: [nodejs] Limit and handling of spawning child_process of ffmpeg

2015-07-06 Thread Matt
Thanks for the clarification Sam. On Sun, Jul 5, 2015 at 11:34 PM, Sam Roberts wrote: > On Sun, Jul 5, 2015 at 7:53 PM, Matt wrote: > > On Sun, Jul 5, 2015 at 6:12 PM, Sam Roberts wrote: > >> On Mon, Jun 29, 2015 at 10:37 AM, Matt wrote: > >> > You've ex

Re: [nodejs] Limit and handling of spawning child_process of ffmpeg

2015-07-05 Thread Matt
On Sun, Jul 5, 2015 at 6:12 PM, Sam Roberts wrote: > On Mon, Jun 29, 2015 at 10:37 AM, Matt wrote: > > You've exhausted the threadpool. Try setting the UV_THREADPOOL_SIZE env > var > > higher and see if you can spawn more. > > Child processes don't go through

Re: [nodejs] Limit and handling of spawning child_process of ffmpeg

2015-06-29 Thread Matt
You've exhausted the threadpool. Try setting the UV_THREADPOOL_SIZE env var higher and see if you can spawn more. On Sun, Jun 28, 2015 at 1:12 PM, Ofir Attia wrote: > The server is waiting for request, for each request I am take a video > input ( it can be RTSP input, video file .. ) and output

Re: [nodejs] Interesting for maybe delegating JSON.parse to another language

2015-05-28 Thread Matt
That's a naive way of looking at things. JSON.parse is slower in Node not due to the parser itself, but due to constructing objects. So yes you could parse in C++, but your object access would be hundreds of times slower. On Tue, May 26, 2015 at 7:11 PM, Ω Alisson wrote: > https://github.com/ko

Re: [nodejs] Asynchronous Control Flow

2015-05-18 Thread Matt
Looks like you're trying to run before you can walk, to be honest. Play a bit with async. Play some with Promises (most people recommend Bluebird for that). Learn what works and what fits with your mindset. Nobody can give you an all encompassing perfect answer here. On Sun, May 17, 2015 at 11:46

Re: [nodejs] Asynchronous Control Flow

2015-05-16 Thread Matt
alc depends on 'ideal_calc'. The rest can be executed in parallel, and the async library takes care of that for you. Hope that helps, Matt. -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https:/

Re: [nodejs] Node.js as SMTP server emulator

2015-05-03 Thread Matt
Andris' smtp-server is great though requires a little coding. With Haraka running the test_queue plugin, it just writes every mail to /tmp/mail.eml which might be exactly all you need. On Fri, May 1, 2015 at 9:06 AM, Adrian Lynch < adrian.ly...@concreteplatform.com> wrote: > This looks like the

Re: [nodejs] Does anyone know a NodeJS development company in TORONTO area for outsourcing?

2015-04-29 Thread Matt
The guy who runs the Toronto Node.js meetups runs a shop that can do this kind of thing: claremontinteractive.com - his name is Neal Pollock. On Tue, Apr 28, 2015 at 6:41 PM, Far M wrote: > Hello everyone, > > Does anyone know of a reputable NodeJS development company/group in > Toronto area? >

Re: [nodejs] bcrypt install failed. Node-gyp rebuild error

2015-04-03 Thread Matt
Looks like someone has already helped you there, but to record it here as well: "npm install bcrypt --msvs_version=2012 or 2013 and then enter" On Fri, Apr 3, 2015 at 8:41 AM, Aryak Sengupta wrote: > I have already filed it as an issue under NPM. > > https://github.com/npm/npm/issues/7845 > > *

Re: [nodejs] GitHub.js - node module for GitHub activities

2015-03-30 Thread Matt
You need a lot of work on your documentation, and your examples need the code with them, not just the output. Looks useful for github projects, but it really has zero to do with Node, there's no server side code here whatsoever. On Mon, Mar 30, 2015 at 2:43 PM, Akshay sharma wrote: > An easy wa

Re: [nodejs] node.js requires to many TCP sockets

2015-03-17 Thread Matt
Looks like an EMFILE error. You need to set ulimit -n higher. On Tue, Mar 17, 2015 at 4:10 AM, Spab Rice wrote: > Hello, > > I'm new to node.js. > My script creates/open too many TCP Sockets which I don't have any plan > how to prevent this? > > Please see the StackOverflow link to have full det

Re: [nodejs] change code on runtime without restart

2015-03-06 Thread Matt
How I do this is have a "runner.js" which uses cluster. When it receives SIGUSR2 it restarts each child process one-by-one, ensuring that the service is always running even during a restart. I've posted it here before: https://gist.github.com/baudehlo/c4d00a78720b85171237 On Fri, Mar 6, 2015 at 6

Re: [nodejs] Re: Why siege test showing PHP is performing better than Node

2015-03-03 Thread Matt
On Tue, Mar 3, 2015 at 1:32 AM, Axel Kittenberger wrote: > However, comparing naive approaches with different utilities like these > does have its warrant. Lets please not ignore that. Technically it may be > apples vs. oranges but from a user perspective it is not. It is comparing > how well you

Re: [nodejs] Re: Why siege test showing PHP is performing better than Node

2015-03-02 Thread Matt
ally matter - you need to get a feel for the entire app. Matt. On Sun, Mar 1, 2015 at 4:27 AM, Alexey Petrushin wrote: > Also, if you are interested in "kinda real-life" Node.js benchmarks, > here's one more for Ruby on Rails vs Node.js > > http://jslang.info/blog/2014

Re: [nodejs] Re: Why siege test showing PHP is performing better than Node

2015-02-28 Thread Matt
On Fri, Feb 27, 2015 at 5:35 PM, Anirban Bhattacharya < anirbanbhattacharya1...@gmail.com> wrote: > Here is Git link for source codes and database structure > > https://github.com/anisoftcorporation/nodevsphp > > You're only using one CPU for node

Re: [nodejs] How to set part headers in node.js while doing a multipart post request?

2015-02-23 Thread Matt
I use request for this (npm install request). https://github.com/request/request#multipartform-data-multipart-form-uploads I generally use the "advanced cases" technique. On Mon, Feb 23, 2015 at 12:13 AM, jeevan kk wrote: > I am trying to do a multipart post request from my node.js server. How

Re: [nodejs] Re: Why siege test showing PHP is performing better than Node

2015-02-20 Thread Matt
So Node transferred 400MB of data in the same time that PHP transferred 58MB of data? Sounds like a big win for Node. On Fri, Feb 20, 2015 at 2:29 PM, Anirban Bhattacharya < anirbanbhattacharya1...@gmail.com> wrote: > So, > > I made changes to code of node. > > 1. I removed that extra query for u

Re: [nodejs] Can't find getting started documentation

2015-02-20 Thread Matt
The best place to get started is Node School: http://nodeschool.io/ On Fri, Feb 20, 2015 at 2:30 AM, alota takada wrote: > At http://nodejs.org/documentation/ it says "Here on nodejs.org you will > find three types of documentation, reference documentation, getting started > documentation, and t

Re: [nodejs] io.js forum

2015-02-09 Thread Matt
>From the perspective of people here, I think we'd all rather not split the forum. The technology is basically the same and there's really no reason for a split at this time. Maybe if they diverge significantly, but let's cross that bridge if it arrives. On Mon, Feb 9, 2015 at 4:00 PM, john.tiger

Re: [nodejs] StrongLoop announces most complete process manager for Node.js clustering with Nginx support built-in

2015-02-09 Thread Matt
I don't use any of the "node" process managers because they don't solve the problem of starting your process at server boot. I use init scripts, or upstart, or runit or systemd like you're supposed to for a service. Anyone using forever or pm2 likely doesn't understand sysops. Does this strongloop

Re: [nodejs] end-of-life/support policy

2015-01-28 Thread Matt
This was asked and answered last week. The answer was basically: 0.8 will get security fixes only, but will be considered EOL when 0.12 is released. On Wed, Jan 28, 2015 at 1:56 PM, Nick Santos wrote: > Hi, > > Is there a formal end-of-life/support policy on old versions of node? > > For exampl

Re: [nodejs] Trigger the event loop to be processed

2015-01-21 Thread Matt
Yes it's called existsSync(). You don't need some fancy function to call the event loop if you just want to find a file before the rest of your code starts. On Wed, Jan 21, 2015 at 6:06 PM, Fredrik O wrote: > I need to call a function synchronously which trigger the event loop to be > processed

Re: [nodejs] How to parse email on haraka ?

2015-01-12 Thread Matt
(mostly answered on the Haraka mailing list already, but putting more here so others can benefit) There's two things in Haraka you have to do to get the email parsed: 1) set `connection.transaction.parse_body = true` in `hook_data` (or one of the earlier hooks, but not before 'MAIL FROM' because

Re: [nodejs] what is the difference between child/callback and fork that is used in Perl

2015-01-12 Thread Matt
On Mon, Jan 12, 2015 at 12:34 PM, Aria Stewart wrote: > The difference is in the separation of the task: a unix process shares > nothing, and returns nothing but a status code That's not true at all of fork though. It shares everything copy-on-write, and so you can communicate with the parent u

Re: [nodejs] Data Model Definition Standard in JavaScript/Node

2015-01-11 Thread Matt
If you do that you probably lose some of the performance enhancements V8 does by converting things internally to classes. On Sat, Jan 10, 2015 at 8:39 PM, Alexander Praetorius wrote: > Many people use *"this"*, *"prototype"* and *"new"*, like: > > >> *module.exports = function Car (name, cost, m

[nodejs] Re: is the debug node binary supposed to work?

2014-12-17 Thread Matt Ginzton
On Tuesday, December 16, 2014 6:42:14 PM UTC-8, Matt Ginzton wrote: > > I could not reproduce this issue. How did you get the source for node >> (GitHub clone and if so which branch/tag did you checkout, source tarball, >> other)? Also, which OS did you use to run node? &

[nodejs] Re: is the debug node binary supposed to work?

2014-12-16 Thread Matt Ginzton
e official nodejs.org binaries are built that way). It doesn't seem to make a difference. thanks Matt -- 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-L

[nodejs] is the debug node binary supposed to work?

2014-12-12 Thread Matt Ginzton
I wonder, does anyone else have experience running the debug node binary and is it known to work better than this? Does the condition that's failing here mean anything to you? Can you repro this, or did I perhaps do something wrong when building node? thanks, Matt [1]: One thing I did learn along

Re: [nodejs] node.js and io.js reconciliation

2014-12-09 Thread Matt
Ravi, I highly recommend you subscribe to nodeweekly - it's a weekly roundup of node news where you'll at least get to hear about this stuff. http://nodeweekly.com/ On Tue, Dec 9, 2014 at 1:57 PM, // ravi wrote: > On Dec 9, 2014, at 1:36 PM, Stephen Belanger > wrote: > > > > The node communit

Re: [nodejs] child_process pause/resume

2014-12-01 Thread Matt
You could send SIGSTOP to the process. This will not work on Windows. But what are your actual requirements here to stop the process? On Mon, Dec 1, 2014 at 10:16 AM, Steffen Schorling < steffen.schorl...@googlemail.com> wrote: > Hallo > is it possible to set a child_process.fork() on "pause" an

Re: [nodejs] Correct Database usage

2014-11-24 Thread Matt
I'm not 100% sure about knex, but by default the node Pg library caches connections, so it's not an issue. Might be worth checking the docs or the source though to make sure it's using that code path. On Mon, Nov 24, 2014 at 11:35 AM, Alex Spencer wrote: > Hey. > > Need some advice on an api app

Re: [nodejs] MEAN.js for a large project?

2014-11-22 Thread Matt
you have to display a google map with any usage of it. That might work for you. We maintain our own mapping of postcode to lat/long for this purpose which has worked pretty well so far. I've yet to find a great cloud service for the queries we needed to be able to do, and postcodes/zips don&#

Re: [nodejs] node module for docx to html

2014-11-18 Thread Matt
I ended up controlling OpenOffice via the node-java module to do this. It worked, used gobs and gobs of memory, and wasn't particularly fast, but hey it worked. Unfortunately I no longer have the code available to me. Matt. On Tue, Nov 18, 2014 at 12:44 AM, Arvind T wrote: > Hi > I

Re: [nodejs] Are there two event loops in node.js? How do they work?

2014-11-17 Thread Matt
The "v8 has its own js event loop" comment is only relevant to the browser. It's not used in Node. The only event loop in Node is the libuv one. On Mon, Nov 17, 2014 at 6:31 AM, Vaibhav Jain wrote: > Hi, > > I have just started learning node.js and I am already confused about how > the event loo

Re: [nodejs] GET Route Spam

2014-11-13 Thread Matt
On Thu, Nov 13, 2014 at 2:37 PM, Alex Spencer wrote: > But if a user hits Refresh (F5) twice instantly for example, I only want > the code to run once. There's not a system on the planet that will make that work the way you want it to. Once they hit refresh they have broken the connection to t

Re: [nodejs] node.js theme

2014-11-13 Thread Matt
You're looking for something like Bootstrap. Though this has nothing to do with Node.js. On Thu, Nov 13, 2014 at 7:45 AM, Bala Kumaran wrote: > I want create web design so i chosse express framework and jade > template.. but not there in any theme. how can i use good theme in my page > or is t

Re: [nodejs] Node.JS vs Erlang

2014-11-12 Thread Matt
osql, in-memory) > Not sure about Erlang, but Node has everything pretty much covered. > - hire skills / price > It's far far FAR easier to find Javascript programmers. Erlang programmers will tell you that when you find an Erlang programmer they are generally a "1

Re: [nodejs] Hosting of Application in Europe

2014-11-07 Thread Matt
We get asked this sort of wide open question a lot on the #node.js IRC channel. Honestly it very much depends on your experience and capabilities. There's a massive range of services to consider, from simple no-devops-required systems like Heroku ranging up to installing your own hardware in datac

Re: [nodejs] privilege separation

2014-11-02 Thread Matt
le idea to implement this kind of thing, it just seems like you may be over-thinking it. It's far more important to get the basics of security right in your application, and most people don't spend nearly enough time on that. Matt. On Sat, Nov 1, 2014 at 2:06 PM, Tim Kuijsten wrote: >

[nodejs] Does 0.11.13 or 0.11.14 come with the POODLE patch?

2014-10-30 Thread Matt Fletcher
Hi, I'm running v0.11.13 on my dev machine, but I was wondering if it will have a security loophole regarding the POODLE vulnerability that 0.10.33 resolved? Would it be recommended to roll back to a stable version? In fact, is there any reason to use the 0.11.* build? Many thanks -- Job bo

Re: [nodejs] Re: Network performance on AIX 7.1 with v0.10.32 seems to be slow

2014-10-29 Thread Matt
Could it be related to the fact that uv will have to use poll() on AIX instead of epoll/kqueue? On Tue, Oct 28, 2014 at 5:18 PM, Michael Dawson wrote: > I'm not aware of known network issues that would explain what you are > seeing. If we can get sample code to recreate we could investigate > f

Re: [nodejs] process._tickCallback and where dispatch happens

2014-10-10 Thread Matt Ginzton
keCallback is not purely limited to node-weak. Thanks again to anyone looking into this -- I am very eager to get to the bottom of it. Matt -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://g

Re: [nodejs] Re: Streaming fs.readdir?

2014-10-10 Thread Matt
On Fri, Oct 10, 2014 at 2:54 AM, Bruno Jouhier wrote: > var ez = require('ez-streams'); > var cp = require('child_process'); > > var reader = ez.devices.child_process.reader(cp.spawn('ls'), { > encoding: "utf8" > }).transform(ez.transforms.lines.parser()) > > // just check that it works > reader.

Re: [nodejs] process._tickCallback and where dispatch happens

2014-10-10 Thread Matt Ginzton
is documented and advertised properly, I as a client of that extension can code around it; I just have to realize that certain entry points into the extension are a yield/redispatch point from the point of view of the calling code, and if I know where those are, I can code around it.) Meanwhile node-

Re: [nodejs] Re: Streaming fs.readdir?

2014-10-09 Thread Matt
On Thu, Oct 9, 2014 at 3:27 PM, Bruno Jouhier wrote: > You may also run into perf problem with the file system itself. How well > does it cope with 1M+ entries per directory? > Answering that depends on the filesystem used. Some struggle. Some are OK. -- Job board: http://jobs.nodejs.org/ New

Re: [nodejs] detect "document.webkitVisibilityState" at server side

2014-10-09 Thread Matt
You can't detect it on the server directly. You'll have to detect it on the client and then send it down to the server somehow. On Thu, Oct 9, 2014 at 5:10 AM, manish sapkal wrote: > How Do I detect "document.webkitVisibilityState" of client on my app.js > on node (server). because If my "Conti

Re: [nodejs] Streaming fs.readdir?

2014-10-09 Thread Matt
The buffer size of a pipe between your process and ls should fill up eventually and ls's calls to write to stdout should eventually block not allowing ls to continue until you've consumed the buffer. At least that's my theory - maybe you aren't applying backpressure right? On Wed, Oct 8, 2014 at

Re: [nodejs] Re: Streaming fs.readdir?

2014-10-08 Thread Matt
Please note that the suggestions to shell out to "ls" are dangerous as "ls" has a bunch of default options (some set by the environment) and will by default try and sort (reading the whole directory into memory). At the minimum you want the "-1 -f" flags set. On Wed, Oct 8, 2014 at 2:08 AM, Hacke

Re: [nodejs] Streaming fs.readdir?

2014-10-08 Thread Matt
You could stream from a child process written in another language. For example you could do 'opendir(DIR,$ARGV[1]); print "$_\n" while $_=readdir(DIR)' as a perl script (with the directory as the first command line argument). On Tue, Oct 7, 2014 at 10:48 PM, Forrest Norvell wrote: > I know there

[nodejs] process._tickCallback and where dispatch happens

2014-10-07 Thread Matt Ginzton
; it should be easy to distinguish between these cases and the one I'm asking about here. Clearly, that line of code quoted above from request/lib/copy.js, "o[i] = obj[i]", should not be triggering a fiber yield, and if it did (say in fancy situations with proxies or getters are

[nodejs] Re: NodeJs e-commerce solution?

2014-09-30 Thread Matt Mischewski
this is built on Meteor https://reactioncommerce.com/ Not pure node but looks promising On Thursday, May 10, 2012 8:55:51 PM UTC+2, guzelgoz wrote: > > Hi all, > > I've been searching and searching but couldn't find any project/open > source node e-commerce platform. As I am running some e-comm

Re: [nodejs] Running node on port 80?

2014-09-27 Thread Matt
To run on port 80 you need to run as root, so it's best to drop privileges after setting up the listening port. You do this with process.setgid and process.setuid. See how Haraka does it here: https://github.com/baudehlo/Haraka/blob/master/server.js#L267 Though I highly recommend running a front e

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Matt
On Tue, Sep 23, 2014 at 5:04 PM, Bruno Jouhier wrote: > So I would not take this blog article as an authoritative source on > exceptions. I don't. But it's a good read on some of the pitfalls exceptions can lead you towards. -- Job board: http://jobs.nodejs.org/ New group rules: https://gist

Re: [nodejs] Can someone help me with basic postgresql question?

2014-09-23 Thread Matt
You're just fundamentally misunderstanding how async code works (a common problem with people new to Node). You're coding as if things are synchronous. You need to do some of the basic ground work first to understand this. Try http://nodebeginner.org/ On Tue, Sep 23, 2014 at 2:16 PM, kurofune wr

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Matt
ide of web > framework code) - and it does handle errors. > http://www.ckwop.me.uk/Why-Exceptions-Suck.html Besides that, not all ruby functions/methods throw exceptions on errors (thankfully - in fact I'd venture to say that most don't), so you have to handle them local

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Matt
, for example. Error handling is very language/environment specific and often an area of huge neglect. One thing Node got right was to always use the "error first" callback approach, that makes things like Streamline and Async.js possible. It's not perfect but all programmin

Re: [nodejs] Node.js Addon Examples with V8 Version 3.22

2014-09-23 Thread Matt
Have you looked into using Nan? https://github.com/rvagg/nan On Tue, Sep 23, 2014 at 3:48 AM, blazs wrote: > Hi, > > I am looking for Node.js C++ Addon examples, written for v0.12 version of > the Node.js --- the one that uses V8 version 3.22. There are major changes > between V8 3.14 and V8 3.2

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Matt
t deal with if statements very well. Maybe streamline does - I've yet to check it out. Another option might be to use Smalltalk-style class based logic, so that you don't even have if-statements. Matt. -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiy

Re: [nodejs] Callback hell and how to get around it?

2014-09-22 Thread Matt
On Sun, Sep 21, 2014 at 10:12 PM, Tom Boutell wrote: > Your "if" needs an else clause to ensure the callback is eventually > invoked. > Yes I know - the original didn't either. I'm assuming because it wasn't the entire actual code, more of an example. -- Job board: http://jobs.nodejs.org/ New

Re: [nodejs] Callback hell and how to get around it?

2014-09-21 Thread Matt
}); }); It's more code, but it improves the error checking. If it didn't have that "if" statement in there it would be a lot simpler - async code doesn't deal well with "if" statements I've found (there's no way to short-circuit). Matt. -- Job boa

Re: [nodejs] Node executable size on building from source vs binary downloaded

2014-09-16 Thread Matt
On Tue, Sep 16, 2014 at 12:00 AM, Phani Kumar wrote: > Is there any performance impact if I use node binary the way I built? > > Doubtful. Possibly the opposite in fact. It's likely better optimised for your system. -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com

Re: [nodejs] Node executable size on building from source vs binary downloaded

2014-09-15 Thread Matt
There can be multiple reasons. The "official" binary could be stripped. There could be a different compiler used. All sorts of reasons. On Mon, Sep 15, 2014 at 3:17 PM, Phani Kumar wrote: > any inputs please? > > On Fri, Sep 5, 2014 at 6:35 PM, Phani Kumar wrote: > >> I have downloaded node 0.1

Re: [nodejs] util core module

2014-09-14 Thread Matt
isBuffer is now Buffer.isBuffer(). On Sat, Sep 13, 2014 at 5:06 PM, Ep Ga wrote: > https://github.com/joyent/node/blob/master/lib/assert.js > > http://nodejs.org/api/util.html > > Why did you take out methods? like isBuffer, and isObject? that make no > sense if the core module rely on them, th

Re: [nodejs] A fair test between bcryptjs and twin-bcrypt

2014-09-11 Thread Matt
Two issues: 1) Why would you expect it to be faster? It's pure JS using asm.js (which Node doesn't support), vs bcrypt is compiled C code. And 2) Being slow is a feature of bcrypt - it makes brute force cracking harder. On Wed, Sep 10, 2014 at 10:54 AM, Adrian Lynch < adrian.ly...@concreteplatform

Re: [nodejs] Re: Crypto and the event loop

2014-09-02 Thread Matt
On Sun, Aug 31, 2014 at 2:28 PM, Sanjeev Koranga wrote: > So if an app is doing lot of crypto, would you advice using child > processes/fibers/webworkers for running crypto functionality? > It shouldn't really be necessary. What APIs are you going to use? -- Job board: http://jobs.nodejs.org/

Re: [nodejs] additional "require" argument for native module

2014-08-29 Thread Matt
module.exports = function (arg) { ... } On Thu, Aug 28, 2014 at 8:28 AM, Pawel Por wrote: > Hi, > > How can I receive additional "require" argument inside a native module. > Assume the following javascript code: > var user = require('./user')(client); > > How can I receive "client" argument in

Re: [nodejs] facing problems with concurrency

2014-08-20 Thread Matt
On Tue, Aug 19, 2014 at 8:43 AM, manjunath wrote: > send requests to 3-5 servers Using the built-in http module? You're probably running up to the Agents limit. http://nodejs.org/api/http.html#http_class_http_agent -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.c

Re: [nodejs] node.js vs python tornado

2014-08-17 Thread Matt
The big difference is that the entire Node.js ecosystem is built around async code. With Tornado if you use a library like an XML parser, which loads in external content via entities or xinclude, those will be loaded synchronously and block your event loop. Similarly for all kinds of other librarie

Re: [nodejs] Fundamentals: Callbacks in Node?

2014-08-11 Thread Matt
I don't know where you heard that, but it's not true of V8 (or I doubt of any modern JS engine). There are plenty of benchmarks out there that can prove this. You can however separate out for basic code hygiene - you get a lot of indentation with nested callbacks. Matt. On Sun, Aug 1

Re: [nodejs] Re: new node module: fd-slicer

2014-08-11 Thread Matt
On Sun, Aug 10, 2014 at 1:49 AM, Andrew Kelley wrote: > Can't you just use a stream multiplexer (AKA "Tee") for this? > > > How does this address the problem in any way? > > You create one read stream, then multiplex it to two writers. Isn't that the p

  1   2   3   4   5   6   >