I have a string conditions logic that retrieves values for a Map&lt;String,Boolean&gt; and checks if logic is true or false. For example my logic looks like:  ((1A2)O3)   Being A => AND and O => OR.  And my map has this kind of structure:  new Map&lt;String,Boolean&gt;{'1'=&gt;true,'2'=&gt;false,'3'=&gt;true};  Is it possible to replace characters in logic conditions with boolean values and get a proper result in Apex? Or even in Javascript?
Boolean b1 = true; Boolean b2 = true; String b3 = 'b1 &amp;&amp; b2'; Boolean b4 = Boolean.valueOf(b3); system.debug('test Bool '+ b4);   Given a string how can you convert into expression without breaking the sting.
How do I remove directories that begin with a dot after my server was infected? My server had been infected and the attacker spread a bunch of .5randomletters folders around my file system, with malicious code inside of them. I want to search for all the folders that begin with a dot, review them and then remove them.  How can I do that? How do you iterate backwards through an STL list? I received a journal paper for a review. The paper suggests a solution to an important problem, but the solution is very complicated and has mediocre performance. While reading the paper, I thought of a different solution, which is much simpler and has better performance (to give some scale: their solution is 1 page to write and 5 pages to prove; my solution is 5 lines to write and half a page to prove).  What should I do now?  A. Write my solution in the review, hoping the authors will remember to "thank the anonymous reviewer"?  B. Recommend that the paper published as is, then write a paper of my own with my improved solution?  C. Something else?  EDIT: Before I found the superior solution, I thought of recommending "resubmit with major revision", with the reasons that I mentioned above: your solution is too complicated and its performance is too weak.  However, now I am not sure it is the good course of action. A major revision may take a long time. The authors might even decide to delay or stop working on the paper without telling the editor (or me). Meanwhile, I will have to postpone the publishing of the superior solution for an indefinite amount of time. What do you think? TeXnicCenter & Adobe Acrobat 10 "whatever" as pure determiner? My dictionaries and references define, and I've always thought of, one of the functions of the word whatever as a "relative determiner."  In a sentence like, "I will help you in whatever way is possible,"  inserting the relative pronoun "that" between "way" and  "is", or replacing "whatever" with "the" - a pure, non-relative determiner - (I reckon) renders it ungrammatical:     *I will help you in whatever way that is possible.   *I will help you in the way is possible.   However, I do often encounter utterances like the first one above, such as:     My hope and intent is to contribute in whatever way that I can.   I wish to be of service to the local communities in whatever way that is possible.   where "that" is used, and thus "whatever" can be replaced by "the" without  making the sentences ungrammatical (if they are grammatical to begin with):     My hope and intent is to contribute in the way that I can.   I wish to be of service to the local communities in the way that is possible.   Is this usage of "that" with "whatever" wrong, though colloquial? I am trying to prove that if I have $f:\mathbb{R} \to \mathbb{R}$ satisfying $\forall x,y\in\mathbb{R},f(x+y) = f(x) + f(y)$. Which is assumed continuous at $0$, that $f$ is continuous on $\mathbb{R}$  I am fairly sure it is, for that property seems to be a property of polynomials, and we know polynomials are continuous where defined(all reals)  Any ideas for rigor?  $|x-a| \lt \delta \implies |f(x+a)-f(x)-f(a)| \lt \epsilon$  No idea where to go from here, this is my first time doing $\epsilon-\delta$ stuff. Probably a really simple one this - I'm starting out with C# and need to add values to an array, for example:  int[] terms;  for(int runs = 0; runs &lt; 400; runs++) {     terms[] = runs; }   For those who have used PHP, here's what I'm trying to do in C#:  $arr = array(); for ($i = 0; $i &lt; 10; $i++) {     $arr[] = $i; } Let $({\Bbb R},{\mathcal A},\mu)$ be the measure space where ${\mu}$ is the Lebesgue measure.  Assume that $\int_{\Bbb R}|f|^pd\mu&lt;\infty$ ($p\geq1$). There is an exercise for proving that       $$\int_{[0,\infty)}pt^{p-1}\mu(\{x:|f(x)|\geq t\})d\mu(t)=\int_{[0,\infty)}\mu(\{x:|f(x)|^p\geq s\})d\mu(s).$$   If one formally let $s=t^p$, then $ds=pt^{p-1}dt$ and one would immediately get the equality above. However, how can I justify it rigorously in the sense of Lebesgue integration?    [Edited] What puzzles me is that I have the "change of variable" theorem for Riemann integration, but all the integrations here are in the Lebesgue sense. Unless one has shown that the integrands are also Riemann integrable, how can I directly use "change of variable"? Why is the Descriptor not getting called when defined as instance attribute? Is there a significant difference between "rock" and "stone"? I found this pretty good small research, but I am still concerned about "regular usage" in life, say, when I am talking in the office, especially because of this comment:     To me: Stone is something you can pick up with one hand (for   throwing). A rock takes two hands. Does double negation distribute over implication intuitionistically? Print lines between (and excluding) two patterns I'm going to submit form using cURL, where some of the contents is come from other file, selected using sed  If param1 is line matching pattern from other file using sed, below command will works fine:  curl -d param1="$(sed -n '/matchpattern/p' file.txt)" -d param2=value2 http://example.com/submit   Now, go to the problem. I want show only text between 2 matching pattern excluding the matching pattern itself.  Lets say file.txt contains:  Bla bla bla firstmatch It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. secondmatch The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.   Currently, lots of "beetween 2 matching pattern" sed command won't remove firstmatch and secondmatch.  I want the result to become:  It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. What are the best practices for battery longevity? How do you maximize the cycle count of your battery?  There seems to be a debate between:   Leave plugged in 24/7 but do a full cycle once a month Charge to ~100%, drain to ~10%, repeat.   NOTE: Taking your   Which method is better and why? How much of a difference does it really make?  Here are some of the better sources I've found about battery behavior so far. Even still I feel they don't conclusively answer the question above. See my elaborations below:           Elaborating on Option 1  Now IF Apple engineers were smart and optimized for AC draw when plugged in to not use up your charge cycles, then it seem logical to assume that you are using effectively none of your 1000 charge cycles while plugged in. If that's the case, it would seem that the LiPo drop from holding at 100% would be vastly outweighed by the fact you're not using any charge cycles.  However, this is a purely speculative assumption and I could find no evidence to either confirm or deny.  If this is NOT true, and the AC adapter only goes to charging the battery, then there would be no difference. Your battery would drain to 99%, then back up to 100%, then back down to 99%, etc. Those micro-charge cycles would add up at the same rate as 100% -> 0% -> 100%, and you would get no gain. In this case the negative effect of holding LiPo batteries at 100% would outweigh everything else.  Elaborating on Option 2  There are lots of good reasons why Option 2 is the way it is:   Because of known LiPo chemistry issues, holding a 100% charge for a long time causes the battery to degrade Apple specifically recommends not to leave it plugged in all the time  Draining a battery all the way to zero all the time is bad for the cell (Which is why ~10% is used) Heat is a killer, and when plugged in AND charging, you get extra heat that causes damage.   There are a couple reasons why I'm challenging Option 2:   It seems silly that the most intuitive use case for thousands of people that use their macs as primary computers is wrong. If the hypothesis in option 1 is true, you're just burning unnecessarily through your finite charge cycles. It's a pain to have to remember to keep plugging in and plugging out and be worried about whether or not your device is plugged in. HDMI to VGA convert I just bought a new HP Pavilion dv7t Quad Edition laptop that has HDMI out. I already have a couple of monitors that are VGA and I'd like to hook up one of these to dual monitors.  I've read some sketchy reviews of products that try to convert directly from HDMI (digital) to  VGA (analog), so I was wondering if someone has a good recommendation on how to hook these two together. Teen fantasy book series about a world where people who showed creativity could learn magic, and were killed for it The title word filter is one of the worst ideas ever implemented on SO Using media queries in Lightning component Expected number of hamiltonian paths in a tournament The following theorem is from Alon&amp;Spencer's The probabilistic method, in the beginning of chapter 2:  Theorem 2.1.1: There is a tournament $T$ with $n$ vertices and at least $\frac{n!}{2^{n-1}}$ Hamiltonian paths.  Briefly the theorem is proved by looking at $X_\sigma$ the indicator random variable for a permutation $\sigma$ giving a Hamiltonian path, that is, satisfying $(\sigma(i),\sigma(i+1))\in T$ for $1\leq i \lt n$. Then   $\sum \mathbb{E}\left[X_\sigma\right] = \frac{n!}{2^{n-1}}$.  I don't understand where did this value ($\frac{n!}{2^{n-1}}$) came from! could someone explain it please? Is Angular momentum conserved in Impure rolling Missed the MyOpenID demise; account lost forever? Is there any way to get my old account + metadata back if I have lost an account ties to MyOpenID?