[nodejs] Re: standard content-type for "streaming JSON" (newline delimited JSON objects)?

2012-05-24 Thread Bruno Jouhier
You could make it JSON compliant by emitting a [ line at the beginning of the stream and a false] line at the end (and adding a comma at the end of each line). The extra value at the end could be interpreted as a "more" indicator. If true it means that this is only a stream fragment and that ano

Re: [nodejs] Tests on travis-ci that need a couchdb connection with full admin rights

2012-05-24 Thread Oliver Leics
First, thanks for the replies. Right now I'm thinking about how Nock works and if Nock can be used to test this: * Create a user and configure its security (rights, wrongs, etc) * Create a database and let only that user read and write to this database (per _security-doc) * Create another user *

[nodejs] getaddrinfo ENOENT error

2012-05-24 Thread thuan le minh
Hi all, when i use http method to connect and get content data of any webpages , there is an error appears : getaddrinfo ENOENT error my code : var qs = require('querystring'); var http = require('http'); var server = http.createServer(function(req, res){ res.writeHead(200, {'content-Type': 't

[nodejs] Node.js cache website

2012-05-24 Thread thuan le minh
hi all, i want to cache a web page to view it offline examle : - the first : i can access the website http://nodejs.org as you see - and then : the web server may be dead so if i try to enter the url http://nodejs.org on my web browser i can'nt access this website . A notification will be appe

Re: [nodejs] Node.js cache website

2012-05-24 Thread Ryan Schmidt
On May 24, 2012, at 03:47, thuan le minh wrote: > i want to cache a web page to view it offline > examle : > - the first : i can access the website http://nodejs.org as you see > > - and then : the web server may be dead so if i try to enter the url > http://nodejs.org on my web browser i can'n

Re: [nodejs] Tests on travis-ci that need a couchdb connection with full admin rights

2012-05-24 Thread Nuno Job
Sounds about right. I cheat though. I use NANO_ENV=testing and just run the tests with nocks off. Then i create my own mocks cause i can ignore most of the headers stuff and even some parts of the body for the sake of tests. The ability to run mocked and un-mocked tests is critical. On pull re

[nodejs] Re: getaddrinfo ENOENT error

2012-05-24 Thread mscdex
On May 24, 4:24 am, thuan le minh wrote: > when i use http method to connect and get content data of any > webpages , there is an error appears : getaddrinfo ENOENT error Sounds like the machine you're using is having a problem trying to resolve that particular address. > my code : >[...]

[nodejs] Re: Node.js cache website

2012-05-24 Thread mscdex
On May 24, 4:47 am, thuan le minh wrote: > i want to cache a web page to view it offline So, you want to just save the webpage itself, or all assets as well (e.g. images, javascript, css, etc)? If you don't need to do this programmatically, why not just use the 'save page' feature of your browse

[nodejs] Re: Node.js cache website

2012-05-24 Thread thuan le minh
my question mean : i want to write a node js webserver program that creates a vitual url on my local computer (exam : http://localhost:) that will replace real url on the internet (http://nodejs.org) . So when i query webserver for vitual url i will have all of assets (images, text file, json f

Re: [nodejs] Re: Node.js cache website

2012-05-24 Thread Micheil Smith
I'm not sure exactly what the requirement here is, but why not just setup a squid proxy between you and the internet, then you have a cache of everything you visit? If it's just for the docs on nodejs.org, then have a look in `doc` in the git repo, then do `make doc` or `make website`, that'll

[nodejs] Check if IP is within range

2012-05-24 Thread Kevin Whitman
Not sure where's the best place is to ask. Does anyone know of a function or module that will check if a IP address is within a IPv4 range, also with IPv6 support. Say it would get a list like var IPV4 = ['204.93.240.0/24', '204.93.177.0/24', etc...]; var IPv6 = ['2400:cb00::/32', 2606:4700::/3

[nodejs] Fatal error

2012-05-24 Thread kapil gopinath
Hi, Please help me in solving this issue which is causing the node file to hang. "FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory". Thanks in advance Regards Kapil -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-

[nodejs] Re: Zero Window error when nodejs as TCP server

2012-05-24 Thread xzYue
Any idea? On 5月24日, 上午11時17分, xzYue wrote: > Hi all, > I created a tcp server using nodejs codes below: > > var net = require('net'); > var server = net.createServer(function(c) { //'connection' listener >   console.log('server connected'); > >   c.on('data', function(data) { >           console.

Re: [nodejs] Fatal error

2012-05-24 Thread Rohit Singh
This happens when the object you are using/manipulating consumes a lot of memory space. I have seen a few instances of this, try sharing the loc, will try to help. On Thu, May 24, 2012 at 11:00 AM, kapil gopinath wrote: > Hi, > > Please help me in solving this issue which is causing the node fil

[nodejs] fs.link() on windows makes a file same as srcFile, I guess it isn't a link file.

2012-05-24 Thread Andrew Goal
fs.link() on windows makes a file same as srcFile, I guess it isn't a link file. But I don't know what is the true hard link file created by CreateHardLinkW() , is it like a shortcut .lnk file created by context menu with mouse right click? How can I recognise a file is a hard link file on window

Re: [nodejs] Check if IP is within range

2012-05-24 Thread Matt
iptrie - is very fast but the documentation is a bit weak. https://github.com/postwait/node-iptrie I'm pretty sure it supports *IPv6* based on the source, even if the docs don't mention it. On Thu, May 24, 2012 at 4:47 AM, Kevin Whitman wrote: > Not sure where's the best place is to ask. Does a

Re: [nodejs] Re: standard content-type for "streaming JSON" (newline delimited JSON objects)?

2012-05-24 Thread Daniel Rinehart
A random idea, haven't thought it through completely, would be to send the response as a multipart message where each part is a valid JSON object. Should be able to stream the MIME parsing and then hand each chunk off to a JSON stream parser. -- Daniel R. [http://danielr.neophi.com/] On Thu, Ma

Re: [nodejs] fs.link() on windows makes a file same as srcFile, I guess it isn't a link file.

2012-05-24 Thread Matt Patenaude
I think you're confusing hard links and soft links (symlinks). A symlink is like a shortcut (and probably is represented as one on Windows). A hard link plays the same role as the original filesystem entry: it exposes an inode as an entry in a directory. A hard link is indistinguishable from a r

[nodejs] Conversion between binary data (Buffers) and strings, revisited as the binary encoding now will go away

2012-05-24 Thread Mattias Ernelli
Ok, after a couple of turns it seems like the support for binary string encoding in Buffer's will go away, still I believe that it can be a better way to represent binary data in JSON instead of base64 in some circumstances, for example when transparently shuffling HTTP entityBodies forward and

[nodejs] Re: fs.link() on windows makes a file same as srcFile, I guess it isn't a link file.

2012-05-24 Thread Oleg Efimov (Sannis)
fs.link() on Windows creates hardlink, fs.symlink() creates junction. you can read about difference in http://msdn.microsoft.com/en-us/library/windows/desktop/aa365006(v=vs.85).aspx четверг, 24 мая 2012 г., 16:58:17 UTC+4 пользователь Andrew Goal написал: > > fs.link() on windows makes a file sa

Re: [nodejs] standard content-type for "streaming JSON" (newline delimited JSON objects)?

2012-05-24 Thread Isaac Schlueter
On Wed, May 23, 2012 at 3:00 PM, Mark Hahn wrote: >>   it seems that the work on the client side to do streaming parsing gets >> much harder > > I don't understand?  Parsing commas is hard?  However you planned on parsing > newlines could parse commas instead. It goes from trivial (because you do

Re: [nodejs] standard content-type for "streaming JSON" (newline delimited JSON objects)?

2012-05-24 Thread Tim Caswell
application/x-json-stream -> JSON messages (without extra whitespace) newline separated. Several streaming json parsers support this already out of the box. They ignore the newlines and know when a json body ends because of the parser state. People who don't have a streaming parser, can search f

Re: [nodejs] standard content-type for "streaming JSON" (newline delimited JSON objects)?

2012-05-24 Thread Nuno Job
>> Several streaming json parsers support this already out of the box. >> They ignore the newlines and know when a json body ends because of the parser state. Pretty much sums it up :) Nuno On Thu, May 24, 2012 at 6:05 PM, Tim Caswell wrote: > application/x-json-stream -> JSON messages (withou

Re: [nodejs] standard content-type for "streaming JSON" (newline delimited JSON objects)?

2012-05-24 Thread Alan Gutierrez
On Thu, May 24, 2012 at 12:05:13PM -0500, Tim Caswell wrote: > On Thu, May 24, 2012 at 11:52 AM, Isaac Schlueter wrote: > > > On Wed, May 23, 2012 at 3:00 PM, Mark Hahn wrote: > > >> it seems that the work on the client side to do streaming parsing gets > > >> much harder > > > > > > I don't und

Re: [nodejs] standard content-type for "streaming JSON" (newline delimited JSON objects)?

2012-05-24 Thread Ken
Using arbitrary x- subtypes is allowed but if this format ever leaves experimental status we'd want to drop the x- and I don't think application/json-stream is ideal, in particular because the only other current use of the word stream in content types is application/octet-streamwhich has no par

[nodejs] Re: OOP in node.js

2012-05-24 Thread Shogun
You should look at Joose , great class system. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group.

[nodejs] Re: standard content-type for "streaming JSON" (newline delimited JSON objects)?

2012-05-24 Thread mscdex
On May 24, 4:42 pm, Ken wrote: >    - application/json; boundary=NL >       - one or more JSON objects delimited by newlines (no newlines allowed >       in object) >    - application/json; boundary=CRNL >       - one or more JSON objects delimited by carriage return/newline pairs >       (newline

[nodejs] Function.toString() and canonicalizing Javascript snippets at runtime

2012-05-24 Thread Ken
For a project I'm working on I need to record what version of an algorithm was used to generate some pseudo-random data for an indefinitely long time. I don't need to preserve the exact algorithm, but I do need to know if it has changed. For the seeds/initialization vectors/lookup data I'm re

[nodejs] nd: a documentation viewer for node

2012-05-24 Thread Russ Frank
Hi, I wrote this small tool to make it easer to read documentation for node modules in a terminal window: https://github.com/russfrank/nd It respects the module's package.json.directories.doc field, but will fall back to just looking for a readme.md. It displays markdown pages using a modifi

Re: [nodejs] nd: a documentation viewer for node

2012-05-24 Thread Nuno Job
THIS IS AWESOME npm install -g nd jsontool cdir Is a must if you use node. Here's why: http://codestre.am/34d0a6ae7872687b1ded83945 Nuno On Thu, May 24, 2012 at 10:31 PM, Russ Frank wrote: > Hi, > > I wrote this small tool to make it easer to read documentation for node > modules in a termin

Re: [nodejs] nd: a documentation viewer for node

2012-05-24 Thread Joshua Holbrook
/r/ fallback to globally-installed modules :) Besides that, I dig it a lot. --Josh On Thu, May 24, 2012 at 3:29 PM, Nuno Job wrote: > THIS IS AWESOME > > npm install -g nd jsontool cdir > > Is a must if you use node. Here's why: > > http://codestre.am/34d0a6ae7872687b1ded83945 > > Nuno > > > On

[nodejs] Re: Function.toString() and canonicalizing Javascript snippets at runtime

2012-05-24 Thread Jimb Esser
UglifyJS has multiple parts - an AST parser and a minifier/beautifier, if you just use the AST parser, I would expect that to be pretty stable over time, although if you also use the minifier you'd be safe against things like variables being renamed, but be more susceptible to other randomness or c

[nodejs] Re: fs.link() on windows makes a file same as srcFile, I guess it isn't a link file.

2012-05-24 Thread Bert Belder
On May 24, 4:26 pm, "Oleg Efimov (Sannis)" wrote: > fs.link() on Windows creates hardlink, fs.symlink() creates junction. you > can read about difference > inhttp://msdn.microsoft.com/en-us/library/windows/desktop/aa365006(v=vs... fs.symlink() actually create symlinks on windows (although this i

[nodejs] Re: Zero Window error when nodejs as TCP server

2012-05-24 Thread xzYue
No one meet this kind of problems? xzYue On 5月24日, 下午8時03分, xzYue wrote: > Any idea? > > On 5月24日, 上午11時17分, xzYue wrote: > > > Hi all, > > I created a tcp server using nodejs codes below: > > > var net = require('net'); > > var server = net.createServer(function(c) { //'connection' listener > >

Re: [nodejs] Re: Zero Window error when nodejs as TCP server

2012-05-24 Thread Joshua Holbrook
What is `buffer`? What is `parsePacket`? --Josh On Thu, May 24, 2012 at 5:38 PM, xzYue wrote: > No one meet this kind of problems? > xzYue > > On 5月24日, 下午8時03分, xzYue wrote: >> Any idea? >> >> On 5月24日, 上午11時17分, xzYue wrote: >> >> > Hi all, >> > I created a tcp server using nodejs codes belo

[nodejs] Re: Check if IP is within range

2012-05-24 Thread Kevin Whitman
Over the past few hours I've hacked up a solution. https://github.com/keverw/range_check -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "node

Re: [nodejs] nd: a documentation viewer for node

2012-05-24 Thread Russ Frank
I just published version 0.0.9 to npm, which will fall back to globally installed modules. On Thursday, May 24, 2012 6:35:54 PM UTC-4, jesusabdullah wrote: > > /r/ fallback to globally-installed modules :) > > Besides that, I dig it a lot. > > --Josh > > On Thu, May 24, 2012 at 3:29 PM, Nuno J

[nodejs] Re: Zero Window error when nodejs as TCP server

2012-05-24 Thread xzYue
Thanks Josh! var buffer = ""; function parsePacket(buff) { //parse packet from buff. //return rest-buff; } var net = require('net'); var server = net.createServer(function(c) { //'connection' listener console.log('server connected'); c.on('data', function(data) { console.log("raw

[nodejs] [ANN] MeshCraft: Collaborative Concept Map Editor

2012-05-24 Thread Axel Kittenberger
With MeshCraft you can organize your concept maps (and notes, presentations, texts, etc.) in a mesh using your browser. GitHub source: https://github.com/axkibe/meshcraft Live site: http://meshcraft.net/ Current release: Version 0.2 It's causal consistency / action transformation engine (