Here is the piece of code which contains two CSS elements. del and ins  I want to include the whole CSS code into Javascript... But the code is one level above my experience...  Here is the CSS code:  del {     text-decoration: none;     color: #b30000;     background: #fadad7; } ins {     background: #eaf2c2;     color: #406619;     text-decoration: none; }   And here is the piece of code which contains those classes:  convertChangesToXML: function(changes) {   var ret = [];   for (var i = 0; i &lt; changes.length; i++) {     var change = changes[i];     if (change.added) {       ret.push("&lt;ins class='diff'&gt;");     } else if (change.removed) {       ret.push("&lt;del class='diff'&gt;");     }      ret.push(escapeHTML(change.value));      if (change.added) {       ret.push('&lt;/ins&gt;');     } else if (change.removed) {       ret.push('&lt;/del&gt;');     }   }   return ret.join(''); },   How to include CSS into Javascript here?  I don't want a separate CSS file ... Because I'm using a third party app called Storyline to create a web page and it's a lot easer to run a javascript code there without a css file
It's easy to set inline CSS values with javascript. If I want to change the width and I have html like this:  &lt;div style="width: 10px"&gt;&lt;/div&gt;   All I need to do is:  document.getElementById('id').style.width = value;   It will change the inline stylesheet values. Normally this isn't a problem, because the inline style overrides the stylesheet. Example:  &lt;style&gt;    #tId {       width: 50%;    } &lt;/style&gt;  &lt;div id="tId"&gt;&lt;/div&gt;   Using this Javascript:  document.getElementById('tId').style.width = "30%";   I get the following:  &lt;style&gt;    #tId {       width: 50%;    } &lt;/style&gt;  &lt;div id="tId" style="width: 30%";&gt;&lt;/div&gt;   This is a problem, because not only do I not want to change inline values, If I look for the width before I set it, when I have:  &lt;div id="tId"&gt;&lt;/div&gt;   The value returned is Null, so if I have Javascript that needs to know the width of something to do some logic (I increase the width by 1%, not to a specific value), getting back Null when I expect the string "50%" doesn't really work.  So my question: I have values in a CSS style that are not located inline, how can I get these values? How can I modify the style instead of the inline values, given an id?
The book Theory of Functions of a Real Variable by I. P. Natanson, proves that a denumerable or finite union of pairwise disjoint sets of cardinality $c$ has cardinality $c$.  The proofs given in the book are fairly easy, using the axiom of choice. But then it is left as an exercise a generalization of the above theorems for not necessarily pairwise disjoint sets.  I have searched all over the web, but all the proofs found so far are for pairwise disjoint sets.  The proof given in the book relies on the fact that each set $A_k$ can be matched with a set like $[a_{k-1},a_k)$, with $a_k$ point of a partition of $[0,1]$, such that $\bigcup_{k=1}^{\infty\lor n}A_k=[0,1)$. So it is easy to guess the bijective function, but I can't generalize this proof.  Any help is highly appreciated. Thanks and regards. Are there fixed size integers in GCC? On the MSVC++ compiler, one can use the __int8, __int16, __int32 and similar types for integers with specific sizes. This is extremely useful for applications which need to work with low-level data structures like custom file formats, hardware control data structures and the like.  Is there a similar equivalent I can use on the GCC compiler? Why was Arcanine with the Legendary Birds in Veridian City in Pokémon Origins? In Pokémon Origins, Red sees a image with the three legendary birds and Arcanine.     Why was Arcanine there? I mean, he's 'The Legendary Pokemon' but not a legendary Pokémon. In , there is a comment by  on the answer that Arcanine was originally a legendary Pokémon:     "...Nintendo first gave Zapdos, Articuno and Arcanine as the legendary trio. But they removed Arcanine as it would have been awkward. Two birds and a dog, huh!..."   This still does not add up because Pokémon Origins was created a while after they removed Arcanine. Any thoughts? Different font color for question status => closed <= When I stared at  () and I even thought [question refined] as offical status of the post.    &lt;somebody  it now, So, I've edited this question to get same effect>  How about official status [closed] as   different font color or  different font size or put the text [closed] outside the question link   Or   put a special tag as suggested in the    to clarify from those? taller than any student or taller than any other student Which of the following sentences is correct?     a)   1. John is taller than any student in his class.   2. John is taller than any other student in his class.        b)   1. No student is taller than John in his class.   2. No other student is taller than John in his class. Build a basic Python iterator I am using 15.04.   So I'm working with git and I installed the standard version. I set up the ssh keys and was able to clone one of my repositories to the correct folder. Everything was working great and then I decided it was a good idea to install more packages. I ran sudo apt-get install git-all. I'm looking at error codes now having to deal with upstart.  start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused No apport report written because the error message indicates its a followup error from a previous failure. dpkg: error processing package runit (--configure):  subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of git-daemon-run:  git-daemon-run depends on runit; however:   Package runit is not configured yet.  dpkg: error processing package git-daemon-run (--configure):  dependency problems - leaving unconfigured Errors were encountered while processing:  runit  git-daemon-run E: Sub-process /usr/bin/dpkg returned an error code (1)   This is what happens when I even update/upgrade my system. At this point all I'm looking to do is be able to install software and update my current software. Is there any way I can potentially reverse this issue or at least correct it?   Edit: Thankfully this issue was solved only a day or two after it happened. The accepted answer worked perfectly and took care of my issue I have a front end module that generates an (ECG) signal that varies from +/-2.5 V. I want to shift this signal to 0 - 5V. What is the best way to do this? Would a summing amplifier like the below circuit good enough? With R1 = R2 and V1 = 2.5V, V2 = my signal, V3 = V4 = GND How to encrypt folders (not in Home)? Is there a way to encrypt a folder, which is not in Home (/home/user/) but even in a different partition, so only my user can access/read contained files?  Alternatively, I would like to understand if it is possible to turn a complete ext4 partition into an encrypted volume, which would be mounted at user login.  If possible, I would like to make the change without reinstalling Ubuntu.  My PC has (mount output):  /dev/sda1 on / type ext4 (rw,errors=remount-ro) /dev/sda3 on /home type ext4 (rw) /dev/sda4 on /home/igor/Personale type ext4 (rw)   sda4 is the partition containing folders I would like to protect. Why are my PHP sessions dying? And why can't I restore them? I have an app using PHP and the PayPal API. The basic way it works to get a payment is that you do a web service call to PayPal to get a token and then do a browser redirect to PayPal with that token for the user to pay. After the payment details have been confirmed, PayPal redirects back to the URL you originally set in the service call.  This all works, millions of people use it every day, et cetera.  Strange thing is, when PayPal redirects back, the PHP session is gone. It's a .  First question: why is this happening? Both pages are on the same domain, both use HTTPS. The session works for all requests up until the PayPal redirect back.  The linked forum thread suggests a workaround, to persist the session ID in the PayPal request and then to retrieve it later and restore the session. Great, except it doesn't seem to work.  I can add some log statements:  log(session_id());   before and after the various redirects. When coming back from PayPal, I log some more.  log("session id is " . session_id()); $session_id = get_session_id_from_paypal(); log("setting it back to " . $session_id); session_id($session_id); session_start(); log("session id is now " . session_id());   The result is not at all what I'd expect:     session_id is fc8f459a186a3f4695ff9ac71b563825   setting it back to 82460dcf8c8ddd538466e7cb89712e72   session_id is now 360ba3fd99d233e0735397278d2b2e55     Second question: why is the session id not at all what I set it to? What am I doing wrong? Or, at least, why do none of the session variables come back? What is the person called who always thinks negative? E.g.        Mr. X always thinks negative.   Mr. X has negative attitude.      What we can use either? Is there any particular word for this? Could anyone tell me what is up with so many archives, and how are they differ?  There's at least five that I can think of, .tar.tz, .tar.gz, .tar.bz2, .tar.lz, .tar.z  Which is best for what applications? It just seems silly to make so many variations of the same file but I'm sure there's a reason. Under what circumstances will a passive HDMI-to-VGA adapter work? I have bought a no-brand, passive HDMI Male to VGA Female adapter, to link up a PC with a more dated monitor. It did not work.  After doing some reading, I have learned that buying such an adapter is often discouraged because in many cases it will not convert the signal from Digital to Analog, or the Motherboard/CPU on a specific computer might not be compatible with that particular adapter.   So my question is: seeing how there are so many of these passive adapters on the market, are there circumstances under which they actually do suffice to connect an HDMI output to a VGA input? Or are they generally just a rip-off?  Example of the kind of adapter I bought: I've been using mac for years, but prefer to do software development on windows. I'm really used to is using the folowing shortcuts on windows very much:  &lt;CTRL&gt;  + INSERT: Copy &lt;SHIFT&gt; + INSERT: Paste &lt;SHIFT&gt; + DELETE: Cut   Of late, I've taken to doing even my development work on the Mac. However, as a matter of habit, I'm missing these shortcuts very much. Actually, I find these a lot more convenient than COMMAND + (C/V/X) combo.  Is there a way to reassign these three shortcuts at least?   I've look all over the internet and in the "Keyboards" system preferences but I did not find anything.  PS: If you're wondering where I find the INSERT keys on a mac book pro, I use a wireless keyboard. I've always wondered this - why can't you declare variables after a case label in a switch statement?  In C++ you can declare variables pretty much anywhere (and declaring them close to first use is obviously a good thing) but the following still won't work:  switch (val)   {   case VAL:     // This won't work   int newVal = 42;     break; case ANOTHER_VAL:     ...   break; }     The above gives me the following error (MSC):     initialization of 'newVal' is skipped by 'case' label   This seems to be a limitation in other languages too.  Why is this such a problem? How to retrieve and display images from a database in a JSP page? I'm using a class I've derived from DocumentPaginator (see below) to print simple (text only) reports from a WPF application. I've got it so that everything prints correctly, But how do I get it to do a print preview before printing? I have a feeling I need to use a DocumentViewer but I can't figure out how.  Here's my Paginator Class:  public class RowPaginator : DocumentPaginator {     private int rows;     private Size pageSize;     private int rowsPerPage;      public RowPaginator(int rows)     {         this.rows = rows;     }      public override DocumentPage GetPage(int pageNumber)     {         int currentRow = rowsPerPage * pageNumber;         int rowsToPrint = Math.Min(rowsPerPage, rows - (rowsPerPage * pageNumber - 1));         var page = new PageElementRenderer(pageNumber + 1, PageCount, currentRow, rowsToPrint)                        {                            Width = PageSize.Width,                            Height = PageSize.Height                        };         page.Measure(PageSize);         page.Arrange(new Rect(new Point(0, 0), PageSize));         return new DocumentPage(page);     }      public override bool IsPageCountValid { get { return true; } }      public override int PageCount { get { return (int)Math.Ceiling(this.rows / (double)this.rowsPerPage); } }      public override Size PageSize     {         get { return this.pageSize; }         set         {             this.pageSize = value;             this.rowsPerPage = PageElementRenderer.RowsPerPage(this.pageSize.Height);             if (rowsPerPage &lt;= 0)                 throw new InvalidOperationException("Page can't fit any rows!");         }     }      public override IDocumentPaginatorSource Source { get { return null; } } }   The PageElementRenderer is just a simple UserControl that displays the data (at the moment just a list of rows).  Here's how I use my Row Paginator  PrintDialog dialog = new PrintDialog(); if (dialog.ShowDialog() == true) {     var paginator = new RowPaginator(rowsToPrint) { PageSize = new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight) };      dialog.PrintDocument(paginator, "Rows Document"); }   Sorry for the code dump, but I didn't want to miss something relevant. Nested Mathematical Functions This question has bugged me for a while. I want to write a nested function, f(g(x)). If I naively enter it:  \begin{align}     f(g(x))=y \end{align}     The problem is that each and every parenthesis is the same size as all of the others. Shouldn't the outer parentheses be larger? But if I do this:  \begin{align}     f\left(g(x)\right)=y \end{align}     Now it looks even less like the functions are nested. What's the proper way to do this? Reading the Result of Traceroute When you use tracert www.example.com in the command prompt, what exactly does the returned information tell you, and how does it go about getting that information. Up until now I have only used traceroute to get the I.P. address of a website without really thinking about the bigger purpose of traceroute. Calculate the radius of a circle given the chord length and height of a segment I have a (circular) segment of known height and known chord length. Is is possible to determine the radius of the circle?  Any help much appreciated.