I am trying to make a bot clear an interval if my config file says "off" but leave it running if it says "on".  I've already tried doing  discord.js      config.Interval = setInterval(() =&gt; {         WallCheck.send(WallCheckembed);     }, 500);      clearInterval(off) };   but when I put in the "config.Interval" its setting the setInterval to "config.Interval".  discord.js      config.Interval = setInterval(() =&gt; {         WallCheck.send(WallCheckembed);     }, 500);   This is my code. And my config file is:  "Interval": "off"   The only error I'm getting is this:  (node:6844) UnhandledPromiseRejectionWarning: ReferenceError: off is not defined   And the variable "off" is referring to the "off" in my clear interval.
2127
I am using setInterval(fname, 10000); to call a function every 10 seconds in JavaScript. Is it possible to stop calling it on some event?   I want the user to be able to stop the repeated refresh of data.
97101
I want a certain local user to not log off. ever.  It's much like this , however I don't necessarily care if the buttons are there, I want to pop up a messagebox that says "Please do not log off the console" with an "OK" button that then cancels the log off attempt. Can this be done in a logoff script?  there are group policies to disable the logoff button on the startmenu and on the CTRL-ALT-DEL dialog.  However what I'd like is more like , which appears to not be in server 2008 R2?  Or am I missing it?  I even tried to , but it doesn't work,   Is it possible to create a logoff script that displays a dialog warning the user to not logoff and then cancels the logoff?  I understand this is a daft need - unfortunately it is not in my power to change or push back.  I've exhausted those options.  Feel free to get a ton of upvotes on a comment explaining that this is really a dumb plan that is obviously mitigating a symptom of many many systemic issues rather than solving anything.  I fully understand that this course of action is actually creating problems.  I want this done so I can be done with this contract and never ever work with them again.
30514
I'm trying to make a systemd timer that runs every 15 minutes. Right now I have:     timer-fifteen.timer:  [Unit] Description=15min timer  [Timer] OnBootSec=0min OnCalendar=*:*:0,15,30,45 Unit=timer-fifteen.target  [Install] WantedBy=basic.target    timer-fifteen.target:  [Unit] Description=15min Timer Target StopWhenUnneeded=yes    This runs over and over again without stopping. Does it need to be *:0,15,30,45:* instead? How can I make this work?
14541
I have a pretty good understanding of Javascript, except that I can't figure out a nice way to set the "this" variable.  Consider:  var myFunction = function(){     alert(this.foo_variable); }  var someObj = document.body; //using body as example object someObj.foo_variable = "hi"; //set foo_variable so it alerts  var old_fn = someObj.fn;   //store old value someObj.fn = myFunction;   //bind to someObj so "this" keyword works someObj.fn();               someObj.fn = old_fn;       //restore old value   Is there a way to do this without the last 4 lines?  It's rather annoying...  I've tried   binding an anonymous function, which I thought was beautiful and clever, but to no avail:  var myFunction = function(){     alert(this.foo_variable); }  var someObj = document.body;        //using body as example object someObj.foo_variable = "hi";        //set foo_variable so it alerts someObj.(function(){ fn(); })();    //fail.   Obviously, passing the variable into myFunction is an option... but that's not the point of this question.  Thanks.
88514
I want a method to run after every 10 or 15 seconds.   My timer is set to:   timer = (double) gameTime.ElapsedGameTime.TotalSeconds;   What would be the logic to check for every 10 or 15 seconds?
99698
I tried to write out the aura if statement but I am getting stuck if someone can explain it to me in detail. thank you  &lt;aura:if isTrue=&quot;{!lessthan(v.Tl.time, v.Tl.End_Date_Time1__c)}&quot;&gt;                            &lt;/aura:if&gt;
72811
I've attempted to suspend a user from chat for 1-2 minutes so I input 0.02 into the &quot;hours&quot; field. The result was
14452
Somehow, I am finding it difficult to understand tweaking around * parameters with cron.  I wanted a job to run every hour and I used the below setting:  * */1 * * *   But it does not seem to do the job. Could someone please explain the meaning of above and what is needed for the job?
71061
I'm new at scripting.  I know that it's a basic question but I tried everything I could and nothing works.  So here's my problem:  I want to create a shortcut that automatically sets up a mirror modifier to an empty and then my custom pie menu opens with extra modifier options.  The only problem is that the menu will show me the option only of the selected object, and in my series of code I'm stuck at selecting the empty. I just want to select the object I defined as "OB" and it's done.  Here is the code:   import bpy  OB = bpy.context.selected_objects[0] bpy.ops.object.modifier_add(type='MIRROR') bpy.ops.object.mode_set(mode='OBJECT') bpy.ops.object.empty_add(type='PLAIN_AXES', view_align=False, location=(bpy.context.scene.cursor_location)) bpy.context.object.name = "Mirror Axes" OB.modifiers["Mirror"].mirror_object = bpy.data.objects["Mirror Axes"]  # HERE I NEED THE CODE THAT SELECTS "OB"  open_menu("D Mirror Menu")   I tried:    bpy.context.scene.objects.active = OB  OB.select = True  bpy.context.selected_objects[0] = OB   bpy.context.object = OB    And many other methods, but nothing works, the empty is still selected !! and I dont know why.  thanks
70961
I am looking for a method built-in to ubuntu that will allow me to run a script or program or whatever for a fixed period of time.  , but the package is unavailable for Ubuntu. In any case, I was hoping for something built-in.  The only thing i can think of is to get the current time and set a cron job 30 minutes from 'now' that will kill the program.  I was hoping there was a way to do this without setting up a script, but if I need to - it wont be the end of the world. After the 30 minute interval I would like to put my laptop in a sleep mode, but this can be separate from the timer thing.  Thanks in advance.
89433
I have a config-file that I keep open in vim, but that sometimes gets changed on disk, without these changes being reflected on the terminal. Can I refresh the content on the screen without closing and re-opening the file? If so, how?
36279
I have set -e turned on for my script. The only thing is there is one command here that I don't want causing the script to exit if it fails, but I want everything else to do that. How can I keep set -e on, and not have my script exit when an error code is thrown?  script in question:  native=$(pacman -Qenq -)   If stdin has a non-native package name an error code gets written to stdin.
10409
If I do not edit the .bashrc or other config files, the environment variables that I've setted are gone when I logout, or turn off the terminal.   What I'm curious is, where are those 'temporary' env vars saved in?   As I guess, they might be in the memory. That makes sense because they will disappear when the terminal is turned off(equals the terminal I was using is gone from the memory). Am I correct?
30377
AFAIK, you never need to specify the protocol in an onclick:  onclick="javascript:myFunction()" Bad  onclick="myFunction()" Good  Today I noticed in  on Google Anallytics that they are using it:  &lt;a href="http://www.example.com" onClick="javascript: pageTracker._trackPageview('/outgoing/example.com');"&gt;   Is this example just plain wrong, or is there ever a reason to specify javascript: in anything other than a href?
64780
I want my crontab to be every 4 hours but from a certain time 1 pm:  I chose this config:  0 1/4 * * *   but if I save I get the error:  bad hour errors in crontab file, can't install.   This following works perfectly, but then I cannot decide the starting time.  0 */4 * * *
34723
I am creating a script which clears the cache for Google Chrome. However, I would like to check if Chrome is open and if so not run the code but if it isn't then it will execute the code. I can see that the Process Name is Google Chrome but the code doesn't work.  This is what I have done so far. What am I doing wrong?  SERVICE='Google Chrome'  if ps ax | grep -v grep | grep $SERVICE then     RUNS THE CODE else     echo "PLEASE CLOSE GOOGLE CHROME" fi   Any help would be appreciated :)
45192
I'm trying to make a minecraft map and to prevent cheating i want to run a command on a clock that sets everyone in creative mode except myself back to adventure mode.