I see the link about the use of this is jQuery. Yes, the problem was exactly this, but this situation is a completely different one, so please remove useless links to other questions and mark as duplicated because this can lead to confusion to a poor SO user looking for a more simple situation.  Also: my code is fully pasted here, not just a snippet, and my code is not using some complicated binding at all, is more basilar. So it's a complete new question for me  This is my full working code  var game = {     status : {         NOT_INITIALIZED : "gamepad:not_initialized",         INITIALIZED     : "gamepad:initialized",     },     _selector : null,     _status   : null,     init : function( gamepad_selector ) {         this._selector = gamepad_selector;         $(this._selector).on(this.status.NOT_INITIALIZED, this.onNotInitialized);         this.setState(this.status.NOT_INITIALIZED); // just to force the first console log         $(this._selector).on(this.status.INITIALIZED, this.onInitialized);         this.setState(this.status.INITIALIZED);     },     setState : function ( new_status ) {         this._status = new_status;         $(this._selector).trigger(new_status);     },     onNotInitialized: function () {         console.log("onNotInitialized()");     },     onInitialized: function () {         console.log("onInitialized()");     }, }   The entry point is a call to game.init().  Note that on the init function, I can call setState using one of the predefined status. This works.  this.setState(this.status.NOT_INITIALIZED);   I tried to avoid using of this.setState, so I deleted this function and tried to set this._state directly into the event listeners.   This the significative parts of not working code:  init : function( gamepad_selector ) {     ....     console.log ("a");     $(this._selector).on(this.status.NOT_INITIALIZED, this.onNotInitialized);     console.log ("b");     $(this._selector).trigger(this.status.NOT_INITIALIZED)     console.log ("c");     .... },  onNotInitialized: function () {     // I can't do this: throws an error     this._status = this.status.NOT_INITIALIZED;     console.log("onNotInitialized()"); },       The problem: at runtime I got this error:  Cannot read property 'NOT_INITIALIZED' of undefined   related to   this._status = this.status.NOT_INITIALIZED;   The error is at runtime, not at 'compile' time (please forgive me the term), because I can see on the console log both a and b. But not c.  Why can I explicitly use this.status.NOT_INITIALIZED in init but not in onNotInitialized ?
I have created a 'control' using jQuery and used jQuery.extend to assist in making it as OO as possible.  During the initialisation of my control I wire up various click events like so  jQuery('#available input',              this.controlDiv).bind('click', this, this.availableCategoryClick);   Notice that I am pasing 'this' as the data argument in the bind method. I do this so that I can get at data attached to the control instance rather from the element that fires the click event.   This works perfectly, however i suspect there is a better way  Having used Prototype in the past, I remember a bind syntax that allowed you to control what the value of 'this' was in the event.  What is the jQuery way?
I'm setting up a Cronjob that will backup a MySQL database I have in my server, but I don't want it to keep overwriting the same file over and over again. Instead, I want to have an array of backups to choose from, done automatically. For example:  ## Cronjob, run May 21st, 2011: mysqldump -u username -ppasword database &gt; /path/to/file/21-03-2011.sql  ## SAME Conjob, run May 28th, 2011: mysqldump -u username -ppasword database &gt; /path/to/file/28-03-2011.sql   And so on.  Is there any way that I can use the system date and/or time as some kind of variable in my Cronjob? If not, what are your suggestions to accomplish the same? I have a button created by my script. I wonder how I can display what the system console displays but inside blender's console. CoDEmanX did this by running a script inside it as shown , but I want to display what happens in the system console inside blender's console.  My .blend file can be found here: What happens to Jen when she jumps off the cliff? What happens to Zhang ziyi (Jen) in  when she jumps off the cliff .. she dies? becomes immortal? Just before jumping what does she want Lo to become - a master?  Why does she jump off, guilt? How can I get grub2 to boot a different option only on the next boot? Category of Grp is not a subcategory of Set How do I install Adobe Flash player? Open all iCloud tabs from iPhone on Mac TLDR; Is there a way to simultaneously open all iCloud tabs saved on iPhone, on a Mac?  I use my iPhone for browsing and as a means of "read it later" I just leave the open tabs there with the purpose of opening them all later on my Mac. Is there a way to open them all (much like Chrome allows in the "Tabs from other devices" in History page)? Dynamic select list in the form (dependent dropdown) Best Practice for Forcing Garbage Collection in C# When to use the double not (!!) operator in JavaScript Does more reflective aluminum foil make a room cooler compared to less reflective foil? Aluminum foil is said to be not absorbing light at all. It reflects light. So, does it mean that a more shiny aluminum foil will reflect more light and thus make the room more cooler as compared to less shiny foil?  If yes, then where does unreflected light go in case of less shiny aluminum foil?  Does less shiny and more shiny actually make a difference? Why?  In order to keep whole room cool will it help if I stick the foil to the outside of wooden door (exposed to the sunlight) too? tl;dr  Due to the special nature of Meta and the high rate of "lost souls", should we try out the Ask a Question Wizard here on Meta Stack Exchange too?  General idea  In case anyone doesn't know yet, . It guides new users towards writing better questions.  I think that such a question wizard would be useful on Meta Stack Exchange too, for three main reasons:   . There are four types of questions on Meta, each represented by the different required tags: , ,  and . Especially bug reports can often be split into a certain structure (what's wrong, how to reproduce, why I think it's wrong, examples). The same holds true for feature requests. Such a structure is ideal for a question wizard. Quite a few users  and . While the Meta community is well prepared to deal with these posts quickly, they lead to an less-than-ideal first impression by the new users and they distract the community from more important issues. Site-specific questions are often off-topic. This  since nowhere is it hinted at in the help pages (and there are a lot of old, not-yet-closed SO-specific questions from a prior era of this site) and can lead to unnecessary drama. If we add an honeypot into the wizard to catch this case (and ideally redirect them to the proper meta site), we could prevent this.   As Sonic said, there's an  new users need to read and confirm. However this doesn't really prove effective right now and we might need to try stronger tools (e.g. question wizard).  Therefore I think that we should test the Ask Question Wizard here on Meta too.  Implementation details (help welcome)  I think the wizard should have six main entry points:   I want to discuss a specific post or action from any Stack Exchange site. (-> honeypot, redirects to the appropriate per-site meta) I have a question regarding the use of Stack Exchange sites (-> support mode) I think I found a bug while using the Stack Exchange sites  (-> bug mode) I have an idea for improving the Stack Exchange sites  (-> feature request mode) I have a discussion I want to start about Stack Exchange communities or their rules  (-> discussion mode) I have some other (e.g. programming) question  (-> honeypot, redirects to )   Coming from these choices, the user would either be redirected to a landing page explaining, why this is not the right community and offering some alternative choices or they would follow the guided assistant.  For 1. the user might be asked on which site the post/action is. Maybe the system could show the three sites where the user was recently active/has the highest reputation on.  support mode would ask the user for these details:   what do you want to achieve? what have you tried? what is your current problem?   bug mode would ask the user for these details:   bug description how to reproduce the problem why do you think that this is wrong? (possibly) examples   feature request mode would ask the user for these details:   what is your goal? how do you think could this be achieved? why will the community benefit from this change? (possibly) details   discussion mode would ask the user for these details:   which rule do you want to propose/clarify (optionally) examples/why is this rule required?   Note: the above implementation details probably require some revision. Feel free to edit/suggest improvements for both wording and details. Array of zero length Short sci-fi story about Earth blockaded by other human colonies Like the subject: short sci-fi story about Earth blockaded by other human colonies.  The best humans have colonized some stellar systems. But they begin to treat humans of earth like inferiors. A war began, colonies won the war and blockaded the earth, but despite this the earth won. Who is the author? Illogical twoside margins Shouldn't the twoside option produce a wider margin at the binding/spine edge, rather than the other way around? I'm using \documentclass[twoside]{report}. Will it be possible to create apps/games in Java SE or Java ME on new Ubuntu phones? Here's a scenario:  Someone asked about "How to build a SQL query to get count and blah blah blah..."  His only tag is . I added the  and  tags to it.  Someone else answered with a nice SQL statement that has a "group by" statement which seems "logically inevitable".  I proceed to add a tag . I did that on the basis that someone who searches for  will be able to find this post useful, just as I did. My concern is, it wasn't described at all in the question, nor was it implied, unlike  and .  What is the community opinion?  The scenario above is a real one . And the one who answered it nicely is Jon Skeet. I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland How many Java string objects created in the code String s="abc"+"xyz";? When I wake the laptop from the sleep I need to get the VPN state as I left it (turned on). Can't find the setting of autoconnect in VPN settings... Need some easy way to ask the system to autoconnect the VPN when the internet is available.  Edit based on comments:  Ubuntu 18.04 has no option to Always connect to VPN when using using this connection.