+1 to mscdex and Mark Hahn. It's up to the developer if he wants to make
his live easy or hard. That's true for node.js and every other platform
too.
Cheers Martin
On Sun, Apr 8, 2012 at 11:38 PM, Matthew Hazlett wrote:
> Done that way for consistency.
>
> if the connection already exists it
Done that way for consistency.
if the connection already exists it doesn't recreate it, It passes the
existing one to the callback.
On 4/9/2012 2:11 AM, Roly Fentanes wrote:
Why are you reconnecting to the db every time a user connects? If that
is necessary, as in if the db connection depen
Why are you reconnecting to the db every time a user connects? If that is
necessary, as in if the db connection depends on the user connecting, then
define a function which given a query, connects to the db if not already
connected, then executes the query after it connects. Then it disconnects
Try streamline.js. It is not a library but a language tool. Problem is solved
and people should start to use real solutions instead of whining and
re-inventing the wheel.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelin
In coffeescript it is only nesting heck.
--
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 no
+1, there's a ton of other libraries like Step as well. For really hairy
conditional things Streamlinejs works really nicely.
On Sun, Apr 8, 2012 at 8:16 PM, mscdex wrote:
> On Apr 8, 10:57 pm, Matthew Hazlett wrote:
> > It works but its still calllback hell :-( The db connection gets reused
>
Hmm, European CST is GMT+1, it could be using that instead (in spite of the US/
bit there). Try changing to (for example) 'America/Chicago' and see if you get
different results?
-Matt
On Apr 9, 2012, at 12:49 AM, james33 wrote:
> I'm running node 0.6.14 on a Joyent machine (OS is a varient of
I'm running node 0.6.14 on a Joyent machine (OS is a varient of Solaris).
The timezone is set to US/Central, but the Date object in node doesn't seem
to recognize this. Below are the outputs of a few different console.logs:
*process.env.TZ*: 'US/Central'
*new Date()*: 'Mon, 09 Apr 2012 04:45:28
I'm also working on a web+ios game, and I've fallen in love with phoneGap.
It really does work as advertised (files/camera/contacts/etc all available
in JS)
With a little work, you can even get push notifications going (this package
is great for it: https://github.com/argon/node-apn). I'm happ
Nesting is a lot less painful in coffeescript. It is just sequential code
that happens to get more and more indented.
getApp: (appid) =>
@useConnection (db, client) =>
@useCollection db, 'authors', (collection) =>
@useQuery collection, 'apps.id':appid, (data) ->
console.log
nope .. the close event is fired with has_error flag as false
I also tried using socket with allowhalfopen = false .. but no luck !
On Sunday, April 8, 2012 9:18:09 PM UTC+5:30, mscdex wrote:
>
> On Apr 8, 6:33 am, Chirag A wrote:
> > Using the net library in nodejs I'm able to connect as a
After doing some debugging I found out that the failure is with iswspace()
in libc. tracking it back to freeling, I figured out that I need to set
the locale prior to instantiating the tokenizer class otherwise the
string/wstring conversations get screwed up and the subsequent operations
fail.
Can't you pull up the "this.useConnection( function(db, client)" part to a
middleware? How about patching the request object with the db connection in
an express middleware? Then you can simply refer to "req.db" for the db
connection. This will remove one level of nesting.
I can usually tolerat
Just a question: are you using socket.io for server communication?
Em domingo, 8 de abril de 2012, Taj Pelc escreveu:
> Hi,
>
> we just released the first version of Chilly Framework. We needed a way to
> serve static files and sync all the actions that a player does between
> clients for a multi
+1 to this.
On Sun, Apr 8, 2012 at 8:16 PM, mscdex wrote:
> On Apr 8, 10:57 pm, Matthew Hazlett wrote:
> > It works but its still calllback hell :-( The db connection gets reused
> > tho.
>
> FWIW I do two things in my apps when it comes to deeply nested
> callbacks:
>
> 1. Pull out some or mo
On Apr 8, 10:57 pm, Matthew Hazlett wrote:
> It works but its still calllback hell :-( The db connection gets reused
> tho.
FWIW I do two things in my apps when it comes to deeply nested
callbacks:
1. Pull out some or most of the anonymous functions/callbacks, change
them to named functions, pl
Awesome! I will use it for some project in the future for sure!
Thanks!
Em domingo, 8 de abril de 2012, Taj Pelc escreveu:
> Hi,
>
> we just released the first version of Chilly Framework. We needed a way to
> serve static files and sync all the actions that a player does between
> clients for a
It works but its still calllback hell :-( The db connection gets reused
tho.
getApp: function(appid) {
this.useConnection( function(db, client) {
this.useCollection(db, 'authors', function(collection) {
this.useQuery(collection, {'apps.id':appid},
functi
The EasyMySQL npm eliminates these callbacks and uses a connection pool, so it
only opens a new connection when needed.
Sent from an iPhone.
On Apr 8, 2012, at 6:17 PM, Matthew Hazlett wrote:
> Thats how I originally did it, but when you need to do multiple queries to
> the database you shoud
On Apr 8, 2012, at 10:33, Dean Landolt wrote:
> On Sun, Apr 8, 2012 at 4:02 AM, Ryan Schmidt wrote:
>> On Apr 6, 2012, at 17:26, Artur wrote:
>>
>> > Calango.js enables you to run "native apps" (i.e. native graphics +
>> > audio) directly from Node using HTML5 APIs (like Canvas).
>>
>> "native" t
Thanks, I would much rather do things the proper async way then rely on
a 3rd party library that may not always be around. I will give this a try.
On 4/8/2012 9:24 PM, Matt Patenaude wrote:
In that case, you might consider doing something like this:
function obtainConnection(callback){
v
Create a connection in the initialize phase of your application, then refer
to that open connection later. There is no reason your .collection / .query
methods needs to be nested immediately under the .open call.
JavaScript is a mostly functionality programming language. You start at the
top and i
Sorry, put that "var c = null;" outside the function, and maybe give it a less
likely to be messed with name like var __persistentDBConnection = null;
-Matt
On Apr 8, 2012, at 9:24 PM, Matt Patenaude wrote:
> In that case, you might consider doing something like this:
>
> function obtainConnec
In that case, you might consider doing something like this:
function obtainConnection(callback){
var c = null;
if (c == null){
var conn = db.open(... fn() {
c = conn;
callback(c);
// set some close timeout here
});
}
else
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
I agree, it seems entirely manageable.
One low-overhead option would be just to split that out into a function, if
it's used frequently:
function dbQuery(query, callback){
db.open(... fn() {
db.collection( fn() {
db.query(query, callback);
});
});
}
dbQuer
> But as you can see this creates callback hell.
It doesn't look that bad to me.
--
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" grou
There's also another way to ease it
- Express.js has some capabilities in form of middleware to eliminate some
callbacks (like connecting to db) ,
- some DB drivers use sort-of deferred API, it eliminates some callbacks
(connec -> get collection -> query callbacks will be merged into one)
I b
>
> It seems this is the most popular type of question in the Node community :)
>
> There are tons of libraries to fight it, async.js (allow to write state
> machine instead of callbacks), iced coffee script (code manipulation,
> really cool thing), fibers (node extension to create pseudo - sync
I'd prefer to start with CoffeeScript.
In pure javaScript there's so many hacks and quirks that You'll spend lots
of time examining and fighting it.
CoffeeScript generates sort of "ideal" JavaScript, in the same way it would
be written by professional.
As has been said before - You anyway n
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
Phonegap online build tool to avoid the Mac requirement but you still need
a dev acct from apple
--
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
Where the HTML5 part come in?
Em domingo, 8 de abril de 2012, Artur escreveu:
> On Sunday, April 8, 2012 11:33:19 AM UTC-4, Dean Landolt wrote:
>>
>>
>> It's qt, so "native" to the desktop environment. As opposed to being
>> nested in a browser environment.
>>
>
> Exactly.
>
> --
> Artur Adib
> M
JavaScript is definitely the way to go. If you want to go down the Coffee
script I recommend you learn JavaScript first especially if you're new to
programming (I'm not planning to go down the Coffee Script route).
Learn to use Chrome Inspector (dev tools) or Firebug. There are lots of good
J
http://phonegap.com/
I also saw this for publishing HTML games to iOS
On Sun, Apr 8, 2012 at 3:21 PM, Derek Chalmers wrote:
> I don't really get the difference between AIR and Flash, but I hate Flash,
> so I think I'll stick with HTML/JS
>
> On Sun, Apr 8, 2012 at 3:12 PM, blake wrote:
>
>> > I
I don't really get the difference between AIR and Flash, but I hate Flash,
so I think I'll stick with HTML/JS
On Sun, Apr 8, 2012 at 3:12 PM, blake wrote:
> > I've been wanting to write a game and have been looking at both iOS and
> the
> > web. After I found out I need a Mac to make iOS games t
On Apr 9, 12:06 am, Bert Belder wrote:
> Very cool. It would be nice if we could figure out how to integrate qt
> without relying on `setInterval(qt.processEvents, 0)`.
(replying to myself)
I just tried it out (on Windows) and it seems to be not so bad: when
the application is idle, node's proc
> I've been wanting to write a game and have been looking at both iOS and the
> web. After I found out I need a Mac to make iOS games that sealed the deal:
> I'm making a game for the web.
Pretty sure you can develop with Adobe AIR for Mac on a PC.
Not trying to talk you out of Node just sayin'.
On Apr 8, 7:14 pm, Artur wrote:
> On Apr 6, 8:32 pm, Jeff Kunkle wrote:
>
> > Is this similar to the wxNode project?https://github.com/joeferner/wxNode
>
> Yes, it's similar in spirit. I've worked hard to make it work cross-
> platform out-of-the-box via `npm install` though (Windows, Mac),
> wit
Wow! This looks like it might be exactly what I need
-- DC
On Sun, Apr 8, 2012 at 12:48 PM, Taj Pelc wrote:
> Hi,
>
> we just released the first version of Chilly Framework. We needed a way to
> serve static files and sync all the actions that a player does between
> clients for a multiplayer b
Interesting!
Sent from my Windows Phone
From: dolphin278
Sent: 4/8/2012 1:18 PM
To: nodejs@googlegroups.com
Subject: Re: [nodejs] Node.js IDE for iPad
You can use ssh-client for iPad, and then vi/emacs :)
On 08.04.2012, at 11:03, Ryan Schmidt wrote:
> I currently write code using a plain text e
Hi,
No so easy to use compared to v8-profiler, but works great.
Thanks for your job.
On Apr 7, 4:39 pm, Camilo Aguilar wrote:
> FWIW, I finally fixed my memory leaks using a module I started to write
> recently,https://github.com/c4milo/node-webkit-agent. As I mention in the
> readme, it's a wor
Hi,
we just released the first version of Chilly Framework. We needed a way to
serve static files and sync all the actions that a player does between
clients for a multiplayer browser tank game that we are developing. We
abstracted the framework and released it as open source. It has worked
gr
What's up people?
I've been wanting to write a game and have been looking at both iOS and the
web. After I found out I need a Mac to make iOS games that sealed the deal:
I'm making a game for the web.
JavaScript is my first programming language so everything I need to do is a
bit tricky, but I ha
If you are going to be in the LA vicinity, we're setting up a small node.js
meetup for Tuesday night. I'll be there with a few folks from my team that
work on node.js for Azure.
Hope to see you there.
Details here: http://lanodemeetup.eventbrite.com/
--
Job Board: http://jobs.nodejs.org/
Postin
You can use ssh-client for iPad, and then vi/emacs :)
On 08.04.2012, at 11:03, Ryan Schmidt wrote:
> I currently write code using a plain text editor (TextWrangler) on a
> 5-year-old MacBook Pro. As I ponder eventual upgrades to this configuration,
> I wonder if anybody has had any experience
On Sun, Apr 8, 2012 at 9:48 PM, mscdex wrote:
> I haven't looked closely at other features of EventEmitter2 and
> similar modules, but I'd have an issue with how EE2 implements their
> "catch-all" event (reserving "*" as a special event name). I'd much
> rather see a separate method for this inste
I did.
I understand your view and that it could be problematic adding that
into the Event emitter critical path of emit(), but I think we could
easily work around that.
I'm interested here in collecting opinions and also from the core team.
No dia 08/04/2012, às 20:58, Oliver Leics escreveu:
>
I seriously wonder if you read what I wrote.
No offense.
--
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,
What about the syntax I proposed? (1st arg is catch-all callback).
No dia 08/04/2012, às 20:48, mscdex escreveu:
> On Apr 8, 1:59 pm, Pedro Teixeira wrote:
>> Are there any plans to support this on Node Core in order to make it
>> standard or does any one has anything to say agains this piece o
It would be cool if this worked: http://jsapp.us/. It does "kind of" but
less than ideal.
Glenn
On Sun, Apr 8, 2012 at 1:05 AM, Rob Ashton wrote:
> I try c9 from time to time, but it has serious quality issues and there is
> *always* some show stopping bug within 10 minutes of logging in.
>
> Ke
On Apr 8, 1:59 pm, Pedro Teixeira wrote:
> Are there any plans to support this on Node Core in order to make it
> standard or does any one has anything to say agains this piece of
> functionality?
I haven't looked closely at other features of EventEmitter2 and
similar modules, but I'd have an iss
Sure, this thing distributes very well. This can be done right now inside
fitness function, or i may add distributions to several process/remote
processes in future :)
-
Boris Egorov
skype/gtalk/nickname: dolphin278
mobile: +7 905 728 1543
On Sun, Apr 8, 2012 at 9:54 PM, C. Mundi wrote:
Thanks, I know that.
My question still remains:
Are there any plans to support this on Node Core in order to make it
standard or does any one has anything to say agains this piece of
functionality?
On Sunday, April 8, 2012 6:29:07 PM UTC+1, Oliver Leics wrote:
>
> On Sun, Apr 8, 2012 at 5:25 P
Right. I probably would not have done this in JavaScript unless of course
you're brute force distributing generations over a huge cloud. :)
On Apr 8, 2012 9:59 AM, "dolphin 278" wrote:
> To your collection of 'things you should never do with JavaScript' — brand
> new module that implements gen
On Sun, Apr 8, 2012 at 5:25 PM, Pedro Teixeira wrote:
> Yes, thanks, I know that's an option.
> Are there any plans to standardize this into core?
Question is, why?
The core EventEmitter-class is pure javascript, nothing fancy, just
the very basics. It is sufficient for almost all situations. Th
On Sunday, April 8, 2012 11:33:19 AM UTC-4, Dean Landolt wrote:
>
>
> It's qt, so "native" to the desktop environment. As opposed to being
> nested in a browser environment.
>
Exactly.
--
Artur Adib
Mozilla Labs
http://twitter.com/arturadib
--
Job Board: http://jobs.nodejs.org/
Posting guide
On Saturday, April 7, 2012 11:53:09 AM UTC-4, adrians wrote:
>
> Hi Artur,
>
> This looks like a good counter-move by Mozilla against node-webkit (
> https://github.com/rogerwang/node-webkit) ? Good to see some competition
> - may both projects thrive!
>
Hello Adrian,
Thanks -- just wanted to cl
On Apr 6, 8:32 pm, Jeff Kunkle wrote:
> Is this similar to the wxNode project?https://github.com/joeferner/wxNode
Yes, it's similar in spirit. I've worked hard to make it work cross-
platform out-of-the-box via `npm install` though (Windows, Mac),
without requiring the installation of external li
To your collection of 'things you should never do with JavaScript' — brand
new module that implements genetic algorithm.
See more, watch and fork — https://github.com/dolphin278/genetic
So whether you want to deal with simple optimization problems without using
external tools like Octave or Mathla
On Apr 8, 6:33 am, Chirag A wrote:
> Using the net library in nodejs I'm able to connect as a client to a tcp
> server which is hosted on a RS-232 to ethernet embedded hardware.
>
> Problem is, when I restart my hardware ( i.e. the tcp server ) the client
> is unaware of the same & the client take
On Sun, Apr 8, 2012 at 4:02 AM, Ryan Schmidt wrote:
> On Apr 6, 2012, at 17:26, Artur wrote:
>
> > Calango.js enables you to run "native apps" (i.e. native graphics +
> > audio) directly from Node using HTML5 APIs (like Canvas).
>
> "native" to what?
>
It's qt, so "native" to the desktop environ
Yes, thanks, I know that's an option.
Are there any plans to standardize this into core?
No dia 08/04/2012, às 12:36, Oliver Leics escreveu:
> Have a look at https://github.com/hij1nx/EventEmitter2
>
> eventEmitter.on('*', function() {
> console.log('got event type %s and args %j', this.event,
Nginx will not handle websockets without some significant work on your
part. Go with node-http-proxy, as has been recommended several times now.
It is pure node.
Write a simple script which listens on port 80 and proxies each host to the
right port.
If you're concerned about bringing down and bac
@Lothar, yes, that was a solution that I was exploring, but shutting
down all websites for adding one more it's quite perturbing..
After researching a bit, I'm start convincing myself that I'll need
Nginx to reverse proxy webites on the same host but running node in
diferent ports.
I was hopping t
Have a look at https://github.com/hij1nx/EventEmitter2
eventEmitter.on('*', function() {
console.log('got event type %s and args %j', this.event, arguments);
});
Another way would be to overwrite EventEmitter.prototype.emit
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://gi
Cloud9IDE is too bloated in my point of view, it's a cool project from the
technical point of view but very poor from the point of ergonomics &
usability.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received
Cloud9IDE is too bloated in my point of view, it's a cool project from the
technical point of view but very poor from the point of ergonomics &
usability.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received
Using the net library in nodejs I'm able to connect as a client to a tcp
server which is hosted on a RS-232 to ethernet embedded hardware.
Problem is, when I restart my hardware ( i.e. the tcp server ) the client
is unaware of the same & the client takes a while to emit the close event.
Are th
I work with sub domains on my live and test systems, but with single
host on my dev and sandbox systems.
I use express as the web framework and my first route is something
like this:
app.get('*', function(req, res, next) {
var host = req.headers.host;
var url = req.url;
if (host === env.vHo
On Sun, Apr 8, 2012 at 05:03, Ryan Schmidt wrote:
>
> But for all the time I spend in a fullscreen terminal on my Mac, I still hope
> there's a way to add a Cocoa Touch iOS interface into the mix. Something more
> than just fullscreen vim. I do love using the keyboard, but for some things
> it
Delegating an event emitter into another event emitter is hard.
A catch-all event handler that worked like this would be of much help:
eventEmitter.on(function(eventType, args) {
console.log('got event type %s and args %j', eventType, args);
});
Do you know if something like this is on the wor
On Apr 8, 2012, at 03:19, Angel Java Lopez wrote:
> Ryan, it's not an answer for your question, but it's interesting:
> http://yieldthought.com/post/12239282034/swapped-my-macbook-for-an-ipad
Thanks, it's a very good read. I'm encouraged to find at least one developer
who found it not only pos
Ryan, it's not an answer for your question, but it's interesting:
http://yieldthought.com/post/12239282034/swapped-my-macbook-for-an-ipad
On Sun, Apr 8, 2012 at 4:03 AM, Ryan Schmidt wrote:
> I currently write code using a plain text editor (TextWrangler) on a
> 5-year-old MacBook Pro. As I ponde
I try c9 from time to time, but it has serious quality issues and there is
*always* some show stopping bug within 10 minutes of logging in.
Keen to hear of viable alternatives
On 8 Apr 2012, at 08:31, Srirangan wrote:
Ryan,
You can probably evaluate the many browser based IDEs.
Cloud9IDE (htt
On Apr 6, 2012, at 17:26, Artur wrote:
> Calango.js enables you to run "native apps" (i.e. native graphics +
> audio) directly from Node using HTML5 APIs (like Canvas).
"native" to what?
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-Lis
Hi people!
Martin, I understand your argument. And yes, that is the kind of argument I
would prefer to read in this thread. Usually, I don't participate in this
list, I'm usually a lurker ;-)
But There are sync IO functions in node core. It's not the case:
- Node is async by principle AND it
Ryan,
You can probably evaluate the many browser based IDEs.
Cloud9IDE (http://c9.io/) comes to mind, but there are many others out
there that you can check out. Many of them are open-source as well.
These should work fine in iPad's browsers.
- Sri
Srirangan | +91 9711 477 595 | About
I currently write code using a plain text editor (TextWrangler) on a 5-year-old
MacBook Pro. As I ponder eventual upgrades to this configuration, I wonder if
anybody has had any experience with developing Node.js web sites on an iPad. I
don't have an iPad because for so many tasks I do, I couldn
79 matches
Mail list logo