“best result achieved by any JS implementation is still more than an order-of-magnitude slower than native code“ @jgw http://blog.j15r.com/2011/12/for-those-unfamiliar-with-it-box2d-is.html
yeah it's very much a preference thing and nobody else i've come across seems to prefer it, so i only use it in personal stuff, but i've been using it for a long time and strogly prefer it. it's weird
var a = new function Person(){this.sayHello = function(){};} how to create another instance of that Person? You can't. and of course by class I don't mean a classical class :P
In software engineering, the singleton pattern is a design pattern used to implement the mathematical concept of a singleton, by restricting the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The concept is sometimes generalized to systems that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects.
There is criticism to the use of the singleton pattern, as some consider it an anti-pattern, judging that it is overused, introduces unnecessary re...
the "class" is "declared" inline and then instantiated and the constructor is lost forever so you cannot create any more instances of it, yet you have a single instance of that class. That is not singleton?
RT @Scirra: Why you really should avoid using MP3 in your HTML5 games http://www.scirra.com/blog/64/why-you-shouldnt-use-mp3-in-your-html5-games #html5 #gamedev #mp3
@Esailija a singleton is all about enforcing the existence of a single class. The pattern your describing is an instance of an anonymous class, also called an anonymous object
note all object literals in javascript are "anonymous objects"
identifier, that's a good term. One should a say that a function is anonymous if there is no identifier for said function within the scope that contains the function express
Prototype-based singleton
In a prototype-based programming language, where objects but not classes are used, a "singleton" simply refers to an object without copies or that is not used as the prototype for any other object
”MediaKeys“ API proposal to enable a “secure key delivery & content decryption“ in HTML5 video & audio for DRM purposes http://www.w3.org/2011/webtv/wiki/MPTF/Netflix_Content_Protection
I’m confused between the two. Which is better, especially for jQuery and JS? Also, which do you think is more SEO-friendly? Note: I’m a noob. Please be kind. =) Thank you.
"you'll need to pass them as a url-esque array: ?error[]=err1&error[]=err2 so on"
an array
with two element.... one being err1, the other being err2
that would make $_GET['error']
http_build_query can be used to make urls that like in an easy manner: $url = '?' . http_build_query('error' => array('err1', 'err2')); yields my example url