webdevRefinery Forum: Kyek - Viewing Profile - webdevRefinery Forum

Jump to content

Reputation: 1085 Excellent
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:
User is offline 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 Male
Location:
Philadelphia, PA, USA
Expertise:
HTML
CSS
PHP
Java
Javascript
Node.js
SQL

Contact Information

E-mail:
Private

Latest Visitors

Posts I've Made

  1. In Topic: Toady :)

    09 June 2013 - 10:09 PM

    AHAHAHAHAHA HOW COOL IS THIS:

    Posted Image

    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.)
  2. In Topic: Toady :)

    08 June 2013 - 08:55 PM

    View PostLemon, 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.
  3. In Topic: adopt Node.Js for my game as the server for +100 connections

    23 March 2013 - 08:12 PM

    View Postelias, 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
  4. In Topic: Development Apps

    22 March 2013 - 12:54 PM

    View Postgibbonweb, 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 of
    screen
    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 a
    screen
    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.
  5. In Topic: Development Apps

    22 March 2013 - 05:12 AM

    View Postcallumacrae, 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 ;-)

Comments

  • 6 Pages +
  • 1
  • 2
  • 3
  • Last »
  1. Photo

    hydralisk 

    12 Mar 2012 - 12:18
    STUPID N00BIE
  2. Photo

    Fike 

    06 Jan 2012 - 17:49
    Check your inbox! ^_^
  3. Photo

    Fosjam 

    22 Dec 2011 - 12:34
    Psst, would it be possible to get Imp in the new IRC rooms? Both preferably. Just to make things easier. And also to keep them inhabited.
  4. Photo

    fauverism 

    07 Nov 2011 - 07:17
    Hey Kyek,
    Expect more of me on the WebDev, I love the vibe that this site gives off!
    ®
  5. Photo

    Leamsi 

    06 Nov 2011 - 23:07
    So, I was wondering; are you Ok with the type of threads I've been posting on the site? I've seen a few "controversial" threads started (specificly My sex thread, and Mo3's drug thread.) And, they kindof started to go downhill at points. I was just wondering if your OK with these, and if your not, i'll stop posting stuff like that. Thanks, reply on my profile please. (or...
  6. Photo

    sparkhh 

    06 Aug 2011 - 15:44
    Hey kyek, if you can please can you look into the PM i sent you about a month back, 11july :) I am really looking for some proper advice. I am very confused what to do in it.
    Just a small answer would do great, i know you are very very busy and i wouldnt have PM'd you as such :)
  7. Photo

    JustinP 

    28 Jun 2011 - 19:12
    Can you fix the "New Content" button so when clicking it from PMs, it links to new posts instead of newly joined members? Thanks.
  8. Photo

    Fosjam 

    22 May 2011 - 06:07
    Roll had saved the picture so I could have reuploaded it and changed the icon, but this was easier ;)
  9. Photo

    Fosjam 

    22 May 2011 - 05:27
    Just so you know, you broke the supporters icon. It was hosted on your site rather than Imps.
  10. Photo

    callumacrae 

    18 May 2011 - 11:15
    To be unhelpful! :D
  11. Photo

    Fike 

    23 Apr 2011 - 15:24
    Ah, that would be a nice project. Something like, people in the community pitch in with code :D
  12. Photo

    Fike 

    23 Apr 2011 - 15:18
    Ah, I wasn't around the scene at the time of Appulous. Yeah, if you need any help with IPB, I'm your man :). Had more than 6 months experience with IPB and know most of the system. Or a mini mod or anything. :D
  13. Photo

    Fike 

    23 Apr 2011 - 15:13
    thanks for the rep :). Didn't you do work at Hackulous?
  14. Photo

    Ruku 

    12 Apr 2011 - 15:06
    Harsh! I'm still going to be a grammar nazi in all of my posts, if it's any consolation? :p
  15. Photo

    sparkhh 

    07 Apr 2011 - 08:25
    Hey kyek,
    Would really appreciate some directions, SVG based application.
    http://www.webdevrefinery.com/forums/topic/8090-virtual-circuit-designer/page__pid__82184#entry82184
    Thank you.
  • 6 Pages +
  • 1
  • 2
  • 3
  • Last »

Enter your sign in name and password


Sign in options
  Or sign in with these services