How can I raise an event from another thread on the main (UI) thread? I'm trying to raise an event from my worker thread in the SerialPort.DataReceived event in the main thread.  Background: I have a device connected that can send data by itself to the serial port of my PC. I need to recognize this data and when a telegram is completed, pass it to the UI thread to e.g. show received values. Because the data can arrive spontaneously I used the DataReceived Event of the SerialPort class.  The DataReceived Event creates its own background thread, this I know and this is my problem. When the telegram is complete, I raise an event on the open form of the application e.g. to update a certain text field. The problem is, this event raising is done in the worker thread of the SerialPort received Event.  Is there a way to raise this event on the main UI thread?
How do I update the GUI from another thread? Which is the simplest way to update a Label from another Thread?   I have a Form running on thread1, and from that I'm starting another thread (thread2).  While thread2 is processing some files I would like to update a Label on the Form with the current status of thread2's work.   How could I do that?
Putnam and Beyond AM-GM help Using Pigeonhole Principle to prove two numbers in a subset of $[2n]$ divide each other Let $n$ be greater or equal to $1$, and let $S$ be an $(n+1)$-subset of $[2n]$. Prove that there exist two numbers in $S$ such that one divides the other.   Any help is appreciated! Drag-and-drop functionality no longer working after upgrade to 19.04 After upgrading from 18.04 to 19.04 (with a necessary upgrade to 18.10 between) on a Lenovo Yoga 11e, I can no longer drag and drop anything (ie, files, windows, etc.) with the touchpad.  I can, however, move things around using the touchscreen.  Whenever I attempt to do so with the mouse, though, sometimes it turns into a hand.  Whether or not it turns into the hand or remains a pointer, the icon will not move anymore.  IOW, as soon as I left-click, the pointer freezes in place until I release the touchpad. Irreducible polynomial which is reducible modulo every prime How to show that $x^4+1$ is irreducible in $\mathbb Z[x]$ but it is reducible modulo every prime $p$?   For example I know that $x^4+1=(x+1)^4\bmod 2$. Also $\bmod 3$ we have that $0,1,2$ are not solutions of $x^4+1=0$ then if it is reducible the factors are of degree $2$. This gives that $x^4+1=(x^2+ax+b)(x^2+cx+d)$ and solving this system of equations $\bmod 3$  gives that $x^4+1=(x^2+x+2) (x^2+2x+2) \pmod 3$. But is there a simpler method to factor $x^4+1$ modulo a prime $p$? graphics with \setbeamercovered{transparent} With \setbeamercovered{transparent} covered parts of a slide are displayed transparently. If there is a (small) picture among the text, it is shown as it is. Beamer has only this picture, so it shows this picture. My question: How can I give a gray version of the picture to beamer such that in covered parts of a slide, this gray version is used? Show all comments if there is just "1" extra comment to show When looking at a question or answer with comments, I think it would be better to just show that one extra comment if the threshold is "Show 1 more comment".  In other words, if there are 6 comments, show all 6 comments.  If there are 7 comments, then show 5 comments and the link "Show 2 more comments".  Etc for more comments. What would Voldemort have done had he won? This might sound like speculation, but can it be reliably predicted from canon what Voldemort would have done after he won, were he successful in defeating Harry and the Order?  Would he just rule over the wizard world and keep up the masquerade, or would he try to take over the whole Earth by starting a (dark-)wizard vs. muggle war? How do I get HTML5 h.264 Video working on Firefox? According the the , h.264 video should now be working in Linux.  It does also say the appropriate gstreamer plug-ins need to be installed.  Does anyone know what these are?    I used this  and the  to verify that h.264 support works in Google Chrome on my Ubuntu 12.04 64-bit, but does not work on Firefox 26. Is it possible to use an Ubuntu Live CD and run GParted to partition a my HDD (including the partition that is usually mounted on a given system)? I'm encountering a problem with my HDD's partitions and can't resize it. I've described my problem and my system here: .  Now, from a more general perspective, I was thinking on whether it is possible to use an Ubuntu Live CD and use GParted in a live session to possibly go around that problem. Is that possible? I made a separate question as I'm interested in the possibility independently from my current problem.  You see, I only have one partition and that's mounted. When I use GParted through Ubuntu I don't get any error reports (unlike the case reported in the question linked above).  Thanks beforehand. No grub menu after Ubuntu install, booting directly into Ubuntu Are there any reserved words in SQLite? How to convert strings into integers in Python? I am looking at the 4-vector treatment of special relativity, but I have had no formal training in Tensor algebra and thus am having difficulty understanding some of the concepts which appear.  One such concept is the notion of contra- and co-variant vectors.  describes a contra-variant vector as varying with the co-ordinates, i.e. the inverse of the reference axes. It gives the example of a change of basis matrix $\mathbf{M}$, and a contra-variant vector $\vec{v}$ and states that in the new set of co-ordinates, we have:  $$\vec{v}'=\mathbf{M}\vec{v}$$  It then states that a covariant vector varies with the co-ordinate axes.     Does this mean that for a covariant vector $\vec{u}$ and change of basis matrix $\mathbf{M}$ we have: $$\vec{u}'=\mathbf{M}^{-1}\vec{u}?$$   I am also having problems understanding the concept of raising and lowering indices. For instance, Wikipedia states that for two four-vectors $\vec{A},\vec{B}$ and using Einstein summation we have:  $$\left\langle \vec{A} \middle|\vec{B} \right\rangle=A^{\mu}B_{\mu}=A_{\nu}B^{\nu}$$  And I am having difficulty understanding how this relates to the other definition of the inner product:  $$\left\langle \vec{A} \middle|\vec{B} \right\rangle =\mathbf{A}^{T}\mathbf{\eta}\mathbf{B}$$  If anyone could help give me a more intuitive understanding of these concepts I would be grateful. As I was taught in school and , the T ending sound of words is unvoiced and should be pronounced with air, but recently I met a friend from the US, those aired T sounds were missing from her speaking, like "hat", "hot", "right". She speaks like /hæ/, /hɑː/,/raɪ/.   So I wonder if it's common to miss those sounds for Americans? How many roots have a complex number with irrational exponent? If a rational exponent on a complex number $z^q$ is the representation of a finite number of roots, then if the exponent is irrational this mean that there is infinite countable roots?  If this is the case... the cardinality of the number of roots is the same for any irrational exponent? Thanks in advance.  NOTE: there are different questions about irrational exponents but no one answer what Im searching so please dont mark this as repeated. Could you list all possible directories where Android apps may store data, providing description what kind of data are stored in each directory? How do I "replay" the "Caveats" section from a homebrew recipe I connect my phone to a Bluetooth speaker to play music. When engage Siri or try to use dictation, the phone wants to use the microphone on the Bluetooth device, which is either too crappy or too far away for it to understand what I am saying.  So, I would like a way to restrict the iPhone to using its own microphone even when connected to a Bluetooth speaker.  I am open to doing this via a setting, buying an app, or jailbreaking or whatever.  Is there a way to do this? There are a lot of legendaries available in ORAS, however a lot of them will only show up/be available if certain prerequisites are met.  I know Groudon/Kyogre are available through the Story, and      Rayquaza &amp; Deoxys   through the postgame Delta episode, but what about the other available legendaries? What do I need to do to catch them? Why is there a controversy on whether mass increases with speed? Some people say that mass increases with speed, some people say that the mass of an object is independent of its speed.  I understand how some (though not many) things in physics are a matter of interpretation based on one's definitions. But I can't get my head around how both can be 'true' is any sense of the word.  Either mass increases or it doesn't, right?  Can't we just measure it, and find out which 'interpretation' is right? e.g.: (in some sophisticated way) heat up some particles in a box and measure their weight?  ------------------------------  UPDATE  Right, so I've got two identical containers, each with identical amounts of water, each on identical weighing scales, and each in the same g field. If one container has hotter water, will the reading on its scale be larger than the other? If the answer is yes, and g is constant, does this mean that the m in w=mg has got bigger?