NodeJS, IRC-bot. Something is slowing it down, but what? - javascript

Today I just felt like writing an IRC-bot in Javascript with NodeJS. Everything works just fine, but it is bottlenecking somewhere.
For example, when I type a command several times it answers me immediately at first, but then starts to queue up and take longer and longer to respond.
Here's my code http://kl1p.com/ONyw

Not seeing anything apparently wrong with your code.
Try debugging it by commenting out parts of it, if at some point you don't see the slowing down you know that commented portion is responsible.
Archaic, but works every time :)

I totally forgot about this post. That's what coding drunk does to you!
Anyway, I solved it. It was as caf said, server-side ratelimiting. My local ircd was setup wrong. Working like a charm when it's running in a live environment.

Related

JavaScript and CSS working in Dreamweaver but not in the browser

I have an html page and it is getting linked to jquery, javascript and css. This all works fine in Dreamweaver, but when I put it on a server or run the file locally, it doesn't work. I have run all 3 files through syntax checkers and there is nothing wrong with any of them.
I created a codepen and it seems to be working fine:
https://codepen.io/vishalkaului/pen/bYedPp
Possible problem could be in the path, please crosscheck.
Too much recursion? Wow. So, something in your code is going bonkers re-running itself. Does it give you a clue as to where the recursion is happening? If so, you'll need to trace the code and fix or limit the recursion. It may be the dreamweaver has a larger recursion stack, or some how "fixes" the recursion problem itself. This is why I don't develop in alternate environments than the actual target (in this case, a browser -- or do you have another reason for using dreamweaver?)
Sounds like dreamweaver is doing something "for you" that the regular environment isn't doing. Some js include, jQuery include, something like that. Some code post would help. And maybe you should use some console.log statements to see if jQuery is loaded up, or to see if you can establish how far your code is getting before failing. Are there any console messages at all, indicating errors or failures?

domap resulting on error 'google' is not defined

I'm make use of GMLib some time ago to create same forms with Delphi 7 that did must interact with google maps.
At time this work great, (begin of year) until now the project stay paused, now I came back to work with him and the code that I was written back in time is not running any more.
For some reason when I run: GMap.DoMap;
I did get back a error of javascript with message:
'google' is not defined
. This occur in different lines of javascript at different times of execution and at end the program breaks on an exception.
First of all I updated my component to last version (1.2.4) once this is originally written using the 1.1.0, but this not solved my case.
Then I've tryed to find at google anyone with the same problem, but I can't find one solution. So please, if someone could help me on this, thanks.
So, sorry for posting this too soon, now that I did test the code on other machine, this run perfectly.
Well, obviously this is not a component problem, but yes a incompatibility, my pc is running Windows 8, and I have a lot of things installed on him, but I will try figure out what is causing this.

How to debug my code Ruby , Javascript, CSS?

I'm new to developing and started with a ruby on rails tutorial.
There i came to an error and after redoing it and googling it for days i can't figure it out. I was told to learn how to debug but i have no clue how to. i read that it actually is not possible to debug css. Maybe i used the wrong expression and i don't want to make it about my error which i already asked about here: CSS is not working after push to heroku but works on localhost
and here endless scrolling does not work
but i was wondering how to debug in general. i found various code snippets but not a really good tutorial where it explains everything from the beginning. i found things about breakpoints which i have no clue about what it is and where to set and how to read or where to get the logfile. do you know any good tutorials about that topic which i weren't able to find yet. something like a debugging for dummies.
Thanks a lot.
The Rails Guides site is an excellent resource for learning Rails.
Here's a great one on your subject: http://guides.rubyonrails.org/debugging_rails_applications.html -- section 3 goes into the debugger itself. Should really be all you need, but let me know if you've any specific questions after reading this.
Debugging CSS is different, though. Generally, the best way to debug CSS is to play with it in real time in a web page. You can do this with the Firebug addon for FireFox, or the web inspector which is built in to Chrome and Safari.
Debugging means finding and fixing problems with your code. You can start by checking your code for syntax errors (such as typos in function names or missing punctuation). Then use print statements (such as document.write in JavaScript) to check that your variables have the correct values. Also check for mistakes in logic, such as off-by-ones and infinite loops. Based on the unexpected results (and error message, if any), try to figure out which part of your code is faulty. You can debug without a debugger program, but they offer useful features. Your code can run slowly (line-by-line or pausing at the breakpoint), so after each line/breakpoint, you can check its status.

Why does has my javascript stopped working on live site, but works fine in test environment?

Okay, this is very weird...
http://connecttofriends.com/admin/login
I'm writing an administration control panel and am using a template from Theme Forest (because I didn't sign on to create any graphics, so my client bought it). For the login page listed above, I had to program it to run through Javascript due to the way it was set up.
I got it working and everything. Suddenly, though, something bizarre happened, and Javascript has not worked on that page at all since. None of my Javascript will even appear in Firebug, and I haven't been able to find anything to suggest that there's a Javascript error. Worse yet... on my local test server, it works perfectly fine. It just refuses to work on the live server for whatever reason.
Has anything like this ever happened before? How can I possibly fix this? I can't find anything wrong, and it works fine on my test server. I've at least been able to continue development on the test server, but without the live version working its useless.
I'll post code if people ask, but I don't see much of a reason to under these circumstances because the code actually works.
Any help is appreciated...
jQuery doesn't load.
It tries to fetch jQuery from this address: http://connecttofriends.com/admin/js/jquery-1.7.min.js, and it's not there. Missing a /, to indicate root?
the path you using is not loading, why dont you use jquery link as https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js
this'll also reduce your server hits.
jquery library is not getting loaded.Please check the path of the jquery-1.7.min.js.

flash interaction with javascript internet explorer

I have a flash object interacting with a javascript function. The interaction works fine in every browser except in IE (all versions)
I have tried with swfobject and with classic embeding. AllowScriptAccess is set to "always". Is there any cause for this flaw ?
Thanks
If you're using ExternalInterface, the problem may be related to the way you're attempting to reference the object in JavaScript. Take a look at my answer to this question -- it might not be exactly the same issue, but my answer provides an end-to-end example of ExternalInterface that's been tested on IE, too, so you might want to compare it to your own to see whether anything's missing or out of place.
If that doesn't help, though, try posting some code, so we can have a look at what's going on and maybe diagnose the problem more specifically.
If you are running the test from a file instead of testing it on a webserver it might be because security settings.

Categories