Re: [nodejs] Anonymous Function Return Value

2013-12-28 Thread Matthew Hazlett
I had this idea as well, to make an overloaded function of sorts and call it again after the results are in. But this wouldn't really help me, as the goal is to sent the output to the caller of the function that executed the process not to the.function that actually executed the process. -

Re: [nodejs] Anonymous Function Return Value

2013-12-28 Thread Matthew Hazlett
I found this, looks promising: https://github.com/jeremyfa/node-exec-sync I had an idea how I can do it with flat files, but I'm going to look at this first.l -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You

Re: [nodejs] Anonymous Function Return Value

2013-12-28 Thread Matthew Hazlett
I want to share my idea for an execSync tailored to this issue. The commands it execs usually are less then 1 second long (run time). Doing it this way, I think I will be able to get the

[nodejs] fs.read

2012-04-01 Thread Matthew Hazlett
This throws an error unexpected end of file. fs.readFile(__dirname + '/' + filename, function (err, data) { if (err) throw err; console.log(data); }); This is a oneline file created by: fs.writeFile(__dirname + '/' + filename, JSON.stringif

Re: [nodejs] fs.read

2012-04-01 Thread Matthew Hazlett
I have traced the error to the JSON statement. when I return JSON.parse(data) ; it blows up with an unexpected end of file. When I console.log(JSON.parse(data)); it works fine. I'm confused! Matthew Hazlett <mailto:hazl...@gmail.com> Sunday, April 01, 2012 4:25 PM This thro

Re: [nodejs] fs.read

2012-04-01 Thread Matthew Hazlett
It already is a string. I just don't get it :-( -- 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. To post to this group, send emai

Re: [nodejs] Re: fs.read

2012-04-01 Thread Matthew Hazlett
:17 PM I don't see a callback on your `writeFile`. are you sure there's no race condition? On Sunday, April 1, 2012 1:25:29 PM UTC-7, Matthew Hazlett wrote: -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines Y

Re: [nodejs] fs.read

2012-04-01 Thread Matthew Hazlett
from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en Matthew Hazlett <mailto:hazl...@gmail.com> Sunday, April 01, 2012 6:14 PM It already is a string. I just don't get it :-( Marak Squires &

Re: [nodejs] fs.read

2012-04-01 Thread Matthew Hazlett
Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en Matthew Hazlett <mailto:

Re: [nodejs] fs.read

2012-04-01 Thread Matthew Hazlett
Thanks, that works! -- 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. To post to this group, send email to nodejs@googlegroups.co

Re: [nodejs] question regarding googletalk: Node.js: JavaScript on the Server

2012-04-05 Thread Matthew Hazlett
/etc/passwd is a unix file. does not exist on windows On 4/5/2012 12:54 AM, reinvent wrote: Hi Guys im trying to run this example from Ryan Dahl's talk: http://www.youtube.com/watch?v=F6k8lTrAE2g im on windows7 node.js version v0.6.13 var stat = require('fs').stat; stat('etc/passwd'

Re: [nodejs] Modest proposal to make async optional in Node.js

2012-04-05 Thread Matthew Hazlett
It's easy to write JS in async, node gives you "event". Here's an example. http://www.pastebucket.com/1981 On 4/1/2012 10:20 PM, Olivier Lalonde wrote: I'm sorry if this has been discussed before, but I couldn't find anything. This a modest proposal to introduce sync APIs in Node.js A lot of

[nodejs] How to avoid callback hell?

2012-04-08 Thread Matthew Hazlett
I'm trying to write a simple app that preforms a db query when a user connects to a tcp port. I can get the query working if I do everything as callbacks: db.open(... fn() { db.collection( fn() { db.query(.. fn() { }); }); }); But as

Re: [nodejs] Re: How to avoid callback hell?

2012-04-08 Thread Matthew Hazlett
Thats how I originally did it, but when you need to do multiple queries to the database you shoud open the connection once and reuse it instead of opening it multiple times a session. On 4/8/2012 9:14 PM, Matt Patenaude wrote: I agree, it seems entirely manageable. One low-overhead option wo

Re: [nodejs] Re: How to avoid callback hell?

2012-04-08 Thread Matthew Hazlett
(... fn() { db.query(query, callback); }); }); } Voila! Connection reuse. :) -Matt On Apr 8, 2012, at 9:17 PM, Matthew Hazlett wrote: Thats how I originally did it, but when you need to do multiple queries to the database you shoud open the connection once and reuse it

Re: [nodejs] Re: How to avoid callback hell?

2012-04-08 Thread Matthew Hazlett
new connection when needed. Sent from an iPhone. On Apr 8, 2012, at 6:17 PM, Matthew Hazlett <mailto:hazl...@gmail.com>> wrote: Thats how I originally did it, but when you need to do multiple queries to the database you shoud open the connection once and reuse it instead of opening it mu

Re: [nodejs] Re: How to avoid callback hell?

2012-04-08 Thread Matthew Hazlett
x27;s flexible enough to let you define the ways you use asynchronous functions. On Sunday, April 8, 2012 5:42:14 PM UTC-7, Matthew Hazlett wrote: I'm trying to write a simple app that preforms a db query when a user connects to a tcp port. I can get the query working i

[nodejs] Free Little Utility

2012-04-09 Thread Matthew Hazlett
I created a simple node app that recursively deletes unwanted files: https://github.com/hazlema/Sweep-NodeJS Thought it might be of some use to others out there so I posted it on Git. Cheers -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-

Re: [nodejs] Re: How to avoid callback hell?

2012-04-09 Thread Matthew Hazlett
Thanks everyone for your input on this matter. I will say that, I opted not to use any sort of Async library, but instead opted to build my application the way the framework was designed. Thanks again. Matthew -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joye

Re: [nodejs] Free Little Utility

2012-04-10 Thread Matthew Hazlett
aside, you should just add bak,tmp,temp,save to your global gitignore. On Tue, Apr 10, 2012 at 12:46 AM, Matthew Hazlett <mailto:hazl...@gmail.com>> wrote: I created a simple node app that recursively deletes unwanted files: https://github.com/hazlema/Sweep-NodeJS Thought

Re: [nodejs] Free Little Utility

2012-04-10 Thread Matthew Hazlett
eader comment, the project "Deletes the crap outta your directories before you post to git." File system cleanliness aside, you should just add bak,tmp,temp,save to your global gitignore. On Tue, Apr 10, 2012 at 12:46 AM, Matthew Hazlett wrote: I created a simple node app that recu

Re: [nodejs] HTML to PDF

2012-04-10 Thread Matthew Hazlett
Pricey, should be possible to build a rendering engine using webkit or something to output to a image. Then insert the image in a PDF. On 4/10/2012 10:24 AM, Kenneth Shaw wrote: PrinceXML (http://www.princexml.com/) is a really nice tool that I've used in the past to generate things such a

Re: [nodejs] Free Little Utility

2012-04-10 Thread Matthew Hazlett
I'll look up how to do that, I'm still new to node. On 4/10/2012 1:11 PM, Isaac Schlueter wrote: Seems like it'd be nice to have a package.json in there, and publish it to npm. On Tue, Apr 10, 2012 at 06:24, Matthew Hazlett wrote: Ohh, quite right. I will fix that, thanks!

Re: [nodejs] mobile web ui with node

2012-04-16 Thread Matthew Hazlett
Jo http://joapp.com/ DHTMLX Touch http://dhtmlx.com/touch/?mn Haven't used these for a project, your mileage may vary On 4/16/2012 9:28 AM, john.tiger wrote: we've tried using JQuery Mobile but it's way too buggy (and note all the unanswered posts on the forum which is not a good sign) Sen

Re: [nodejs] Re: How to avoid callback hell?

2012-04-16 Thread Matthew Hazlett
As the starter of this thread that sums it all up for me. Just look at how long this thread is with people waring back and forth it's really silly. I have basically given up and found this list to be of no help with my question. With so many different approaches, I have no idea what one to u

Re: [nodejs] Re: How to avoid callback hell?

2012-04-17 Thread Matthew Hazlett
love the analogy On 4/17/2012 2:51 AM, Dan North wrote: As a relatively recent adopter of node.js and even JavaScript I find the tendency to offer streamline etc. to newcomers a bit like offering a boat to someone who has just joined a swimming club and is learning to swim. - "I'm finding swi

[nodejs] Geddy Mailing List?

2012-04-23 Thread Matthew Hazlett
Does geddy have a mailing list? I searched google groups but it says there wasn't one. anyway In the example application for geddy (todo list)... I added a route for updating the data: router.match('/todos/update').to({controller: 'todos', action: 'update'}); Then in the controller I have:

[nodejs] Geddy Mailing list

2012-04-26 Thread Matthew Hazlett
Just an FYI. Geddy has a mailing list now: https://groups.google.com/forum/?fromgroups#!forum/geddyjs -- 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

[nodejs] Minified Code

2012-04-26 Thread Matthew Hazlett
Has anyone experimented with minifing code with node? I know the reason to minify on the client side is its faster load time to the browser, was just wondering if there were any performance gains with minimized code on the server side or perhaps a bottleneck with the eval() of the code. -- J

Re: [nodejs] Amazon AWS S3 SDK / Library?

2012-04-27 Thread Matthew Hazlett
This lib uses the old SSH1 not the recommended SSH2. I used this lib and found the streaming upload to S3 had issues with authentication, however the normal S3 PUT worked as well as the SNS. On 4/27/2012 4:54 AM, Rob Ashton wrote: https://github.com/appsattic/node-awssum This is quite activ

Re: [nodejs] request an english name for a node development group

2012-05-01 Thread Matthew Hazlett
This is sure to be as useful as a fart in a windstorm: http://online-generator.com/name-generator/project-name-generator.php I love this one it came up with: Abandoned Crayon On 5/1/2012 11:44 PM, jason.桂林 wrote: > I am a chinese, so my english not very good, but I need a english name > for the

Re: [nodejs] Re: Multiple Web Roles on Azure

2012-05-02 Thread Matthew Hazlett
I have never used windows azure before, but this sounds like what you are describing, communication between two roles of the same application. http://blogs.msdn.com/b/avkashchauhan/archive/2011/10/30/communication-between-windows-azure-roles.aspx "Only role instances that are part of the same Wi

Re: [nodejs] Geddy as a service in a productive server

2012-05-03 Thread Matthew Hazlett
Might want to try the geddy mailing list https://groups.google.com/forum/?fromgroups#!forum/geddyjs On 5/3/2012 2:32 AM, Leonardo Otero wrote: I'm looking for a way to deploy a geddy app in a productive server. Any idea better than: Create a .sh with: cd {GEDDY_APP_PATH} geddy -- Job Board: h

Re: [nodejs] Re: Hosting NodeJs How?

2012-05-04 Thread Matthew Hazlett
Amazon EC2, you can get a free account for a year (AWS Free Usage Tier ). But you do everything yourself, from installing software to configuration and deployment. http://aws.amazon.com/ec2/ On 5/4/2012 5:15 PM, henry.oswald wrote: After moving my site about a bit

Re: [nodejs] Calculation bug

2012-05-11 Thread Matthew Hazlett
Its not fixing the problem just hiding it. function add(a, b) { return (a + b).toPrecision(10); } answer = add(0.1, 0.2); // 0.30 On 5/11/2012 1:41 PM, Yogesh Agrawal wrote: Hi, I am performing a simple calculation in node.js, but receiving strange result. 0.2 + 0.1 should be equ

Re: [nodejs] Implement Password Reset in Node.js

2012-05-13 Thread Matthew Hazlett
if you use passport then they need to use passport to change their password. Anyway I think passport became Windows Live ID. On 5/13/2012 11:44 AM, Feras Odeh wrote: mrdnk, I used passport for login and authentication. I'm using mongoose for MongoDB. Guys is there any sample that implement pa

Re: [nodejs] Uniquely identify a socket

2012-05-17 Thread Matthew Hazlett
// global scope var connection = 0; // on connection socket['cool_id'] = connection; connection++; Could you just do something as simple as this? On 5/17/2012 8:33 AM, Veeru wrote: Ok, one question here, am setting a cool_id to the socket, then later on how can i retrieve this socket from anot

Re: [nodejs] ANN: blog article on async programming and generators

2012-05-19 Thread Matthew Hazlett
On 5/19/2012 6:20 AM, Bruno Jouhier wrote: http://bjouhier.wordpress.com/2012/05/18/asynchronous-javascript-with-generators-an-experiment/ shouldn't that be print(num) not print(n) -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posti