- Group:
- Administrators
- Active Posts:
- 6870 (5.65 per day)
- Most Active In:
- General Discussion (1783 posts)
- Joined:
- 20-February 10
- Profile Views:
- 27380
- Last Active:
Jun 12 2013 05:13 AM- Currently:
- Offline
My Information
- Member Title:
- Founder of wdR
- Age:
- 29 years old
- Birthday:
- March 9, 1984
- Gender:
-
Male
- Location:
- Philadelphia, PA, USA
- Expertise:
-
HTML
CSS
PHP
Java
Javascript
Node.js
SQL
Contact Information
- E-mail:
- Private
Posts I've Made
-
In Topic: Toady :)
09 June 2013 - 10:09 PM
AHAHAHAHAHA HOW COOL IS THIS:

One can now, while running Toady, search for third-party mods that aren't on your local machine, download and install said mod from a remote repository, and load that mod into Toady, ALL FROM IRC WITHOUT RESTARTING :D :D :D :D
(And those first few lines are me developing the mod. The search didn't work because I didn't provide a search term. So I fixed that bug, saved it, live-reloaded the mod, and then the exact same command that didn't work before started working.) -
In Topic: Toady :)
08 June 2013 - 08:55 PM
Lemon, on 08 June 2013 - 07:20 PM, said:Witchcraft!
That's certainly something I never ever thought to attempt in Node and, judging by what I've seen, nobody else has really. Now you've got me trying to think of ways this could be a useful technique in anything I've built and I'm drawing a blank at the moment
.
To be honest, when I decided I wanted this feature and started exploring how to do it, my first approach was to write my own implementation of 'module' and 'require', overriding require() with a call to fs.readFile() and eval'ing what I got back. Then that tiny voice inside my head saying this is so dirty oh my god this is dirty please don't do this it's so frigging dirty got the better of me and I decided to figure out how Node tracked what's already been loaded. Lo and behold, it was in the docs the whole time. Not exactly well-documented, but there nonetheless.
The more I dug, though, it turns out they really strongly recommend against ever modifying the cache, because it can often result in some nasty circular logic. And they're not wrong; so to be safe, you have to design your app structure around ensuring that there's no way a dynamically reloaded module could ever have a dependency on something involved in loading that module, or loading THAT module, or loading... you get the picture. So after banging my head off the wall for a couple hours, I realized that the core issue is that, in Node.js, modules generally require() anything they need. What if they didn't have to? What if each module was passed its dependencies by the parent sometime after it was require()'d, rather than the module loading its own dependencies when it's potentially not safe?
So I tried it. All Toady mods are functions that accept the module manager class and some other dependencies as arguments, and running that function is what returns the actual mod. So you can require() a mod without it ever touching a core dependency, and then pass the mod its main dependencies (rather than the mod finding them itself) whenever they've all been initialized and you're ready to call that function. Now I can willy-nilly delete almost anything from the cache, reload it, and not have an issue. I just call a function called unload() on each module before I drop it out of the cache so that it can detach its event listeners. (I'm still working on a way to hook node's EventEmitter to let my mod manager forcibly drop any mod's listeners without trusting that the author of the mod will do it in unload(). Nothing elegant so far, but I'm determined)
So that was my really long way of saying: This is totally awesome and incredibly useful, **especially** to upgrade applications that hold open long persistent connections like socket.io does. But to pull it off safely, you have to design your entire application around this "dependency push" pattern. Chances are, any existing application won't be compatible with the concept without a rewrite. Damn. -
In Topic: adopt Node.Js for my game as the server for +100 connections
23 March 2013 - 08:12 PM
elias, on 23 March 2013 - 07:54 PM, said:Thank you for the informations.
I have understand how node.js work, and I was made a web chat using node.js and socket.io.
You have spoken about CPU "However, using the built-in clustering, you can put a worker on each core of the CPU and balance your connections between them", can you explain? thank you Mr kyek.
I can do better than explain
The API docs for Node's cluster module have a really fantastic example at the top, and then they explain how it works. A lot of it is handled intelligently for you, once you define what the workers should do and what the leader node is responsible for: http://nodejs.org/ap...cluster_cluster
-
In Topic: Development Apps
22 March 2013 - 12:54 PM
gibbonweb, on 22 March 2013 - 09:41 AM, said:Hm. This sounds pretty impressive, but since I use MoSH I stay connected across temporal outages anyways (if I want to) and, well... anything else just seems to be some kind ofscreen
like black magic? I only use one computer anyways, but if I needed to be in the exact same session on two computers, I' just fire up ascreen
session...
That works too and isn't terribly different -- the big benefit of this is that you can, for example, scroll the buffer with your mouse wheel instead of unintuitive keystrokes. -
In Topic: Development Apps
22 March 2013 - 05:12 AM
callumacrae, on 22 March 2013 - 01:45 AM, said:Really? I would have thought that they wouldn't include Java support to try to get people to buy IntelliJ.
Oh I didn't mean it supports Java as a programming language -- I mean PHPStorm (and all the other JetBrains IDEs that are basically subsets of IDEA) is written in Java. So he'd still have to have Java on his computer ;-)
Friends
-

Dissident
-

Ivy
-

Sephir
-

Horoscope911
-

Quinn
-

AjBlue
-

Starblaste...
-

Nick
-

heLLo
-

KUNITZ
-

FrNcSc
-

Kaspa9t9
-

wind0ws
-

Sebaste716
-

Jamesey
-

chipstherebel
-

RBroncos
-

Wilson_Chi...
-

Sankor
-

MC10
-

TheDevMan
-

Zee
-

Zac_man211
-

Numba5
-

Ruku
-

Stephen_J
-

Afrog2
-

natejont
-

thinkoutlo...
-

Maxx
-

CodeHungry
-

IGABC23
-

KiNG
-

Charun
-

ONi
-

Devin
-

gibbonweb
-

Kartoffels
-

Keiron_Lowe
-

AndrewJLin...
-

AfroSamurai
-

Shadower856
-

dialtone
-

Cocoa
-

snipersquad8
-

callumacrae
-

Scrupulous
-

Alexogo
-

Ferdin_han...
-

jcahn93
Showing 50 random friends of 190 (View all)






Cartoon Clouds
Mountains
Sunrise
Clouds
Green Clouds
None
Find My Content
Display name history
Help
Comments
hydralisk
12 Mar 2012 - 12:18Fike
06 Jan 2012 - 17:49Fosjam
22 Dec 2011 - 12:34fauverism
07 Nov 2011 - 07:17Expect more of me on the WebDev, I love the vibe that this site gives off!
®
Leamsi
06 Nov 2011 - 23:07sparkhh
06 Aug 2011 - 15:44Just a small answer would do great, i know you are very very busy and i wouldnt have PM'd you as such :)
JustinP
28 Jun 2011 - 19:12Fosjam
22 May 2011 - 06:07Fosjam
22 May 2011 - 05:27callumacrae
18 May 2011 - 11:15Fike
23 Apr 2011 - 15:24Fike
23 Apr 2011 - 15:18Fike
23 Apr 2011 - 15:13Ruku
12 Apr 2011 - 15:06sparkhh
07 Apr 2011 - 08:25Would really appreciate some directions, SVG based application.
http://www.webdevrefinery.com/forums/topic/8090-virtual-circuit-designer/page__pid__82184#entry82184
Thank you.