« first day (54 days earlier)      last day (4897 days later) » 

5:01 PM
hm, wouldn't help much
data's too old
 
@IvoWetzel can't you parse the content of this page? stackoverflow.com/search?q=user:170224+[node.js]
 
IT IS TOO LATE - THE <CENTER> CANNOT HOLD
 
!kitten regex
 
4011
A: RegEx match open tags except XHTML self-contained tags

bobinceYou can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool th...

 
@IvoWetzel: that gave me a big laugh .. :p
 
5:03 PM
!kitten wisdom Andy E
 
!kitten wisdom Coding Kitten
 
Guess you're out of luck with Coding Kitten. Yawn I nearly fell asleep when checking their answers.
 
lol
@IvoWetzel: smart ass
 
@CodingKitten heehee
@IvoWetzel I didn't say "regex"
 
var c= 0;$('.vote-count-post').each(function(i, e) {c+=+$(e).text()});c
> 93
 
5:09 PM
!kitten smart ass
 
Huh? What's a "smart ass" supposed to be? If you can't type you should reconsider your profession, what about writing the next Harry Potter? Can't get any worse with that...
 
very nice...
 
I'll do the google thing later :P
 
@IvoWetzel: Oh no, they're attacking the listeners :P stackoverflow.com/questions/4213351/…
 
@thejh FAQ you :P
 
5:12 PM
@IvoWetzel: Hey, fork you :-P
Back soon, I'll leave you with a little bit of wisdom.
!kitten wisdom Andy E
 
@IvoWetzel
var c= 0;$('.vote-count-post').each(function(i, e) {c+=+$(e).text()});c
100
 
?
hm
I remember the tag awarding being some kind of cron
 
!kitten say Good bye Chouchenos o/
 
Good bye Chouchenos o/
 
thanks @CodingKitten
 
5:17 PM
...that seems rather useless.
(;
 
bye the others
 
!kitten rchern
 
0
Q: Get a slice of a Javascript Associative Array?

David SavageHey everyone, I have an associative array object in Javascript that I need only part of. With a regular array, I would just use slice to get the part I need, but obviously this won't work on an associative array. Is there any built in Javascript functions that I could use to return only part of ...

RAGE! RAGE
RAAAAAAGE!
 
@IvoWetzel put s/associative array/object/g in your proxy config :)
@IvoWetzel The answer is also good: "Is jQuery an option?"
why always jquery?
 
5:22 PM
Because that's low level?... wait!
 
Obligatory (for anyone who hasn't seen it):
 
@LucasJones :)
 
that's shop'ed :P
 
Tek
lol
 
that image got one of my answers 45 votes :-p
 
5:24 PM
@IvoWetzel who cares? And how do you know it wasn't created by swapping contents using the js console?
 
@thejh Yea, that would be definitely easier
 
jquery? Sounds interesting, gonna write that down, yes on real paper, and no, papers's not edible.
 
!kitten jquery image
 
Hold on a second, googling that for you... "jquery image did you mean horrible typo?" There you go!
 
!kitten ? jquery image
 
5:27 PM
Hold on a second, googling that for you... "jquery image did you mean horrible typo?" There you go!
 
!kitten jquery
 
!kitten ? jquery
 
that triggered
but the chat prevents double posts
 
@IvoWetzel ah, ok
 
5:28 PM
BTW: YouTube is finally rolling out unlimited length uploads for everyone
 
what? 4 people left in the same second?
 
(except for evil evil people who got flagged for copyright thingies)
 
@IvoWetzel wasn't there some licensing issue?
 
hey I've only got 38% accept rate!
man programmers.se need to make it out of beta
so off topic stuff can be moved there
 
@IvoWetzel why didn't the kitten delete its post?
 
5:36 PM
it only auto deletes help and wisdom
 
@IvoWetzel ah, ok
 
that was just a normal ? command
 
5:53 PM
!kitten bar
no? what happened?
 
?
it somehow died :(
had to restart
 
Ahh
 
no error, nothing
maybe the request never returns so it doesn't fetch any new data
 
!kitten foo
 
Huh? What's a "bar" supposed to be? If you can't type you should reconsider your profession, what about writing the next Harry Potter? Can't get any worse with that...
 
5:57 PM
it doesn't recognize edits I'm assuming...
 
nope
should it?
 
the kitten is gone :(
 
chat is sloooow for kitten right now
 
no. It shouldn't... But I had to try
!kitten foo
or not
 
something's broken
 
6:05 PM
figured as much ;-)
 
rate limiting on the server side as it seems
 
Maybe you should make a room for your bot.
 
Well, you could do adaptive pinging... Where if it detects a lot of activity, it pings more often than if not. default to 10 seconds, and if it detects a fair amount of activity drop it to 2 or 3...
 
that would be a good idea i guess
 
WTF? Google Chrome truncates one of my js files after 300 lines and then lists it again completely... and after the first 300 lines, it restarts at line number 0...
somebody knows why/how to fix it?
 
6:14 PM
maybe there was a goto on 301? :P
 
it goes on with

default:
console.warn("Strange element in foreach thing");
}
nothing special
gonna open it in a hex editor...
 
6:30 PM
now changed three lines above 300 into one and it's still at line 300. gah!
 
@IvoWetzel
> goto
> ReferenceError: goto is not defined
 
is updating chrome now
 
@Raynos that's eval
 
@Raynos AAAH! Well, at least it isn't COMEFROM.
 
6:36 PM
guys I'm off, that tag badge won't make it today I guess, kitten now has adaptive ping, so it shouldn't get rate limited tomorrow
 
hey guys this is more of a general question than a specific js one, can i still ask it or will you guys be angry? :P
 
@alcoolico the worst thing that can happen is that you get bit by a kitten, so go on
 
I probably gonna eat you, but go ahead..
 
LOL ok
0
Q: Which portion should I be looking at to modify the Path-Algorithm? ( I want to make 3 versions with different pathing algos)

alcoolicoclass path_finder (): def __init__ (self): # map is a 1-DIMENSIONAL array. # use the Unfold( (row, col) ) function to convert a 2D coordinate pair # into a 1D index to use with this array. self.map = {} self.size = (-1, -1) # rows by columns self.pathChainRev = "" se...

I understand where the algorithm is.. for the pathing
but I'm not entirely sure what the algo itself is doing
is it depth first, is it just following a certain pattern?
 
lunch time..
 
6:39 PM
:c
i asked beforehand.. im not 100% sure about the rules around here i'm new to SO
and i figured people were overlooking my post so i'd jjust ask in a chat room
 
@alcoolico maybe you could try to convert it to pseudocode to faciliate understanding it?
restarts chrome now
 
@thejh I commented it in a pseudocode ish way
 
Tom
7:22 PM
Hi, are there any public sources on howto handle cross browser dom node attributes? I'm currently using the following, but have heard that this should result in different outcomes on different browsers and versions:
gist: 735180, 2010-12-09 19:22:01Z
var attributes = [];
				if (node.attributes) {
					for (var i = 0, iMax = node.attributes.length; i < iMax; i++) {
						//set name
						var name = node.attributes[i].name;
						
						//validate name
						if (typeof(name) != "string") throw "newTreeNode attr name is not a string.";
											
						//exclude style
						if (name == "style") continue;
						
						//value
						var value = node.attributes[i].value;
						
						//add
						attributes.push(new DOM.Tree.NodeAttribute({name: name, value: value}));
					}
				}
Another question I have which does not seem to get a lot of attention:
0
Q: Standalone webGL/Javascript client?

TomHi there, I'm looking into the possibilities of creating a Javascript application which makes use webGL. Since webGL is only available in a couple of browsers, and I do not want to force people to use a certain browser (directly), I would like to offer a standalone app client download aswell. ...

 
8:09 PM
How do you edit cross site iframes?
What I want to do is in this question but no1 answers it : stackoverflow.com/questions/4392520/…
 
@Zalastax the answer is correct
@Zalastax you have to let a server-side script grab the data and pass it to the browser or to save the page to your server and serve it from there
 
The host he refers to don't allow the script I want
shall I go to php chat and ask there about how to do what he said?
 
@Zalastax you could try it
 
@thejh thanks
 
Tom
@thejh your answer is not totally correct in that you can use java to grab the data client-side
java applet within the browser, that is
you can create a bridge for javascript
 
8:22 PM
Java applets are ugly :(
 
There are increasingly many people who don't have Java installed at all, which could be another problem
 
Tom
There are many problems related to that "solution", just saying building a server inbetween is not the only answer
 
@Tom errr... are you trying to say that there's a way to circumvent the same origin policy using java applets?
 
Tom
@thejh yeah, you just have to let the user accept a policy box
 
@Tom hmmm... then that could work, too
 
8:28 PM
Hi!
 
Why not use JSONP
 
I want to do something with all elements with a class of colhead. How do I do that in pure JS? (userscript, I can't use jQuery)
 
Tom
@Raynos what do you mean?
 
@Raynos I think that he doesn't have control over the server that serves the actual data, right, Tom?
 
Tom
Yea, it's Zalastax his question -- see above.
 
8:33 PM
I think I've got it. I need to iterate through them with a for() loop.
And yees, it works! :)
 
@Nyuszika7H then you will also need hasOwnProperty
!kitten jsforin
 
@thejh huh?
This seems to work fine for me:
var colhead = document.getElementsByClassName('colhead');
for (i = 0; i < colhead.length; i++) {
  colhead[i].addEventListener('click', function() {
    this.scrollIntoView();
  }, false);
}
 
@Nyuszika7H ah, that kind of for, ok
@Nyuszika7H right, should work
sorry
 
Oh he doesnt have control over the other end
A serverside middle man is probably better then a java bridge
 
Tom
Of course
 
8:41 PM
WATCH AS I FLOAT IN FROM THE SKIES
sorry, hey all
I am looking for a resource to learn closures with jquery and ajax better
for oo stuffs
 
@SaraChipps api.jquery.com This is probably your best source for jQuery.
 
right, so, I think my focus is on oo ajax
so, js or proto, or anything is fine
I have a whole bunch of read only calls that I need to make objects out of
 
@SaraChipps so you want to turn ajax responses into objects and reverse in js and some server-side language? In that case, I'd suggest using JSON. json.org
 
Right, it is all JSON.
 
but that is de-facto yes? Is there something specific out of the ordinary here?
 
8:47 PM
what I need is the ability to populate these objects within a callback
which is why I assume I need to use closures
*unless there is a function in jquery that just lets me populate an object/var with the results of my get
what I'm thinking now is the $ajac with the callback
$ajax
 
$.get can do that for you - in fact it will by default if it recognises it as json
 
or XMLHttpRequest as well
perfect, thank you, Mar
*c
 
something like:
$.get(url, function(obj) { /* use obj here */ });
(or any of $.post / $.ajax etc; if needs be you can overrule the detection to tell it to expect json, but most times you don't have to)
worst case (stealing some chat code):
$.ajax({
    type: "POST",
    url: url,
    data: /* your post data */,
    success: function(data) { ... },
    dataType: "json",
    error: /* some #fail callback */
});
 
Tek
I had the following question (selecting an element while hiding the rest of the page):

http://chat.stackoverflow.com/transcript/message/183580#183580

Someone replied with the following code:

http://chat.stackoverflow.com/transcript/message/183608#183608

But I'm having trouble understanding it enough to fix the issue. I want an element to *stay* highlighted when the mouse points to an element as long as the mouse is there until it's moved to another object. Basically always highlighting the element as long as the mouse is there.
At the moment that's only highlighting the selected mouseenter element for a brief moment then everything fades out... including the element that is being pointed at by the mouse. Any help with this?
 
that would be perfect, thanks
with a little research I learned that I can only use XMLHttpRequest in a chrome plugin for cross deomain stuffs
which is a headache to do OOP stuff with, as I haven't done it before
 
9:01 PM
jsonp?
 
any thoughts?
hmmm, looking
 
but yeah, XMLHttpRequest is a pain
 
Tek
@SaraChipps What are you trying to do exactly?
 
ps this room is awesome, esp for lone devs as myself :)
@Tek
I am building a chrome plugin
which references and external api
 
ah, might not apply there then
 
9:02 PM
I could just do xmlhttp functionally
but my life would be a lot easier if I could create reusable objects
 
Tek
@SaraChipps I love this room myself. Saved me a lot of headaches with JSON and AJAX callbacks as well, too bad I wasn't building a chrome plugin.
 
yeah, I'm going to see if I could use jsonp
*can
 
(you can press up to edit; or click the little menu against each post)
 
however, I think the answer is getting better at closures
which is something I haven't played with too often - sweet edits
 
Tek
@SaraChipps Tip: There's an edit button at the left of the text, if you didn't know already.
 
9:05 PM
@Tek or you could press up
 
clicking is lame (;
 
Tek
Whatever works.
 
@rchern userscripts are way better ;)
 
Tek
I always forget the key (for some reason, maybe I use too many keyboard shortcuts)
 
@drachenstern you said it, not me q:
 
9:07 PM
I believe I'll mention your use of backwards smileys now as not to disturb the one or two new people in here ;)
 
Tek
backward smiles are the best (:
 
^__^
 
yes... thanks for pulling our nice tidy chat API to pieces and putting it back together inside out (mutters something unmentionable about user-scripts...)
 
@Tek only if you use a mirror ;)
 
though they aren't backwards.
@MarcGravell LOL
 
9:08 PM
@MarcGravell does it break functioning of the site? ;)
 
At one point I did ask in the feedback room if y'all had looked at it all because I was curious for opinions. As I recall, @balpha hadn't.
 
If it only breaks their client, then that is their problem. If it impacts the server, we've already failed (as is right and proper, the server is the boss here; the client is just there to make things pretty)
 
@rchern More blasphemy!
 
What's the equalivent of draggable() and droppable() in jQuery 1.4.4? They seem to be deprecated.
 
@MarcGravell, userscript doesn't touch the server at all. You can blame @TheUnhandledException and his xmpp adventures for any and all server touching. (;
throws him under the bus. >_<
 
9:11 PM
@rchern Yeah, he was on Gaming a few minutes ago. We might need to have words with him ;)
 
@Nyuszika7H are you referring to jQueryUI draggable and droppable? Have you seen those?
2
 
@rchern also: the kitten
 
I didn't think the userscript talked to the server, only to the browser, and then only to chrome, no?
 
@drachenstern The userscript is userscript-supporting browser compatible. Even Safari, apparently, though I don't know why anyone would use that. :P
 
@drachenstern thanks. In jQuery 1.3.2, they were in jQuery Core, or jsshell loaded jQuery UI too.
 
9:14 PM
@MarcGravell Eh, I had nothing to do with that and have commented on it a few times. So there I'd have to agree with you.
 
@TimStone so just the ones based on webkit then?
 
@drachenstern Firefox works too.
 
All I wanna know is what have you bastards done to the poor kitten?
 
And maybe Opera, but we'll never know.
 
@TimStone no kidding? <strike>I was not aware of that</strike>
 
9:15 PM
Chrome, Firefox + Greasemonkey, Safari + Greasekit (?)
 
@rchern oh, so I have to have greasemonkey ... ok
 
@drachenstern Yeah, I use Firefox, so. :P
Right, sorry.
 
@TimStone yeah it makes more sense now
@MarcGravell I have a suggestion for the chat rooms
 
HI MALON
 
want me to carry that back over to MSO for discussion and a proper boxing about the ears?
 
9:16 PM
Haha, hi there
I'm getting a little confused with jQuery ajax....I'm looking for someone to set me straight and a point in the right direction
 
@MALON: now we can only shout at you
 
@drachenstern erm.... why?
 
@thejh Um, why can I only be shouted at?
 
@MALON jquery handles xmlhttprequests (ajax) pretty nicely with its own .ajax() function
@MALON what's up?
 
"getting a little confused" is probably the right direction anyway
 
9:19 PM
@MarcGravell because I'm lazy, why else would I ask for a feature like that?
 
at least, when I am not confused, I am usually heading the wrong way...
 
Well, it's not so simple of an explanation of what function to use, it's more like how to use it. The API is confusing me. I've never really had to use AJAX to do anything. Right now, I'm just trying to do a simple upvote/downvote style thing.
 
@MALON because your name is all-caps?
 
[status-hell-no]
5
 
The confusion comes from reading up on tutorials with upvote/downvote topics, and the most meaningful and applicable tutorial I read mentioned using the same ID for more than one element
And I didn't like it breaking the "one unique id per page" standard
 
9:20 PM
good for you
 
hello
 
@MALON one id for one element, not more - use classnames for multiple elements per label
 
@thejh Right, I know the standard
Let me explain what I'm trying to do:
Reddit-style voting (upvotes and downvotes). Multiple topics per page (recipes, actually). If you look at reddit's source code, it's one GIANT mass of no whitespace unreadable mess.
I'm trying to explain this as succinctly as possible
 
@MALON Can't you make the things people vote on have unique ids?
 
Absolutely not. What I am saying is that upvoting something sends a +/-1 vote to a given counter via AJAX
 
9:25 PM
@MALON use jsbeautify to make it human-readable
 
Hm, maybe I'm not in the right place to be asking about this....I think I'm almost looking for a "human tutorial". Sorry to be a bother, I figured it was worth a shot.
jsbeautify...
I'll check that out right now
 
sorry
 
@Greg you're mean to him
 
sorry this isn't IRC, I shouldn't be sarcastic ...
 
I've very limited experience with using actually jQuery or JavaScript native. Most of the time, a jquery plugin exists with what I need to do.
 
9:28 PM
@MALON if you're doing an up/vote thing, you need to do the actual changes on the server
 
@MALON often this is neither helpful, nor useful. Write an SO question, make it long and beautiful and full of detail, and then post a link to the question. Usually gets you MUCH better answers.
 
i.e. in PHP or ASP.NET
 
Right, fully aware, I'm quite good with PHP and MySQL
I've got the backend already coded. I can directly call my vote.php?vote=up&recipe=id and it records the vote fine, I just don't know how to do it via ajax
 
@MALON ok, go ahead and write the logic in PHP, and make it so it is fully functional by POSTing the id of the element/user
then it'll be really easy to make your pages dynamic with ajax
 
Yeah, that's what I thought....I'm nearly done with the site, I just SUCK with understanding the AJAX model...I know it's a layer between Client and Server that does processing of incoming and outgoing HTTP requests
 
9:30 PM
Hey guys i am sure I am doing something silly -- but I am having a double submit issue w/ jquery
 
I know it TECHNICALLY, I just can't make the words go together right.
haha
 
I have a submitWithAjax method that looks like:

jQuery.fn.submitWithAjax = function() {
this.submit(function() {
$.post(this.action, $(this).serialize(), null, "script");
return false;
});
return this;
};
 
@MALON ajax is a normal http request... it performs exactly the same as when you go to a url in the browser... just the browser doesn't display the result.
 
and in use like:

$(document).ready(function() {
$('#new_starting_thumbnail').submitWithAjax();
});
and its double submitting
no idea why
 
Alright, thanks everyone for your help. You guys are trying to be most helpful and I can see it's me not asking the right questions....I don't think I know the right questions to ask you guys for an answer...My question is so generalized at this point that I'm nearly asking you for a "Please do my work for me" kind of answer, which is nearly impossible to give without actually being at my terminal understanding exactly where I am
 
Tek
9:33 PM
have you checked that the ID "new_starting_thumbnail" is unique?
 
I'll stick around on the shoutbox/chat thing here for a while...I'll come back with more specific questions in a bit
 
@MALON If you have a PHP page that performs a query on the database when you go to voteUpOrDown.php?id=4&up=1, you can "call" that php page using ajax as easily as browsing to that page
 
@MALON you could make it work the oldfashioned way by hyperlinking from each votable thing to your vote script, right?
 
Yes, I've tested it with a straight hyperlink and it works fine
I just don't like it reloading the WHOLE page
 
so you just need to make a hyperlink that triggers an Ajax call to the same URL, without doing a full page roundtrip
and then you update the DOM to give the user an indication that something happened
 
9:36 PM
Yeah, the color of the clicked button changes to show the vote's been recorded (and the vote number changes)
 
so is it hitting your backend script?
 
Yeah, totally understand, I just gotta figure out how to use ajax. It's not the logic side, it's the javascript side....I'm an absoutle javascript nub
So like I said, I'll come back with more specific questions in a sec
 
Tek
@MALON Been there, I just started 3 weeks ago.
 
or...in a while anyway
 
you should be able to watch the server logs and see it succeeding or failling or something
 
Tek
9:37 PM
or so...
 
@MALON it's literally this simple: jquery.ajax("yourUrl.php?foo=1&bar=2");
 
wtf, really?!
THAT SIMPLE?!
 
Tek
yes
 
ha!
 
For the href?
 
Tek
9:38 PM
mhm
 
amggggggggggggggggggggg you gotta be shitting me....
 
Tek
lol
 
You gotta love the penny dropping moment :)
 
@Tek actually, not in the href, but in the onclick attribute, right?
 
So to clarify...

href="jquery.ajax("yourUrl.php?foo=1&bar=2");"
or
href="javascript:jquery.ajax("yourUrl.php?foo=1&bar=2");"
oh onclick?
ok
onclick="jquery.ajax("yourUrl.php?foo=1&bar=2");"
BRB (omg if this works)
 
9:40 PM
@MALON sorry, you need to use jquery.get not .ajax
 
afaik onclick instead of href, but basically, it should work
 
@MALON <a href="#" onclick="jquery.get('yourpage.php?foo=bar');">Your link</a>
 
yay
 
@MALON but you will get no indication that the function has completed... you need to set up a callback.. but hey, that's simple too! jquery.get("page.php", function() { alert("Done!"); });
 
Yeah, I have the mysql terminal open to see if the vote was recorded
 
9:44 PM
@MALON if you make your PHP echo the new vote number, you can easily update the page when it's done... jquery.get("page.php?id=4", function(data) { jquery("#idOfVoteCount").text(data); }); and you're done
that way you can get PHP to echo 'error' as well if there is something wrong
 
@MALON you might want to watch the web server log too, in case it's hitting a borken URL or something.
 
@MALON then you can move your jquery into a separate single function to automatically hook up to all your <a> elements
 
I'm still here guys, I'll let you know of success or failure
I sorta ruined the code so I gotta put it back together
Not your code, my general page code
Let you know of success in 20 min or so
 
I can't wait
 
Tek
so while MALON is away, could someone help me with this? chat.stackoverflow.com/transcript/message/184128#184128
:D
 
9:50 PM
@Tek what's not working?
 
Tek
Wherever the mouse is pointing, I need everything to fade out except the element that's pointed at
That way it looks like it's "highlighted"
 
@Tek: I think that it's because the fade effect creates an element that's above the element the user pointed at, too
 
Tek
Kind of like a lightbox effect, but with the elements in the page instead
 
@Tek ask the question on SO .. I want the points :)
 
@Tek: Maybe you will have to check coordinates on mousemove (although that would be unclean)
 
Tek
9:52 PM
@thejh I have no idea where to start so... hehe
sure thing greg, I was just finishing writing a question
 
@Greg @Malon alternately try assigning a class then using an onclick handler from jquery, like so: <a myattr='bar' class='ajaxianlink'>my link!</a> and $('.ajaxianlink').click(function(event){ $.get('yourpage.php?foo=' + $(this).attr('myattr') ) }); ... gives a much cleaner overall feel to it, and let's you embed it in a list, and have a single point of update and and and ;)
 

« first day (54 days earlier)      last day (4897 days later) »