Is there a way to add and remove or disable a CSS rule in JavaScript? Here is the CSS:   #myElement *, #myElement *:before {    outline:1px dotted red; }   Here is what I have so far:    var myCSS = "#myElement *, #myElement *:before {outline:1px dotted red;}"; // document.addCSS(myCSS);   EDIT: I can't add the rules to the HTML page and toggle between them. I need to be able to create a rule in JavaScript after the page loads and also switch it on and off in JS.
How do you add CSS rules (eg strong { color: red }) by use of Javascript?
How to make \hl (highlighting) to automatically place incompatible commands in \mbox? The soul package provides a useful command \hl for highlighting text. However, \cite, \ref, and some other commands (maybe equations too) must be placed within an \mbox in order for \hl to work properly.  Is there any way to make this automatic? Meaning that to modify \hl (and other commands provided by soul) to put everything except plain text in an \mbox?  \documentclass[12pt]{article} \usepackage{soul} \begin{document}  \section{1}\label{sec} This is to show that \textbackslash{hl} fails to highlight texts containing citations or reference!  \hl{ This is one line containing a citation \mbox{\cite{}}}  \hl{ This is one line containing a reference \mbox{\ref{sec}}}   \end{document} I'd like to user a FIDO2 key to log into Windows 10. There are various guides explaining how to add a key to a Microsoft web account, or to Windows 10 sign in options, but neither result in showing up as an option when I try logging into Windows.  How can I configure windows to use my FIDO2 key to log in? In the following question  the notation $c\in ]a,b[$ is used. What does this mean? I have never seen it before. How do I recover the default version of some configuration file? By accident, I messed up a configuration file. How do I recover the default version without reinstalling or affecting other things? Browsing Quora, I saw the following  with contradicting answers.  For the :     The bits are represented by certain orientations of magnetic fields   which shouldn't have any effect on gravitational mass.   But,  contradicts that one:     Most importantly, higher information content correlates with a more   energetic configuration and this is true regardless of the particular   type of storage... Now, as per Einstein's most famous formula, energy   is equivalent to mass.   Which answer is correct? Changing timezone in PHP Alright, quick question.  A server is running in Eastern Time. PHP program needs to make date calculations using Central time.  At the moment, I am putting this line at the very top of my script:  putenv("TZ=US/Central");   Is that the best way to go about that or is there some PHP trick I'm not aware of?  Cheers. Bash-like, non-rotating filename tab completion with PowerShell Under Windows, using PowerShell, is it possible to make the filename suggestion (using the Tab key) work like with bash under Linux?  Let's assume a directory contains 3 directories: example1, example and examination.  On Windows (by default), if you type cd ex and Tab, it will auto-suggest cd .\examination. Subsequent uses of Tab will rotate the suggestion between example1, example and examination.  Using bash (typically under Linux), if you type cd ex and Tab, it will auto-complete until the character where the filenames start to differ: cd exam. Another use of Tab then suggests which directories are available:  $ cd exam examination/ example1/    example2/   Then, if you type p and Tab, it will auto-complete to example, and so on (here, offering a choice between example1 and example2).  Is there a way to make the filename suggestion work in a tree-like search like this, instead of rotating through the names?  (I'm mainly interested in file names. Bash can also refine this selection based on the file type, for example only directories for cd, which would be good, but having the file name selection itself would be enough.) What conditions are necessary for a Wither Skeleton to spawn naturally, and can I manipulate those conditions to increase the chance of them spawning?  I want to make a Wither Skeleton spawning pad in the Nether but I'm having trouble finding Wither Skeletons. I've only heard that they spawn in Nether Fortresses. In Euclidean geometry texts, it is always mentioned that point is undefined, it can only be described. Consider the following definition: "A point is a mathematical object with no shape and size." I do not understand what is the problem with this definition. Please give the detailed reasons. Thanks in advance! How to install a dictionary (danish) in Texmaker How do I count the number of occurrences of a char in a String? I have the string   a.b.c.d   I want to count the occurrences of '.' in an idiomatic way, preferably a one-liner.  (Previously I had expressed this constraint as "without a loop", in case you're wondering why everyone's trying to answer without using a loop). How to copy metadata of Partial Sandbox into a new Developer sandbox? I Have only one license of Partial sandbox. I want to refresh it with Production. Before that I want to copy all the metadata present in the Partial sandbox into New/Existing Developer sandbox. How can do that?  Is it supported by salesforce? or are there any tools available for this requirement.  Thanks. Category-theoretic limit related to topological limit? How to find the id of the last added feature using pyQGIS? Is it possible to programmatically (in python) access the attribute info of the last added feature in QGIS 2.0 before edits are saved? I'm failing to find a way to get the ID and subsequently other attributes of my feature of interest (the one most recently added).  idx = layer.fieldNameIndex('myField') myList = [] lastEdited = ID THAT I'D LIKE TO RETRIEVE for feature in layer.getFeatures():     if feature.id() == lastEdited:         print feature.attributes()[idx]   From this I'd like to get 'myField' of my most recent addition.   UPDATE: Following lead of this , I was able to achieve my goals via the Python console, but am failing to get it to work for my plugin.  def updateTableWidget(self, fid):     idx = layer.fieldNameIndex('myField')     myList = []     for feature in layer.getFeatures():         if feature.id() == fid:             myList.append(feature.attributes()[idx])   Via the python console, I was able to connect to my layer like so:  layer.featureAdded.connect(updateTableWidget)   After adding a QgsMessageLog to my function, the attributes were correctly identified. I now have a beginner python issue, however. Calling the function in my plugin as shown below gives me TypeError: updateTableWidget() takes exactly 2 arguments (1 given):  self.updateTableWidget()   The function was called from feature form python file. The Megahertz Myth became a promotional tactic due to differences between the PC's INTEL 8086 processor and Apple's Rockwell 6502 processor.  The 8086 ran at 4.77MHz while the 6502 ran at 1MHz.  However, instructions on the 6502 needed fewer cycles; so many fewer, in fact, that it ran faster than the 8086.  Why do some instructions need fewer cycles?  And why can't the instructions of the 6502, needing fewer cycles, be combined with a fast cycling processor of the 8086?  Wikipedia's article for instructions per cycle (IPC) says     Factors governing IPC   A given level of instructions per second can be achieved with a high IPC and a low clock speed...or from a low IPC and high clock speed.   Why can't you have both high instructions per cycle and high clock speed?  Maybe this has to do with what a clock cycle is?  Wikipedia mentions synchronization of circuits?  Not sure what that means.  Or maybe this has to do with how a pipeline works?  I'm not sure why instructions in a short pipeline are different from instructions in a long pipeline.  Any insight would be great!  Just trying to understand the architecture behind the myth.  Thanks!  References: It seems that a number of the statistical packages that I use wrap these two concepts together. However, I'm wondering if there are different assumptions or data 'formalities' that must be true to use one over the other. A real example would be incredibly useful. When umpire change the cricket ball, was the old ball thrown as waste or keep for reuse? Comma use with nonessential appositives Sorry, I do not know the language terminology. Is this a case of nonessential appositive?  Which of the following sentence has a correct comma use? Comma before &quot;should&quot;  Importantly, two frail subgroups of stroke population, long-term residential care and cognitive impairment patients, should not be excluded from the rehabilitation.  No comma before &quot;should&quot;  Importantly, two frail subgroups of stroke population, long-term residential care and cognitive impairment patients should not be excluded from the rehabilitation. Spice containers purchase  I'm planning on upgrading my spice storage. Reading some advice online (e.g. , and ) I came to the conclusion that spice containers should:   Not be exposed to direct sunlight and high temperatures Be airtight   Which means that either you store it inside of some closed cupboard/wardrobe/room or you have containers which do block light and are in a relatively shady place. And the containers need to be airtight.  Available solutions  I've been browsing for some containers available online in my country and the 2 most sensible options I've seen are these:       The problem  The first one is hermetic (it has some rubber around the lid) but it's clear glass. The other one does not have the rubber, just a regular twist-off lid, but it's amber glass.  It'll be hard for me to find any space inside of cupboards to store all of my spices (I need at least 30), so I'd rather buy amber glass container, which I believe will effectively block the sunlight, even when kept on the counter. But I can't find any hermetic amber-glass containers, only ones with regular lid.  The question  Is that regular twist-off lid enough to keep spices airtight and fresh? Or should I focus on buying a hermetic container (like the one in clear glass). I could then for example paint them black to block the sunlight. How to convert hex string to float in Java?