I'm wanting to update an iframe with css in javascript. I know how to update the iframe body with the code below but is there a way to insert css into the head of the iframe?  Thanks David  var previewFrame = document.getElementById('previewFrame'); var preview = previewFrame.contentDocument || previewFrame.contentWindow.document;  preview.open(); preview.write('New Content'); preview.close();
I have a simple page that has some iframe sections (to display RSS links). How can I apply the same CSS format from the main page to the page displayed in the iframe?
Simple prime number generator in Python Could someone please tell me what I'm doing wrong with this code? It is just printing 'count' anyway.  I just want a very simple prime generator (nothing fancy).   import math  def main():     count = 3     one = 1     while one == 1:         for x in range(2, int(math.sqrt(count) + 1)):             if count % x == 0:                  continue             if count % x != 0:                 print count          count += 1 INSERT takes over 5 hours, when inserting more than specific number of rows When inserting less then about 1,350,000 rows to the table it all takes about 2 minutes, however when number of inserted rows is bigger, then the time needed to insert data grows to about 5 hours.  The problem is not connected with query or indexes, because everything has been working fine for a long time and nothing has changed in the structure of query, tables or indexes.   Problem appeared for the first time about 2 weeks ago and it appears repeatedly on days, when number of inserted rows is bigger than +-1,350,000. For example on one day number of inserted rows is 1,200,000 and the process takes 2 minutes, on the other day number of rows is 1,450,000 and it takes 5-6 hours to insert data.  I tried to rebuild indexes, but it has not helped. Inverse of Strictly Monotone Function How to determine the encoding of text? Why are mutable structs “evil”? Following the discussions here on SO I already read several times the remark that mutable structs are “evil” (like in the answer to this ).  What's the actual problem with mutability and structs in C#? When I parent mesh to an armature (automatic weights), the mesh "jumps" forward a bit. If I select armature and switch to edit mode it "jumps" backward a bit.   Why is it happening and how can I fix it? I already applied location, rotation, and scale to the mesh and armature, but it didn't help.  Thank you in advance! We have the matrix: $$\left[\begin{array}{rrr} 0.8&amp;0&amp;0\\ 0&amp;1.2&amp;0\\ 0&amp;0&amp;1\\\end{array}\right]$$ Finding the eigenvalues and eigenvectors are easy. But finding ${\bf M}^n$ when $n \rightarrow \infty$ is the hard part. Any suggestions? Is it possible to run two windows sessions from the same computer at the same time? A friend asked me if it is possible to have two screen/keyboards/mouse connected to one computer, and allowing two users to use the computer as if they where using two different computers (one sessions for each input/output)  Is it possible? Prove that $T$ has a cyclic vector iff its minimal and characteristic polynomials are the same Why are orbits elliptical? If I look through the microwave window I can see through, which means visible radiation can get out. We know also that there is a mesh on the microwave window which prevents microwave from coming out.  My question is how does this work? how come making stripes or mesh of metals can attenuate microwave radiation yet allow visible radiation?  Looks like an electrodynamics problem to me with periodic boundary conditions (because of the partitions on the microwave oven window). Is it discussed in any textbook? How to calculate the sum of the data that have the same ID in the first column? I want to sum the values of the rows of my data that have the same ID in the first column. My data looks like   data.txt  Id    a    b    c    d    e 1     1    2    3    4    5 1     2    3    4    5    6 1     3    4    5    6    7 2     4    5    6    7    8 2     5    6    7    8    9 2     6    7    8    9    10 3     7    8    9   10    11 3     8    9    10  11    12 3     9    10   11  12    13 3     10   11   12  13    14 4     11   12   13  14    15 4     12   13   14  15    16 5     13   14   15  16    17 5     14   15   16  17    18   Required results  out.txt  Id    a     b   c   d   e 1     6     9   12  15  18 2     15    18  21  24  27 3     34    38  42  46  50 4     23    25  27  29  31 5     27    29  31  33  35 Why does a vertical line have a SLOPE (steepness) of undefined? The curve shows :   x goes 1 to right  y goes up by 3   the SLOPE is defined as the ratio of rise to the step  SLOPE = rise/step = 3/1 = 3  Now that :   Horizontal line has SLOPE of 0. Vertical line has SLOPE of undefined.   It makes sense for me to imagine horizontal line has SLOPE of 0 since there is no rise at all. But why the vertical has SLOPE of undefined.? Note: This question is specifically about installed, desktop software. There is  specifically about free cloud-based software and services.  What free programs should every GIS user have installed?  I'm not necessarily referring to ESRI extensions or open-source products, but others that increase your productivity and ability to handle GIS tasks.  For example:    for writing code snippets or editing XMLs.  or  for quick graphic editing. I use  daily and I think it's worth mentioning. It's not GIS-specific, but it's a great tool, especially if used independently and on multiple projects where purchasing time-management software isn't reasonable. While it's not focused on GIS development,  has proven to be very useful in terms of increasing productivity and monitoring system resources. I have created a GIS "sidebar" on my desktop that holds all of my development tools, as well as links to the online resources I used the most. It's nice to be able to use one location, rather than many (e.g. taskbar, bookmarks in browser, search engine). Altering layer's CRS to correct Layer Misalignment in QGIS I've got a vector layer in my project which isn't aligned with the rest of the project (see attached JPEG).  These are work files so I'm not sure when they were created or how they might have been messed with since they were created.  We moved from ArcGIS to QGIS a couple of years ago.  The infilled blue vector layer is the one I need to move, slightly north and east, so that it correlates to the blue line (also a vector).  All layers (and the project) are currently in EPSG:27700 - OSGB 1936.   If I need to create a new CRS based on OSGB 1936 and give it some new parameters, then how would I go about this?  Further information:  This is on Exmoor in SW England, and the data is uniformly almost exactly 8m out to the SW point to point - i.e I need to shift it 8m NE. What is this noisy shadow overlay that stays with the camera? If electrons were positive and protons were negative, would life be different? This was a question on a worksheet during my first week in a class on Electromagnetism. The answer is essentially:     No. Life would be no different if electrons were positively charged and protons were negatively charged. Opposite charges would still attract, and like charges would still repel. The designation of charges as positive and negative is merely a definition.   But how would we have negative charges within the nucleus? Taking a look at the , it seems that down quarks are required in this new "negative proton" to help with creating the pion to "transmit a residual part of the strong force even between colorless hadrons".  I tried to set out and try to find a particle with (-1) charge with a down quark (by going through this ) but all the particles are not stable with the exception of two unknown:   Bottom Xi Baryon Double Bottom Xi Baryon   Assuming one of the above are stable, could the strong force act between one of them and a neutron, implying its alright to have a negatively charged nucleus?  Edit: If it wasn't clear, my question concerned whether or not there existed stable baryons of $-1$ charge with down quarks that could "replace" the proton. What is "preimage resistance", and how can the lack thereof be exploited? How is this different from collision resistance, and are there any known preimage attacks that would be considered feasible? Upgrading from Yosemite to El Capitan, but not Sierra We have an older iMac (Model A1311, Mid 2011). It has been running Yosemite. We have run into some of the WIFI issues associated with Yosemite.   Is it possible to upgrade to El Capitan but not Sierra?   El Cap has been out longer. Its my wife's computer, its older, and I really don't want to be debugging Sierra until a few  more "dot" releases come out. Where can I travel for prolonged periods of time while legally working remotely for a company in my home country? I found several questions about inbound travelers to the US in this scenario, but little about other countries: I work for a company in my home country (USA) who are open to me working remotely while traveling.   Which countries allow me to legally work remotely for a company in my home country (USA) while traveling in their country? The work has absolutely no connection to the destination country, it would take place identically entirely within the USA if I weren't traveling.