I know arrays are faster at getting and setting, while LinkedLists are better at adding and removing elements, but what about when iterating? A more "traditional" for(i=0;i&lt;intList.size();i++) would definitely make LinkedLists slower since you'd have to get the element at index i every time. But what if I use for(int i : intList)? How does it work under the hood for this instance? For example:  LinkedList&lt;Integer&gt; intList = new LinkedList(); /* populate list... */ for (int i : intList) {     //do stuff }   I imagine that there's no need to get an specific element when going through the whole List, so it should be possible to have some sort of loop implementation where performance is about the same. Though I don't know how exactly how for is implemented for this example so I can't be sure if this is it.
I've always been one to simply use:  List&lt;String&gt; names = new ArrayList&lt;&gt;();   I use the interface as the type name for portability, so that when I ask questions such as these I can rework my code.    When should  be used over  and vice-versa?
$\operatorname{Ext}$ and injectives, respectively projectives Scheduling a Batch job at a particular time I have a Apex batch class which I would like to schedule at a particular date time. The date time is stored in a variable and changes dynamically. ex Datatime scduleDateTime = datetime.now() ; I want to schedule the apex batch file to run at this datetime variable value.  How can I do that using system.scheduleBatch()  I started with this but could'nt see how I can specify a datetime variable in here:  datetime d = datetime.now(); sampleapexbatch b = new sampleapexbatch(d); System.scheduleBatch(b,'Sample Job',XXXXXXXX)   Any help is appreciated! comma delineation of consecutive endnotes Consecutive footnotes can be separated by commas by invocation of the multiple option of the  package:    \documentclass{article} \usepackage[multiple]{footmisc} \begin{document} Comma delineation of consecutive footnotes fails upon conversion to endnotes% \footnote{First note.}% \footnote{Second note.}.% \end{document}   This comma delineation fails, however, if footnotes are converted to endnotes using the  package:    \documentclass{article} \usepackage{endnotes} \let\footnote=\endnote \usepackage[multiple]{footmisc} \begin{document} Comma delineation of consecutive footnotes fails upon conversion to endnotes% \footnote{First note.}% \footnote{Second note.}.% \theendnotes \end{document}   How can one preserve automated comma delineation of consecutive endnotes? Use the new helpcenter for the question/answer ban message Related:    The helpcenter has . It still links to the  for further details. Besides that, the question ban message .  Now that we have the helpcenter, could the following changes be implemented?   Link to the help center instead of the meta post Remove the link to the meta post from the help center, and instead incorporate its contents into the helpcenter itself Inner product on $C(\mathbb R)$ With axiom of choice it is possible to construct an inner product on $C(\mathbb R)$. My question is, is it possible to explicitly construct an inner product on $C(\mathbb R)$? I.e. to give a closed formula to calculate the inner product? I know it is straight-forward to write down a scalar product using a Hamel basis. This is not the answer I am looking for. This question came to me, when a student asked me in the lecture today 'whether there are vector spaces without inner products'. So I tried to find scalar produces for function spaces. I think I managed to write one down for $L^1((0,1))$. But I failed to construct one for $C(\mathbb R)$. How do I sudo a command in a script without being asked for a password? I want to turn my system on automatically every day. So I use the below code in my Python script, but sudo asks me for a password every time:  os.system('sudo sh -c "echo date \'+%s\' -d \'+ \        24 hours\' &gt; /sys/class/rtc/rtc0/wakealarm"')   How can I run this script without sudo asking for the password every time? To show for following sequence $\lim_{n \to \infty} a_n = 0$ where $a_n$ = $1.3.5 ... (2n-1)\over 2.4.6...(2n)$ How can I make a material only apply to a side of a plane? How can I straighten ALL the vertical UV lines at once? Is there a hot keyshort cut? Or if I have to do them one by one .. is there at shortcut for that? Thank you! To give you some background, I have a grasp on the basics of statistics and probability theory and even remember touching Bayes theorem at the university data mining course. But being a few years away from the university made my math got extremely rusty (so much for last-minute pre-exam cramming). While I remember various random basic concepts, there are a lot of gaps in my understanding of them.  What would be a good material (a book, a site, or otherwise equally accessible medium) to revise the fundamentals and go beyond basics? I'd like a book that can be actually read as a book (most statistics books are really dry and are close to being reference material, rather than a book). Time complexity of nested for-loop I need to calculate the time complexity of the following code:  for (i = 1; i &lt;= n; i++) {   for(j = 1; j &lt;= i; j++)   {    // Some code   } }   Is it O(n^2)? Any suggestions for a good undergraduate introductory textbook to statistics? I am hoping you can give me some suggestions. I am teaching in a very diverse (made of minority groups) college and the students are mostly Psychology majors. Most students are fresh from high school but some of them are older returning students above 40. Most of the students have motivational problems and aversion to math. But I am still looking for a book that covers the basic curriculum: from descriptive to sampling and testing all the way to ANOVA, and all in the context of experimental methods. The department requires me to use SPSS in class, but I like the idea of building the analysis in a spreadsheet such as excel.  p.s. the other teachers use a book that I don't like because of the extensive reliance on computational formulae. I find using these computational formulas - rather than the more intuitive and computationally intensive formula that is consistent with the rational and basic algorithm- unintuitive, unnecessary and confusing. This is the book I refer to Essentials of Statistics for the Behavioral Sciences, 7th Edition Frederick J Gravetter State University of New York, Brockport Larry B. Wallnau State University of New York, Brockport ISBN-10: 049581220X Thank you for reading! i want to compile several pgfplots pictures with lualatex, since it dynamically allocates memory for compiling (in contrast to pdflatex).  In some plots, like my MWE.tex given below, i want to use a contour plot. This is typically done with gnuplot. To compile a document like this i need to use --shell-escape, such that gnuplot command can be executed while compiling the document.  \documentclass[a4paper]{article}  \usepackage[utf8]{luainputenc} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{tikzpicture}   \begin{axis}     \addplot3[contour gnuplot]      {x+y};       \end{axis}   \end{tikzpicture} \end{document}   If i use  pdflatex --shell-escape MWE.tex   everything works fine, and the log says something along the lines  This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex 2016.6.12)  13 JUN 2016 10:46 entering extended mode  \write18 enabled. .... Package pgfplots notification 'compat/show suggested version=true': document has been generated with the most recent feature set    (\pgfplotsset{compat=1.13}).  \openout3 = `MWE_contourtmp0.dat'.  \openout3 = `MWE_contourtmp0.script'. runsystem(gnuplot "MWE_contourtmp0.script")...executed.   If i use     lualatex --shell-escape MWE.tex i get the following error:  This is LuaTeX, Version 0.95.0 (TeX Live 2016)  (format=lualatex 2016.6.12)  13 JUN 2016 10:52  system commands enabled. ... Package pgfplots notification 'compat/show suggested version=true': document has  been generated with the most recent feature set (\pgfplotsset{compat=1.13}).  Package pgfplots info on input line 10: Using 'lua backend=false' for plot 0 (type 'contour external'): plot handler does not support LUA.  \openout3 = MWE_contourtmp0.dat  \openout3 = MWE_contourtmp0.script gnuplot "MWE_contourtmp0.script"  ! Package pgfplots Error: sorry, plot file{MWE_contourtmp0.table} could not be opened.   The .table file exists and looks identical to the one created by pdflatex, but it says that it cannot be executed.  (I just installed texlive 2016 yesterday, so everything should be up to date.) Trying to prove that $H=\langle a,b:a^{3}=b^{3}=(ab)^{3}=1\rangle$ is a group of infinite order. I'm trying to prove that the following group has infinite order: $$H=\langle a,b\mid a^{3}=b^{3}=(ab)^{3}=1\rangle.$$  Currently I'm checking on some cases using the relations, but my problem is the reducibility for large products.  Naively I started to check that $ab$ is different than $1,a,b$ and then $ba$ than $1,a,b,ab$, just to understand $H$ in some extent.   Now I'm wondering about some more effective method to prove that $|H|=\infty$, I'm tempted to look for an injection from some group of infinite order into $H$, but I'm still stuck.  More than asking for a solution I'd rather appreciate some hints or thoughts about it. Thanks a lot. Question 1: Let $x,y \in S$ such that $x\sim y$ if $x^2 =y^2\pmod6 $. Show that $\sim$ is an equivalence relation.    This is what I tried: Reflexive: $x^2\pmod6 = x^2$  implying $x\sim x$ Symmetry: suppose $x\sim y$, then  $x^2 =y^2\pmod6$ Operating by inverse of $x^2$ both sides we have $e=(x^2)^{-1} y^2\pmod6$ Then I have $y^2=x^2\pmod6$, hence $y\sim x$ I would like to get some corrections up to here because am not sure with this     Question 2. Find the orbits of the given permutation:    $$v:\mathbb{Z}\to\mathbb{Z}\quad\text{ defined by }\quad v(n)=n+3$$   Here is my solution which I would also want somebody to correct me! Let the relation $\sim$ be defined on $\mathbb{Z}$ by $a\sim b$ if $b=a+3$ I consider that the orbits of $v$ are the classes of $\mathbb{Z}$ with respect to $\sim$ given by  $\{b\mid b=a+3\}$. Thus I get only three orbits which are $\{1,4,7,10,…,3n-2\mid n\in \mathbb{Z}\}$, $\{2,5,8,…,3n-1\mid n\in \mathbb{Z}\}$, and $\{3,6,9,…,3n \mid n\in \mathbb{Z}\}$. If I am introducing someone to my daughter's husband's parents can I say "Hi, I'd like to you meet my ___". In-laws would not work here because they are my child's in-laws not my own. Is there a word for this relationship? How to measure the component value on a PCB? Is $(x^2+y^2+z^2) \ \sin \frac{1}{\sqrt{x^2+y^2+z^2}}$ Differentiable in $(0,0,0)$? In  (ignoring Hawking radiation), why is a  black? Why nothing, not even light, can escape from inside a black hole? To make the question simpler, say, why is a  black hole black? I am using a plugin to help "build" a customized product. There are different tabs/steps the user has to go through with back and continue buttons. At the last step I would like to add an "agree to terms" box with a checkbox "Agree". I have this done. But I would like to hide the add to cart button in Woocommerce until the user selects the checkbox agreeing to the terms.  This will be beneficial to me to make sure they reviewed the return policy as well as avoid confusion with the add to cart button appearing during all the steps, assuring they go through all the steps.  Here is the checkbox coding i pulled from console:  &lt;ul data-rules="{&amp;quot;Agree_0&amp;quot;:[&amp;quot;&amp;quot;]}" data-original-rules="{&amp;quot;Agree_0&amp;quot;:[&amp;quot;&amp;quot;]}" data-rulestype="{&amp;quot;Agree_0&amp;quot;:[&amp;quot;&amp;quot;]}" data-tm-validation="{&amp;quot;required&amp;quot;:true}" class="tmcp-ul-wrap tmcp-elements tm-extra-product-options-checkbox tm-element-ul-checkbox element_16 termsbox-ul"&gt;     &lt;li class="tmcp-field-wrap tmhexcolorimage-li-nowh"&gt;         &lt;label for="tmcp_choice_16_0_35"&gt;    &lt;input class="tmcp-field termsbox tmhexcolor_16_0_35 tm-epo-field tmcp-checkbox" name="tmcp_checkbox_16_0" data-limit="" data-exactlimit="" data-minimumlimit="" data-image="" data-imagec="" data-imagep="" data-imagel="" data-image-variations="[]" data-price="" data-rules="[&amp;quot;&amp;quot;]" data-original-rules="[&amp;quot;&amp;quot;]" data-rulestype="[&amp;quot;&amp;quot;]" value="Agree_0" id="tmcp_choice_16_0_35" tabindex="35" type="checkbox"&gt;     &lt;span for="tmcp_choice_16_0_35"&gt;&lt;/span&gt;&lt;span class="tc-label tm-label"&gt;Agree&lt;/span&gt;&lt;/label&gt; &lt;span class="price tc-price  hidden"&gt;     &lt;span class="amount"&gt;$0.00&lt;/span&gt; &lt;/span&gt;&lt;i data-tm-tooltip-html="This is were the description will be to agree" class="tm-tooltip tc-tooltip tcfa tcfa-question-circle"&gt;&lt;/i&gt;     &lt;/li&gt;&lt;/ul&gt;   Here is the add to cart section with the quantity  &lt;div class="quantity buttons_added"&gt;     &lt;input value="-" class="minus button is-form" type="button"&gt;    &lt;input class="input-text qty text" step="1" min="1" max="9999" name="quantity" value="1" title="Qty" size="4" pattern="[0-9]*" inputmode="numeric" type="number"&gt;     &lt;input value="+" class="plus button is-form" type="button"&gt;  &lt;/div&gt; &lt;button type="submit" name="add-to-cart" value="267" class="single_add_to_cart_button button alt"&gt;Add to cart&lt;/button&gt;   I am self taught with html and css, but javascript is to foreign for me  I tried the following in CSS but it does nothing.Tried is on codepen and works (i know needs to show instead of hide when checked)....  input[type=checkbox]:checked + .single_add_to_cart_button {     display:none !important;  }