How do i replace an array with an arraylist?
Create ArrayList from array
What happens when a photon hits a beamsplitter? Yesterday I read that we can affect the path and the 'form' (particle or wave) of a photon after the fact ().  Part of what is puzzling me is the beam-splitter. Are the individual photons actually being split into two new photons of lesser energy?  This  implies that you cannot split a photon but it seems that beam splitters do exactly that. Finding real roots of $ P(x)=x^8 - x^7 +x^2 -x +15$ Let $ P(x)=x^8 - x^7 +x^2 -x +15 $, Descartes' Rule of Signs tells us that the polynomial has 4 positive real roots , but if we group the terms as $$ P(x)= x(x-1)(x^6+1) +15 $$ we find that $ P(x) $ does not have any positive roots.  Where did I err ? Why isn't an infinite direct product of copies of $\Bbb Z$ a free module?   Actually I was asked to show that it's not projective, but as $\Bbb{Z}$ is a PID, so it suffices to show it's not free.   I am stuck here. I saw some questions in SE, but there is no satisfactory answer at all. I am using longtable and I cannot find a way to adjust its column spacing. I want a table like this:    But I am getting this:    This is what I am doing for defining table size:   \begin{longtable}{p{.1\textwidth} p{.2\textwidth} p{.2\textwidth}p{.3\textwidth}}     xxxxx &amp; xxxxx &amp; xxx &amp; xxxxx\\     \end{longtable} I saw several bugs and error messages when I was looking by chance into the tool called "logs".  Being a newbie in Ubuntu I have no idea how to deal with these bugs, where to report them or how to fix them.  Any help to guide me here?  The bug I have (which is listed under important) reads:  [Firmware Bug]: TSC_DEADLINE disabled due to Errata; please update microcode to version: 0x52 (or later) Difference between (in / for / ∅ / during / over) the (past / last) three years Microsoft has steadily improved its operating cash flows in the past three years. Microsoft has steadily improved its operating cash flows in the last three years. Microsoft has steadily improved its operating cash flows for the past three years. Microsoft has steadily improved its operating cash flows for the last three years. Microsoft has steadily improved its operating cash flows for the past three years. (&quot;for&quot; omitted) Microsoft has steadily improved its operating cash flows for the last three years. (&quot;for&quot; omitted) Microsoft has steadily improved its operating cash flows during the past three years. Microsoft has steadily improved its operating cash flows during the last three years. Microsoft has steadily improved its operating cash flows over the past three years. Microsoft has steadily improved its operating cash flows over the last three years.  Which of them are idiomatic and preferred? Are they interchangeable? Number of surjections from $\{1,...,m\}$ to $\{1,...,n\}$ Let $m,n$ be two integers such that, $m\ge n$. Compute the number of surjections from $\{1,...,m\}$ to $\{1,...,n\}$   There are $n^m$ functions (total).  we subtract from $n^m$ the number of non-surjective functions.  There are $\binom{n}{1}(n-1)^m$ functions missing one element.  There are $\binom{n}{2}(n-2)^m$ functions missing two elements, but how many times did we count this in the previous count ?  Then we have to add this again by inclusion-exclusion but why is the difference always 1? Database design for products with bundles of products I am building a database system for my retail business. I have set some tables which are:   Product Purchase Sales Balance   All are connected one another and are able to show my inventory level.  The problem I am having is I also sell bundles of products - that have different prices than their individual prices. Example: I sell an orange for $1, an apple for $1.2; I sell fruit package 1 (2 oranges and 2 apples) for $3.8, package 2 (4 oranges and 4 apples) for $7.  Is there a right way how to create relationship for these product bundles?  PS: I am using FileMaker Pro creating this. apt-get build-dep is unable to find a source package I'm in the market for a new Smartphone. Except for iPhone's, I'm new in the field and probably have some misconceptions.  My first choice was the Google Nexus S, but I was offered a great deal on the Samsung S Galaxy II (i9100). The only issue is that I read that it came with an "enhanced" version of Android. Being familiar with PC's, I know that these enhancements are almost always bloatware: I always do a clean install of Windows to get rid of it.  My question is fairly simple: is this possible to use the stock Google Android OS on the Samsung S Galaxy II (i9100)? That was the killer feature of the Nexus S for me: coming directly from Google, easily upgradable. Would that be possible and if yes, how?  Thank you for enlightening me. "Where will you go" vs. "Where you will go" Which sentence is correct between these?      Where will you go?     Where you will go? I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for what event?  Events are attached using:    Event.observe; DOM's addEventListener; As element attribute element.onclick. Why are passports checked at the check-in counter, Immigration and even at the gate? I was wondering, why there are passport checks at the check-in counter, Immigration and even at the gate?    For example, I was at Istanbul flying to either UK or US. There's a security check at the check-in counter asking a bunch of questions about my immigration status - even more than the Immigration officer at the border. Also, at the gate, there's also Security officer checking my immigration status and passport asking the same questions.    I thought that would be the responsibility of an Immigration officer rather than some third party company?   The thing I'm curious the most is they don't even know which countries this passport can go to with or without visa. They have to go back to the counter and check with the system which takes a long time. I was wondering why they hire these kind of companies to slow down the process? A good reference on optimal control theory Ok, so I am reading about decision making and I came across this subject. Fortunately it has a  , but the point is I want to see some examples, and learn to solve regular problems of this field. Of course I can go for the book by Pontryagin but then I don't think that would be an educative book. Does anyone has a suggestion? I would be happy if it also covers LQ problems. P.S. I studied math, therefore I appreciate a book with rigorous approach to the subject. How can I create my own Action using Photoshop? Can anyone guide me with a simple example? The runtime arguments are as follows: $1 is the path to the file containing the list of files $2 is the path to the directory containing the files What I want to do is check that each file listed in $1 exists in the $2 directory  I'm thinking something like:  for f in 'cat $1' do if (FILEEXISTSIN$2DIRECTORY) then echo '$f exists in $2' else echo '$f is missing in $2' sleep 5 exit fi done   As you can see, I want it so that if any of the files listed in $1 don't exist in the directory $2, the script states this then closes. The only part I can't get my head around is the (FILEEXISTSIN$2DIRECTORY) part. I know that you can do [ -e $f ] but I don't know how you can make sure its checking that it exists in the $2 directory. Performance differences between visibility:hidden and display:none Notification for reviews shows way too many Why does Stack Overflow only allow one @User per comment?  This restriction lead me to a non-comment like :     @MiMo - seem my previous comment (Only one @ user per comment)   Which left me wondering why Stack Overflow is blocking me from notifying two users of a response.  I am sure there is a reason for this, can some one share it with me? I was trying to accomplish this through a trigger, but its not really working. Is there a way to get this done through Process Builder? If so, what is that process?  I'm trying to have ProductB being added to the opportunity automatically once ProductA is manually added to the opportunity.  Also, is there a way to have the $ amount of ProductB being 0.5% of ProductA?  Trigger that I have so far:  trigger Attempt1 on OpportunityLineItem (after insert) { List&lt;OpportunityLineItem&gt; oliList = new List&lt;OpportunityLineItem&gt;();  for( OpportunityLineItem item: [SELECT  OpportunityId,                                          Name                                  FROM    OpportunityLineItem                                 WHERE   Id = :Trigger.new AND                                          Name = 'NAME OF PRODUCTA'])  {   oliList.add(new OpportunityLineItem(     OpportunityId = item.OpportunityId,      PricebookEntryId ='01uA000000QPDldEAt',     Quantity = 1,     UnitPrice = 25)   );  }  Insert oliList; }