Setting task scheduler to run when online
How to launch a command on network connection/disconnection?
Iterating over Java collections in Scala I'm writing some Scala code which uses the  API. I would like to iterate over the rows contained in the java.util.Iterator that I get from the Sheet class. I would like to use the iterator in a for each style loop, so I have been trying to convert it to a native Scala collection but will no luck.  I have looked at the Scala wrapper classes/traits, but I can not see how to use them correctly. How do I iterate over a Java collection in Scala without using the verbose while(hasNext()) getNext() style of loop?  Here's the code I wrote based on the correct answer:  class IteratorWrapper[A](iter:java.util.Iterator[A]) {     def foreach(f: A =&gt; Unit): Unit = {         while(iter.hasNext){           f(iter.next)         }     } }  object SpreadsheetParser extends Application {     implicit def iteratorToWrapper[T](iter:java.util.Iterator[T]):IteratorWrapper[T] = new IteratorWrapper[T](iter)      override def main(args:Array[String]):Unit =     {         val ios = new FileInputStream("assets/data.xls")         val workbook = new HSSFWorkbook(ios)         var sheet = workbook.getSheetAt(0)         var rows = sheet.rowIterator()          for (val row &lt;- rows){             println(row)         }     } } Sketching base characteristics of first order pde $$xu_{x} - uu_{t} = t$$   with intial data: $u(1,t) = t, −\infty &lt; t &lt; \infty$  So I want to sketch the base characteristics and I'm not too sure what I'm doing.  characteristic equations: $\frac{\partial{x}}{\partial{\tau}}=x$, $\frac{\partial{t}}{\partial{\tau}}=-u$, $\frac{\partial{u}}{\partial{\tau}}=t$  initial conditions:  $x(0)=1$, $t(0)=\xi$, $u(0)=\xi$  $x=e^\tau$ so $\tau=lnx$  Notice that:  $\frac{\partial^2{u}}{\partial{\tau^2}}=\frac{\partial{t}}{\partial{\tau}}=-u$,  This gives me the second order ODE  $\frac{\partial^2{u}}{\partial{\tau^2}}+u=0$  Solving I get:  \begin{align}   u&amp;=c_{1}\cos(\tau) + c_{2}\sin(\tau)\\ t&amp;=c_{1}\sin(\tau) - c_{2}\cos(\tau) \end{align}  From here I don't know what I'm doing? What is the meaning of the term "linear" A fiber bundle over Euclidean space is trivial. What's the easiest way to see this? The only thing I could think of was to try to patch together trivializations. I couldn't find a way to make that work. Thank you! edit: For the record, here's why I asked about this special case of the more general result about fiber bundles over contractible spaces. In the much beloved book by Bott and Tu, it's claimed that the Leray Hirsch theorem can be proven in the same way the Kunneth theorem is proven:  induct on the size of a finite good cover for the base space, then apply the Mayer Vietoris sequence and the Poincare lemma for the induction step. It's assumed that there exists a finite good cover for the base space, but it's not assumed that this cover is a refinement of the cover of the base space, which gives the local trivializations of the fiber bundle. Therefore, to apply the Poincare lemma in the induction step, it seems that you need to know that the result I asked about is true. Since fiber bundles had just been introduced in the text, I thought there may be a short, elementary proof that the authors had taken for granted. Good books for a high schooler self-studying Abstract Algebra? Does anyone have any suggestions for abstract algebra books particularly suited to self-study?     Here is some background and motivation, if it's helpful.  I'm currently a junior in high school, but I have some familiarity with groups, rings, polynomials and fields, as I went through Fraleigh's book. I liked its writing style, but many of the problems were not helpful. I would like to get better at algebra with some other book, particularly one that's aimed at someone who already has a little familiarity with the objects, but is by no means completely comfortable.  One of my longer-term goals is to learn a bit of algebraic number theory, as I've only been studying elementary number theory. That's why I feel it  good to learn more algebra first. (I'd also be interested in suggestions of other good subjects to learn prior to tackling algebraic number theory.)  I was considering using one of Lang's books, since they seem pretty universal, but I've heard rumors that they are very terse and not good for self-learning. How to use unicode characters in Windows command line? Skype doesn't work in Ubuntu 14.04 Installing firmware blob for Intel Wifi USB pen I have installed Debian 8/Jessie minimal ISO on my laptop. I get error message during system installation:  Some of your hardware needs non-free firmware files to operate. The firmware can be loaded from removable media, such as a USB stick or floppy. The missing firmware files are: iwlwifi-7265-9.ucode iwlwifi-7265-8.ucode If you have media available now, insert it, and continue. Load missing firmware from removable media?  I found the appropriate firmware on Debian website, downloaded it (zip), extracted to flash drive, and booted with flash drive plugged in. I still get the error message that appropriate firmware could not be found (the error message disappear to fast to copy down). How do I properly format the flash drive? Or is the problem here something else? Windows Explorer on another computer tells me the flash drive is 14.6GB and formatted as FAT32. Why didn't Sauron find Bilbo when he put on the ring like Frodo? How do I get fan control working? I know there something called fancontrol, that enables you to control the speed of your system's ventilation. I'd like to let my fans spin a bit faster as my laptop is heating up very easilly. All tutorials and stuff I've found are for old versions of Ubuntu and don't seem to be working anymore.  Can anyone explain to me or give me a good link on how I  can get it working on Ubuntu? Something different with the same effect is also fine. Question is to prove :  $f : S^1 \to \mathbb R$ is continuous then $f(x)=f(-x)$ for some $x\in S^1$  I guess it would be helpful to use intermediate value theorem  Assuming $f(x)\neq f(-x)$ then given any $p\in (f(-x),f(x))$ (assuming $f(-x)&lt;f(x)$) there exists $y\in (-x, x)$ such that $f(y)=p$  I am not very sure of how to use this..   It would be helpful if someone can give some hint which would help me to solve this..  Thank you. Does $E = mc^2$ apply to photons? Photons are massless, but if $m = 0$ and , then $E = 0c^2 = 0$. This would say that photons have no energy, which is not true.  However, given the formula $E = ℎf$, a photon does have energy as $ℎ$ is a non-zero constant and photons with a zero frequency do not exist.  What am I missing here, or does the famous formula not apply to photons? Checkout subdirectories in Git? Is it possible to check out subdirectories of a repository in Git?  Imagine I am setting up a new WordPress installation. I will create two new directories for my plugin and theme customization:   wordpress/wp-content/plugins/myplugins/  wordpress/wp-content/themes/mytheme/   I want to maintain these directories via Git. In Subversion, I would accomplish this by having trunk/myplugins/ and trunk/mytheme/ directories and checking out subdirectories. Does Git have a way to accomplish the same task using a single repository?  I could just be missing the boat on some Git paradigm, as a long time SVN user with little exposure to Git.  Edit:  storing different content is an interesting way to handle this. I have purchased a rather large bag of long-grain white rice (25 lbs.) and need to know the best way for storing it long-term. This rice will be used as both a food-storage food source and as my everyday source of rice for cooking, so the storage solution should (hopefully) be resealable, rather than once-it's-open-it's-open. I eat rice maybe three times a month, so it isn't really "everyday" but it will be my go-to when I have it. Efficient computation of $\sum_{k=1}^n \left\lfloor \frac{n}{k}\right\rfloor$ I realize that there is probably not a closed form, but is there an efficient way to calculate the following expression?  $$\sum_{k=1}^n \left\lfloor \frac{n}{k}\right\rfloor$$  I've noticed $$\sum_{k=1}^n \left\lfloor \frac{n}{k}\right\rfloor = \left\lfloor\frac{1}{2}\sum_{k=1}^{\left\lfloor\frac{n}{2}\right\rfloor} \left\lfloor\frac{n}{k}\right\rfloor\right\rfloor + \sum_{k=1,\ odd(k)}^n \left\lfloor \frac{n}{k}\right\rfloor$$  But I can't see an easy way to let the second term enter in a recursion. Can't mount ISO file as loop device: Error: “failed to setup loop device” sudo mkdir -p /media/cdrom cd ~ sudo mount -o loop ubuntu-* / mount: ubuntu-*: failed to setup loop device: No such file or directory I'm trying to create record Type selection screen in LWC, but getting this error  afterRender threw an error in 'c:createContact' [Cannot read property 'recordTypeInfos' of undefined]  HTML:  &lt;template&gt;     &lt;lightning-combobox name="recordType" label="Record Type" placeholder="Choose Status"                         value={value}                          options={recordTypeId}&gt;      &lt;/lightning-combobox&gt; &lt;/template&gt;   JS:  import { LightningElement, track, wire, api } from 'lwc'; import { getObjectInfo } from 'lightning/uiObjectInfoApi'; import CONTACT_OBJECT from '@salesforce/schema/Contact';  export default class CreateContact extends LightningElement {      @track statusOptions;     @track value;     @api objectApiName;      @track objectInfo;      @wire(getObjectInfo, { objectApiName: CONTACT_OBJECT,})     objectInfo;       get recordTypeId() {         // Returns a map of record type Ids          console.log(this.objectInfo);         const rtis = this.objectInfo.data.recordTypeInfos;         return rtis;     }  } How to execute sudo commands with Expect & send commands in bash script? How to configure Micromax 352g USB Modem? I want the driver software for my Micromax 352g USB modem for Ubuntu 12.04 LTS. On Ubuntu 10.04 sakis3g was working well, but it is not working on Ubuntu 12.04 LTS. Is natural projection a natural transformation?