If I want an asynchronous thread to, do I need setTimeout?
JavaScript closure inside loops – simple practical example
Am I Running as a Service I am currently writing a little bootstrap code for a service that can be run in the console. It essentially boils down to calling the OnStart() method instead of using the ServiceBase to start and stop the service (because it doesn't run the application if it isn't installed as a service and makes debugging a nightmare).  Right now I am using Debugger.IsAttached to determine if I should use ServiceBase.Run or [service].OnStart, but I know that isn't the best idea because some times end users want to run the service in a console (to see the output etc. realtime).  Any ideas on how I could determine if the Windows service controller started 'me', or if the user started 'me' in the console? Apparantly  is not the answer. I thought about using commandline args, but that seems 'dirty'.  I could always see about a try-catch statement around ServiceBase.Run, but that seems dirty. Edit: Try catch doesn't work.  I have a solution: putting it up here for all the other interested stackers:      public void Run()     {         if (Debugger.IsAttached || Environment.GetCommandLineArgs().Contains&lt;string&gt;("-console"))         {             RunAllServices();         }         else         {             try             {                 string temp = Console.Title;                 ServiceBase.Run((ServiceBase[])ComponentsToRun);             }             catch             {                 RunAllServices();             }         }     } // void Run      private void RunAllServices()     {         foreach (ConsoleService component in ComponentsToRun)         {             component.Start();         }         WaitForCTRLC();         foreach (ConsoleService component in ComponentsToRun)         {             component.Stop();         }     }   EDIT: There was another question on StackOverflow where the guy had problems with the Environment.CurrentDirectory being "C:\Windows\System32" looks like that may be the answer. I will test today. Is there a way to offset an edge? (extrude edge loop perpendicular to each edge) I recently figured out how to do it with faces, but with edges, I can't seem to get it to work. I have a complex flat plane and i need to extend an edge loop. I tried setting to individual origins in combination with all possibilities for x,y,z axes in global and local, but it is still not extruding along the normals.   actual problem   simplified How to replace the first occurence in an expression instead of replacing all? Graph with $k$ components. Let $G$ be a simple graph on $n$ vertices. If $G$ has $k$ components and every component is complete prove that: $$|E| \le \frac{(n-k)(n-k+1)}{2}$$ I'm asking for advice. How to search for list of papers citing both papers A and B? For given papers A and B, I would like to search for all papers that cite both A and B. I guess one can generalize to papers {A,B,C,...} and find all papers that cite all of them.   A quick Google Scholar and Web of Science search revealed nothing. Google Scholar has a "cite=..." thing in the URL, which I messed with a bit to no avail. My opponent casts , which resolves, then he attacks with his creatures.  In my hand, I have a creature card with Flash. If I summon this creature before the declare blockers step, will it be affected by Predatory Rampage's blocking requirement? Add Virtualbox Shortcut in Unity Launcher to boot to a VM Can I create a shortcut to a virtualbox OS in the unity sidebar without it being on the desktop too.  I tried to right click in virtualbox and create shortcut on desktop then move it. but if i do it then delete the desktop shortcut it renders the unity shortcut useless.  Any ideas? How do I save a variable or function definition to a file? "Naturally occurring" non-Hausdorff spaces? It is not difficult for a beginning point-set topology student to cook up an example of a non-Hausdorff space; perhaps the simplest example is the line with two origins. It is impossible to separate the two origins with disjoint open sets. It is also easy for a beginning algebraic geometry student to give a less artificial example of a non-Hausdorff space: the Zariski topology on affine $n$-space over an infinite field $k$, $\mathbf{A}_{k}^{n}$, is not Hausdorff, due to the fact that polynomials are determined by their local behavior. Open sets here are in fact dense. I am interested in examples of the latter form. The Zariski topology on $\mathbf{A}_{k}^{n}$ exists as a tool in its own right, and happens to be non-Hausdorff. As far as I'm aware, the line with two origins doesn't serve this purpose. What are some non-Hausdorff topological spaces that aren't merely pathological curiosities? Is it supposed to be a HTML or an HTML Light is clearly affected by gravity, just think about a black hole, but light supposedly has no mass and gravity only affects objects with mass.  On the other hand, if light does have mass then doesn't mass become infinitely larger the closer to the speed of light an object travels. So this would result in light have an infinite mass which is impossible.  Any explanations? How extended must my extended paper be? I am studying elementary Algebraic Topology recently. I have seen that a topological space is identified with a group. We are telling the group as Fundamental Group. So every topological space $X$ and for any $x \epsilon X$ there is a fundamental group $\pi_1 (X,x)$. I have a question about the converse. If we consider any arbitrary group $G$, then does there exist a topological space $X$ and an element $x\epsilon X$ such that $\pi_1 (X,x)=G$? Since asking for tutorials, videos, resources, links to other content or downloads is considered off topic here, this is a specifically created Community Wiki which gathers resources for Blender and it has been approved by the .  Just write in the appropriate answer/section. If you have concerns, questions, post a  question, so we don't clutter the comments, but you can link your meta question from the comments.  Questions regarding such resources are not allowed anymore, except for very specific and on topic requests (ask on  if you're unsure about your question). Follow the instructions made in the question about how to post, what can be posted, etc.  Learning             Assets    (also see: )   Reference Images/Blueprints (also see: )    Tools    (also see: )      Other   Special Interest ()     Also see the . Say that Player X is 2nd in the initiative. 1st is the Black Court vampire that is in a rage and taking a swing at Player X. Player X gets a built in defense [Athletics/Fists + 4dF] but can Player X instead use his action this turn to cast his Rote Evocation Shield?  It is not his turn in the initiative order. A Block is an Action that a Player can take on his turn.   Thematically though, it seems to make sense that the char could cast a Rote Evocation Shield in response to an attack ahead of him in the initiative order. At least thematically in the books. Also, the example in YS252, shows him reacting to an attack by Agatha Hagglethorn by bring up his shield.  I am hoping there is some as yet undiscovered dark corner where this concept is covered or squashed. How to get rights of admin after I disabled all admin accounts in my computer I accidentally disabled my admin account.  After I login to another account I found I can not get admin rights, because all admin accounts on my computer are disabled.  I clicked on 'run as administrator' but only see a smart card choice (all the admin accounts are disabled so no choice provided)    I don't want to re-install my OS, help!    Details:  I have account A on my computer.    I got a new computer so I want to give the old one to my mother.    Creating a new user account B for her and disable account A.    Logout and restart.    Successfully login B, now I found I could not get admin rights because no account choice is provided.    More informations about my machine:  OS is Windows 10 and my admin account is a Microsoft Account.  I have an arch-linux installed on my computer and dual-boot it using GRUB, so maybe I can not use safe mode. Without appealing to choice, can we prove that if $X$ is well-orderable, then so too is $2^X$? Without appealing to the axiom of choice, it can be shown that (Proposition:) if $X$ is well-orderable, then $2^X$ is totally-orderable.  Question: can we show the stronger result that if $X$ is well-orderable, then so too is $2^X$?  Proof of Proposition. Pick any well-ordering of $X$. Then the lexicographic order totally orders $2^X$.  More explicitly: for any two $f,g \in 2^X$, define $f &lt; g$ iff   there exists $x \in X$ such that $f(x) \neq g(x)$, and if $x \in X$ is minimal such that $f(x) \neq g(x)$, then $f(x)=0$ and $g(x)=1$.   It can be shown that $&lt;$ totally-orders $2^X$. I've compiled a java project into a Jar file, and am having issues running it.  When I run:  java -jar myJar.jar   I get the following error  Could not find the main class: myClass   The class file is not in the root directory of the jar so I've tried changing the path of the main class to match the path to the class file and I get the same issue.  Should I be flattening the file structure? if so how do I do this. I'm using Ant to build the Jar file if thats of any use.  UPDATE   Here is the contents of the jar and the relevant Ant sections, I've changed the name of the firm I work for to "org":  META-INF/ META-INF/MANIFEST.MF dataAccessLayer/ dataAccessLayer/databaseTest.class org/ org/eventService/ org/eventService/DatabaseObject.class org/eventService/DatabaseObjectFactory.class org/eventService/DbEventClientImpl$HearBeatMonitor.class org/eventService/DbEventClientImpl.class org/eventService/EmptyQueryListException.class org/eventService/EventHandlerWorkItem.class org/eventService/EventProcessor.class org/eventService/EventTypeEnum.class org/eventService/EventWorkQueue$MonitorThread.class org/eventService/EventWorkQueue$PoolWorker.class org/eventService/EventWorkQueue.class org/eventService/FailedToLoadDriverException.class org/eventService/IConnectionFailureListener.class org/eventService/InvalidEventTypeException.class org/eventService/JdbcInterfaceConnection.class org/eventService/NullArgumentException.class org/eventService/OracleDatabaseObject.class org/eventService/ProactiveClientEventLogger.class org/eventService/ProactiveClientEventLoggerException.class org/eventService/PropertyMap.class org/eventService/SQLServerDatabaseObject.class org/eventService/TestHarness.class org/eventService/Utilities.class   And the ant target:  &lt;target name="compile" depends="init" description="compile the source "&gt;     &lt;javac srcdir="src" destdir="bin" classpathref="project.class.path"/&gt; &lt;/target&gt; &lt;target name="buildjar" description="build jar file" depends="compile"&gt;     &lt;mkdir dir="dist"/&gt;     &lt;jar destfile="dist/myJar.jar" basedir="bin" includes="**/*.class" &gt;         &lt;manifest&gt;             &lt;attribute name="Main-Class" value="org.eventService.ProactiveClientEventLogger"/&gt;         &lt;/manifest&gt;      &lt;/jar&gt; &lt;/target&gt; The workings of the Hall effect? I want to ask about the workings of the . Why do the electrons come to rest on the edge of the wire? The magnetic field pushes them up, and the electric field pushes them forward. Shouldn't they reach the top of of the conductor and then stop moving up but continue moving forward?  Why does the magnetic field stop them from continuing to flow? The magnetic force is up so why would it effect their velocity forwards? How can I control a servo motor with the PWM output of a microcontroller? I wanted to control the direction of servo motor with a switch. I am using an Atmega32.  Outputs are PIND4 and PIND5 and the input is PINA3, but the two servo motors turn only in 1 direction.  #ifndef F_CPU  #define F_CPU 1000000UL   #endif  #include &lt;avr/io.h&gt; #include &lt;util/delay.h&gt; #include &lt;avr/interrupt.h&gt;   int main(void) { DDRD= 0xFF ; DDRA=0x00; PORTA =0x00; // FAST PWM TCCR1A |= 1&lt;&lt;COM1A0 | 1&lt;&lt;COM1A1 | 1&lt;&lt;WGM11 |1&lt;&lt;COM1B0|1&lt;&lt;COM1B1 ; TCCR1B= 1&lt;&lt;WGM12|1&lt;&lt;WGM13 ; ICR1 = 19999 ;  TCCR1B |=1&lt;&lt;CS10 ; while (1) {    if(PORTA==0x08) //if pina3 is 1    {     OCR1A = ICR1 -2000 ;   //turn servo 1     _delay_ms(1000);          OCR1B=ICR1-2000;    //turn servo 2     _delay_ms(1000);     }     if(PORTA==0x00)// if pina3 is 0     {       OCR1A = ICR1 -900 ; //turn servo 1 in the other direction       _delay_ms(1000);               OCR1B=ICR1-900;     //turn servo 2 in the other direction       _delay_ms(1000);      } }       return 0 ;  }