[nodejs] Re: Erratic behavior of readable event in ReadStreams

2013-09-12 Thread greelgorke
Isaac answered you in your other thread with that: The 'end' event doesn't happen until you read PAST the last chunk. If there's no data in the buffer, then that read() returns null, and then 'end' is emitted. your last question is simple to answer. a 'readable' event appears, your

Re: [nodejs] Re: NodeJs e-commerce solution?

2013-09-12 Thread klrumpf
if you do go sql because of the ACID issues there's also non blocking MariaDB https://npmjs.org/package/mariasql for node and see https://mariadb.com/blog/mariadb-non-blocking-client-api-and-nodejs Karl-L. Rumpf klru...@gmail.com Mlaga,

Re: [nodejs] Because curiosity wins, nodejs embedded into PHP?

2013-09-12 Thread Ryan Schmidt
On Sep 10, 2013, at 18:05, Ingwie Phoenix wrote: However, I am very curios in how an embedment of nodejs into PHP owuld look like. You'll have to tell us. What are you expecting such a thing to do, that nodejs and php on their own don't already do today? -- -- Job Board:

Re: [nodejs] Because curiosity wins, nodejs embedded into PHP?

2013-09-12 Thread Kevin Ingwersen
I would personaly like to be able to launch a node module from PHP (appjs in my case) and modify some callbacks. I currently have to go a rather complicated router all around to get this managed. x-x So it would be great to simplfy the co-operation of the two and embed nodejs into PHP (since

Re: [nodejs] Re: NodeJs e-commerce solution?

2013-09-12 Thread Adam Reynolds
Lol SQL is boring Think you're doing it wrong :) On Thu, Sep 12, 2013 at 11:04 AM, klrumpf klru...@gmail.com wrote: if you do go sql because of the ACID issues there's also non blocking MariaDB https://npmjs.org/package/mariasql for node and see

Re: [nodejs] Because curiosity wins, nodejs embedded into PHP?

2013-09-12 Thread Ryan Schmidt
I'm not familiar with appjs but its github page describes it as an SDK on top of nodejs to build desktop apps using HTML5/CSS/JS. As such, I don't see what it has to do with PHP at all. PHP is PHP. node is node. They're both used for making web sites, or more generally, for making software,

Re: [nodejs] Because curiosity wins, nodejs embedded into PHP?

2013-09-12 Thread Kevin Ingwersen
Well I was simply curios, that is why i put it into the tile. It is written ontop of nodejs, but has CEF in its back (Chromium Embedded Framework). Sadly, I dont know how I could establish connections between CEF and PHP myself, but I have found projects such as V8js that embed the v8 engine

Re: [nodejs] Re: NodeJs e-commerce solution?

2013-09-12 Thread Alexey Petrushin
Customers doesn't care if there's MongoDB, CouchDB, MySQL inside this e-commerce stuff. Also, as soon as the goal is to build widely used open source e-commerce - it won't be a huge million user a day site (nobody uses simple open source shops at such scale), it will be a small, simple and

Re: [nodejs] Re: NodeJs e-commerce solution?

2013-09-12 Thread Adam Reynolds
The customer will care when the last item in stock is sold twice. You are right, in the initial work, it's all about the pretty stuff, but the backend implementation should be scalable as the customer grows. The last thing a customer wants to hear is that the solution works as long as you don't

Re: [nodejs] Re: NodeJs e-commerce solution?

2013-09-12 Thread klrumpf
no node expert by a long shot but I concur totally, am developing international logistics solutions for others and also running them in my own businesses since the 90ties and you've *got to play it safe* in this area or (apart from your MD, CEO or whatnot) the

[nodejs] Re: using twitter-bootsrap modules examples with node

2013-09-12 Thread greelgorke
you are using node and it's http server. it is your responsibility to parse the paths and deliver the right file. you might have a look on expressjs framework, which is a web framework. there also several module on npm for serving static files. Am Donnerstag, 12. September 2013 03:43:53 UTC+2

Re: [nodejs] Because curiosity wins, nodejs embedded into PHP?

2013-09-12 Thread Peter Rust
The kind of integration you're talking about would take quite a bit of low-level C/C++ work and I don't think anyone has done it. You would probably be better off finding an alternative to AppJS that supports PHP, like TideSDK (previously Titanium Desktop): http://www.tidesdk.org/. There are

Re: [nodejs] Re: NodeJs e-commerce solution?

2013-09-12 Thread jed
I generally agree with Adam too, it's really important to have the right foundation in place or you (or someone else using the project) will regret it later. I asked about whether it would be possible to implement a robust solution in mongo db because I've been working on an open source

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread Mark Hahn
Node is usually an http server like any other. It returns whatever response you want. The contents of a file containing Hello world HTML text is a good example. On Thu, Sep 12, 2013 at 9:01 AM, Reza Razavipour reza.razavip...@gmail.comwrote: I am not understanding the data flow from the

[nodejs] Problems passing results of a func. to module.exports

2013-09-12 Thread akira
I am trying to retrive data from a MongoDB collection and pass it as an extended object to module exports for scaffoling purposes. The code below does not work, can anyone tell me why? //Mongoose model var Profile = require('./../../models/profile'); Profile.findOne({'username': 'test'},

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread Reza Razavipour
I want it to return helloworld.html, the filename itself. Can it do that? On Thursday, September 12, 2013 9:34:15 AM UTC-7, Mark Hahn wrote: Node is usually an http server like any other. It returns whatever response you want. The contents of a file containing Hello world HTML text is

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread Mark Hahn
change `res.end('Hello World\n'` to fs.readFile( yourFilePath, 'utf8', function(err, data) { res.end(data); } ); You need to study up on node programming. If you don't know how to do this you are going to have a hard time doing anything else in node. On Thu, Sep 12, 2013 at 11:15 AM,

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread Reza Razavipour
thank you for your reply. At this point I am trying to validate my assumptions and my understanding of the big picture and data flow. On Thursday, September 12, 2013 11:21:23 AM UTC-7, Mark Hahn wrote: change `res.end('Hello World\n'` to fs.readFile( yourFilePath, 'utf8', function(err,

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread Mark Hahn
correction: Change it to `res.end(MyFileName + '\n');` where MyFileName contains the name of the file you want. BTW, I have no idea why you want to return a file name. You will just see that name on your browser page. On Thu, Sep 12, 2013 at 11:01 AM, Mark Hahn m...@reevuit.com wrote: Just

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread Reza Razavipour
I want the browser to display the content of the HTML page and not the name. On Thursday, September 12, 2013 11:03:40 AM UTC-7, Mark Hahn wrote: correction: Change it to `res.end(MyFileName + '\n');` where MyFileName contains the name of the file you want. BTW, I have no idea why you

Re: [nodejs] Problems passing results of a func. to module.exports

2013-09-12 Thread akira
All I want to do is create fixtures for my application doing: 1. Retrive an profile from a mongo db collection 2. Create a new empty object object and fill it with some data from the above profile 3. export the object, in this case a Message The module that needs a Message instance is a

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread Jerome Hwang
IMO, if you don't know much about web app, you could start by learning a little of how it wroks for PHP, since PHP is built for web programming so it'll be a lot easier to understand how web app works. Node.js can do a lot more things that's not just web app. (Experts please correct me if I'm

[nodejs] Re: using twitter-bootsrap modules examples with node

2013-09-12 Thread Tony M
On Thursday, September 12, 2013 5:29:11 AM UTC-7, greelgorke wrote: you are using node and it's http server. it is your responsibility to parse the paths and deliver the right file. OK thanks will look into it. Trying to get a sense of the type of project that would benefit from node.js

Re: [nodejs] Problems passing results of a func. to module.exports

2013-09-12 Thread // ravi
On Sep 12, 2013, at 1:27 PM, akira nhy...@gmail.com wrote: I am trying to retrive data from a MongoDB collection and pass it as an extended object to module exports for scaffoling purposes. The code below does not work, can anyone tell me why? //Mongoose model var Profile =

Re: [nodejs] Re: using twitter-bootsrap modules examples with node

2013-09-12 Thread Angel Java Lopez
A simple express/node.js example serving Bootstrap https://github.com/ajlopez/ExpressSamples/tree/master/MyBootstrap On Thu, Sep 12, 2013 at 5:41 PM, Tony M tony.v.mulli...@gmail.com wrote: On Thursday, September 12, 2013 5:29:11 AM UTC-7, greelgorke wrote: you are using node and it's http

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread Mark Hahn
app.get must be from some framework. It is not a part of node. On Thu, Sep 12, 2013 at 1:29 PM, Jerome Hwang jhwan...@gmail.com wrote: IMO, if you don't know much about web app, you could start by learning a little of how it wroks for PHP, since PHP is built for web programming so it'll be

Re: [nodejs] Problems passing results of a func. to module.exports

2013-09-12 Thread Forrest L Norvell
On Thu, Sep 12, 2013 at 12:44 PM, akira nhy...@gmail.com wrote: All I want to do is create fixtures for my application doing: 1. Retrive an profile from a mongo db collection 2. Create a new empty object object and fill it with some data from the above profile 3. export the object, in this

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread Jerome Hwang
Sorry.. I used Express too much these days app.get is from Express (http://expressjs.com/) which is the most used web framework for Node On Thu, Sep 12, 2013 at 4:52 PM, Mark Hahn m...@reevuit.com wrote: app.get must be from some framework. It is not a part of node. On Thu, Sep 12,

[nodejs] Re: Forget your promises... adopt the yielded style programming

2013-09-12 Thread Michaël Rouges
New version (1.1.9) released. ;) Le mardi 13 août 2013 03:41:37 UTC+2, Michaël Rouges a écrit : Hi all, I created a new tool browsers/Node.js compatible. It can handle asynchronous calls as if they weren't, and can create relationships between your various scopes.

Re: [nodejs] Re: Forget your promises... adopt the yielded style programming

2013-09-12 Thread Norman Paniagua
can you provide release notes? regards -- Norman Paniagua Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, September 12, 2013 at 6:32 PM, Michaël Rouges wrote: New version (1.1.9) released. ;) Le mardi 13 août 2013 03:41:37 UTC+2, Michaël Rouges a écrit :

Re: [nodejs] Because curiosity wins, nodejs embedded into PHP?

2013-09-12 Thread Kevin Ingwersen
Well, when I start the app bundle, it calls the nodejs script. When in this particular place I am inserting a redirection, like file.log, then the following node-process is displayed as a seperate instance of the application. The logging and all works, but i get two icons in the switcher and an

Re: [nodejs] Because curiosity wins, nodejs embedded into PHP?

2013-09-12 Thread Ryan Schmidt
On Sep 12, 2013, at 05:51, Kevin Ingwersen wrote: They are different and I kinda got to like both, but Mac is a little not nice when spawning multiple processes from within an app-bundle. In fact, it thinks there are two instances of the same app and goes nuts entirely. You're obviously

Re: [nodejs] Re: Forget your promises... adopt the yielded style programming

2013-09-12 Thread Michaël Rouges
Hi Norman, Thanks for your interest. This version includes some internal improvements changing nothing in its operation. There's one significant change: in order to avoid recursion problems, the asynchronous execution privileges setImmediate(), then process.nextTick(), then setTimeout()...

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread Ryan Schmidt
On Sep 12, 2013, at 15:29, Jerome Hwang wrote: IMO, if you don't know much about web app, you could start by learning a little of how it wroks for PHP, since PHP is built for web programming so it'll be a lot easier to understand how web app works. If you are interested in learning node I

[nodejs] node.js and front end JS code

2013-09-12 Thread Reza Razavipour
I am not understanding the data flow from the client side JS and back end node.js code. So I am developing a web app, my first one ever :) Here is how I am envisioning it, the client is browser based, one URL only... I have a node script that is my web server, index.js, starts listening on

Re: [nodejs] Re: NodeJs e-commerce solution?

2013-09-12 Thread Lucas Schmidt
I should explain myself :D When I say developing in SQL is boring, I should state that I meant that developing in SQL with Node-js is basically pointless when you need to use all the goodies of ACID. You should just use another language that can give you that. But, part of me just wants to

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread Mark Hahn
Just use the http server example on the node front page and change `res.end('Hello World\n'` to `res.end('MyFileName\n');` -- -- 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

Re: [nodejs] Re: NodeJs e-commerce solution?

2013-09-12 Thread Jose Luis Rivas
On 09/12/2013 06:42 AM, Adam Reynolds wrote: The customer will care when the last item in stock is sold twice. You are right, in the initial work, it's all about the pretty stuff, but the backend implementation should be scalable as the customer grows. The last thing a customer wants to

Re: [nodejs] Problems passing results of a func. to module.exports

2013-09-12 Thread Forrest L Norvell
Module evaluation is synchronous, so if you have other modules requiring this module, the export won't have happened until a while after loading completes. Try exporting the function that fetches the object and having it take a callback that will be passed the object retrieved from MongoDB when

Re: [nodejs] node.js and front end JS code

2013-09-12 Thread mscdex
On Thursday, September 12, 2013 2:21:23 PM UTC-4, Mark Hahn wrote: change `res.end('Hello World\n'` to fs.readFile( yourFilePath, 'utf8', function(err, data) { res.end(data); } ); Or better yet: fs.createReadStream(filePath).pipe(res); -- -- Job Board: http://jobs.nodejs.org/

Re: [nodejs] Re: NodeJs e-commerce solution?

2013-09-12 Thread Mark Hahn
to not use SQL in an e-commerce application, it would be stupid Huh? I don't understand. What is your logic? On Thu, Sep 12, 2013 at 5:21 PM, Lucas Schmidt lucastschm...@gmail.comwrote: I should explain myself :D When I say developing in SQL is boring, I should state that I meant that