« first day (293 days earlier)      last day (4656 days later) » 
00:00 - 20:0020:00 - 23:00

12:34 AM
@codeninja for practice you can use jsfiddle.com or something similar it speeds up alot
 
how do i focus on recursion problems
for example, how did you learn to apply recursion to your programming
 
1:07 AM
@codeninja function recurse(oath) { say(oath); recurse(Oaths.random()); }
;)
 
hahahaha
well said sir
 
but seriously
i can understand recursion when i see it
 
What do you want to use recursion for?
 
but im having trouble seeing ways where it can provide a solution
thats just the problem
i dont know when to use it
 
1:17 AM
Oh. I just used some yesterday, in a music player. Can you think how it might apply?
 
search?
 
Visualize a music player: as the music plays, the time bar moves, the text telling you the time in the song updates...
anything that's being continually updated can use recursion.
 
why use recursion when you could just say time = time + 1
 
Often it's more efficient to put a timer in between self-calls, but it's still recursion.
How do you know when to say time = time +1?
You have to keep doing it.
 
ah i see
for example, the towers of hanoi problem
how to use recursion is simple when you know how to solve the problem
but only in retrospect
how would you look at the problem and say 'ah, i can use recursion here'
 
1:21 AM
Break it down: anytime you find yourself doing the same thing more than once, that might be a time to use recursion.
I'm trying to think of another good example...
 
brb
in case i dont catch you, thanks for the help
 
3
Q: Use recursion instead of EVAL

n33xI have a list of items in a page that must be hidden in sequence, but just after the previous item has been totally hidden. I made the following code, where I create a big string inserting the callbacks inside the previous callbacks and later use eval to execute the effects, but despite the code...

^^ example of using recursion to solve a DOM iteration problem.
 
2:10 AM
@MattMcDonald Thanks for the response
 
0
Q: Contentious Douglas Crockford JavaScript claims

JustinI've started programming with JavaScript a few weeks ago. My first book is Douglas Crockford's "JavaScript: The Good Parts". I've been a good student, closely doing as he says; I even use his strict 'validator' JSLint. While he clearly defines his best practices, he too often doesn't justify the...

 
Anyone around here know anything about userscripts?
 
When's the last time you've seen a 500 rep bounty? :)
1
Q: Is it possible to get the response of a cross-domain asynchronous file upload?

Šime VidasFirst of all, let me use this diagram to explain how asynchronous file uploads can be achieved: As you can see, the trick is to let the HTTP-response load into a hidden IFRAME element instead of the page itself. (This is done by setting the target property of the FORM element when submitti...

 
 
2 hours later…
4:45 AM
Does this chat hangs osmebody else aswell ?
 
 
1 hour later…
6:04 AM
Hi
 
6:17 AM
I am using soap in my app and getting this error : cannot use object of type stdclass as array
 
 
3 hours later…
9:30 AM
0
Q: What's the default setting for including a <script> in a post

SebastianAs we're evaluating whether we should build a Wordpress plugin and in that context I'm trying to figure out how Wordpress handles script tags in a post? What's the default setting? Thanks!

 
 
1 hour later…
10:30 AM
0
Q: Unity3d- Find all Game Objects with an Input string name (not Tag)

Epic447I've been searching every where for clear answer, and have yet to find one. Im basically trying to mimic 'FindGameObjectsWithTag' with FindGameObjectswithName'. I know using tags is faster, but I'm trying create a way to search for objects I spawn with a child object I name on instantiation throu...

 
10:58 AM
hi all
can i get some help here plz
0
Q: listener on tab click or activation not working properly / extjs4

astrocybernautefor my application that im developing with extjs4 and c#, im based on the browser-layout example. so i have a menu on the left side , then on clicking on each item of that menu i have on the right side all my tabs now the listener im using on the tabs only work when i do click on the tab, but d...

 
11:24 AM
@Neal buddy you on gchat ?
 
12:05 PM
1
Q: Multiple SOAP request using Javascript problem

Ajay PatelAll I am using my SOAP API using java script. this example explain how to send single soap request using js var symbol = "MSFT"; var xmlhttp = new XMLHttpRequest(); xmlhttp.open("POST", "http://www.webservicex.net/stockquote.asmx?op=GetQuote",true); xmlhttp.onreadystatechange=function() { if...

Any solution
 
0
Q: Alternatives to Java Applet for interactive Websites

Asamandrain short i am searching for an alternative to javaapplets for making some interactive parts like minigames etc. on my website facts: i´m developing an e-learning website for children. this site has following main functions: * practice part where children can do grammar test and receive points f...

 
12:20 PM
Anyone here know how long an AJAX request could hold on for?
I wanted to make a site with chat
But comet seems pretty mundane
I wondered if I got the PHP page being requested to loop into sleeping everytime it didn't find any new chat messages, the request could stay alive, but only until it timed out, right?
Not mundane, more like tedious.
 
1:17 PM
So, this is pretty sweet. Go to O'Reilly Radar - 4 Short Links, highlight some text, and click the speaker icon that comes up.
I've never seen a screen reader integrated into a site before.
 
1:28 PM
@RyanKinal Any idea on how to allow any scope draggable's to drop on a droppable using jquery ?
 
@Darkyen Not off the top of my head. Is this a plugin thing?
 
its a UI addition in jQuery
they dosnt support multiple scopes on draggables , atleast as much as i know x(.
 
Sorry. I don't really do plugins.
 
Ah its okay.
i think will have to edit jQuery source code .. gasp
not over the top of my head but still a bit confusing!
 
@Darkyen What? No.
 
1:37 PM
@Incognito any idea to assign multiple scopes to droppables in jQuery ?
if yes . speak please ... if not i am going to make it possible by editing jQuery's part that makes scopes work
theres a workaround using classes but that will be changing the whole code in project.
 
@AmaanCheval The HTTP request it's self is determined by either the scripting language or the web server. You could use persistent connection headers to help it work faster, but you still need to manage the maximum time a script can live in the code. For example, php times out by default after I believe 60 seconds, you can modify that.
@Darkyen What do you mean scopes work?
In computer programming, scope is an enclosing context where values and expressions are associated. Various programming languages have various types of scopes. The type of scope determines what kind of entities it can contain and how it affects them—or semantics. Typically, scope is used to define the extent of information hiding—that is, the visibility or accessibility of variables from different parts of the program. Scopes can: * contain declarations or definitions of identifiers; * contain statements and/or expressions which define an executable algorithm or part thereof; * nest or be...
 
facepalm
in jquery context for drag and drop
its like a property
assigned to draggable
 
jquery or jqueryUI?
 
which makes a special droppalbe accept it and jQueryUI
 
Okay, you do not have to edit jquery source. And you shouldn't.
Why you ever would is beyond me.
If you edit it you must release it as open source GPL or MIT licensed code.
 
1:43 PM
^_^ I think i know about that "Law stuff"
the trouble is
if u assign a scope to a draggable
 
Okay, stop using the word scope, it doesn't make sense.
 
it will only be allowed to drop in a droppable with same scope
 
There is no "a scope you asssign"
 
scope

String
Default:
'default'

Used to group sets of draggable and droppable items, in addition to droppable's accept option. A draggable with the same scope value as a droppable will be accepted.
thats written in jQuery manual
what if u want 2 'types' of droppables to go there :P . which have different scopes (because of some other reason)
 
Stop referring to jqueryui as jquery, they are very different.
 
1:46 PM
sorry. jQueryUI
 
So, you want to use group scope attributes to work as the same thing?
 
yes
 
Why can't you use one scope?
 
Okay its like for a feature private chat i need it to allow any type of user
 
What does dragging and dropping have to do with types of users?
 
1:52 PM
its basically a chatbox where everything is done with users
 
Oh, thanks. How though?
I'm trying to create a long-lived AJAX connection. Would this be possible?

On a similar note, would reverse sending AJAX requests be possible? As in, sending something from a PHP page to an HTML page?
 
i mean to show another user in the chat i use a draggable
 
@AmaanCheval http_keep_alive in Apache, if you're using that.
 
the problem starts with Administrator Stuff . when that comes in action there are two types of users one which he can Ban , Make Guest , Member (simple chat ranks) and some like Co-Administrator or Owner which he cannot! . now an option is processing the data after the drag and drop is compelete but that looks a bit Not So Good
 
I'll be back in like half an hour.
@Incognito Nope. Plain PHP.
 
1:54 PM
Long Lived Ajax Connections might also require u to do php_set_timeout(0)
 
@AmaanCheval No, servers respond to requests, browsers make requests. You can't request from a client like that.
 
to disable timeout();
 
@Darkyen Oh, cool, thanks.
 
@Incognito maybe hes trying to do something like chats.ws
it also relies on mysql connected long lived ajax connections ..
 
I have to go now, bye!
I'm working on 2 projects. One includes synchronising text on 2 computers. The other is a simple chat room.z
 
1:56 PM
@Darkyen Okay, but this doesn't explain drag and drop needing to have a specific scope, these are all features of your program you're talking about. What's stopping you from separating the logic?
 
jQueryUI only allows 1 scope to be assigned
 
Yes.
 
to a draggable - droppable.
i think theres no -work around .. i amma try using the older way ... to process the request after the drop is complete.
 
Why does it matter that you have "oh this bans" and "this makes bananas" or "this one plays music" ?
 
will it help
if i show you a youtube video ?
or wait
 
1:58 PM
no
 
ever been to xat like chatboxes ?
 
the presentation of something being able to be dragged somewhere needs to be separated from the logic of what you do.
/ragequits
 
well nvm incognito
i think i can process it with a slight tweak
 
Ugh. I hate it when people build HTML in a SQL stored procedure.
 
2:18 PM
Could you please share your thoughts about http://stackoverflow.com/questions/6950636/finding-justification-in-some-of-crockfords-claims
it has been closed, but has 4 reopen votes.
 
2:36 PM
Back
Anyone know of a way to receive updates from the server, without having to keep checking at intervals?
 
@AmaanCheval Long polling
 
Yeah, I've heard of it, but could you give me some sample code?
And if possible, no libraries, please.
 
No, and no
 
Hahaha, okay
 
0
Q: JS Object Literal Review

ObiWasabihttp://dev.bushidodeep.com/image_gallery/imageGallery.html After crafting an image gallery using a JS object literal I could use a code review on the JS. It works, but is it efficient and lean?

0
Q: Why do we need different JS for different browsers

Amar JarubulaWhat exactly are different things we need to take care when writing different JS files, like arrays, variables etc., Is there a book or website explaining differences between different JS engines used for browsers? I was working on something in our application and bumped into a JS issue and was ...

 
3:11 PM
"ES6 is targeting end of 2013"
 
3:36 PM
Interesting that an article (of decent technical merit) on JS is on a design site (of some repute).
 
4:07 PM
Anyone want to help me test out my chrome extension (goo.gl/OugJe)? I feel it should work correctly, but I haven't had any recent notifications to fully test it out yet :3 (Ps: You'll need to have Google+)
 
@Shaz ... what is it supposed to do?
 
It should show the number of unread Google+ notifications in the title bar when you are on a Google site that display the black bar on top of its page
So for example, if you're on Google+ the title bar will say "Google+". If you have any unread notifications, you'll see "(+n) Google+"; where n = the number of unread notifications
 
4:39 PM
Ooh, interesting. caniuse.com/#feat=calc
 
5:03 PM
@RyanKinal Heresy! Burn the witches!
 
oh god
2 co workers spent 2(!) hours tracking down a "leak"
they dug through all the code I had written months ago
when I finally joined the leak hunt... we found that they had a superfluous ! in the code they had written this morning
 
@IvoWetzel No stack trace, or code profile?
What language was this?
 
this is JS channel , isnt it
 
@teresko Yes?
 
From what I've heard, only Chakra's profiles are actually that good.
 
5:20 PM
ga all
 
hey
 
Hey is for horses ^_^
 
Hay is for horses :P.
 
true true B-)
 
v.v, so, I'm not sure how to refactor linear code into objects, instead I'm taking my old school approach from programming in C, everything goes inside main(), and I abstract to functions instead.
It feels weird writing a main() function. Like, nostalgia....
 
5:36 PM
?
 
5:47 PM
@Incognito JS
the game was running slower.. and slower.. and slower.
came down to the fact that the superfluous ! resulted in items not being removed from a list
so the growing list slowed down things more and more :D
 
user1385191
it's always fun running into apps that do really poor (or no) gc prep
 
user1385191
there's a ton of flash apps like that
 
user1385191
ran into an award-winning one that basically crashed the browser after 30 seconds
 
@MattMcDonald What do you mean gc prep? :/
 
user1385191
removing, nulling, etc
 
user1385191
5:51 PM
basically giving the garbage collector something to pick up
 
Greek yogurt yummi ^_^
 
user1385191
love vim's "inside" selection system
 
user1385191
so handy
 
indeed
 
5:54 PM
@gsnedders I'm waiting for "Suprise, Opera 12 is fully ES5 compliant!"
 
Fun thing... CTO joined a colleague to do some pair programming... result: Colleague was like 200% less productive :D
 
3
A: Reuse HTML with css

NealCtrl+C => Copy Ctrl+V => Paste And put to a new HTML file and save it.

^_^
 
ok
should I downvote this one... or rather the jQuery one?!?!
!!!
 
@IvoWetzel is that because the CTO is scary?
 
@Raynos No, he just sits there and talks :D
 
user1385191
5:57 PM
the right answer is the php-related one
 
Questioning every other line of code :D But he's not that bad, he does a pretty good job at what he does most of the time (which is not coding) he's more occupied with planning and stuff
 
@MattMcDonald haha
i changed my answer up a bit
^_^
orginally it had a jQuery tag lol
 
@MattMcDonald So I'm free to downvote everything else? :P
 
:-P
 
man we played so much bad good 90's music in the office today..
 
5:59 PM
Wow non-void html elements exist :\
Do I not know anything?
 
user1385191
I was actually debating this problem in my head today in regards to my blog project
 
user1385191
one php file for the html
 
@Raynos ... you were unaware?
 
user1385191
one php file for the css
 
@MattMcDonald It's not often we need to worry about GC in JS, at least not as much as some other languages.
 
user1385191
6:00 PM
it's a big problem in flash because of display-oriented stuff
 
user1385191
ivo's working on that type of stuff, so it was a problem
 
@Incognito Tell your kids the Story of that guy from Yahoo who fought against windmills bad JavaScript :P
 
Ah, I'm not a fan of flash as a platform, it just irks me to death.
 
user1385191
adobe annoys me, but it's more inept programming than anything
 
@Incognito Depends on what engine you're running on
At least iPhone 4 is really bad...
Chrome is the only browser with a "good" GC
 
6:02 PM
@IvoWetzel What did he fight the javascript with?
 
0
Q: Review my simple javascript canvas game

CaimenHere is a link to the code on jsfiddle. http://jsfiddle.net/caimen/kMkrW/ This is my first attempt at playing with canvas. Things I am looking for. Before I move on doing anything else it would be nice to have insight from somebody who knows canvas and javascript better than me. Also I don't...

 
@Incognito He was a man of words! (good way to tell your kids that violance is not a solution)
 
user1385191
what else does a programmer fight with? his mind, his foul mouth, and his bony | flabby fingers
 
I use my foul mouth all the time at work.. to curse about IT
we trying to get our stupid Hudson to build the new HG repo for a week
still doesn't work..
 
> In a village of Yahoo, the name of which I have no desire to
call to mind, there lived not long since one of those gentlemen that
keep an interpreter in the script directory, an old parser, a linting engine, and a
blog for coursing. An olla of rather more beef than mutton, a
salad on most nights, scraps on Saturdays, lentils on Fridays, and a
pigeon or so extra on Sundays, made away with three-quarters of his
income.
 
6:05 PM
these people even break unix servers with ease
I mean... come on! I can sudo su name and grab everyone and their mothers stuff
 
I decided against writing the entire story of Don Quixote around Crockford's life. online-literature.com/cervantes/don_quixote/5
 
Ah, I just love the writing style of it
 
Sorry to interrupt, but does anyone know what the original game (youtube.com/…) is called?
 
oh woah
!
 
Youtube gets blocked over here.
 
6:11 PM
So I finally do get machinarium :)
 
Send me a screencap?
 
@Incognito Okay
It's a little too dark
Wait, I'll send you a proper one
 
uh there are a lot of games like this
cannabalt comes to mind
sonic too, although there are no llopings and it's a bit slower
 
Yeah, I remember the sonic one.
It was a handheld device that would play ONLY this game
So, if I were to make this game in Canvas, what would I name it?
Sorry, can't send the screenshot, the app keeps crashing on me for some reason
 
Eh no worries,
 
6:23 PM
hello all
im pretty familiar with javascript, but i just started learning jquery
and the syntax seems completely foreign
in the end, jquery is just a javascript library right?
 
Yeah
I don't use jQuery, never have, but AFAIK, it's just a group of very useful functions, packed into a single JS file
 
there seems to be liberal use of the $ sign
im still unclear on how the $ is used
 
It's simply used because it can be
Normally, JS doesn't allow the usage of symbols in functions
It allows only $
jQuery tries to shorten every function using the $ sign
And occasionally the #
The # is used for getting id's, if I'm not mistaken
Why do you want to learn jQuery?
 
that sounds abot right
 
Javascript allows you to use numbers, letters, underscore and dollar signs in variable and function names.
The # is part of CSS2.1 selectors.
 
6:28 PM
But not at the beginning.
 
The # is not a jquery invention or part of javascript.
 
Except for $
I know. but it is used in jQuery
 
The $ can be used in the start of a function, unlike numbers and underscores
 
from what i know so far the # is used to target an id
 
6:29 PM
Oh, it allows underscores!
 
$("#foo").hide()
 
the start of an identifier of any sort can start with a letter, underscore, or dollar sign.
 
Okay stop. Everyone.
 
Yeah, you're right
 
ECMA allows you to use dollar signs and udnerscores.
It's not some special hack thing, it's just a variable name
the same way you can define a variable "bananas"
instead of "bananas" it's simply "$"
 
6:30 PM
Yeah, I'm pretty sure I'd read on W3Schools that an _ wasn't allowed
 
and the syntax is standard JavaScript syntax. What you're not getting is the paradigm, I'm guessing.
 
There's no magic other than it's not a letter, it's a dollar sign.
 
w3schools LOL
 
is there any reason its better to use $ than just defining a variable?
 
it's the shortest variable name
 
6:30 PM
@AmaanCheval You stay the f*&k off of w3schools if you ever want to accomplish something.
 
@codelahoma yeah, I didn't have any other place to learn from, shoot me.
 
That website should go die in a fire.
 
@Incognito I've learnt that over time, especially with W3fools.com
Agreed.
 
@codeninja using $ is defining a variable.
 
6:32 PM
Quoth the EMCA-262:
> 7.6 Identifier Names and Identifiers
Identifier Names are tokens that are interpreted according to the grammar given in the “Identifiers” section of chapter 5 of the Unicode standard, with some small modifications. An Identifier is an IdentifierName that is not a ReservedWord (see 7.6.1). The Unicode identifier grammar is based on both normative and informative character categories specified by the Unicode Standard. The characters in the specified categories in version 3.0 of the Unicode standard must be treated as in those categories by all conforming ECMAScript implementations.
@codeninja jQuery doesn't introduce any syntax into javascript, it can't. It's just javascript it's self. There's no magic or hacks going on, it's passing functions around, parsing strings, and working with the dom.
3
 
@Incognito agreed, but the way the code is organized is unfamiliar
like event handling for example
 
It is a weird library. All of them are. They may be useful, but I'd rather write my own pure JavaScript code
 
doing animations in js is tedious
 
But sadly, lots of job requirements list JavaScript, AND jQuery
 
@codeninja Can you be less nebulous please?
 
6:42 PM
@Incognito what do you mean?
 
I can make broad stroke statements about "The code organization is weird" about virtually anything on the planet.
The linux core, the GLUT library, javascript it's self, PHP, C, drupal, markdown, whatever.
It's a meaningless statement without specific context
 
@Incognito what im saying is that jquery's syntax, especially in regard to executing events, is unclear
even though im used to using javascript
im asking 1. if anyone here is familar with jquery
and 2. how they got over these problems
 
$(element).bind('click', function(e){/*...*/})
What's unclear?
 
well i wouldnt think of executing an event like that
im used to placing a handler in the html tag
 
$(element).delegate('a', function(e){/*...*/})
 
6:45 PM
not that this is a crazy departure from that
 
Right, there's nothing wrong with putting it into the html tag.
 
@codeninja You can continue doing that then
 
$("html") is an element.
You don't have to write your code using the jquery core for event delegation just because you included it.
You can if you would like.
And you can still bind events to the HTML tag.
Which makes a lot of sense to do so.
And the event object is still passed to the callback function.
 
so, i could use $(#button).bind('click','function(){})
and it would still work?
how wold i call it?
without the handler i mean
 
You need to make it $("#button")
it's a string that's parsed as per CSS2.1 grammar for selectors.
 
6:48 PM
what does the .bind() method do
 
It binds an event to the element you're referencing it to
 
$("divID").bind('click',function(){alert()})
Will pop an alert when you click on an element with the id, 'divID'
 
Right, but you're better off delegating from the HTML element, not divID.
function(e){}, where E is the event object from the click event.
e can obviously be whatever you'd like.
 
I'm off guys!
Bye!
 
6:51 PM
@Incognito by event object what do you mean
 
@codeninja Event is what is used commonly in JavaScript too
document.onclick=function(e){
alert(e.offsetX)
}
will give you the mouse's x coordinate
 
It's because the event of the mouse click is being passed into the function, and that event has the offsetX, or clientX (for Firefox) properties
Bye!
 
@AmaanCheval i see, thanks
 
@codeninja There's nothing magical about jquery, just check out the source code.
Well documented, only about 9000 lines.
 
7:10 PM
I'll do that
thanks for the help
i gotta go
 
7:40 PM
	$(window).keydown(function(e) {
		var code = (e.keyCode ? e.keyCode : e.which);
		if (code == 115 && e.ctrlKey) {
			e.preventDefault();
			console.log('hello');
		}
	});
why won't this simple snippet work in Chrome?
 
What key is 115?
 
S
tested and working in Firefox :/
 
What key code do you get from chrome on S?
Because I get 83.
 
I get 83 also...
 
Same with FF4.
 
user1385191
7:43 PM
what told you it was 115?
 
CTRL is 17, shift is 16, S is 83.
I get the exact same in FF4.
 
relatively highly upvoted post on SO
5
Q: Best cross-browser method to capture CTRL+S with JQuery?

ceejayozMy users would like to be able to hit Control+S to save a form. Is there a good cross-browser way of capturing the Ctrl+S key combination and submit my form? App is built on Drupal, so jQuery is available.

now I notice it's from 2008 lol
 
user1385191
"True, but CTRL+S is not an often-used feature." grrrrrrrrrrrrrrr
 
user1385191
there really needs to be a feature to downvote comments
 
agreed
 
7:46 PM
These are keycodes, not event.which.
 
am I abusing hijacking key strokes if it's for saving a working copy of something?
 
Maybe, it's up to you.
If it makes sense to do it, do it.
 
user1385191
if you're blocking me from saving a document, I get angry
 
If it's going to annoy people, don't do it.
 
asking mostly Matt since he seems to not like it lol
 
user1385191
7:48 PM
I'm a heavy user of keyboard shortcuts
 
also, e.which and e.keyCode come up at the same thing in Chrome
 
user1385191
you're still using jQuery, correct?
 
yes
 
@MattMcDonald You make a rebuttal and get all the upvotes.
@MattMcDonald I hate that I can't easily navigate SO without my mouse.
IMO it should be mandated.
 
user1385191
I got mad when FF messed around with f6
 
user1385191
7:50 PM
so now it's f6 + tab to edit the url bar
 
I always used Alt D for that
 
ctrl+l to get URL bar in chrome
browse like a baus
 
alt and d are closer together
 
user1385191
to me, f6 always made sense since f5 refreshed
 
worse are laptop keys where the function keys are perverted into other controls
 
7:54 PM
ctrl-l, with caps and ctrl swapped.
 
00:00 - 20:0020:00 - 23:00

« first day (293 days earlier)      last day (4656 days later) »