Why does the first block of code get highlighted but not the second one?  Is the second code block being interpreted as part of the second list item?  If so, how do I close the second list item so I can start marking code with only 4 spaces?  Sub HereIsSomeCode()  End Sub    First list item. Next list item.  Sub HereIsSomeCode()  End Sub  (code prefixed by 8 spaces) Sub HereIsSomeCode()  End Sub
Consider the following piece of Markdown code:  This is some regular text.      &gt;&gt;&gt; def factorial(n):     ...     return 1 if n &lt; 2 else n * factorial(n - 1)     ...   * This is a list item.      &gt;&gt;&gt; def factorial(n):     ...     return 1 if n &lt; 2 else n * factorial(n - 1)     ...    Notice that the second code block is preceded by a list item.   Why is the factorial code not properly formatted under these circumstances? To demonstrate the problem, I'll insert the Markdown code show above:    This is some regular text.  &gt;&gt;&gt; def factorial(n): ...     return 1 if n &lt; 2 else n * factorial(n - 1) ...     This is a list item                 def factorial(n):       ...     return 1 if n &lt; 2 else n * factorial(n - 1)       ...               This applies to numbered as well as unnumbered lists.
I have to refactor a large C# application, and I found a lot of functions that are never used. How can I check for unused code, so I can remove all the unused functions? “community wiki” checkbox in new question shows a dialog twice when self-answering Click Answer your own question Check community wiki A dialog box     Are you sure you want to make this post Community Wiki?   will appear, Click OK or Cancel; The same dialog will appear again.   Google Chrome 44.0.2403.107 / Windows8.1 / site rev 2015.7.25.3609 My 1.12 solution can be found . When trying to update command blocks to 1.13, I have the following:  scoreboard objectives add invert dummy   (run at start) then:  scoreboard players set FakePlayer invert 1   (impulse unconditional repeat) chained into:  execute at @e[tag=summoned] run scoreboard players reset FakePlayer invert   (chain unconditional repeat) chained into:  execute if score FakePlayer invert = 1 invert run say "All summoned animals are dead!"   This should reset FakePlayers score continuously until all entities with tag "summoned" are dead, then it should run the final condition. This does not happen, and I can't see why. How to pack the game files into one without using any file compressor? Well, one example is this file of the game The Sims 2 for PS2: quickdat.arc. The file contains this .arc extension, but it's no one an archive file and it contains some data of the game inside. How can I do this? Put so many files in one?  How to do something like this? All the game files inside one without using a file compressor? I'm rotating an object on two axes, so why does it keep twisting around the third axis? I see questions come up quite often that have this underlying issue, but they're all caught up in the particulars of a given feature or tool. Here's an attempt to create a canonical answer we can refer users to when this comes up - with lots of animated examples! :)    Let's say we're making a first-person camera. The basic idea is it should yaw to look left &amp; right, and pitch to look up &amp; down. So we write a bit of code like this (using Unity as an example):  void Update() {     float speed = lookSpeed * Time.deltaTime;      // Yaw around the y axis using the player's horizontal input.             transform.Rotate(0f, Input.GetAxis("Horizontal") * speed, 0f);      // Pitch around the x axis using the player's vertical input.     transform.Rotate(-Input.GetAxis("Vertical") * speed,  0f, 0f); }   or maybe  // Construct a quaternion or a matrix representing incremental camera rotation. Quaternion rotation = Quaternion.Euler(                         -Input.GetAxis("Vertical") * speed,                          Input.GetAxis("Horizontal") * speed,                          0);  // Fold this change into the camera's current rotation. transform.rotation *= rotation;   And it mostly works, but over time the view starts to get crooked. The camera seems to be turning on its roll axis (z) even though we only told it to rotate on the x and y!    This can also happen if we're trying to manipulate an object in front of the camera - say it's a globe we want to turn to look around:    The same problem - after a while the North pole starts to wander away to the left or right. We're giving input on two axes but we're getting this confusing rotation on a third. And it happens whether we apply all our rotations around the object's local axes or the world's global axes.  In many engines you'll also see this in the inspector - rotate the object in the world, and suddenly numbers change on an axis we didn't even touch!    So, is this an engine bug? How do we tell the program we don't want it adding extra rotation?  Does it have something to do with Euler angles? Should I use Quaternions or Rotation Matrices or Basis Vectors instead? S. Weinberg, “The Quantum theory of fields: Foundations” (1995), Eq. (9.2.15) In Weinberg's book The Quantum Theory of Fields, Volume 1 on p.388 (Chapter 9), the following identity is used (with $f$ being any "reasonable" function):  $$f(+\infty) + f(-\infty) = \lim_{\epsilon \rightarrow 0^+} \epsilon \int_{-\infty}^{+\infty} d\tau f(\tau) e^{-\epsilon |\tau|}.\tag{9.2.15} $$  I don't understand the identity in a qualitative / heuristic way. Linux: Case-INSENSITIVE Filesystem How to change the forgotten root password? I forgot my root password...actually I think I know what it is because it is the same password I have for pretty much everything but in the Terminal in tell me "Sorry, try again." Is there a way to reset the password? If so how? How do I divide a circle into equal parts like a pie chart with Adobe Illustrator? Is there a fairly simple way to divide a circle into equal parts using Adobe Illustrator CC? Accessing variables from other functions without using global variables I've heard from a variety of places that global variables are inherently nasty and evil, but when doing some non-object oriented Javascript, I can't see how to avoid them. Say I have a function which generates a number using a complex algorithm using random numbers and stuff, but I need to keep using that particular number in some other function which is a callback or something and so can't be part of the same function.   If the originally generated number is a local variable, it won't be accessible from, there. If the functions were object methods, I could make the number a property but they're not and it seems somewhat overcomplicated to change the whole program structure to do this. Is a global variable really so bad? I have rigged up a notch filter from . See below: -     Its the first circuit. Now I am trying to calculate its transfer function. I have calculated two equations, but I need the third one:   (Vin-V2)/(1/SC1) = V2/R3 (Vin-V1)/R1 = (V1-Vo)/(R2+(1/SC2))   V1 and V2 are the potentials at the input of the op-Amp. Proper way to exit iPhone application? I am programming an iPhone app, and I need to force it to exit due to certain user actions.  After cleaning up memory the app allocated, what's the appropriate method to call to terminate the application? Why is Grub menu not shown when starting my computer? I am a new user of Ubuntu 12.04.   I installed Ubuntu and Windows XP, and I want to use both operating systems. When I restart or boot my PC the GRUB menu does not appear.  How can I solve this problem? Is there an English phrase for an inability to actually *leave* already? There is a Hungarian expression, küszöbgörcs, which literally means "threshold-cramp", and is used to describe that long conversation you have in the entryway, with all the guests awkwardly holding their coats and purses, and every so often somebody says something like "Ok, we really have to leave now, but just one more thing...", and then the conversation is good for another half an hour at least.  I've searched in vain for an equivalent idiom in English, yet I feel sure it must exist: I know English speakers are equally susceptible to this malady, it's not a uniquely Hungarian thing. I will sometimes use literal translations, like the aforementioned threshold-cramp (or doorway-spasm), but then I need to explain it, and that's less than satisfactory. (Plus it leads to more threshold cramping.) custom button visibility list view This is a neat little problem that I was discussing today with my lab group out at lunch. Not particularly difficult but interesting implications nonetheless  Imagine there are a 100 people in line to board a plane that seats 100. The first person in line realizes he lost his boarding pass so when he boards he decides to take a random seat instead. Every person that boards the plane after him will either take their "proper" seat, or if that seat is taken, a random seat instead.  Question: What is the probability that the last person that boards will end up in his/her proper seat.  Moreover, and this is the part I'm still pondering about. Can you think of a physical system that would follow this combinatorial statistics? Maybe a spin wave function in a crystal etc... Why is "No new release found" when upgrading from a LTS to the next? I'm following the , but on launching the upgrade tool I get this response:  Checking for a new ubuntu release No new release found   Am I doing something wrong? Is there a workaround? If $0$ is the zero-object $ \Longrightarrow F(0) $ is the zero object when $F$ additive var self = this? Using instance methods as callbacks for event handlers changes the scope of this from "My instance" to "Whatever just called the callback". So my code looks like this  function MyObject() {   this.doSomething = function() {     ...   }    var self = this   $('#foobar').bind('click', function(){     self.doSomethng()     // this.doSomething() would not work here   }) }   It works, but is that the best way to do it? It looks strange to me. Simple animation in WinForms Imagine you want to animate some object on a WinForm. You setup a timer to update the state or model, and override the paint event of the Form. But from there, what's the best way to continually repaint the Form for the animation?   Invalidate the Form as soon as you are done drawing? Setup a second timer and invalidate the form on a regular interval? Perhaps there is a common pattern for this thing? Are there any useful .NET classes to help out?   Each time I need to do this I discover a new method with a new drawback. What are the experiences and recommendations from the SO community?