I'm using code from GitHub for mitigation of DDoS attacks using reactive flow rules in Floodlight Controller. I can't run the program because the global variable attacked_switches is not defined, but I don't know how to do that. Can anybody help me?        def start():      try:          number_of_switches, number_of_hosts = topology_info()         switch_dpids = list()         hosts = dict()         switch_dpids = switch_info(number_of_switches, switch_dpids)         hosts = host_info(number_of_hosts, hosts)         dpid = switch_byte(number_of_switches, switch_dpids)         print 'dpid= ', dpid         if dpid != 0:             print'calling flow pusher'             global attack             attack = True             attacked_switches.add(dpid)             T2 = threading.Thread(target=Flowpusher, args=[dpid])             T2.start()         elif attack:             T3 = threading.Thread(target=Flowremover, args=[dpid])             T3.start()      except Exception as e:         print'Error occured:', e
How can I create or use a global variable in a function?  If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?
How do I get the distinct/unique values in a column in Excel? If I have a column with values, and I want to find out what distinct values are in there (not how many - but the actual distinct values), how can I do that?  In SQL Server I would do something like   SELECT Distinct(MyColumn) FROM MyTable Execute vs Read bit. How do directory permissions in Linux work? Are there perfect elastic collisions in Nature? How does one find which files are taking up 80% of the space on a Linux webserver? The drive is constantly filling up. You've hunted down all the spare and random files you can. grep'd for coredump files and even removed some of the un-needed backups...  What would be your next move.  The actual server in question has 10GB of website files and the OS shouldn't take any more than 10GB so how do you track down what's filling a 50GB (virtual) drive? I am looking for a list of all English words that are their own antonyms. Off the top of my head, I can only think of "either", "fast", "to dust" and "to lease", but there must be dozens more. Can you provide a link to a comprehensive list, if such exists?  Also, what are such words most commonly called? I like the term "Janus word" I once heard, but is that widely understood?  Edited by popular demand to make it absolutely clear that this is not a community wiki poll. Notify-send ignores timeout? Maybe I'm doing something wrong, but shouldn't the commands (run separately) notify-send -t 1 &quot;test&quot; notify-send -t 1000 &quot;test&quot; notify-send -t 10000 &quot;test&quot;  have different timeouts? The first being nearly instantaneous, the second taking 1 sec and the third 10 seconds? In all cases it seems to take about six seconds for me. Is there a way around this behaviour? As the developers label this as a &quot;feature&quot; instead of a bug, I would like some alternatives. I have seen similar posts but none seem to work. I simply need to remove the dots in the ToC between the chapter titles and the page numbers. I think the page numbers should line up (as if there were dots). This is using the memoir class. Here is my ToC info:  %%%% Do the ToC \let\oldtoc\tableofcontents \renewcommand{\tableofcontents}{\clearpage\pagestyle{toc}\oldtoc}  \renewcommand{\contentsname}{TABLE OF CONTENTS} \renewcommand{\listfigurename}{LIST OF FIGURES} \renewcommand{\listtablename}{LIST OF TABLES} \renewcommand*{\tocheadstart}{\vspace*{-\topfiddle}} \renewcommand*{\aftertoctitle}{\thispagestyle{plain}%   \par\nobreak \mbox{}\hfill{\normalfont Page}\par\nobreak} \renewcommand*{\cftchapterfont}{\normalfont} \renewcommand*{\cftchapterpagefont}{\normalfont} \renewcommand*{\cftchapterleader}{%   \cftchapterfont\cftdotfill{\cftchapterdotsep}} \renewcommand*{\cftchapterdotsep}{\cftdotsep} %\renewcommand*{\cftchaptername}{CHAPTER~} %%% no extra space before the entry \setlength{\cftbeforechapterskip}{0pt plus 0pt} %% no extra 'chapter' space in LoF/LoT \renewcommand*{\insertchapterspace}{}   I tried everything that was suggested. Nothing seemed to make any difference. I am stuck with this format. Any suggestions would be greately appreciated! When light waves enter a medium of higher refractive index than the previous, why is it that:  Its wavelength decreases? The frequency of it has to stay the same? How do I select background music for my RPG campaign? Music is an essential component of my games. When running games set in the Star Wars universe, the music of John Williams adds a new dimension to the experience, both for me and for my players. Now that I'm starting a fantasy campaign, I'm a bit more uncertain about which music to use.  How do I create a soundtrack suitable for using in a fantasy campaign?  Specifically:   What sort of characteristics make for good back ground music? What makes for bad background music? What should I look for to get a fantasy feel? Which genres/sub-genres support fantasy games? What are good sources for fantasy background music?   A few notes:   Because the music will be used in the background of game sessions, most of the tracks should be one minute or longer, to avoid repetitive loops. Likewise, soundtracks with a variety of themes are preferred, so that they can easily support different modes of the game: exploration, combat, and chases, to name a few. Orchestral or acoustic music is preferred over music with vocals or electric instruments. ASP.NET MVC: Weird characters in error page Earlier today I posted  which yielded a .  I'd like to attract attention to this answer in the hope that the answer will get upvoted, as a kind of reward for the quality of the answer.  Is there anything that I can do to achieve this? What's the source of "shipped" in a romantic sense? Does one work in or on an aeroplane? In an exam paper, there was a picture of an air stewardess in the aeroplane serving passengers. One of my pupils wrote the following:      The air stewardess works on an aeroplane.    Shouldn't it be the air stewardess works in an aeroplane? How to access "The grimm Troupe" and "Hidden dreams" content in Hollow Knight? In these two official announcements from Team Cherry, it's said:       Grimm’s quest, and all other new features can be accessed at any point   in your Hollow Knight journey.        Hollow Knight: Hidden Dreams content is accessible at any point in the   game, whether starting fresh or scouring for completion.   I still haven't find any way to start the quests from the menus or during beginning of the game. Some sources say the content can only be accessed late in the game from specific locations.  So, is Team Cherry simply lying in our faces? Evaluation inside Button stops after some seconds What's the best way to convert a string to an enumeration value in C#? I have an HTML select tag containing the values of an enumeration. When the page is posted, I want to pick up the value (which will be in the form of a string) and convert it to the corresponding enumeration value. In an ideal world, I could do something like this: StatusEnum MyStatus = StatusEnum.Parse(&quot;Active&quot;);  but that isn't a valid code. How do I use Moq to mock an extension method? I am writing a test that depends on the results of an extension method but I don't want a future failure of that extension method to ever break this test. Mocking that result seemed the obvious choice but Moq doesn't seem to offer a way to override a static method (a requirement for an extension method). There is a similar idea with Moq.Protected and Moq.Stub, but they don't seem to offer anything for this scenario. Am I missing something or should I be going about this a different way?  Here is a trivial example that fails with the usual "Invalid expectation on a non-overridable member". This is a bad example of needing to mock an extension method, but it should do.  public class SomeType {     int Id { get; set; } }  var ListMock = new Mock&lt;List&lt;SomeType&gt;&gt;(); ListMock.Expect(l =&gt; l.FirstOrDefault(st =&gt; st.Id == 5))         .Returns(new SomeType { Id = 5 });   As for any TypeMock junkies that might suggest I use Isolator instead: I appreciate the effort since it looks like TypeMock could do the job blindfolded and inebriated, but our budget isn't increasing any time soon. Is spacetime absolute? As I understand it Newton's Laws imply that space is relative, as the laws of physics are the same in all inertial frames and as such there is no way, even in principle, to distinguish a frame that is truly at rest (absolute space). Hence the concept is physically meaningless, and the positions of (and distances between) physical objects, events, etc. are relative to the frame in which one is observing them from. Advancing on to Special Relativity, by postulating that the speed of light (in vacuum) is constant in all frames of reference, we are forced to conclude that time is relative also (as if it weren't then different observers would observe a different speed of light (in vacuum)). This leads to the result that the concepts of space and time are no longer completely separate and independent of one another and instead intertwined (as an event that occurs at rest over some time period in one frame, will occur over some spatial interval and a different time interval in another frame). Hence they should be considered as should be considered as a single entity, called spacetime.  Sorry for the waffling so far, just want to check that my understanding is correct up to this point?!  My main question is, given that space and time are (individually) relative quantities, is spacetime itself relative, or can it be considered absolute (as after all, it is the mathematical space of all possible events and exists independently of the physical events that occur within it)? How align the qedsymbol after of a big formula in display mode? Description of the problem My problem is this. For the proof of a math theorem i use the proof environment of the package amsthm. It adds a \qedsymbol in the last line of the proof, but if the proof ends with a displayed formula the qedsymbol appears in the next line leaving an unwanted blank space. The documentation of  teaches to fix this problem placing the command \qedhere after of the displayed formula but inside of the appropriate environment. This works well if the formula is of one line like \[ax^2+bx+c=0.\qedhere \]  but if the proof ends in a matrix, or cases with a &quot;great height&quot; the qedsymbol is fixed in the baseline at right and it this looks higher than expected (for my taste). The result is showed in this MWE \documentclass{article} \usepackage[width=7cm]{geometry} % Only for reducing space in this MWE  \usepackage{amsmath} % For `bmatrix` \usepackage{amsthm} % For `proof` environment \begin{document} \begin{proof} And this proof ends with \[ \begin{bmatrix}     1 &amp; 0 \\     0 &amp; 1 \\     0 &amp; 0 \end{bmatrix}.\qedhere \] \end{proof} \noindent Text \end{document}  that produces  What I want I'd like something like  with the qedsymbol aligned with the bottom of the matrix. Is this possible? Where do the American and Japanese Transformers franchises meet? The original Transformers TV series was created by the American company Hasbro, and was adapted into Japanese as well. At some point, the Japanese franchise split off into its own continuity, launching its own set of sequels and spin offs.  The questions is: What part of the American franchise is considered canon by the Japanese one? Minor details such as name changes are not to be taken into consideration.