I used to have this block of code in a widely used method:  SObject[] ls = Database.query(q);  SObject[] children = new SObject[]{}; for (SObject l : ls) {     for (SObject c : l.getSObjects('Children__r')) children.add(c); }   This started giving errors with large data sets, so I switched to using a QueryLocator instead:  Database.QueryLocator locator = Database.getQueryLocator(q); Database.QueryLocatorIterator it = locator.iterator();  SObject[] children = new SObject[]{}; while (it.hasNext()) {     SObject l = it.next();     for (SObject c : l.getSObjects('Children__r')) children.add(c); }   I know that there are limitations on the number of active iterators, but besides that are there any risks that I should be aware of?
Ierator and for-each loop both we use for traverse no of items, I have used for-each many times but I am not clear about iterator, means when we should use ierator. I am studying salesforce workbook example..  global class CustomIterable implements iterator&lt;Account&gt;{    public List&lt;Account&gt; accs {get; set;}   public Integer i {get; set;}    public CustomIterable(){      accs =[SELECT Name fROM Account limit 5];      i = 0;              }   global boolean hasNext(){          if(i &gt;= accs.size()) {          return false;         } else {          return true;         }    }    global Account next(){          if(i == 8){return null;}          i++;          return accs[i-1];     } }   //------------  @isTest(seealldata=true) global class IteratorClass{     public static testmethod void main(){          IteratorClass obj = new IteratorClass();         Iterator&lt;Account&gt; acs =  obj.Iterator();         system.debug(acs);      }     global Iterator&lt;Account&gt; Iterator(){             return new CustomIterable();          }  }
Change default shell for Terminator I want to change the default shell of Terminator to zsh. In /etc/passwd/ I've changed the default shell to /bin/zsh. This settings changes the default shell in LXTerminal (the default terminal on Lubuntu), but not in Terminator. So I tried chsh -s /bin/zsh, but that doesn't work either. The Terminator  says:  How do I change my default shell? Terminator will always start the shell specified by the SHELL environment variable. (It will fall back to /bin/sh if the SHELL environment variable isn't set.) You could simply influence Terminator's environment, but the best solution is to tell your operating system which shell you'd like, and it will ensure that SHELL is set correctly for all applications, not just Terminator. See the documentation for your operating system for details on how to change your default shell.  So I expected my attempts to work, but they don't. How can I change the default shell in Terminator. I've noticed that, if I add \n to a pattern for substituting using sed, it does not match. Example:  $ cat &gt; alpha.txt This is a test Please do not be alarmed  $ sed -i'.original' 's/a test\nPlease do not/not a test\nBe/' alpha.txt  $ diff alpha.txt{,.original}  $ # No differences printed out   How can I get this to work? Allow the user to hide its own reputation value and/or badges similarly as visible on wiki pages. If the visitor wants to know your reputation, he/she has to view it on your user page.  Scenarios why to do it:   You have so much rep/badge, that your name gets recognized wherever you post You want to be just helpful and you show this by not advertising how 'good repped' you are, but rather focus on a good answer Implicit 'reputation' by name within the community - same as in the real world   Scenarios why not to do it:   Could impose transparency problems regarding to the site's basic concepts Hard to implement on a per user basis Concerns about showing/hiding it in the question part or in answers.   Discussion welcome.  Follow-up to  of mine. I'd really value your thoughts on this one. I'm familiar with the following use of 'made of':  The shirt is made of silk.  But I'd like to know if anyone thinks using this phrasal verb as a synonym for comprise/consist of/be composed of/made up of is actually grammatically correct/non-standard usage.  The board is made of five members. The board is made up of five members.  A few instances of this usage came up on a google search, but I'm not convinced... "Thus" vs. "Thusly" I read an article that used "thusly" and was wondering if there is any grammatical credence to it.   The :     The issue started when Sokolowski quickly ran out of storage capacity in his 32GB Surface after adding media files. After poking around, he realized that while the device has a 32GB drive, only 16GB of that capacity is available for users’ data. Thusly Microsoft is being sued for false advertisement, with the suit seeking class action status.   Is thusly an outmoded form of thus, or does it have a different meaning altogether? Option to hide rep/badges on the avatar block displayed of you Thermodynamics of supercooled water Now that it's been freezing outside for the last few days, I experimented a bit with supercooling. I've left a bottle of clean water outside for a few hours, and behold, when I shook the bottle, the liquid began to freeze rapidly, as expected.   However, not all of the water froze, only about half of it. This got me thinking.  I reasoned that happens because freezing releases heat, and that heat raises the temperature of the ice and remaning water to 0$^\circ$C, at which point the freezing stops.  To try to quantify this, set   $H_f = 334000 \frac{J}{kg}$, the "freezing heat" (enthalpy of fusion) of ice, $c_i = 2110 \frac{J}{kg\cdot K}$, specific heat of ice, $c_w = 4181 \frac{J}{kg\cdot K}$, specific heat of water, $M$, initial mass of supercooled water, $T_0$, initial temperature of supercooled water, $m$, mass of ice at a given moment, $T$, temperature at a given moment.   We suppose that the energy released by the freezing of a $\textrm dm$ mass of ice is used up by raising the temperature of both the already frozen ice ($m$) and the remaining water ($M-m$):  $$ \textrm dm \cdot H_f = c_i m \cdot\textrm dT + (M-m)c_w \cdot\textrm dT$$  By rearranging we get a linear differential equation for $m(T)$:  $$\frac{\textrm dm}{\textrm dT}+\frac{c_w-c_i}{H_f}m = \frac{c_w}{H_f}M$$  The solution of this equation, using the initial condition that at $T=T_0$, $m=0$:  $$ m = M \frac{c_w}{c_w-c_i}\left[ 1-e^{-\frac{c_w-c_i}{H_f}(T-T_0)} \right]$$  This looks neat, however, plugging in the actual values of the constants, $T = 0^\circ$C and $T_0 = -6^\circ$C, I get that little more than 7% of the water should freeze - as opposed to more than half, as I've observed. What's worse, the formula can be used to calculate the starting temperature required to freeze all the supercooled water: $$T_{all} = \frac{H_f \log\frac{c_w}{c_i}}{c_i-c_w}=-110.26^\circ \textrm C$$ which seems absurd.  Where is the error in the calculation above?  I've made a number of assumptions which may or may not hold:   the constants are really constant. I think this is a good approximation for $c_w$, a not that good but still acceptable approximation for $c_i$, and I suppose it holds to $H_f$ to some extent as well. there is no heat transfer with the environment, i.e. the bottle is a closed system. The process seemed fast enough (a few seconds at most) for this to be a good approximation. the system is in a thermal equilibrium at all times and the heat released by the freezing of the ice is distributed evenly in the emerging ice-water mixture. Now this is where I have doubts. Precisely because of the process happening so fast, this might not be true at all. However, acknowledging the presence of temperature variations makes the problem order of magnitudes harder: one has to solve a system of partial differential equations that take heat transfer, the shape of the bottle and \$deity knows what else into account. Freeman and Tukey interval If $Y$ is Poisson$(\lambda)$ distributed, how do we obtain this confidence interval for $\lambda$:  $$ \left (\frac{(\sqrt Y+\sqrt{Y + 1}-z_{(α⁄2)} )^2 - 1}{4},\  \frac{(\sqrt Y+\sqrt{Y  +1}+z_{(α⁄2)} )^2 - 1}{4} \right ) $$ Inequality similar to the Schwarz-Pick theorem Subgroups of $U(n)$ isomorphic to a direct sum of cyclic groups What is this strange function definition syntax in C? How to Self-Study Mathematical Methods? Edit:  Ok, user  made comment that truly helps narrow the focus of my question. Basically, I'm asking for a self-study course of Mathematical Methods.  Thanks to his recommendation I identified a book that is very close to the answer:  Mathematical Methods in the Physical Sciences by Mary L. Boas  Supposedly, the book covers most of the Math a person needs to learn in order to understand the simulations I presented.  Does this book suit my needs?    Hello,  I have always been interested on the idea to study Math at an Undergraduate level to be able to implement simulations like the followings:  Finite Difference Simulation of the Wave Equation    Heat Equation in Two Dimensions    Besides my precollege experience in Math, I have only been able to do very simple simulations due to my lack of knowledge of Advanced Math. Every time I ask about the inner workings of the simulations I get redirected to papers that look like foreign language to me and, unfortunately, I depend on easy-to-read tutorials to understand them, and while I have found   I'm more interested in reaching the solution myself.  I checked some of the questions related to book recommendations for self-study and while they are very helpful I'm interested in learning by example (There is a book called: "Accelerated C++ Practical Programming by Example" that fits very well my study habits)  Thanks in advance. I'm stuck with the proof of the following:  Suppose that $(s_n)$ converges to $s$, $(t_n)$ converges to $t$, and $s_n \leq t_n \: \forall \: n$. Prove that $s \leq t$.   I've tried starting with $s_n \leq t_n \: \forall : n$ and the definitions of each limit (i.e. $|s_n - s| \leq \epsilon \: \forall \: n &gt; N_1$), but I'm not really getting very far. Any help is appreciated! Explain why $E(X) = \int_0^\infty (1-F_X (t)) \, dt$ for every nonnegative random variable $X$ poll() failed, context incorrect? - Example: bpy.ops.view3d.background_image_add() Trim string in JavaScript? How do I trim a string in JavaScript? That is, how do I remove all whitespace from the beginning and the end of the string in JavaScript? Are $_SESSION variables stored on the client or the server? How do I download with youtube-dl to get video title as filename? Why is my Spring @Autowired field null? Alternatives to one-way ANOVA for heteroskedastic data I have data from 3 groups of algae biomass ($A$, $B$, $C$) which contain unequal sample sizes ($n_A=15$, $n_B=13$, $n_C=12$) and I would like compare if these groups are from the same population.  One-way ANOVA would definitely be the way to go, however upon conducting normality tests on my data, heteroskedascity seems to the main issue. My raw data, without any transformation, produced a  ratio of variances ($F_{\max} = 19.1$) which is very much higher than the critical value ($F_{\rm crit} = 4.16$) and therefore I cannot perform one-way ANOVA.   I also tried transformation to normalise my data. Even after trials of various transformations (log, square root, square), the lowest $F_{\max}$ produced after transformation with a $\log_{10}$ transformation was $7.16$, which was still higher compared to $F_{\rm crit}$.  Can anyone here advise me on where to go from here? I can't think of other methods of transformation to normalise by data. Are there any alternatives to a one-way ANOVA?  P.S.: my raw data are below:   A: 0.178 0.195 0.225 0.294 0.315 0.341 0.36  0.363 0.371 0.398 0.407 0.409 0.432     0.494 0.719 B: 0.11  0.111 0.204 0.416 0.417 0.441 0.492 0.965 1.113 1.19  1.233 1.505 1.897 C: 0.106 0.114 0.143 0.435 0.448 0.51  0.576 0.588 0.608 0.64  0.658 0.788 0.958