« first day (623 days earlier)      last day (4330 days later) » 
00:00 - 15:0015:00 - 00:00

12:44 AM
0
Q: For a Javascript library, what is the best or standard way of supporting extensibility

Michael BestSpecifically, I want to support "plugins" that modify the behavior of parts of the library. I couldn't find much information on the web about this subject. But here are my ideas for how a library could be extensible. The library exports an object with both public and "protected" functions. A p...

 
1:32 AM
RT @divya: Great slides by @borismus on mobile web dev http://smustalks.appspot.com/io-12/
 
 
2 hours later…
3:26 AM
RT @devongovett: "Turning the Web Up to 11" Nice slide deck on the Web Audio API from Google IO: http://webaudio-io2012.appspot.com/
 
3:38 AM
RT @stevefaulkner: Using ARIA in HTML http://www.paciellogroup.com/blog/2012/06/using-aria-in-html/ #HTML5 #accessibility #ARIA
 
4:37 AM
hi
nobody?
 
4:49 AM
 
5:06 AM
Hey! Anyone in here?
 
user457812
Just turtles.
 
Land, sea, or teenage mutant ninja ones?
 
user457812
A mixture of the three.
 
I've got a problem that might not be worthy of posting as a question... I'm using jQuery Mobile and when I .show() a div that causes resizing of the windows I get a white flash/flicker
Resizing the window using $('#content').height($(window).height() ); stops the flicker but messes up scrolling
any ideas?
 
user457812
Not a clue since I'd have to know how jQuery Mobile works and I've never touched it.
 
5:11 AM
And if the problem would be just jQuery based (very hard for me to test), any ideas?
also, absolutely positioning the div removes the flash but the page doesn't resize
 
user457812
Nope, since I'm not familiar with its internals. I've mostly stopped using jQuery.
 
simultaneosly increasing the margin of another div so that the page expands also triggers the flickering
Oh darn!
 
user457812
Could be anything from the browser rendering things poorly to jquery doing something iffy with styles to a goat chewing on a cable in your wall.
 
user457812
The goat is pretty easily fixed though.
 
In Greece they put chalk on their trees, supposedly to stop goat chewing. Is it applicable here?
 
user457812
5:14 AM
Sometimes. Sometimes it's actually the Black Goat of the Woods and her thousand young and then you're better off moving to a different country and getting a lobotomy.
 
user457812
It's best not to fight ol' Shubby.
 
Seeing as I'm not in my home country atm, is going back there and getting a lobotomy there sufficient
 
user457812
Depends on the distance, really. I'll leave that to your judgment and whether the hallucinations stop.
 
user457812
I should really start referencing other outer gods. Shub-Niggurath can only get so much usage.
 
Dude, you don't mind me calling you dude, do you? I mean it's wayyyyyy better than "bro'", I can't stand people who call people bro
I digress
Dude, I don't know if it was you or the css-tweaking I did but I / you solved the issue
great work!
 
user457812
5:27 AM
I prefer it when folks call me "Lord." Helps fuel my delusions.
 
user457812
(But not really — calling me that would just be downright weird and awkward for everyone involved.)
 
Delusions of grandeur are only illusions if one does not posses grandeur. I personally think that it's justified in my case, thus "lording" me is quite alright until I actually get knighted when it instead will be mandatory
 
 
3 hours later…
8:05 AM
0
Q: Encapsulation of client side logic in web page

3komma14Is this the best way of doing this. I'm trying to encapsulate all the client side logic inside one "class". <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head&g...

 
8:17 AM
RT @IE: New #MSDN IE blog: Test the web forward http://blogs.msdn.com/b/ie/archive/2012/06/29/test-the-web-forward.aspx #IE10
 
 
2 hours later…
10:21 AM
dafuq did I just read
 
@FlorianMargaine even worse see that !
 
well, it's microsoft
they always put the tests they want in it
you know, innerHTML only passed their tests at first.
it'd be good if it still did.
 
@FlorianMargaine but!
oh well companies like microsoft
can do whatever they want :P theres not much we can say :P
CSS 3 TIP :: You can put 2 animations on same elements with multiple effect on the element this can be used to obtain really mind blowing curves and many other uses cause each animation can have its own cycle time run time and easing functions.
 
11:07 AM
Hello, I asked a question at stackoverflow.com/questions/11266340/… and got answers. All answers are working at JSFiddle, but not on webpage. Webpage link is xsy.in/test/static_fb.htm Could you please have a look and see what I am doing wrong?
 
Error: missing ) after argument list
Source File: http://xsy.in/test/static_fb.htm
Line: 29
Source Code:
`});? `
 
@ThiefMaster Thanks, Inserted an ) in line 29. STill not working. Also put another version at xsy.in/test/static_fb1.htm (Removed the doc ready, because it was not in fiddle. The only problem I guess is that how to add onload event? Because in the fiddle, jsfiddle.net/DerekL/Zdf9d/4 it is set to onLoad.
 
Please use your browser's error console.
You still have syntax errors.
[13:16:42.575] missing ) after argument list @ xsy.in/test/static_fb1.htm:26
 
@Davinder See, instead of trying to understand what the answers are, you revert to copy-pasting the answer and hoping it will work.
 
@Zirak yeah, I know and Its bad. The problem is that I know that the reason why same code is working at JSFiddle and not on my webpage, is that there is no onLoad event code in my page. And I could not figure out how to put that onLOad code. Even after googling for about 2-3 hours. Most of the time I work in PHP So, this JS is pretty confusing me. :(
 
11:21 AM
The error is not related to any onload event at all.
 
No, it's actually because you have syntax errors...
 
Actually, since you put the script at the very bottom of the document the DOM is ready when the script runs so there is no need for an onload/ondomready event.
 
Go to your page, hit F12, any decent browser will open a debugger.
 
<script src="jquery-1.7.2.min.js"></script> - 404 error by the way
 
i created this datokh.me/gallery/quiz_engene test you can try and tell me what you think
 
11:22 AM
Or do a dry check with jshint.com
 
$(this).attr("checked") is also bad. it should be $(this).prop("checked")
 
or this.checked is enough.
 
@ThiefMaster @Zirak ok, jQuery link ok now..
 
cross browser and everything.
 
You don't even need jquery for something like this
 
11:23 AM
@ThiefMaster you're too much buried in jQuery!
 
The only motive/result I need is that Intially Special box should be disabled(Done), then if user ticks the OK, then Special gets enabled. Then if user changes mind, and again , just in case, unticks the OK, special should get untick as well as disabled. And OK/Special pair can be of n numbers
The only motive/result I need is that Intially Special box should be disabled(Done), then if user ticks the OK, then Special gets enabled. Then if user changes mind, and again , just in case, unticks the OK, special should get untick as well as disabled. And OK/Special pair can be of n numbers
 
I'm assuming the inputs are wrapped in a form, right?
 
Now it on xsy.in/test/static_fb1.htm attr change dto prop on line 23. Still now working. And why it is working at jsfiddle.net/DerekL/Zdf9d/4
 
You have syntax errors
 
@Zirak Yeah. in a form using POST..
I am using notepad++ and chrome.
 
11:28 AM
What you use doesn't change the fact you wrote code wrong. Open Chrome's dev tools (F12 or Ctrl+Shift+J), and look at the bright red text saying "Syntax Error"
 
Very thanks @Zirak The ? was culprit. And din't know about F12 tool :(. Now it is working.. Thanks again..
 
Just for fun: jsfiddle.net/Zdf9d/6
 
@Zirak and without the overhead of jQuery.. :)
 
@Davinder this code is not cross browser however
won't work on IE8 and below.
 
11:43 AM
Oh, ok, thanks for the heads-up
 
indexOf on arrays isn't implemented, same for forEach
 
Ok, think I will stick with Derek's jQuery solution.
 
0
Q: Javascript attach event to class name

Guy DavidIf I have 10 items, with the class name keyword: <div class="keyword"></div> How can I attach an event, for example click, on this element. I tried the following, but with no luck: (no alert comes up) document.getElementsByClassName('.keyword').onclick = function() { alert(tr...

everything ^
 
12:14 PM
faceplant getElementsByClassName('.className')
Bring me my shotgun
 
12:36 PM
It might be nice if onclick worked with plural objects.
 
You have jQuery for this ;)
 
It might also be horrible.
 
addEventListener for NodeLists? I doubt it. Common ancestors ftw. Dunno why I didn't do that, actually...
 
(thinking)
Yep, semantically horrible.
It's just a forEach.
Or it would be, if it were an array.
 
yep, that's the drawback. If NodeLists implemented array functions...ahh, what a dream.
Same for arguments
 
12:42 PM
Yes indeed. :-(
Does anyone know why arguments was never an array?
 
At the very first, arrays didn't really have anything useful on them. IIRC, first version of js only had very little array methods, most were added in the standard (ES3).
So there appeared to be no benefit for the trouble of making arguments an array
Or little difference
 
Hmm. Okay, thanks. You'd think that as arrays progressed, so would args though.
Seems odd having a separate data type just for one entity.
I guess history is always full of these accidents. It's not an unacknowledged problem.
What do people here think of Harmony?
 
12:57 PM
A bunch of people shouting "OMG MAKE JS LIKE INSERT-FAVOURITE-LANGUAGE-HERE NO MATTER HOW MUCH IT DOESN'T FIT KTHXBAI <3", filled with horrifying syntax additions just for the sake of it and without much thought as to how it fits together.
 
Oh. Well that doesn't make me feel better.
 
mostly s/favourite-language/ruby/ i guess?
 
Crockford recently said that if ES6 added only modules and TCO then they'd have done a damn good job.
 
Not just Ruby...you see lots of Java, Python, Haskell and lots of other languages.
 
I'm concerned it's turning into JS++.
 
12:59 PM
I eventually just gave up trying to track all of this shit
 
There's CoffeeScript if you want Ruby.
 
Modules are nice, tuples are okay I guess, I can understand let and some sort of shorter function keyword (like fun, at a huge stretch even some arrow), but seriously...we already in ES6 have a dozen array comprehensions, function declarations which conflict with each other, more broken OOP systems
 
I don't understand CoffeeScript. People like the syntax, but JS doesn't need classes; it's a non-problem.
 
People just dump in their favourite syntactic sugar without giving much thought at all. Which is very sad...languages turn into a way of modeling existing ideas into your syntactic sweet-spot, instead of trying to invent new ways to solve problems.
 
I think modules are essential. Otherwise you're stuck with globals.
 
1:04 PM
i think some sugar such as for..in over arrays and list comprehensions would actually be nice
 
@Zirak Yep. Scheme ignored syntax and tackled actual problems.
@ThiefMaster Perhaps. It's tricky. JavaScript seems to be a middle-ground. It's not syntax-rich like ML, nor syntax agnostic like Scheme.
 
While js didn't do something new on its own, it at least incorporated real ideas (like dynamic objects, prototypical inheritance and so on) into a single environment.
oh, how I miss dynamic objects in other languages...
 
I think open objects model the real world better than closed objects and classes.
I don't think it hurts that it has C-syntax too.
 
tbh, the more I think about class-based OOP, the more I realize how it just doesn't fit. The best way to show it is trying to explain OOP to someone who doesn't know it; you can explain things like functions, variables, loops, recursion and so on, but you have to use incredibly weird analogies that don't quite work in order to describe OOP.
And you have to do it lower-level as well. The computer doesn't understand OOP, and humans need to bend a bit to understand OOP, so why is it used?
Add to that the fact that nobody seems to do OOP right.
 
Dunno.
If my car isn't fast enough, I can add a supercharger. I don't need to send the factory my design docs and wait for them to be incorporated into the production line.
I think JS style OOP follows natural thought processes better.
Not everything can be classified. There isn't a taxonomy for the universe.
 
1:15 PM
yep. Pure objects mimic the way we think much, much better.
 
Actually I've not used prototypes for a long time either. They're can speed things up, but aren't conceptually necessary if you have open objects.
This is why ES6 bothers me. JS should be looking to simplify, but do things right.
 
amen
 
1:45 PM
does css posses () selectors ?
input[type=radio] + (img+li)
 
For what purpose?
 
Dunno. I wish CSS had printf for straightforward debugging though.
 
@Zirak for evaluating a selector explicitly
 
What's the difference between something + (a + b) and something + a + b?
 
hmm
 
1:52 PM
I think that answers your question
 
Dunno. + is just adjacency, right?
 
but there is

a thing inside ( something + a )

and

a thing inside something
 
Those are two different things, or your hierarchy is wrong.
 
maybe
 
Give me a case
 
1:55 PM
have u known of the $ operator coming in CSS 4 ?
 
Does it invoke jQuery?
 
nope
it selects parent
 
Why not, dammit?
^ should select parent.
 
$ul li:hover{
/* Applies on the parent when hover occurs*/
}
 
$ should select dollars.
 
1:57 PM
lo
@Zirak now $ will select the whole selector

$ blah di blah
what if i wanna do

($blah di blah) > kamehameha // a sibling :3 woot ?
 
Then do it in another way :P
Or file a request.
 
I choose to do it javascript way (x
and file a request :D
 
I think the demands being placed on CSS are making it grow outside of its DSL specificity.
It should just be replaced with a JS API.
 
+1
 
CSS needs to be burned anyway
 
2:02 PM
and then non-js users will die
@Zirak -.-!
daFuQ why ?
u can do so much with CSS

1. Tabs
2. Accordions
3. All control elements
4. Keyboard Powered Slideshows
5. Make faces
6. Make animations ?
why burn CSS ?
 
Because it's one of the most terrible things which had the chance to crawl on this miserable earth. Never have I seen a language so messed up, so voodoo, so grotesque and so...irrational as CSS.
 
Hehe. The CSS box model makes sense to fractionally more people than understand the entirety of C++.
 
its magnificent @Zirak
 
You can do all those things with flying feces...you can make the most amazing things with the shittiest of tools. The fact you can do awesome things with it DOES NOT mean it's awesome.
 
atleast as i see it
 
2:04 PM
I bet Gilbert and George love CSS then.
 
no debate we can't leave CSS and neither can drop it
cause the amount of web that looks good because of css is ... 80% of it
 
That isn't a fact to its favour...you don't have anything else.
CSS has just completely missed the goal, from the beginning, of being a companion language to html. What exactly is it? Because it's nothing like a programming language, nor is it a kind of markup language. It's just a few rules glued together in a way which seems dignified.
It does not correspond to the nesting structure of html. It does not describe the document in a clean way. It doesn't even interact with itself in a nice way.
 
It made more sense when things were very simple. But things no longer are.
The box model never made sense.
It seems to get brushed under the carpet and rarely discussed by developers. Not a good sign.
It's tolerated.
 
Yeah, we can't throw it away, but shoot me if I call CSS anything favourable, because at that point I'd have lost all mental capabilities and is likely to think I'm Octopus King and build the octopi army, conqouring earth and destroying all civilization.
 
HTML, DOM, JavaScript, CSS; they all need unification.
I'd like to be an Octopus King.
I'm not sure it's a fair comparison.
Maybe the Head Lice King.
Of course, 200 years hence, people will finally realise that it's all bollocks and replace JavaScript and all the rest with Scheme. Hopefully the future will be full of irony.
 
2:14 PM
html also needs some core modifications...html5 just proves that.
haha, js needs A LOT of cleaning as well, and oh dear lord, the DOM API...why so Java!?
 
Scheme/Lisp already came up with a similar but more succinct syntax.
Ah, Java, ... it's the future!
 
Scheme is awesome, which is why a big chunk of programmers hate it with a fiery passion.
 
Java (& clones such as C#) is a corporate orgasm.
 
shudder
 
Correct me if I'm wrong, but I thought that Java was originally intended as a small, memory-safe OOP language for embedded systems.
A C replacement, because C++ was too heavyweight for those environments.
 
2:19 PM
The success of Java applets just proves it.
 
Hehe.
<trollface />
That being the case, why are enterprise systems being written in Java, and why is Smalltalk being written off?
 
Because of business.
 
Because of marketing?
 
Sun spent tons of money shoving Java down the throat of every person they could hear, see, smell or sense, kidnapped programmers and tortured them in underground cells to think, nay, to believe that Java is the cure for cancer and all things good.
2
 
I think you've uncovered repressed memories. Phoning therapist now.
 
2:24 PM
Because Smalltalk, like Emacs, does not follow the precious and most divine "Moore's Law", and therefore should be exterminated and relieve humanity of their existence
 
Smalltalk is essentially a portable Lisp machine for OOP lovers (but done right).
 
@Zirak remember the coin thing ?
 
(Prefer Vim.)
 
haha, nice
 
2:26 PM
ultimately i was given this to make in CSS . and i refused (x
 
Tau?
 
@Zirak And Microsoft could easily fuck them by making .NET completely open/free (as in free speech) and create official non-windows versions which are as up to date as the windows versions and well.. official unlike mono.
 
yeah, good call
 
Nah just a toint ( the currency is so far called toint ( point with a t instead of p ) )
 
@ThiefMaster Hardly. Java is a cult now
And Microsoft will never admit the existence of the great ugly beast called *nix
 
2:27 PM
@Zirak Hopefully. Previously it was a bona fide religion.
 
Because of its (sometimes questionable) advantages. Which advantage would Java have over a .net that is as portable and free as java?
 
@Zirak it does a lil bit
1% of whole linux kernel 3.17 i think is microsoft code
 
You don't understand! Java can cure cancer!
 
@Zirak bahahhahahhhahaha
 
yes, it cures itself when it crashes!
 
2:29 PM
@Zirak MS has a POSIX compliant subsystem, SFU: technet.microsoft.com/en-us/library/bb463204.aspx
Not marketed much for some reason ...
 
MS has a lot of things. It also burned, sweeped under the carpet and ignored many of them
 
!!> (Math.floor(Math.random()*10)%2)?'Zirak Drunk':'Zirak trolling':
 
@Abhishek Maximum execution time exceeded
 
LOL
 
waat?
 
2:30 PM
@Zirak You can compile *nix shit as native on Windows.
 
Weird, syntax error at the end...anyway, you can do this:
!!/choose "Zirak's drunk" "Zirak's trolling"
@Zirak Zirak's trolling
 
You can have ksh running as your native shell.
 
lol
 
On Windows.
 
nd the point is >??????????????????????
 
2:32 PM
The point is marketing.
$ > usefulness.
$ > sensibility.
 
!!/choose "Adscriven is ms fanboy" "adscriven is truthful"
 
@Abhishek "SyntaxError: Unexpected string"
@Abhishek adscreen is truthful
@Abhishek Adscriven is ms fanboy
 
Man, that's going to be my epitaph.
 
haha
sorry idk how i typed ur name wrong earlier
 
My headstone will read as follows: 'MS fanboy. 'Nuff said.'
Shame really, because JScript.NET could have been awesome. And F#.NET is awesome.
In a thousand years' time, MS will simply be known as the sponsor of nice typefaces.
 
2:43 PM
0
Q: AABB Sweeping, algorithm to solve "stacking box" problem

Ivo WetzelI'm currently working on a simple AABB collision system and after some fiddling the sweeping of a single box vs. another and the calculation of the response velocity needed to push them apart works flawlessly. Now on to the new problem, imagine I'm having a stack of boxes which are falling towar...

Just in case someone here happens to know this stuff :)
 
If anyone knows Erlang, troll me and tell me how to make these better: pastie.org/4177270
 
@Zirak lol u noob
 
That obvious?
 
dunno, I'm just trolling.
 
2:57 PM
You failed the clause; "troll me and tell me how to make these better"
 
00:00 - 15:0015:00 - 00:00

« first day (623 days earlier)      last day (4330 days later) »