1 #include<type_traits> #include<iostream> using namespace std;  enum class Widget; using UType = underlying_type_t<Widget>; UType getWidget();  int main() {     cout<<getWidget();     cout<<static_cast<int>(Widget::a);     return 0; }  UType getWidget() {     return static_cast<UType<Widget>>(Widget::a); }  enum class Widget {     a, b, c };  2 #include<iostream> #include<type_traits> using namespace std;  template<typename T> using UType = underlying_type_t<T>;  enum class Widget;  template<typename T> UType<T> getWidget();  int main() {     cout<<getWidget<Widget>();     //cout<<static_cast<int>(Widget::a);     return 0; }  template<typename T> UType<T> getWidget() {     return static_cast<UType<Widget>>(Widget::a); }   enum class Widget {     a, b, c };  When I used Widget::a in main, compiler failed because of "Undefined identifier Error". But, when I called GetWidget, this code was compiled. What is difference in two situations? ---2 is working if I use getWidget(). but 1 isn't. ---compiler : visual studio 2019 iso c++14 standard ---error message :  c2027 : use of undefined type 'Widget'  C2065 : 'a' : undeclared identifier

I'm trying to do something like the following:  enum E;  void Foo(E e);  enum E {A, B, C};   which the compiler rejects.  I've had a quick look on Google and the consensus seems to be "you can't do it", but I can't understand why.  Can anyone explain?  Clarification 2: I'm doing this as I have private methods in a class that take said enum, and I do not want the enum's values exposed - so, for example, I do not want anyone to know that E is defined as  enum E {     FUNCTIONALITY_NORMAL, FUNCTIONALITY_RESTRICTED, FUNCTIONALITY_FOR_PROJECT_X }   as project X is not something I want my users to know about.  So, I wanted to forward declare the enum so I could put the private methods in the header file, declare the enum internally in the cpp, and distribute the built library file and header to people.  As for the compiler - it's GCC.


I have the following congruencies: $$x= 4(mod 7) $$ $$x= 2(mod 4) $$ $$x= 2(mod 5) $$ I solved for the smallest possible x that satisfies all of those conditions by breaking it up like so: $$a= 4(mod 7) $$ $$a= 0(mod 4) $$ $$a= 0(mod 5) $$ which gets a = 60 $$b= 0(mod 7) $$ $$b= 2(mod 4) $$ $$b= 0(mod 5) $$ which gets b = 70 $$c= 0(mod 7) $$ $$c= 0(mod 4) $$ $$c= 2(mod 5) $$ which gets c = 112 then I do $$ a + b + c = 242 $$ But it says the answer is 102. I tried it like this too:  and got the same answer. What am I doing wrong?

I've written some code that takes two integer arrays (one of moduli and one of remainders) and returns a number that solves this set of congruences.  It's working, but it's not giving me the smallest possible answer, and I'm not quite sure how to achieve this.  I followed what was written  to write my code.  The code looks like this:  def crt(m: Array[Int], r: Array[Int]): Int = {     assert(m.length == r.length)     for (a <- m; b <- m if b != a) assert(coprime(a, b))     for (a <- m) assert(coprime(m.product / a, a))     val parts = for (i <- 0 until m.length) yield {         r(i) * modinv(m.product / m(i), m(i)) * (m.product / m(i))     }     parts.sum }   For example, crt([3,5,7], [1,3,5]) returns 157, which isn't incorrect, but the lowest possible (and thus the "best" answer) is 52.  I don't know what I'm doing wrong or what I could do to change this, and whether or not it's the algorithm over at MathWorld or a fault in my implementation.


I'm trying to query my database with an array, I'm trying to count the number of rows returned from the query for each country in my database, and also count the rows for each of these countries with a digit equalling 1. Using the following code: <?php  include ('mysqli_connect.php'); // indclude mysql connection functions   $countries = array('united states','canada','united kingdom');   foreach($countries as $country){         //e.g. $r_spain holds the results from the query below with spain as $country         $r_.$country = mysqli_query($dbc,"SELECT * FROM feelings WHERE country = '$country' AND digit='1'");           //loop through the results         while($row = mysqli_fetch_array($r_.$country, MYSQLI_ASSOC)){                 $rowCount = mysqli_num_rows($r_.$country);                 echo $country."=".$rowCount;            }       }   ?>  This is the error message I get:  Catchable fatal error: Object of class mysqli_result could not be converted to string in /home2/designwr/public_html/uwe/notalone/updates/percentage.php on line 9  Can anybody point me in the right direction?

I want to store courseworks marks of n courseworks into n variables, such as cw1 and cw2 etc. Using variable variables how can I come with cw1, cw2 etc.   How can I dynamically create variables?


Why do the scenes in the films of year 1917 and before seem to run faster than the normal speed? Does it have to do something with the equipment of that era or that the actors used to act like that?

If I am correct, films run at 24 fps. Early, we saw jerky and rapid movements of people. This was, I think, 16 fps.  However, we have seen earlier films (like the first kiss) at 24 fps it seems.  Also the famous brontosaurus  (Bab?) seems at a faster rate than 16. Why did films seems to start off with 24 fps but later... such as in the 1920's we see the 16 fps,  then back to the 24 fps In the late 20's mid 30's?


we're using this regex to filter a ticket number from the subject.  This is the regex we're using: \\[\\#(.*)\\]  The subject usually looks like this: "[#20160708-0020] Hello blah blah"  Regex get's us "20160708-0020" and we can use that further.  Somebody from the company started writing mails like this: "[#20160708-0020] Hello [SQL] blah blah"  So the regex will get us "20160708-0020] Hello [SQL" which obviously isn't correct.  Is there any way to tell the regex to stop after the first match? Thanks! :)

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


I'm not sure why this is happening. With my scene i have an emission plane as the main light source for the scene:  As you can see, the material preview shows the shader correctly, but in the actual render it is much darker. This applies to final renders as well. The same thing happens with the world material, even if I make it 100% white, it appears as a shade of grey. Jacking up the strength just emits that same color of grey stronger, not whiter.

There are several techniques to do a 3 point lighting system.   How do you properly light a scene while using mesh planes as emission light sources?   I'm following , however despite setting up planes to act a lighting sources, the scene is still very dark.      Actual Blender file here:


I need to change several variable values by rounding them, and while it works if I specify each variable individually I'm having trouble getting it to do the same thing in a function.   Single Variable  Result = 9.5 (Works correctly)  $var = 9.54; If ($var != NULL AND $var !== "") {    $var = round($var , 1, PHP_ROUND_HALF_EVEN);  } echo $var;   Function Result = 9.54 (Doesn't work correctly)  $a = 9.54; function RoundDecimal($var) {    If ($var != NULL AND $var !== "") {       $var = round($var , 1, PHP_ROUND_HALF_EVEN);     } } RoundDecimal($a); // Calls function echo $a;

Are PHP variables passed by value or by reference?


I am confused about showing the ring $\mathbb Z[\sqrt{2}] $ is a UFD? I understand to show that for all non-zero units you must show they factor into irreducible elements and that they must all be associates of each other although I do not know how to prove this because to disprove it is easy simply showing a counterexample.. Any help would be greatly appreciated

We're proving that $\mathbb{Z}[\sqrt{2}]$ is a Euclidean domain, using the norm function $$\nu (a + b\sqrt{2} ) = |a^2 - 2b^2|$$ and the first part says that since $\nu (a + b\sqrt{2} ) = |(a + b\sqrt{2})(a - b\sqrt{2})|$ it's clear that $\nu (xy) = \nu(x) \nu(y)$? ... Can someone please explain to me how this is clear?


If I have multiple entry visa for schengen and i am Indian staying in UK can i travel to schengen countries more than once from UK till the VISA is valid?

My wife was just issued a multiple entry visa by France, which is good for one year.  Our first trip will be to France, the issuing country.  My question is: after we leave the EU and return, must future trips also start in France? Or may we go directly to (say) Greece from the US on a later visit?


I want to expire session after 45 minute.  Is there any simple way to that?   Should I change any config in PHP.ini file?

I need to keep a session alive for 30 minutes and then destroy it.


Is it possible to color some of my text in the post?  I have 2 columns in my question post. I want to show column one as red and column 2 as green.  Is this possible?

Stack Overflow provides good tools in the question editor, like "Links" and "Styling".  Another thing that for me would be nice is a color selector. Although an HTML editor is available, a direct click on tool would be good, and users can select different colors, as for marking errors in their program with red, and more important data with blue.


Find two rational numbers $\frac ab$ satisfying $$\mid \pi - \frac ab\mid < \frac{1}{\sqrt 5 b^2}.$$  I dont know how to find such rationals. IS there a method? or trial?

Do you a digit efficient way to approximate $\pi$? I mean representing many digits of $\pi$ using only a few numeric digits and some sort of equation. Maybe mathematical operations also count as penalty.  For example the well known $\frac{355}{113}$ is an approximation, but it gives only 7 correct digits by using 6 digits (113355) in the approximation itself. Can you make a better digit ratio?  EDIT: to clarify the "game" let's assume that each mathematical operation (+, sqrt, power, ...) also counts as one digit. Otherwise one could of course make artifical infinitely nested structures of operations only. And preferably let's stick to basic arithmetics and powers/roots only.  EDIT: true. logarithm of imaginary numbers provides an easy way. let's not use complex numbers since that's what I had in mind. something you can present to non-mathematicians :)


Let X be a topological space. Show that X is $ T_2 $ if, and only if, $ \alpha $ = {(x, x) $ \in $  X $\times$ X : x $ \in $ X} is closed at  X $\times$ X. =================================================================== By Hausdorff definition we have x, y $ \in $ X, with x $ \neq $ y, there are U, V $ \subset $ X open such that x $ \in $ U, y $ \in $ V e U $ \cap $ V = $ \emptyset $. Assuming that close in X $ \times $ X = A and that to be close $ A^c $ needs to be open. But if X is Hausdorff that means that exist x $\in$ X, U $\subset$ X open, where x $\in$ U. But that doesn't mean X $\times$ X is open?

Let $X$ be a topological space. The diagonal of $X \times X$ is the subset $$D = \{(x,x)\in X\times X\mid x \in X\}.$$   Show that $X$ is Hausdorff if and only if $D$ is closed in $X \times X$.   First, I tried to show that $X \times X \setminus D$ is open using the fact that $X \times X$ is Hausdorff (because $X$ is Hausdorff), but I couldn't find an open set that contains a point outside $D$ and is disjoint to it...


A few months ago I created a Windows 10 VM to host a development version of an enterprise software platform. I set up this software with help from an outside rep, and came back a few months ago having forgotten the password to the VM. Ideally, I'd like to reset the password for the VM, and not wipe it (since that would require engaging the rep again unnecessarily). I have explored several options:  PCUnlocker Reset Windows Password NTPasswd ()  Each of these are bootable ISOs that claim to be able to reset the password on a Windows 10 install if booted. I've verified that the properties of the ISO files do not contain the P attribute, and that they have been Unblocked in the Properties dialogue. I've set the boot order for the VM as follows:  When I boot the VM, either cold, or with a Reset, Stop/Start etc, it boots directly to the login screen, seemingly skipping the disk in the drive. I'm sure this is due to a misconfiguration on my part, though I'm not sure what. If this doesn't work, is there a way to copy all files and registry settings over to a new VM with a new password?

I accidentally disabled my admin account.  After I login to another account I found I can not get admin rights, because all admin accounts on my computer are disabled.  I clicked on 'run as administrator' but only see a smart card choice (all the admin accounts are disabled so no choice provided)    I don't want to re-install my OS, help!    Details:  I have account A on my computer.    I got a new computer so I want to give the old one to my mother.    Creating a new user account B for her and disable account A.    Logout and restart.    Successfully login B, now I found I could not get admin rights because no account choice is provided.    More informations about my machine:  OS is Windows 10 and my admin account is a Microsoft Account.  I have an arch-linux installed on my computer and dual-boot it using GRUB, so maybe I can not use safe mode.


I read that the image of the shadow taken by EHT is actually all the surfaces of the event horizon of M87 which extends to 2.6 schwarchild radius but wouldn't that also meant that we can also observe our galaxy clusters in that photonsphere which is the ring that is just beyond the 2.6 schwarchild radius, by the way I am not confused with the bright coffee mug stain like ring which extends out from 3 schwarchild radius which is supposed to be the falling matter around the blackhole. My question is can we see ourselves in the photonsphere?

The YouTube video is a good example how the gravity of this merging binary black holes bend light around themselves.


What should $n$ be equal to, so that the number: $$5^{2n+1}2^{n+2} + 3^{n+2}2^{2n+1}$$ is completely divisible by 19? I broke it into this: $$20\cdot 2^{n}\cdot 25^{n}+18\cdot 3^{n}\cdot 4^{n}$$ But what should i do next?

Prove that the expression    $$5^{2n+1} * 2^{n+2} + 3^{n+2} * 2^{2n+1}$$   is divisible by $19$.   I'll skip the basis step (as I have done last time) but I can conclude that it's only divisible by 19 for integers n ≥ 0 (or whole numbers).  II.  Assume that  $$5^{2k+1} * 2^{k+2} + 3^{k+2} * 2^{2k+1}$$ is divisible by 19. Then, $$5^{2k+3} * 2^{k+3} + 3^{k+3} * 2^{2k+3}$$ is divisible by 19.   Now this is where I get lost, I try to "dismember" the expression to get  $$5^{2k}* 5^3 * 2^k * 2^3 + 3^k * 3^3 * 2^{2k} * 2^3$$  I also try to get it similar to to the assumption to make use of the said assumption yielding $$5^{2k}* 5 * 5^2 * 2^k * 2^2 * 2 + 3^k * 3^2 * 3 * 2^{2k} * 2 * 2^2$$ $$5^{2k+1} * 5^2 * 2^{k+2} * 2 + 3^{k+2} * 3 * 2^{2k+1} * 2^2$$ $$5^{2k+1} * 25 * 2^{k+2} * 2 + 3^{k+2} * 3 * 2^{2k+1} * 2^2$$ $$50 * 5^{2k+1} * 2^{k+2} + 12 * 3^{k+2} * 2^{2k+1}$$ And this is where I get lost.. : (  Am I missing out something? Had I done it wrong? The number 19 is prime which makes it hard to handle for me. Thanks!  EDIT : After some pondering, I answered it this way : $$50 * 5^{2k+1} * 2^{k+2} + 12 * 3^{k+2} * 2^{2k+1}$$ I realized that 50 can be written as 38 + 12 (and 38 is a multiple of 19) Hence, $$ 38 + 12 * 5^{2k+1} * 2^{k+2} + 12 * 3^{k+2} * 2^{2k+1} $$ Factoring out 12, I get : $$ 38 + 12(5^{2k+1} * 2^{k+2} + 3^{k+2} * 2^{2k+1}) $$ 38 is divisible by 19 and the long expression is divisible by 19 (per the assumption) and qed. Is this correct ?


When we declare all variables and methods in a class as final, we are restricted the concept of override.  Then, "what is the reason we want to restrict IS-A relationship in an OOP language( even we restrict IS-A relationship, this language has Has-A relationship) by using final class?"  My point is we can not restrict the accessing the members of our class any way, then give an easy access by allowing IS-A relationship. Otherwise it is a headache to create objects and all? (in my view 'access' not includes  modifications)  If I miss any important theme of programming , please excuse me. And tell me, what is it?

What are good reasons to prohibit inheritance in Java, for example by using final classes or classes using a single, private parameterless constructor? What are good reasons of making a method final?


Since, in Avengers: Age of Ultron,       Ultron is in the internet, and all files, and pretty much everything connected to a computer (think Cylons),    how does Tony communicate with Veronica without Ultron stopping him?

In Avengers: Age of Ultron movie,      Ultron infected tech of Avengers Tower just after his birth. It means he is capable of infecting tech. Also, if this wasn't the case, he could never be able to create his drones.   Just after its birth,      He escaped using the Internet and infected digital devices across the entire planet. Again, awesome capability (think Skynet).   We also saw that      Iron Man's armor was connected to the Internet. He googled for the keyword "Hulk" during flight just before he deployed Veronica.   Then, why did Ultron let Iron Man win the fight? Why didn't he simply hack Iron Man's armor to use him as own drone?


I want to type a notation as same as the below pictue   How must I do?  Please help me!

This is an absolutely minor/cosmetic problem. I can e.g. use stackrel so combine two math-symbols vertically. This is nice for \stackrel{!}{=}. But how to do this horizontally? I want to combine (only once, no newcommand necessary) the colon and an equivalence sign. I found the option \mathrel{: \equiv} which allows different versions like:  :\equiv  \quad \mathrel{: \equiv} \quad \mathrel{: \!\! \equiv} \quad \mathrel{: \!\! \!\! \!\! \equiv}     So I can shift the horizontal position. But like to achieve that the colon is centered regarding the vertical position. Like the blue version:    Again: if I use stackrel is combines two symbols vertically and centered! If I use mathrel is combines two symbols horizontally but not centered somehow.  I am eager to see your solutions.


I have this problem, which it's keeping me out of focus from the main project on Laravel. I have 2 tables without any fk on them TableA: id(INT) Name(VARCHAR) EventId(INT) PlayerChoiceId(INT)  and TableB: id(INT) PlayerChoice(VARCHAR) PlayerColor(VARCHAR)  I need to make a method on my controller to select all of the data from TableA with the PlayerChoice value, not the id from TableB, but without LEFT JOIN. Example: id(TableA)|Name|EventId|PlayerChoice

Ok, here is my dilemma I have a database set up with about 5 tables all with the exact same data structure. The data is separated in this manner for localization purposes and to split up a total of about 4.5 million records.  A majority of the time only one table is needed and all is well. However, sometimes data is needed from 2 or more of the tables and it needs to be sorted by a user defined column. This is where I am having problems.  data columns:  id, band_name, song_name, album_name, genre   MySQL statment:  SELECT * from us_music, de_music where `genre` = 'punk'   MySQL spits out this error:  #1052 - Column 'genre' in where clause is ambiguous   Obviously, I am doing this wrong. Anyone care to shed some light on this for me?


If $m > n$ and $a,m,n$ are positive, with $m$ not equal to $n$, find the  greatest common divisor of $2^{2^m}+1, 2^{2^n}+1$. Please solve this problem using Euclid's algorithm.  I tried to use Euclid's algorithm by first dividing $2^{2^m}+1$ by $2^{2^n}+1$, but I got stuck in the 2nd step while dividing $2^{2^n}+1$ by the difference of $2^{2^m}+1$ and $2^{2^n}+1$.

I've been working with the Fermat numbers recently, but this problem has really tripped me up. If the Fermat theorem is set as $f_a=2^{2^a}+1$, then how can we say that for an integer $b<a$, the $\gcd(f_b,f_a)=1$?


I am searching for my Great Grandfather’s WW1 records.  His name is Adolf Totscheck or Totschek and he lived in Görlitz, Germany.

Where can I find information on German soldiers from World War I and World War II?   I am curious to find out about my ancestors' role in the wars, i.e. what rank they had, where they where fighting, with whom and anything else.


I have written the binomial expansion of $(1+\sqrt3)^n$ as $$\binom n0 1 + \binom n1 \sqrt3 + \binom n2 3 +\binom n3 3\sqrt3 + ...$$ but I couldn't make any use of it. Can you give me a starting point to solve the problem? Thanks for your effort and time in advance.

Let $a_{n},b_{n}\in \mathbb{Q}$ such that $(1+\sqrt{2})^n=a_{n}+b_{n}\sqrt{2}\;,(\forall n\in \mathbb{N}).$Then $\displaystyle \lim_{n\rightarrow \infty}\frac{a_{n}}{b_{n}} = $   $\bf{My\; Try::}$ Using   $$(1+\sqrt{2})^n = 1+\binom{n}{1}(\sqrt{2})+\binom{n}{2}(\sqrt{2})^2+\cdots \cdots +\binom{n}{n}(\sqrt{2})^n$$  So $$a_{n} = \binom{n}{0}+\binom{n}{2}\cdot 2+\binom{n}{4}\cdot 2^2+\cdots \cdots $$  So $$b_{n} = \binom{n}{1}+\binom{n}{3}\cdot 2+\binom{n}{5}\cdot (2)^2+\cdots$$  Now How can i solve $$\lim_{n\rightarrow \infty}\frac{a_{n}}{b_{n}} = $$  Help required, Thanks


I have a 1 TB hard drive with OS installed (Windows Server 2012 R2), several partitions, dynamic disk.  All I want to do is back everything up so I can basically clone it to a bigger drive. However, so far Windows Server Backup and Paragon Hard Disk Manager have proven to be useless. For some reason I can’t restore a backup I created in Paragon to another disk, even though the back up is on a different drive. I get a metadata collision error.   I just need the simplest way that will let me take a live image of that entire 1 TB drive and just re-apply it to another drive. Suggestions?

I want to transfer my current system hard drive to a larger hard drive. Doing so, I thought of creating an image of my system hard drive which is 320 GB in size.   Would I be able to restore this image on a larger hard drive? I plan buying a 1TB hard drive.  If yes, how? I prefer no data loss.  I am using Windows 7


$X$ has the Poisson distribution with parameter $λ$.  I want to find the average of $(1+X)^{-1}$  Some steps-of-thought would be appreciated.

Question  Let $X$ be Poisson with parameter $\lambda$.  Compute the mean of $(1 + X)^{-1}$. (Introduction to Probability Theory, Hoel, pp. 104)  Answer Key  The answer key shows that the mean is $\lambda^{-1}(1 - e^{-\lambda})$  My Solution  $$E(1 + X)^{-1} = \sum\limits_{j = 1}^\infty (1 + j)^{-1} \dfrac{\lambda^{(1 + j)^{-1}}e^{-\lambda}}{(1 + j)^{-1}!}$$ $$= e^{-\lambda} \sum\limits_{j = 1}^\infty \dfrac{\lambda^{(1 + j)^{-1}}}{((1 + j)^{-1} - 1)!}$$ $$= \lambda^{-1} e^{-\lambda} \sum\limits_{j = 1}^\infty \dfrac{\lambda^{(1 + j)^{-1} - 1}}{((1 + j)^{-1} - 1)!}$$ $$= \lambda^{-1} e^{-\lambda}(e^{\lambda} - 1)$$ $$= \lambda^{-1}(1 - e^{-\lambda})$$  EDIT: I found why I got the answer incorrect.  Thanks for those who answer the question! :)


I programmed the extended Euclidean algorithm together with the inverse modulo because I am making an RSA system from scratch. Any feedback regarding efficiency etc. is welcome :)      def ext_gcd(a, b):          a0, a1 = a, b         x0, x1 = 1, 0         y0, y1 = 0, 1          while a1 != 0:             q = a0//a1             r, s, t = a1, x1, y1             a1 = a0 % a1             x1 = x0 - q*x1             y1 = y0 - q*y1             a0, x0, y0 = r, s, t          return x0, y0, a0      def inverse_mod(a, mod):         va, y0, a0 = Math.ext_gcd(a, mod)         return va % mod

I have programmed the extended euclidean algorithm. Is this a good approach?  def ext_ggT(a, b):     x,y, u,v = 0,1, 1,0     while a != 0:         q, r = b//a, b%a         m, n = x-u*q, y-v*q         b,a, x,y, u,v = a,r, u,v, m,n     gcd = b     return gcd, x, y


So, I tried solving this problem in the following way (though I think I'm begging the question...)  The possible remainders of $x^{2n}-x^{n}$ when divided by $2$ is $0$ and $1$. We wish to solve the following congruence $x^{2n}-x^{n}\equiv b\pmod 2$, where $b=0$ or $b=1$.  Now, Suppose $b=0$ (this is where I think I'm begging the question!). Then $x^{2n}-x^{n}\equiv 0\pmod 2 \Leftrightarrow 2\vert (x^{2n}-x^{n}-0) \Leftrightarrow x^{2n}\equiv (x^{n})^{2}\equiv x^{n}\pmod 2$. If we let $a=x^{n}$. Then it is clear that $(x^{n})^{2}\equiv x^{n}\pmod 2 \Leftrightarrow a^{2}\equiv a\pmod 2$ and by Fermat's little theorem we know that $a^{2}\equiv a\pmod 2$ is true. Thus $x^{2n}-x^{n}$ has a remainder of $0$ when divided by $2$.  Is this correct? Or am I just begging the question?


I am running Xubuntu 13.04, I got in the habbit of closing my Acer Netbook and forgetting about it for a week+. I open it up to find it has still been running. How do I set it to shutdown after 15 minutes of inactivity? I don't want to set it to lid close because I often get up and close the lid so kids don't get at it. Also, due to the sometimes long stretches I go without touching it, I would like to make sure it is completely shutdown.  I'm sure I'm just missing some little check box. I've never had a setup that didn't shut itself down, or wasn't able to with a few click.  I already Googled the question for a bit and wasn't able to get the keywords right to get a relevant answer.

How can I automatically shutdown the system after a certain customizable time?


I just updated ubuntu 14.04 on 01-30-16 and now my netwoking is not working. If I go to settings and try to open networking, I get the message "the system network services are not compatible with this version". Any help would be appreciated. I don't want to reinstall if I don't have to.

While upgrading today, something caused my wireless network manager to disappear. Not even connecting via wired connection.  This error is being shown by files:  **(nm-applet:2716): WARNING **: Could not initialize NMClient /org/freedesktop/NetworkManager: The name org.freedesktop.NetworkManager was not provided by any .service files   (nm-applet:2716): nm-applet-WARNING **: Error connecting to ModemManager: Error calling StartServiceByName for org.freedesktop.ModemManager1: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ExecFailed: Cannot launch daemon, file not found or permissions invalid   (nm-applet:2716): nm-applet-WARNING **: Could not find ShellVersion property on org.gnome.Shell after 5 tries   (nm-applet:2716): nm-applet-WARNING **: Failed to register as an agent: (2) The name org.freedesktop.NetworkManager was not provided by any .service files    Is there a patch I can download through windows and send through to my ubuntu, or is it a case of having to reload everything? I tried running two versions back but still no internet access.


I would like to be able to use (equation) alignment inside a simple in-line $...$ environment.  Of course, normally nobody does this, when this is properly done with the standalone equation environments. However, some text editors support limited simple LaTeX rendering, and they may only support the basic in-line math environment $...$ and not recognise more complex (standard) environments like \begin{equation}...\end{equation}. So it would be really nice and useful if this can be done somehow.  In my case, I am specifically using . It does not recognise the equation environment, just $$ apparently.

Is there any way to override the fact that certain environments in LaTeX are automatically "displayed"?  One such example is the align* environment.  I want to keep my aligned equations inline.  So basically I want something like  \begin{align*} x+y&=z\\ u+v&=w \end{align*}   embedded into a line of text.


Edit I think this differes slightly from the linked "duplicate" as here are paragraphs formatted as typewriter, using \ttfamily while in the duplicate there are  a lot of "common words" in typewriter font sprinkled around his text.  The solution is of course similar, but "Heiko Oberdiek", marked answer here, gave a nice working example and explanation regarding this problem. Personally I had problems understanding what parts of the suggested codes in the "duplicate" question were necessary to solve my issue. Original Question I recently have some bigger texts I want to put into \ttfamily. However, I noticed wordbreaking isn't really working and did some research to add these lines: \setlength{\emergencystretch}{2em} \newcommand{\origttfamily}{}% \let\origttfamily=\ttfamily% \renewcommand{\ttfamily}{\origttfamily \hyphenchar\font=`\-}  Also using english option in a memoir-class and babel-package. This is somewhat helping as there is some wordbreaking and space-stretching happening now, but in the end, most paragraphs are looking more like left-aligned than justified. and there are still some lines going over the defined borders. Here is a minimal example with 2 longer text-passages, one in plain and one in ttfamily. \documentclass[english,11pt,oneside,article,a5]{memoir} \usepackage[english]{babel} \usepackage{geometry}   \setlength{\emergencystretch}{2em} \newcommand{\origttfamily}{}% \let\origttfamily=\ttfamily % \renewcommand{\ttfamily}{\origttfamily \hyphenchar\font=`\-}  \geometry{left=20mm,right=20mm, top=20mm, bottom=50mm} \OnehalfSpacing \leftskip3em\rightskip2em  \begin{document} $>$She didn’t want to spend the time trying to locate them, or try to thin out the operator’s patience for Alison doing whatever. She expects they are already rather sour at her burrowing a tunnel through most of the building’s ﬂoors to make that railgun using an enormous amount of jetalium. If she gets a chance later, though, to come back to this place, she’ll put rescuing Loviro on the table.  \\{}\ttfamily According to the engineer, they are most likely tethers to launch things cheaply into space, given how high they go. Although, Alison does come by close enough to see one to see a revolving restaurant at the top of it, so tossing stuff into space may not be its only function. \end{document}  Did I to something wrong in using ttfamily like this?

This question was phrased as a bug report for LaTeX and I thought it would be helpful to be presented here (including an answer).  The person had a lot of "common words" in typewriter font sprinkled around his text and he was surprised that this text would not automatically hyphenate and he had to manually insert \- to mark hypenation points.


I got a Blue Screen and the computer restarted automatically. After the restart I got a message in a dialog box, and it asked whether I wanted to search online for a solution. However, I just closed the dialog box and restarted the computer again. The message in the dialogue box is as follows:     Problem signature:   Problem Event Name:  BlueScreen   OS   Version:  6.1.7600.2.0.0.256.1   Locale ID:   1033      Additional information about the problem:   BCCode:   1000008e   BCP1: C0000005   BCP2:    99D4139A   BCP3:    B910DB14   BCP4:    00000000   OS   Version:  6_1_7600   Service Pack:    0_0   Product:  256_1      Files that help describe the problem:   C:\Windows\Minidump\050314-33259-01.dmp   C:\Users\uname\AppData\Local\Temp\WER-55879-0.sysdata.xml      Read our privacy statement online:         If the online privacy statement is not available, please read our   privacy statement offline:   C:\Windows\system32\en-US\erofflps.txt   I tried to open the minidump file. When opening the folder it asked me to get permanent access to the folder and I could then open the folder, but it still doesn't let me open the .dmp file. The second .xml file does not exist. Is it possible to analyse this message to understand what the problem was?

Lately I see a blue screen of death a lot and want to know why it appears. Where should I gather the information so the problem can be diagnosed best? Couldn't find anything in C:\Windows\Logs.


One.java  public class One {      private void run() {         System.out.println("one");     }      public void start() {         this.run();     } }   Two.java  public class Two extends One {     public void run() {         System.out.println("two");     } }   Main.java  public class Main {     public static void main(String[] args) {         Two t = new Two();         t.start();     } }   Output: one  But if I declare the run method public in the One class I get "two" as output.  It is pretty unpredictable, how does this work?

In Java, are there clear rules on when to use each of access modifiers, namely the default (package private), public, protected and private, while making class and interface and dealing with inheritance?


Sometimes I face the problems with my video card, so the system freezes. Reset button is broken, so the only way is to hold down power button for 5 secs. Guess that this action differs from power loss, cause motherboard controls process of poweroff, it may send some signals to hw, before shut down.   I am worried about my hard disk drives. Will the hard disk drives heads be safely parked or I will get +1 bad event to SMART? Or it motherboard-dependent?

Can computer hardware suffer damage from forceful shutdowns (holding the power button for five (5) seconds) or power failures?   I believe that normal PC hardware does not suffer from this - after all, it's not much different than what they experience under a standard shutdown. But elsewhere I've read tht another person thought that it could do physical harm to the hard drive and possibly other components as well. He also said that the journaling features of filesystems are useless in face of power failures and were intended to help mitigate damage from system crashes.  I think this is nonsense, but then again I lack the experience and knowledge to say it with certainty.


I've just received and external flash : YN 560 III and I'm learning to use it.  This is a manual external flash, it was mounted on the hot shoe of my Nikon D3200.  For one picture I set the shutter speed at 1/400s and the EXTERNAL flash speed at 1/128 (is this the speed?). This resulted in an unexposed black bar at the bottom half of my image.   Can someone explain why this is happening? I understand that pop-up flashes have limitations, but I thought external flashes overcame these limitations.  Here's a sample photo:

Sometimes in bright backlight and with large aperture (f2.8) I want flash at high shutter speeds.  But when I pop the flash up on D7000 it caps the shutter speed to 1/250th, which overexposes the shots and makes everything look like a nuclear bomb just went off.  What's the logic behind the limiting of the shutter speed when using flash? Is there anything I can do to get flash  + faster shutter speeds?


Okay, let's say you have a handful of enemies, each with their own 'rarity' to spawn. For example:  monsterlist = []  snake = 'snake', 60 wolf = 'wolf', 80 antlion = 'antlion', 30  monsterlist.append(snake, wolf, antlion)   Now I want to spawn one at random:  totalchance = 0  for monster in monsterlist:     totalchance += monster[1] #add each monster's rarity to totalchance chance = random.randint(0, totalchance)  if chance <= targetlist[0][1]: #chance is <= than first entry's rarity     #spawn first monster elif chance <= targetlist[0][1] + targetlist[1][1]: #chance <= second target's rarity     #spawn second monster #etc   Assuming you have a large amount of monsters in monsterlist, this is going to take stupid amounts of code just to calculate chance to spawn, I like to assume there's a less annoying way to do this, right?

I have a loot box that I want to fill with a random item.  But I want each item to have a different chance of being picked.  For example:   5% chance of 10 gold 20% chance of sword 45% chance of shield 20% chance of armor 10% chance of potion   How can I make it so that I select exactly one of the items above, where those percentages are the respective chances of getting the loot?


We use an application called IntraMaps Roam.  Our guys go out in the field, mark up their maps with GPS points, and then bring them back to the office.  They will copy their shapefiles to the server and the script will combine them at night.  The next morning they will download the new maps.  How can I accomplish this task?

What are useful websites for scouting GIS related jobs?


It may be  1 movie or a combination of 2 or more. I would have watched this movie somewhere in the 60's or 70's.   The plot follows astronauts that go to the moon and, while there, discover a disabled alien craft that needs to be repaired. The aliens, who look human, need the assistance of the astronauts so the aliens help the astronauts get back to earth so they can get the parts they need to fix their craft.   The aliens craft was a large round shape and I believe there were robots/androids also inside the alien craft.

Back in the late 60's I watched a show or movie on TV. A guy had a little box on his belt that produced a force-field. I remember him demonstrating it by forcing another guy against a wall. For the guy with the force field it was effortless to pin and or crush the other guy if he wanted.  I don't remember if it was a TV serial or a movie. I've watched all of the old Twilight Zones, Outer Limits, and countless 1950's sci-fi flicks with no luck finding it yet.


Consider this simple MWE  \documentclass{article} \usepackage{subcaption} %sub figures \begin{document} \begin{figure} \begin{subfigure}{\linewidth}     \centering     \caption{Test1} \end{subfigure} \caption{with $10^{−4}$ and a mass fraction cutoff of $10^{−30}$} \end{figure}  \begin{figure} \begin{subcaptionbox}{Test2}[\linewidth]{     \centering } \end{subcaptionbox} \caption{$10^{-4}$ and a mass fraction cutoff of $10^{-30}$} \end{figure}   \end{document}   On my system (TeXstudio 2.5.2 (SVN 3661) Using Qt Version 4.8.1, compiled with Qt 4.8.1 R), this is displayed as the following   Why are the negative signs in the exponents missing when using subfigure?

In the below equation I'm writing, 2 minus signs are not visible, why is that?  $\phi (s, \lambda) = C \frac{ 1 + \beta^2 − 2 \beta cos( \frac{2 \pi s}{\lambda} ) }{ \lambda^5 \exp( \frac{ h c }{ \lambda k B T } − 1) } $


This post uses this math equation    How to write the latex for the L^2 on an arrow?

Hi I am wondering what code is used to get text above the $\rightarrow$   have tried $ \xrightarrow{P}$ but not running on my LaTeX as I do not know which package to install or how to install it.   currently using \usepackage{mathtools} but it wants to load from a random directory and then LaTeX stops working.


I am able to parse the mlab ndt trace log files using the PcapFileInputFormat using the GitHub code located at url .  I'm able to parse the fields(like TIMESTAMP) which are predefined in the "Packet.java" class.But I'm unable to add the new fields like(total_traffic,Total_Size) and parse them .Eventhough I had included the new fields in Packet.java and tried to debug the code.The debugger is not entering into the code where I had newly edited with the new fields.      My Edited Code:     ===============      In PacketReader.java:(In hadoop-pcap-lib)     ==================== (src-->main-->java-->net-->ripe-->hadoop-->pcap-->PcapReader.java)      At Line 62: public static final int TOTAL_SIZE_OFFSET = 12;     At Line 162:           long totalSize = PcapReaderUtil.convertInt(pcapPacketHeader, TOTAL_SIZE_OFFSET, reverseHeaderByteOrder);                 packet.put(Packet.TOTAL_SIZE, totalSize);      In Packet.java:(In hadoop-pcap-lib)     ==============     (src-->main-->java-->net-->ripe-->hadoop-->pcap-->packet-->Packet.java)      At Line 36: public static final String TOTAL_SIZE = "tot_size";      My Mapper:     =========     package com.calsoftlabs.parse;      import net.ripe.hadoop.pcap.packet.Packet;      public class PcapMapper extends Mapper<LongWritable, ObjectWritable, Text, Text> {           public void map(LongWritable arg0, ObjectWritable arg1, Context context) throws IOException,                 InterruptedException {              Packet packet = (Packet) arg1.get();              String clientIp = null;             String serverIp = null;             String timeStamp = null;             String totalTraffic = null;             String srcPort = null;             String destPort = null;             String fields = null;              if (packet != null) {                  clientIp = packet.get(Packet.SRC).toString();                 srcPort = packet.get(Packet.SRC_PORT).toString();                 serverIp = packet.get(Packet.DST).toString();                 destPort = packet.get(Packet.DST_PORT).toString();                 timeStamp = packet.get(Packet.TIMESTAMP).toString();                 totalTraffic = packet.get(Packet.TOTAL_SIZE).toString();                  if (serverIp != null && srcPort != null && destPort != null ) {                     fields = serverIp                             .concat(", ").concat(srcPort)                             .concat(", ").concat(destPort);                             .concat(", ").concat(totalTraffic);                  }              }              context.write(new Text(clientIp.concat("_").concat(timeStamp).concat("::")), new Text(fields));         }     }   Finally,If I run a MRJob I'm getting a null pointer exception near total_traffic.Because the debugger is not at all entering into the newly edited code.How can I overcome this issue.Can anyone please suggest on this issue ...  Thanks,in advance

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


is it possible with newtonian gravity to throw something (which has no on-board propulsion) so that it will orbit the earth without colliding with it(friction is not present)? my intuition tells me that no, because all closed newtonian orbits are periodic so that if I throw some thing it will eventually come back to earth. But I can't seem to show it with the math. Any help would be appreciated.

Assume the Earth to be a uniform sphere of mass M and radius R. Also let the Earth be stationary initially. Assume further that there is all other stellar bodies are very far away so as to have no influence in this problem.  A ball of mass $m$ is to be thrown from the surface of the Earth so that it ultimately ends up moving in a circular orbit at a height $h$ from the surface of the Earth. How should the ball be thrown, as in, what should be its initial velocity and, in particular, what should be the angle $\theta$ of the initial velocity with the radial vector from the Earth's center to its initial position on the surface of the Earth?  My attempt at the solution:  Since the Earth-ball system is isolated, its energy would be conserved. Let the initial speed of the ball be $v_0$ and the final speed be $v_f$. We'll have the following equation:  $$ \frac{1}{2}m v_0 ^2 - \frac{GMm}{R} = \frac{1}{2}mv_f^2 - \frac{GMm}{R+h}$$   Next, we know that when the ball will finally be in circular orbit, the gravitational force will be providing the necessary centripetal acceleration for it to maintain circular motion, which gives us the following equation:  $$ \frac{mv_f^2}{R+h} = \frac{GMm}{(R+h)^2} $$  Besides, since gravity is a central force, the angular momentum of the ball about the center of the Earth will remain conserved, which yields the following equation:  $$ mv_0R \sin(\theta) = mv_f(R+h) $$  That completes setting up three equations for three variables $- v_0, v_f, \theta $. Solving them, we would obtain the following values for each:  $$ v_o = \sqrt\frac{GM(R+2h)}{R(R+h)} $$   $$ v_f = \sqrt\frac{GM}{R+h} $$  $$ \theta = \sin^{-1} \Biggl( \frac{1+\frac{h}{R}}{\sqrt{1+\frac{2h}{R}}} \Biggr) $$  However, it is observed that for $\theta$, the argument of $\sin^{-1}$ is always greater than or equal to one, being one only if $h$ is zero. The proof may be carried out by initially assuming that the argument of $\sin^{-1}$ is less than or equal to one for $h$ greater than or equal to $0$, and solving the inequality will yield that $h$ must be less than or equal to zero. So the only acceptable solution is for $h$ to be zero. This just winds up being the case of throwing the ball with sufficient speed tangentially on the surface of Earth so that it keeps orbiting on the Earth's surface itself. Thus, there is no possible way to just throw a ball so that it ends up in a circular orbit of certain desired radius.  The problem is that I don't see any physical intuition for why this should be true; either that or I am doing something wrong. Any guidance or help would be greatly appreciated!


Problem encoutered  In my program (C++ with Qt), I need to store a float value (let's call it step) which is divisible by 0.15. It is required to store this value as an integer which is the result of the division of step by 0.15. This did the trick:  int storedValue; [...] storedValue = step / 0.15;   Unfortunately, for reasons I ignore, some step values (such as 300.15 or 300.30) aren't divided correctly: when step has the value 300.15, storedValue is 2000 instead of being 2001. Similarly, 300.30 as a step gives storedValue a value of 2001. Then, 300.45 would correctly give storedValue 2003, and so on.  I have no idea why 300.15 and 300.30 have this bug, nor if there are any other values that trigger this bug.  Solutions tried  I think the C++ conversion from float to int is the issue, since I checked the result of the division as a float and it is correct, so I made a float value to hold the result of the division, and use storedValue = static_cast<int>(floatResult), hoping it would make for a better conversion. And, weirdly enough, 300.15 has now the correct storedValue of 2001, but the bug still happen with 300.30, giving the same storedValue of 2001.  The current solution I have tried, but am unhappy with since it does not understand the problem and is not robust, is the following:  float floatResult = step / 0.15; int storedValue = static_cast<int>(floatResult); float verification = static_cast<float>(storedValue);  // If storedValue is false, verification will be different of floatResult if (floatResult != verification) {     storedValue = storedValue + 1;     verification = static_cast<float>(storedValue);     // Case I have never experienced, but since I can't understand the problem, I need to be careful     if (floatResult != verification) {         storedValue = storedValued - 2;         verification = static_cast<float>(storedValue);         if (floatResult != verification) {             // Throw error         }     } }   I found nothing relevant on the matter, since I am sure the result of this division is an integer (the user can't input a step not divisible by 0.15), so I don't see how precision matters here. Do someone have an idea about why this problem happens ? And/or how to improve my solution ?

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


In my physics class, we recently learned how to compute RIV-tables for resistors using a diagram of a complex circuit, and we covered the properties of series and parallel resistors. However, I'm having some trouble simplifying the following circuit diagram and separating it into a conjunction of series and parallel resistors:    Can someone show me how to rearrange this to make it manageable? I left out the voltage and resistances because I'm not having trouble with that part of the problem - just with the rearrangement. But if anyone is curious, each resistor is $1\Omega$ and the battery is $5$ volts.

What's the equivalent resistance in this circuit (between points A and B)?


Prior to posting this question, I have read the post here:   My purpose in asking same questions with different wordings is I don't think many understand the situation. For the final time, here's my predicament.   I have a chess worksheet.   Each worksheet has 4 different group. GroupA, Group B, Group C, and GroupD  Each group has three diagrams.   The worksheet would show in proper order: Group A with three diagrams, Group B with three diagrams, Group C with three diagrams, and Group D with three diagrams in the same orders.   If you compile it, the 1st page of pdf output will show correctly the group with their diagrams. Let's call this Model Worksheet.  Let us suppose I add another 3 diagrams to each group so that each group will now have 6 diagrams.   Using the same foreach loop, here's what I get.   Page 1: (Model Worksheet) Group A, Group B, Group C, Group D  Page 2 output is showing Group A, Group A, Group B, and Group B  Page 3 output is showing Group C, Group C, Group D, and Group D.  What must I do to fix the foreach loop to show same as the Model Worksheet? It has been suggested that I used expl3 to solve the problem. I have no idea on how to implement it.  I am willing to research and learn. Please offer me steps so I can get to the solution.  Thank you for your time.  \documentclass{article} \usepackage{xskak,chessboard} \usepackage[margin=3cm]{geometry} \begin{document}  %**** MODEL WORKSHEET. HAS CORRECT ORDER - 3 IN GROUP A, B, C, AND D ************** %***** FOREACH LOOP WORKS CORRECTLY ***** \foreach \X/\Y in  %******* GROUP A ***************** {GroupA/{3k4/8/2Q5/4K3/8/8/8/8 w - - 0 1, 8/8/2k5/7R/6R1/8/5K2/8 w - - 0 1, 1k6/7R/3K4/8/8/8/8/8 w - - 0 1}, %******* GROUP B ***************** GroupB/{8/8/8/8/8/1k6/7P/4K3 w - - 0 1, 8/8/8/8/4k3/4p3/4K3/8 w - - 0 1, 8/1k6/8/8/1PK5/8/8/8 w - - 0 1}, %************ GROUP C ******************* GroupC/{8/8/8/4p1K1/2k1P3/8/8/8 w - - 0 1, 8/8/8/p7/P7/7k/7P/6K1 w - - 0 1, k7/P1K5/6p1/7p/7P/8/8/8 w - - 0 1}, %************ GROUP D ******************** GroupD/{4BK2/6P1/5k2/8/8/1b6/8/8 w - - 0 1,  8/8/4k3/2p4n/2P1K3/8/7B/8 w - - 0 1, 8/p7/P5p1/1P4P1/5P2/3kb3/8/3K4 w - - 0 1}} {\noindent\tikz{\node[rotate=90,font=\bfseries,align=center,text width=4cm]{\X};} \foreach \Z in \Y {\begin{minipage}[b]{0.35\linewidth} \chessboard[smallboard,setfen=\Z] \end{minipage}}  } %****** WHEN NEW 3 MORE DIAGRAMS ARE ADDED, FOREACH LOOP GETS WRONG. WORKSHEET IS NOT SAME AS MODEL WORKSHEET ***** \foreach \X/\Y in  %******* GROUP A ***************** {GroupA/{3k4/8/2Q5/4K3/8/8/8/8 w - - 0 1, 8/8/2k5/7R/6R1/8/5K2/8 w - - 0 1, 1k6/7R/3K4/8/8/8/8/8 w - - 0 1}, GroupA/{3k4/8/2Q5/4K3/8/8/8/8 w - - 0 1, 8/8/2k5/7R/6R1/8/5K2/8 w - - 0 1, 1k6/7R/3K4/8/8/8/8/8 w - - 0 1}, %******* GROUP B ***************** GroupB/{8/8/8/8/8/1k6/7P/4K3 w - - 0 1, 8/8/8/8/4k3/4p3/4K3/8 w - - 0 1, 8/1k6/8/8/1PK5/8/8/8 w - - 0 1}, GroupB/{8/8/8/8/8/1k6/7P/4K3 w - - 0 1, 8/8/8/8/4k3/4p3/4K3/8 w - - 0 1, 8/1k6/8/8/1PK5/8/8/8 w - - 0 1}, %************ GROUP C ******************* GroupC/{8/8/8/4p1K1/2k1P3/8/8/8 w - - 0 1, 8/8/8/p7/P7/7k/7P/6K1 w - - 0 1, k7/P1K5/6p1/7p/7P/8/8/8 w - - 0 1}, GroupC/{8/8/8/4p1K1/2k1P3/8/8/8 w - - 0 1, 8/8/8/p7/P7/7k/7P/6K1 w - - 0 1, k7/P1K5/6p1/7p/7P/8/8/8 w - - 0 1}, %************ GROUP D ******************** GroupD/{4BK2/6P1/5k2/8/8/1b6/8/8 w - - 0 1, 8/8/4k3/2p4n/2P1K3/8/7B/8 w - - 0 1, 8/p7/P5p1/1P4P1/5P2/3kb3/8/3K4 w - - 0 1}, GroupD/{4BK2/6P1/5k2/8/8/1b6/8/8 w - - 0 1, 8/8/4k3/2p4n/2P1K3/8/7B/8 w - - 0 1, 8/p7/P5p1/1P4P1/5P2/3kb3/8/3K4 w - - 0 1}} {\noindent\tikz{\node[rotate=90,font=\bfseries,align=center,text width=4cm]{\X};} \foreach \Z in \Y {\begin{minipage}[b]{0.35\linewidth} \chessboard[smallboard,setfen=\Z] \end{minipage}} \par } \end{document}


Do you use adverbs to modify these v-ing words especially when they are the objects of the verbs?  Example:      I regret swimming hurriedly   **I regret hurried swimming.   And what about these two sentences:      I regret stamp-collecting   I regret collecting stamps      I regret unnecessary bomb-defusing.   I regret bomb-defusing unnecessarily?   Besides, when using these words, it still retains the verbal characteristics right? Like:     The house needs a careful cleaning   has the same meaning as:      The house needs carefully cleaning   The house needs to be cleaned carefully (SOMETHING like passive voice)

To native speakers, normally do you use adverbs to modify these v-ing worlds especially when they are the objects of the verbs?  Like:      I regret swimming hurriedly     Not      I regret hurried swimming.      Right? And what about these two sentences:     I regret stamp-collecting     or     I regret collecting stamps   Besides, when using these words, it still retains the verbal characteristics right? Like:       The house needs a careful cleaning.     has the same meaning with       The house needs carefully cleaning.     or       The house needs to be cleaned carefully.   (SOMETHING like passive voice)


I remember that if there are $n$ boxes, and a ball is being thrown repeatedly into one of the boxes with uniform probability, then the expected number of throws before every box has a ball is approximately $nH_n$, which is approximately $n\log n$. The derivation goes as follows:   When we've filled $r<n$ boxes, the probability that we hit an unfilled box with each throw is $(n-r)/n$. The expected number of throws before we hit an unfilled box is $n/(n-r)$. By linearity of expectation, the expected number of throws before we fill all boxes is $\sum_{r=0}^{n-1}n/(n-r) = nH_n$.  What about the expected number of throws before every box has $k$ balls, where $k\geq 1$ is an integer? Is it going to be $kn\log n$.

Recently I tried to solve a problem that based on coupons collector problem. Let it be sth like this:  If a package has one of 50 random baseball cards, how many packages do you need to buy to get a complete set? (or sth like this, doesnt matter)  If I need every card one time, so it makes one set that is easy, explaination is on wikipedia and I already understood it. But what if we consider to collect every card k times? (To collect k sets of cards)  How can I tried to solve this problem? I found sth about Chernoff's bound (http://www.math.ucla.edu/~pak/courses/pg/l10.pdf) but I dont get it actually if it is a solution of this problem. I need to estimate E(X) and Var(X) for k sets of cards.  Could anyone give me a hint how to solve this problem? Thanks for all answers:)  Greetings,


Earlier today, I tried applying the update (on my MkTeX system, running under Win7 Pro) for PSTricks from 2.78 (27-Nov-17 build date) to 2.80a (31-Dec-2017 build date), and doing so caused a consistent and 'fatal' compile error:   c:\users\me\Desktop\text\MiktTex\tex\generic\pstricks\pstrick.tex  ! Undefined control sequence  l.31 \if@check@engine   After reverting back to 2.78, compilation proceeded normally. When I diff'd the code in pstrick.tex, the only difference (that seems related to the issue is) in the new code, there is an additional line for \if@check@engine   \if@check@engine    \ifx\c@lor@to@ps\@undefined      \def\c@lor@to@ps{\PSTricks_Not_Configured_For_This_Format}%  message for a pdflatex run    \fi  \fi   Here is the old code for comparison:   \ifx\c@lor@to@ps\@undefined    \def\c@lor@to@ps{\PSTricks_Not_Configured_For_This_Format}%  message for a pdflatex run  \fi   So, something about the newly inserted command,  \if@check@engine, is causing compile fails. Was wondering if anyone can replicate/confirm at there end.   For the moment, the solution is to revert back to old pstricks, but thought I'd point out what seems to be a bug in the latest build.

I have just updated MiKTeX and have found that pstricks now appears to cause a problem. The error message I'm getting is     ("C:\Program Files\MiKTeX 2.9\tex\generic\pstricks\pstricks.tex"      ! Undefined control sequence.      l.31 \if@check@engine   Not sure what's happening here. If I stop pstricks from being loaded things work ok.  Is there a known problem with the latest pstricks?


I have a BibTeX database with some big number of references which I use for work. When I need to send a document prepared using that database to somone I have two options: either send a full copy of the database (which I would not like to do), or copy all referenced entries from a large database to a smaller copy, and send that copy with a document. Are there any tools which would do this automatically?

Normally, LaTeX will only create references for the BibTeX entries cited in the text. Is there a way of extracting these entries into a different .bib file automatically? For example if I have a .bib file with two entries, and only one is cited in a particular text, I need a way of creating a new .bib file with just that reference.


I recently found out about shell injection and I have codes that executes user inputs in shell environment I need to sanitize the input so that there is no backticks or other malicious strings. Is it enough to use str_replace() and remove them?

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I am preparing slides for a presentation and would like to add some figures, but whenever I try to include graphics, I get the following result:    That is, instead of the image that is supposed to be included, a box with the relative path to the image is displayed. The same error also results when I move the image to the same directory as the LaTex file.

I'm using IEEEtran to format an article, and I wanted to include an image. I included the graphicx and hyperref packages, and used the following code, like normal, to include an image.  \begin{figure}[!t] \centering \includegraphics[width=3in]{fetch} \caption{Pipeline: Fetch Instruction} \label{fig:fetch} \end{figure}   What appears, however, is this:    Fetch.png is a file in the directory, and if I remove it, pdflatex errors instead of producing an output. I'm using MiKTeX 2.9 on Windows 7. Any ideas?


I have Ubuntu 16.04 alongside with Windows 10. The problem is that after I choose Ubuntu in GRUB such a sequence follows:  Purple screen Screen shut down Black screen, but turned on  I can't see the login screen but I can hear a specific login sound.  Such a situation happens in around 70%. Sometimes Ubuntu boots normally to login screen. What is more, after I switch Ubuntu into "stand-by" mode, when I try to mąkę it work again, similar things happen, the screen is completelly black, but on. How can I solve this problem?  My graphic card is Intel.

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


How can I Construct a measurable set A contained in C = [ 0, 1] such that for an arbitrary open interval B contained in C, $m(A\cap B)> 0$ and $m(CA\cap B)> 0$, CA is the complement respect to C.  My ideas give some of the measures zero, or can I construct with borel sets? Thanks.

This is from problem $8$, Chapter II of Rudin's Real and Complex Analysis.  The problem asks for a Borel set $M$ on $R$, such that for any interval $I$, $M \cap I$ has measure greater than $0$ and less than $m(I)$.  I was thinking of taking the Cantor approach: taking $R$ to be the union of $[a,b]$ with $a$ and $b$ rationals, and for each $[a,b]$ we construct Cantor sets inside it. During theconstruction of each Cantor set, in order to have positive measure on it, we need to take off smaller and smaller intervals from it, namely the proportion goes to $0$. As a result, these Cantor sets are extremely "dense" on their ends. If for an interval $I$ it intersects with the Cantor set on $[a,b]$ while $b-a>>m(I)$, we shall expect the measure of intersection to be rather close to $m(I)$ and then we lose control on these cases.  Is there any way to fix this or shall I consider other approaches?  Thank you


Lets take a look at this simple example let formatter = NumberFormatter() formatter.number(from: "0.945")?.decimalValue // result: 0.945 formatter.number(from: "0.94")?.decimalValue  // result: 0.9399999999999999  How can I achieve that "0.94" converts to Decimal with exact same value e.g. 0.94? I prefer solutions with NumberFormatter because I want to use this String to Decimal conversion also for amounts with currency, such as "$0.94" and "0.94€"

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


Usually, there is a guiding table below the maps and color-coded tables, to help reader what is the meaning of each color or element. What is that table called in English?

Every map has symbols that describe things. In the corner of a map, there is a list that explains what each symbol means.  What is the name of that list? (What title should I put above this list)?


I am taking numerical string as an input from user and than converting it to float with the help of sscanf() function : #include<stdio.h>  float getfloat(void);  int main() {     float a;     a=getfloat();     printf("You entered %f\n",a);     return 0; }  float getfloat(void) {     float n;     char nstr[50];     printf("Enter a numeric string\n");     gets(nstr);     sscanf(nstr,"%f",&n);     return n; }  Now let's suppose I enter a string 100.1234. After converting to float with help of sscanf when i print the float value i am getting 100.123398 as stored value. Now these are very close values but why am i not getting the same result as i entered. What is going on inside sscanf ?


I live in the US. My parents want to come and visit me. My mother now has dual citizenship France/US (born and raised in US, moved to France later). My father is only French. My mother believes right now that she's not even allowed by herself back to the US because she lives in France. It sounds crazy to me, but is it true? I know France right now would allow the reverse situation (French citizen allowed to bring US spouse to France just on the basis of their being married), but I'm not sure whether the other way around (title question) is true. If you don't know, do you have any idea where I could call and find out?

This community wiki explains the current restrictions by the United States of America on the entry of individuals who may pose a risk of transmission of the SARS-Cov2, the virus which causes the Covid-19 disease.


I recently installed Win 7 Ultimate SP1 and then installed all available important updates. My Windows folder is very big now.     I made sure I have this update , runned Disk Cleanup and checked all that was possible to delete. I also cleaned System Restore with Disk Cleanup tool. Tried to run vsp1cln.exe and compcln.exe, but they were not found on my computer. Then tried DISM /online /Cleanup-Image /SpSuperseded command.   After all my Windows folder is 41,261,065,219 bytes. Winsxs is 13,338,604,038 bytes.    Is this a normal size for Windows folder? Is there any way to make it smaller?

In typical PCs the Size of Windows Folder is 6 to 8 GB but in my Case its 25GB. How can I delete the unwanted files from the Windows Folder (which, in turn, will optimize my C Drive size).  My system is Windows 7 with 60 GB in C Drive with 59 GB occupied.


Below is a perfectly fine proof using basic tools of number theory:    Could we prove this more quickly using group theory? I would be very interested in seeing an abstract algebra-flavored proof.


The mending Cantrip says:  This spell repairs a single break or tear in an object you touch, such as a broken chain link, two halves of a broken key, a torn cloak, or a leaking wineskin. As long as the break or tear is no larger than 1 foot in any dimension, you mend it, leaving no trace of the former damage. This spell can physically repair a magic item or construct, but the spell can't restore magic to such an object.  I see no reason why this shouldn’t be allowed to repair breaks in bones of a corpse, as corpses in 5E are objects. Is there something I’m missing as to why this wouldn’t be allowed or is my understanding correct? I do understand that this may be a RAW vs RAI issue, but I’m asking for the RAW answer not the RAI answer.

, and the  cantrip can do the following:     This spell repairs a single break or tear in an object you touch, such as a broken chain link, two halves of a broken key, a torn cloak, or a leaking wineskin. As long as the break or tear is no larger than 1 foot in any dimension, you mend it, leaving no trace of the former damage.      This spell can physically repair a magic item or construct, but the spell can't restore magic to such an object.   Could you, therefore, use the Mending cantrip on your dead party member who had his body parts chopped off, to reattach those body parts?  The benefit of doing so would be to be able to use a spell such as , instead of having to resort to higher level spells like Resurrection or a Regenerate + Revivify combo.


And specifically Bloch-Floquet boundary conditions? I would love to hear any explanation you guys might have.

It is often stated that  and  are equivalent, even the Bloch's theorem is often referred as Floquet-Bloch theorem.  However, it seems quite confusing to me since the former involves a second order differential equation (Schroedinger equation with a periodic potential) while the latter is defined for a first order one.  Can someone clarify this to me? Also it would be nice if I can get references that connect the two.


I want both the image and text centered horizontally and vertically. What is the best way to go about this? I have tried float but it doesn't seem to be working. See the above image for ideal result  HTML:
            <p1>          I want to work in Computer Design, changing the way people          interact with thoughtfully considered software and hardware          experiences.      </p1>
   CSS:   #one{   background-color: #4E5B71;   width: 100%;   height: auto;   padding: 15px; } .clearfix{   overflow: auto; } p1{   font-family: AvenirNext-Regular;   font-size: 24px;   color: #FFFFFF;   line-height: 50px;   vertical-align: middle;   display: inline-block; } imac{   width: 100% auto;   height: auto;   float:left;   vertical-align: middle; }

Why won't vertical-align: middle work?  And yet, vertical-align: top does work.   span{   vertical-align: middle; }
      Doesn't work.


The school provides services of art teacher. or School provides the services of art teacher. which one is correct

I can’t for the life of me figure out where to use a and where to use the — and where there is no article at all. Is there a simple rule of thumb to memorize?   The standard rule you always hear:     “If a person knows which item you are talking about then use "the"   . . . doesn’t clear things up for me, as I have no idea whether or not they know.


In studying other languages (Korean at the moment) the use of “yes” and “no” when answering questions that are worded in the negative seems to be opposite English (at least American English) style. In Korean, the Question “You haven’t eaten yet?” Would be answered “Yes, I haven’t eaten yet.” While in English it would be answered “No, I haven’t eaten yet.” What are the English grammar rules for answering questions worded in the negative?

I faced a problem to answer a negative question, for example, when someone asks you:      Don't you have any money?   It's a yes/no question but how should one answer the question without ambiguity?  When you answer "yes", does it mean "yes, I don't have any money"? or the other way "Yes, I do have money"? the questioner may think you are agreeing to the negative, that yes, you do not have any money.  I know it's better to answer with "on the contrary" but is it possible to answer yes or no?


I have a question regarding the convexity of logic inclusive value function in the context of multinomial logit model. The inclusive value function is defined as $$IV = \log \sum_{i=0}^N exp(x_i)$$ It says this function is everywhere convex if $x_0 = 0$. This function obviously takes a sequence of $x_i$'s as its argument, but I am not too sure how to show that it is convex for $x_0 = 0$. Any help would be appreciated. Thank you.

How to prove $f(x)=\log\left(\displaystyle\sum_{i=1}^n e^{x_i}\right)$ is a convex function?  EDIT1: for above function $f(x)$, following inequalities hold:  $$\max\{x_1,x_2,\ldots,x_n\}\leqslant f(x)\leqslant\max\{x_1,x_2,\ldots,x_n\}+\log n$$  and I have tried proving its convexity via definition of a convex function with above inequalities, but that didn't work.  EDIT2: I have posted my answers below.


I'm pretty new with PDO. I'm wondering is this now safe from SQL injections?  $name = isset($_GET['name']) ? $_GET['name'] : null;  // Fetch some info $stmt = $db->prepare("SELECT * FROM players WHERE name = ? AND account_id = ?"); $stmt->execute(array($name, $aid)); $row = $stmt->fetch();  if ($row) { $stmt = $db->prepare("DELETE FROM players WHERE id = ?"); $stmt->execute(array($row['id'])); header("Location: /account"); exit(); } else { header("Location: /account"); exit(); }

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


Disclaimer. I'm a long-time Windows user and just starting to get my head around the Linux paradigm. While excited by it, I understand that my formulations might be poorly chosen due to ignorance.  I've received , the contents of which included the following line, which I need help interpreting (after a while of googling I've got a pretty good guess but I'd like to make it more reliable).  curl -sL https://blabla | sudo -E bash -   I understand that we first create a web call to the URL blabla and then (here's the pipe magic popping up) execute a command with admin elevated privileges to open a new terminal window instance.  However, when I try to digest the command, I learn that it's equivalent to the following sequence.  curl --silent --location https://blabla sudo -E bash -   Question 1: Is that correctly understood?  Further on, I tried to learn what the switches for the second line are and used the statement as follows.  man bash | sed -n '/-E/,+1p'   However, I can't really see what "-E" is shorthand for (is it --empty or is it -- or maybe --err) and get stuck on the interpretation. Also, I can't figure out what the alone dash character does and I'm not sure how to look it up in the manual using the statement above.  Question 2: How do I look up the verbose syntax for the switches?  Question 3: What is the meaning of the dash character without the switch?

I was wondering what is the purpose of piping the downloaded file by curl into sudo -E bash - in the following shell:   curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -


I am trying to create a very simple multiplier function.  Although I've used Number() function, I still get NaN upon calling the function.      let x = prompt("1. sayı"); let y = prompt("2. sayı"); let num1 = Number(x); let num2 = Number(y);   function multiply(num1, num2) {   let result = num1 * num2;   alert(result); }  multiply();

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


I'm trying to run a  on my 64 bit Ubuntu. and it results in a following error:  $ ./arm-none-eabi-gcc bash: ./arm-none-eabi-gcc: No such file or directory   The file is here and contains some data:  $ ls -la arm-none-eabi-gcc -rwxr-xr-x 2 alan alan 776368 Sep 26 19:36 arm-none-eabi-gcc $ head -n 1 arm-none-eabi-gcc ELFا4�          4  (44�4�  TT�T���|�   ldd shows there are no dependencies required:  $ ldd arm-none-eabi-gcc not a dynamic executable   strace also provides no additional info:  $ strace ./arm-none-eabi-gcc execve("./arm-none-eabi-gcc", ["./arm-none-eabi-gcc"], [/* 80 vars */]) = -1 ENOENT (No such file or directory) write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory ) = 40 exit_group(1)                           = ? +++ exited with 1 +++   Finally I figure out that it's for a 32 bit system:  $ file arm-none-eabi-gcc arm-none-eabi-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.8, stripped   Question  If the architecture of the binary is wrong why is the error so ambiguous?  I would expect analogous to the below situation where I'm trying to execute a .JPG, where the binary execution makes no sense:  $ ./DSC_0140.JPG  bash: ./DSC_0140.JPG: cannot execute binary file: Exec format error

I have currently a strange problem on debian (wheezy/amd64).  I have created a chroot to install a server (i can't give any more detail about it, sorry). Let's call its path /chr_path/. To make things easy, I have initialized this chroot with a debootstrap (also wheezy/amd64).  All seemed to work well inside the chroot but when I started the installer script of my server I got : zsh: Not found /some_path/perl (the installer includes a perl binary for some reasons)  Naturally, I checked the /some_path/ location and I found the "perl" binary. file in chroot environment returns :  /some_path/perl ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped   The file exists, seems ok, has correct rights. I can use file, ls, vim on it but as soon as I try to execute it - ./perl for example - I get : zsh: Not found ./perl.  This situation is quite understandable for me. Moreover :   I can execute other basic binaries (/bin/ls,...) in the chroot without getting errors I have the same problems for other binaries that came with the project When I try to execute the binary from the main root (/chr_path/some_path/perl), it works. I have tried to put one of the binaries with a copy of my ls. I checked that the access rights were the same but this didn't change anything (one was working, and the other wasn't)


I have made a software in vb.net that has a specific purpose.  It has to compare two strings at a particular point, say they are x and y. The code is  If x.Contains(y) then 'do things here End If   If y is 'Hello' and x is 'hello there', then the if statement must be true according to my requirement, but it turns out the Contains() control is case sensitive.  How do I make it case insensitive?  EDIT: My question is in vb.net and not C#. Though they are mostly similar, I do not understand C# and don't know how to implement the answers in my scenario because both of these are different langauages. So my question is not duplicate of the one mentioned.

Is there a way to make the following return true?  string title = "ASTRINGTOTEST"; title.Contains("string");   There doesn't seem to be an overload that allows me to set the case sensitivity.. Currently I UPPERCASE them both, but that's just silly (by which I am referring to the  issues that come with up- and down casing).  UPDATE This question is ancient and since then I have realized I asked for a simple answer for a really vast and difficult topic if you care to investigate it fully. For most cases, in mono-lingual, English code bases  answer will suffice. I'm suspecting because most people coming here fall in this category this is the most popular answer.  answer however brings up the inherent problem that we can't compare text case insensitive until we know both texts are the same culture and we know  what that culture is. This is maybe a less popular answer, but I think it is more correct and that's why I marked it as such.


Say, I have a sphere, and I want the bright side to be one texture/shader and the dark side to be another texture/shader.  Is there any way to vary this based simply on how much light is hitting it?  I've done some work with dot products, but the best result I have involved a seem in the sphere where the test pattern changes abruptly; furthermore, there are a lot of assumptions about where everything is, among other problems.  Basically, I'm looking to change the material based on the shading itself (ie, if there were a single color, the changes to that color that cycles makes to describe the object is what I want to base the changes on.)  I'd post my work, but it's getting obscenely complicated and it only looks good from certain angles - (none of which are the camera angles, that was one of the cross products.)  Thanks in advance.

It seems that Cycles is mainly built in the form of Python scripts (as far as I can tell). Is it still possible to use Cycles to render a .blend file from the command line?


I need some help. I need to draw horizontal lines all across row 1 and 3, and vertical lines all across columns 2 and 4.  I'm aware I can use \makebox[0pt][l]{\rule[0.1cm]{0.19\textwidth}{0.7pt}} to create horizontal lines. However, I don't know how to draw the vertical lines.  In advance, Thank you!  This is the matrix:  \( \text{Matriz reducida}= \begin{pmatrix} - & 3 & 0 & 2 & 0 \\  5 & - & 4 & 0 & 1 \\ 0 & 2 & - & 0 & 1 \\ 4 & 0 & 2 & - & 1 \\ 4 & 0 & 2 & 0 & - \end{pmatrix} \)

I'd like to draw vertical/horizontal lines over the entries of a column/row in an array. I find the method to draw horizontal lines at . But when I used the same way to draw the vertical lines. It didn't look well. My codes are:  \usepackage{tikz} \usetikzlibrary{calc} \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};} \newcommand{\DrawLine}[3][]{% \begin{tikzpicture}[overlay,remember picture]     \draw [#1] ($(#2)+(0,0.6ex)$) -- ($(#3)+(0,0.6ex)$); \end{tikzpicture}% }%  \begin{displaymath} \left[ \begin{array}{cccc} \tikzmark{11}{15} & 0 & \tikzmark{13}{0} &0\tikzmark{14} \\ 0 & 50 & 20 & 25 \\ 35 & 5 & 0 & 10\\ \tikzmark{41}{0} & 65 & \tikzmark{43}{50} & 65 \end{array} \right]. \DrawLine[black,thick]{11}{14} \DrawLine[black,thick]{11}{41} \DrawLine[black,thick]{13}{43} \end{displaymath}   The result looks like     But the result I want is     Does anyone know how to fix this? Thank you.


I have the following SQL query output    I would like to have the output in the following format  +--+------+ |ID|RoleID| +--+------+ |1 |1, 4  | +--+------+ |3 |1     | +--+------+ |5 |1     | +--+------+ |6 |6     | +--+------+   So on.  How to I achieve this?

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


There are same numbers of white balls and red balls (let's say k each), and 2k slots.  Fill all the slots from left to right, and make sure the at any moment, the number of red balls assigned is less or equal than the number of white balls assigned.  For example: 2 balls for each color   WWRR - Accepted WRWR - Accepted WRRW - Rejected, because after the second R is assigned, the number of Red (2) is greater than the number if white (1) R*** - Rejected, after the second R is assigned, the number of Red (1) is greater than the number if white (0)   in total, 2 accepted solutions  Now the question is, how many different accepted assignments do we have? given the number is K for each color.  we can also explain the question in another way, like there are two actions, EARN A COIN (E) and PAY A COIN (P), and the number of each of them are equal.  How many different arrangement can we have, given at any point, the balance is non-negative

Note that a product   may be parenthesized in two different ways:   and . Similarly, there are several different ways to parenthesize . Two such ways are  and . Let  be the number of different ways to parenthesize the product . Show that if , then      for all integers .  Keep in mind that the sequence  is the same as the sequence of Catalan numbers.   I am entirely lost. Please can someone offer some hint or direction of where to begin? I humbly thank you so very much.


Let $a$, $b$ and $c$ be three positives such that $abc=1$. Prove that $$\sum_{cyc}\frac1{(b+1)^2}+\frac1{a+b+c+1}\ge1$$   Here's what have I done that is completely incorrect. Let $a + b + c + 1 = x$. We have that $$\displaystyle \sum_{cyc}\dfrac{1}{(b + 1)^2} \ge \displaystyle \sum_{cyc}\dfrac{1}{(c + 1)(a + 1)} = \sum_{cyc}\dfrac{1}{x - b + ca}$$ That means $$\displaystyle \sum_{cyc}\dfrac{1}{(b + 1)^2} + \dfrac{1}{a + b + c + 1} \ge \dfrac{16}{bc + ca + ab + 3x + 1}$$ $$\ge \dfrac{48}{(x - 1)^2 + 9x + 3} = \dfrac{48}{x^2 + 7x + 4}$$ That was illogical.

Let $a,b,c>0$ such that $abc=1$. Prove the inequality $$\frac{1}{\left(a+1\right)^2}+\frac{1}{\left(b+1\right)^2}+\frac{1}{\left(c+1\right)^2}+\frac{1}{a+b+c+1}\ge 1$$    I proved $\frac{1}{\left(a+1\right)^2}+\frac{1}{\left(b+1\right)^2}+\frac{1}{\left(c+1\right)^2}\ge \frac{3}{4}$  and i also prove $\frac{1}{a+b+c+1}\ge \frac{1}{4}$ but unsuccessed


How to append comma seperated values to url as search params using history.pushsate. with use of , RFC 3986, specifies that URI path components should not contain unencoded reserved characters and comma is one of those reserved characters. .   code  window.history.pushState('new', 'inventory', '/new');  Desired result  https://www.test.com/new?Year=2020,2019&Pricerange=10001-20000,20001-30000,30001-40000&Mileagerange=1001-2000,2001-3000&Bodystyle=4dr%20Car,Convertible   Data i wanted to append  {   "year": [     "2017",     "2018"   ],   "model": [     "Escape",     "Edge"   ],   "mileage": [     "1-1000"   ],   "bodyStyle": [     "Convertible",     "4dr Car",     "2dr Car"   ],   "priceRange": [     "$20,000-$30,000",     "$30,000-$40,000"   ] }

How do you safely encode a URL using JavaScript such that it can be put into a GET string?  var myUrl = "http://example.com/index.html?param=1&anotherParam=2"; var myOtherUrl = "http://example.com/index.html?url=" + myUrl;   I assume that you need to encode the myUrl variable on that second line?


Why does java.lang.Object have two notify methods - notify and notifyAll? It seems that notifyAll does at least everything notify does, so why not just use notifyAll all the time? If notifyAll is used instead of notify, is the program still correct, and vice versa? What influences the choice between these two methods?

If one Googles for "difference between notify() and notifyAll()" then a lot of explanations will pop up (leaving apart the javadoc paragraphs). It all boils down to the number of waiting threads being waken up: one in notify() and all in notifyAll().  However (if I do understand the difference between these methods right), only one thread is always selected for further monitor acquisition; in the first case the one selected by the VM, in the second case the one selected by the system thread scheduler. The exact selection procedures for both of them (in the general case) are not known to the programmer.  What's the useful difference between  and  then? Am I missing something?


Here's an attempt :     I posted needing help for this question earlier  After spending a few hours I think I may have it :P , if not close to finishing it  take(0) = 100-(2*0) = 100 therefore it holds  Assume take(k) = take(k-1)-2 holds to some point of k  prove take(k+1) = take(k)-2  take(k+1)=take(k-1)-2)-2 take(k+1) = take(k-1)-2+(-2)  take(k+1)=take(k-2)*4

I'm sick and tired off posting threads about induction... I just can't seem to get it, I need someone to give me a detailed explanation and treat me like a 5 year old, literally. I'm wasting a lot of time trying to revise one topic, and getting nowhere... I just don't understand :O  Here's an attempt :     Base case take(0) = 100 - (2*0) = 100 therefore it holds  Assume n=k holds take(k) = 100-(2*k)  prove take(k+1) = 100-(2*k+1)  take(k+1) = take(k)100-2k+1 take(k+2) = ...


Is there a difference in meaning and/or connotation between "can not" and "cannot"?  I have read and seen both used interchangeably, but I know people who argue for a slight difference in meaning. That is, cannot indicates that there is an incapability whereas can not indicates the possibility of absence. Is this a real difference?

Why is “cannot” spelled as one word whereas other similar constructions such as “do not,” “will not,” “shall not,” “may not” and “must not” are spelled as two words (unless they are contracted as “don’t” and so on)?  (I know that languages are not always logical, so I would not be too surprised if there is no known reason for this.  But I am asking this in the hope that there is some explanation.)


I'm going through Stewart's Calculus, and in section 7.3, example 7 asks for $\int \tan^3(x)dx$. In the book, the solution is $\frac{\tan^2(x)}{2} - \ln|\sec x| + C$. This was obtained in the following way: $\int \tan^3(x) dx = \int (\sec^2(x) - 1)\tan(x)dx = \int \sec^2(x)\tan (x) dx - \int \tan (x) dx = \int \sec^2(x)\tan (x) - \ln|\sec(x)|+C$ Now we let $u = \tan(x)$, so $du = \sec^2(x)dx$ and we have $\int \tan^3(x) dx = \int \sec^2(x)\tan (x) - \ln|\sec(x)| = \int u du - \ln|\sec(x)| = \frac{u^2}{2} - \ln|\sec(x)| = \frac{\tan^2(x)}{2} - \ln|\sec(x)|$ However, it seems as though there's a second method of integrating it that doesn't produce the same result. If we instead let $u = \sec(x)$ and therefore $du = \sec(x)\tan(x)dx$, we get $\int \tan^3(x) dx = \int \sec^2(x)\tan (x) - \ln|\sec(x)| = \int \sec(x) (\sec(x)\tan(x)) = \int u du - \ln|\sec(x)| = \frac{u^2}{2} - \ln|\sec(x)| = \frac{\sec^2(x)}{2} - \ln|\sec(x)|$. This site produces the same result as what I got:  So is there some kind of trig identity that I'm missing here, or did I integrate incorrectly? Taking the derivative of both solutions produces the same starting point.

Question:  Is it possible to get multiple correct results when evaluating an indefinite integral?  If I use two different techniques to evaluate an integral, and I get two different answers, have I necessarily done something wrong?    Often, an indefinite integral can be evaluated using different techniques.  For example, an integrand might be simplified via partial fractions or other algebraic techniques before integration, or it might be amenable to a clever substitution.  These techniques give different results.  For example, looking over a few other questions on MSE:      From : evaluate $$ \int x(x^2+2)^4\,\mathrm{d}x. $$    Via the substitution $u = x^2+2$, this becomes $$ \int x(x^2+2)^4\,\mathrm{d}x       = \frac{1}{10}x^{10} + x^8 + 4x^6 + 8x^4 + 8x^2 + \frac{32}{5} + C.     $$ However, multiplying out the polynomial and integrating using the power rule gives $$ \int x(x^2+2)^4\,\mathrm{d}x       = \frac{1}{10}x^{10} + x^8 + 4x^6 + 8x^4 + 8x^2 + C    $$     From :  evaluate   $$ \int \frac{1-x}{(x+1)^2} \,\mathrm{d}x. $$    Simplifying the integrand using partial fractions then integrating gives $$ \int \frac{1-x}{(x+1)^2} \,\mathrm{d}x       = \frac{-2}{(x+1)} - \ln|x+1| + C.    $$ Via integration by parts, we get $$ \int \frac{1-x}{(x+1)^2} \,\mathrm{d}x       = \frac{x-1}{(x+1)} - \ln|x+1| + C.    $$     From : evaluate   $$ \int \frac {\tan(\pi x)\sec^2(\pi x)}2\,\mathrm{d}x. $$    Using the substitution $u = \sec(\pi x)$, this becomes $$ \int \frac {\tan(\pi x)\sec^2(\pi x)}2\,\mathrm{d}x       = \frac {\sec^2(\pi x)}{4\pi} + C.    $$ Using the substitution $u = \tan(\pi x)$, this becomes $$ \int \frac {\tan(\pi x)\sec^2(\pi x)}2\,\mathrm{d}x       = \frac {\tan^2(\pi x)}{4\pi} + C.    $$


What is the difference in what is being performed by mkdir -p and install -d, in terms of what changes the two commands are doing to the system?

I've seen in many places used install -d to create directories and install -c to copy a file. Why not use mkdir and cp? Is there an advantage in using install?


Edited problem description I develop a theme for the Drupal 8. I need to have an access to jQuery $ context in my scripts, so I attached it in libraries as it says in docs.    global-styling:     version: VERSION     css:         theme:             libs/bootstrap/css/bootstrap.min.css: {}             css/layout.css: {}      js:         libs/bootstrap/js/bootstrap.min.js: {}         libs/autohiding-navbar/jquery.bootstrap-autohidingnavbar.js: {}         js/global.js: {}      dependencies:         - core/jquery   But in the Chrome console I get an error that jQuery context $ isn't available.

$(function(){   $('.slider').mobilyslider({     content: '.sliderContent',     children: 'div',     transition: 'horizontal',     animationSpeed: 500,     autoplay: true,     autoplaySpeed: 9000,     pauseOnHover: true,     bullets: true,     arrows: true,     arrowsHide: true,     prev: 'prev',     next: 'next',     animationStart: function(){},     animationComplete: function(){}   });    });   I am integrating the above JavaScript file in a Drupal theme, but it is giving me the "$ is not function" error. I googled it, and changed the code bro the below, but it doesn't work either.  (function($) {   $('.slider').mobilyslider({     content: '.sliderContent',     children: 'div',     transition: 'horizontal',     animationSpeed: 500,     autoplay: true,     autoplaySpeed: 9000,     pauseOnHover: true,     bullets: true,     arrows: true,     arrowsHide: true,     prev: 'prev',     next: 'next',     animationStart: function(){},     animationComplete: function(){}   });    })(jQuery);   The above code gives me following error:     $('.slider').mobilyslider is not a function


I'm on an HP Envy m7, with 16GB of RAM.  I recently did a clean install of Windows 10 on this computer. But for the past month, i've noticed that when Idle, the system uses way too much RAM.  I have checked for both malware and rootkits (MalwareBytes, Bitdefender, Avast, Kaspersky (for rootkits), and none have been found.  When I checked the processes on Task Manager, the used memory simply doesn't add up.  I then used RamMap to determine it.      While RamMap shows that the vast majority of my RAM is being used for Process Private and Page Table, I am still at a loss. When I check the processes tab on RamMap and check the Private Tab, the Usage still doesn't add up to the 15GB being used on my system.  Can anyone help diagnose this issue? Could this be a memory leak in some software? I am running out of options here.

I have 8GB of memory on a 64 bit windows 8.1 machine, and windows is telling me I'm using 91% of my memory, yet its simultaneously telling me I'm only using 3GB.  I literally just restarted my machine a few minutes ago because it was being incredibly rediculously slow. I'm currently only running chrome (with a ton of tabs, but doesn't add up to anywhere near 7.5GB). What could be going on here?   Here's a bunch of my current info       I took a look at this:  but I wasn's able to use xperf and the rest didn't lead me to a solution.  UPDATE - RamMap:   UPDATE 2: I checked Resource Monitor at Wouter's suggestion and found an "Image" called lxdecoms.exe with over 6GB of Commt (KB). I tried killing the process, but while it lowered my Commit Charge, it didn't affect "Used Physical Memory". So I restarted hoping to capture it again in full, but its not back yet and yet the problem persists.  I should note that I do have a Centos virtual box virtual machine running on my machine, not sure if that has any weird memory impacts that aren't reflected in the numbers in these tools.   I got xperf working, so here's my resource monitor and a wpa analysis of my xperf output (from xperf -on ReferenceSet -BufferSize 1024 -MaxFile 512 -FileMode Circular  && timeout 5 && xperf -d MemUsage.etl):     What is N/A that's taking up 2.7GB of memory? My VM?


There are many cards that can put multiple permanents onto the battlefield simultaneously, such as , , or .  How do these interact with the following types of abilities?  As [this permanent] enters the battlefield... You may have [this permanent] enter the battlefield as... [This permanent] enters the battlefield with... When [a permanent with certain characteristics] enters the battlefield...   Justification There have been many questions already about particular instances of this situation.  This question is intended to be a canonical question and answer to all questions such as:      Note to moderators: three of these five questions have already been marked as duplicates pointing to this one.  Can we do the same for the remaining two?

Let's say I have  on the board. He is a 2/2 that says:  Whenever another creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.  I play a . It says:  Put three 1/1 red Human creature tokens with haste onto the battlefield. Sacrifice those tokens at the beginning of the next end step.  The sacrifice portion is not important to this question. What is important is how these two cards interact with each other. Playing this card in my first main phase, assuming no counters or other shenanigans by my opponent, I will have my Commander and 3 tokens on the battlefield. What will happen in terms of the power/toughness of my tokens and Commander? Option A The tokens will be 1/1 each. They don't see each other come in at all. The Commander is 3/3, as one "enter the battlefield" trigger happens. Option B The tokens will be 1/1. They don't see each other come in at all, because they weren't on the battlefield to see any of the triggers. The Commander is 5/5, as he saw three "enter the battlefield" triggers occur. Option C The tokens will all be different, with one being 3/3 as he saw the other two come in, one being 2/2 as he saw only the last one come in, and 1/1 as the last one saw none come in. Option D The tokens will all be 4/4, as three creatures entered the battlefield this turn. I am obviously hoping for this option. It may be supported by a ruling on Goldnight Commander that says, emphasis mine:  The creature that entered the battlefield will also get +1/+1 until end of turn if it's still on the battlefield when the ability resolves.  The key being the ability resolving. So my thought is thus:  Thatcher Revolt goes on the stack. Thatcher Revolt resolves, and three separate "enter the battlefield" triggers go on the stack as the three humans enter the battlefield as 1/1. The last (it is a stack) "etb" trigger resolves. This puts an ability from Goldnight Commander on the stack. This resolves and the humans are now all 2/2. The next "etb" trigger resolves. This puts a new ability from Commander on the stack, and resolves with the humans being 3/3. The first "etb" trigger finally resolves, puts a Command ability on the stack, which resolves putting the humans at their final state of 4/4.  Option E The tokens will all be 2/2.  Thatcher Revolt goes on the stack. Thatcher Revolt resolves, and one single "enter the battlefield" trigger goes on the stack. The "etb" trigger resolves. This puts an ability from Goldnight Commander on the stack. This resolves and the humans are now all 2/2.  I would really like to have a complete understanding both of the result and how this result is calculated by the game engine.


My objective is to have a Linux PC just to run TOR browser. My laptop has an Intel Centrino Processor 1.70GHz with 512MB RAM, ATi Mobility Radeon 9600 128Mb. Which flavour do you suggest?  I have already tried:   Lubuntu - freezes image on install Xubuntu - says processor is non-PAE Linux Mint - other problems and errors Puppy - other problems and errors   Also, every time I try to boot from USB, I get a boot error.

For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and  such as:    with a lighter desktop than the usual Gnome and Unity  with the even lighter LXDE desktop   Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?


I have made a script that I want to run only where the user kyle logs in. I don't want it to be run on all users like a start-up app. I only want it to run when the user kyle logs in

I want to run a simple bash script automatically when I log in. For example  #!/bin/bash echo "start spotify" gnome-terminal -e spotify --title spotify   When I run this command, one gnome-terminal shows up and spotify show up. I also want the gnome-terminal to popup "hidden" in a different virtual desktop. (one of the other four virtual desktops you can choose from taskbar)   I tried to add this to /home/me/.bash_login or something, but that didn't work..


I'm a bit lost in gender neutrality. Please see the example below.  A: What, I got a child‽ B: Sooner or later *he or she* will show up.   From my own research, people put preferences this way: they > she > she or he > he. I think that they, she and he should not be used as it is only one child and we do not know anything about the gender. So she/he does seem to be the most suitable for this sentence. Or is it not?  PS: Would you rather write "he/she" or "he or she"? (I find she before he less natural than vice versa, although people on the internet say...)

Is there a pronoun I can use as a gender-neutral pronoun when referring back to a singular noun phrase?  Each student should save his questions until the end. Each student should save her questions until the end.


I run below script:  for (( i=1; i <= 5; i++ ))     do     echo "Random number $i: $RANDOM" done   I am getting below Error:  Syntax error: Bad for loop variable   why this syntax is not working?

I have written a simple script.  When I runsh <myscriptname.sh>, i got the correct output, but when I run ./<myscriptname.sh>, I got an error.  What is difference between when I do sh and ./?