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

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

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

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

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

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

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,

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,

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

Re: [nodejs] node-mail + haraka

2016-11-30 Thread Matt
is what a webmail talks to (mostly). Matt. On Thu, Nov 17, 2016 at 8:18 PM, Егор Ильин <iiline...@gmail.com> 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 develop

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

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

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

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写道: >

Re: [nodejs] Using UTF-8-Validate

2016-04-25 Thread Matt
id = require('utf-8-validate').isValidUTF8; > const buf1 = new Buffer('buffer'); > > console.log(buf1.toString()); > > if (isValid(buf1)){ > console.log('true') > > } > else { > console.log('false') > > }; > > > On Thursday, April 21, 2016 at 9:46:24 PM UTC-

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 >

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: >

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)

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

Re: [nodejs] Question on Payment Gateways

2016-03-23 Thread Matt
tform 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 <hel...@gmail.com> wrote: > > One is a wrapper which allow

Re: [nodejs] A few newbie questions on Nodejs

2016-03-23 Thread Matt
n 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 would you do that if you want to serve thousands of clients? I think that pretty much answers the rest of your question, so I didn't add further ans

Re: [nodejs] Question on Payment Gateways

2016-03-22 Thread Matt
com> wrote: > Matt: > > Here is a copy of the URL link that refers to the Node.js SDK for > Authorize.net payment gateway.The URL link is available at > https://github.com/ltc-hotspot/Node-for-Authorize-net > > The bottom page refers to Gateway API(s). > > Questio

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,

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

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

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

2015-10-23 Thread Matt
://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 <prabhuvk...@gmail.com> 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 >

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

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 >

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 are

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 s...@strongloop.com wrote: On Sun, Jul 5, 2015 at 7:53 PM, Matt hel...@gmail.com wrote: On Sun, Jul 5, 2015 at 6:12 PM, Sam Roberts s...@strongloop.com wrote: On Mon, Jun 29, 2015 at 10:37 AM, Matt hel

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 s...@strongloop.com wrote: On Mon, Jun 29, 2015 at 10:37 AM, Matt hel...@gmail.com 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 ofirat...@gmail.com wrote: The server is waiting for request, for each request I am take a video input ( it can be RTSP input, video

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 thelinuxl...@gmail.com wrote:

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

Re: [nodejs] Asynchronous Control Flow

2015-05-16 Thread Matt
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://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google

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 n...@claremontinteractive.com - his name is Neal Pollock. On Tue, Apr 28, 2015 at 6:41 PM, Far M farid.mobas...@gmail.com wrote: Hello everyone, Does anyone know of a reputable

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 aryaksengu...@gmail.com wrote: I have already filed it as an issue under NPM.

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

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 spabr...@gmail.com 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

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

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 axk...@gmail.com 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

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

2015-03-02 Thread Matt
to get a feel for the entire app. Matt. On Sun, Mar 1, 2015 at 4:27 AM, Alexey Petrushin alexey.petrus...@gmail.com 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/ruby-on-rails-vs-nodejs 3782

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 jeeva...@gmail.com wrote: I am trying to do a multipart post request from my

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 use

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 paulme...@gmail.com wrote: At http://nodejs.org/documentation/ it says Here on nodejs.org you will find three types of documentation, reference documentation, getting started

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] 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] 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 nicholas.j.san...@gmail.com wrote: Hi, Is there a formal end-of-life/support policy on old

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 evoo...@gmail.com wrote: I need to call a function synchronously which trigger the event loop

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] 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 d...@serapath.de wrote: Many people use *this*, *prototype* and *new*, like: *module.exports = function Car (name,

[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? I cloned the github repo

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

2014-12-16 Thread Matt Ginzton
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-List-Posting-Guidelines --- You received

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

2014-12-12 Thread Matt Ginzton
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 the way while playing with building

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 ravi-li...@g8o.net wrote: On Dec 9, 2014, at 1:36 PM, Stephen Belanger

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 and

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 alex85...@gmail.com wrote: Hey. Need some

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

2014-11-22 Thread Matt
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't change that often. Matt

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 dnivr...@gmail.com wrote

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 vaibhav.jain...@gmail.com wrote: Hi, I have just started learning node.js and I am already confused

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 bala.agni...@gmail.com 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

Re: [nodejs] GET Route Spam

2014-11-13 Thread Matt
On Thu, Nov 13, 2014 at 2:37 PM, Alex Spencer alex85...@gmail.com 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

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

Re: [nodejs] privilege separation

2014-11-02 Thread Matt
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 i...@netsend.nl wrote: Can anyone confirm

[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

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 michael_daw...@ca.ibm.com wrote: I'm not aware of known network issues that would explain what you are seeing. If we can get sample code to recreate

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

2014-10-10 Thread Matt Ginzton
dangerous, because not only can it cause preemption for those same reasons, but you can't document any specific entry points or surface area that can cause that preemption: that surface area is GC, which can happen at any time. thanks, Matt -- Job board: http://jobs.nodejs.org/ New group rules

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

2014-10-10 Thread Matt
On Fri, Oct 10, 2014 at 2:54 AM, Bruno Jouhier bjouh...@gmail.com 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

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

2014-10-10 Thread Matt Ginzton
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://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google

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] 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 sapkal.man...@gmail.com wrote: How Do I detect document.webkitVisibilityState of client on my app.js on node (server).

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

2014-10-09 Thread Matt
On Thu, Oct 9, 2014 at 3:27 PM, Bruno Jouhier bjouh...@gmail.com 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:

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 othiy...@gmail.com

[nodejs] process._tickCallback and where dispatch happens

2014-10-07 Thread Matt Ginzton
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 involved), that should not manifest as a call to _tickCallback. thanks, Matt [1]: https://github.com/laverdet/node-fibers -- Job board: http

[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-commerce

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

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

2014-09-23 Thread Matt
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/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki

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 blaz.sov...@gmail.com 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

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

2014-09-23 Thread Matt
approach, that makes things like Streamline and Async.js possible. It's not perfect but all programming is trade-offs. Matt. [1] Whoever was arguing that Ruby and/or Rails has equal performance obviously has never ported a large project from Rails - I have and the performance difference is staggering

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

2014-09-23 Thread Matt
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 locally/manually anyway, same as you do in Node. Matt. -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file

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

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 bjouh...@gmail.com 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

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 t...@punkave.com 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:

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

2014-09-21 Thread Matt
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 board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules

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 phan...@gmail.com 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:

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 phan...@gmail.com wrote: any inputs please? On Fri, Sep 5, 2014 at 6:35 PM, Phani Kumar phan...@gmail.com wrote:

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 epg...@gmail.com 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

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

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

2014-09-02 Thread Matt
On Sun, Aug 31, 2014 at 2:28 PM, Sanjeev Koranga sanjeev.kora...@gmail.com 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:

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

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

2014-08-11 Thread Matt
? 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-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups

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 10, 2014

Re: [nodejs] Parse an SQL query into a JavaScript object

2014-07-15 Thread Matt
You'll need to write a parser. There are tools to help, e.g. http://pegjs.majda.cz/documentation On Tue, Jul 15, 2014 at 1:25 PM, João Rodrigues joaorod...@gmail.com wrote: I want to create a parser, possibly recursive to use in my GIS application that work on top of OpenLayers 2. I have a

Re: [nodejs] what happened to node.js ?

2014-07-10 Thread Matt
Just scroll down on that same page and it becomes obvious what happened. On Thu, Jul 10, 2014 at 3:00 AM, 庆鸿 盛 who...@gmail.com wrote: https://lh4.googleusercontent.com/-cPNWb-3ZBsk/U744dfj0l-I/ABc/yyy8c5u59j4/s1600/20140710140322.jpg -- Job board: http://jobs.nodejs.org/ New

Re: [nodejs] Re: node.js API documentation clean up

2014-06-25 Thread Matt
for fs.stat() to get the size of a file. But I don't think Joyent/Node core needs to provide tutorials. There are plenty of those, and books too. 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] Re: node.js API documentation clean up

2014-06-24 Thread Matt
On Mon, Jun 23, 2014 at 2:25 PM, mscdex msc...@gmail.com wrote: The module methods and events aren't alphabetical, just the main module index. I'm not sure there is any specific order to the module methods/events currently except in a few cases where similar methods are grouped together (e.g.

Re: [nodejs] Before I write yet another blogging engine.....

2014-06-24 Thread Matt
On Mon, Jun 23, 2014 at 5:31 PM, Prajwal Manjunath prajwalk...@gmail.com wrote: True. Ghost looks nice, but it's development is too slow and monolithic. They only recently managed to add support for tag links, something that you wouldn't expect a blogging engine to launch without (and

Re: [nodejs] Deployment techniques

2014-06-24 Thread Matt
For zero downtime I use a hand-crafted cluster based restarter. It's very much like recluster (on npm) though, so I recommend using that instead. Basic process is install the new code, give the process SIGUSR2, and it reaps the children one by one and restarts them (using cluster's disconnect()

Re: [nodejs] Deployment techniques

2014-06-24 Thread Matt
straight from Git), which creates a LAST_GIT_HASH environment variable, which we provide via an API in the app. If we want to roll back we have to git revert, which may not be the best solution, but it works. Matt. -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com

  1   2   3   4   5   6   >