Let (X,d) be a metric space. Let $\varepsilon > 0$ and let $x \in X$. We view X as a topological space w.r.t. the topology induced by d and write $$\overline{B}_{\varepsilon}(x) = \{x' \in X \mid d(x,x') \leq \varepsilon\}$$ for the closed $\varepsilon$-ball around x. I need to show that: $\overline{B_{\varepsilon}(x)} \subset \overline{B}_{\varepsilon}(x)$ I know that $B_{\varepsilon}(x) \subset \overline{B}_{\varepsilon}(x)$ So if I show that $\overline{B}_{\varepsilon}(x) \subset X$ is closed, then I am ready I think, since the closure of a set is the smallest closed subset of X that contains this set. How do I show that $\overline{B}_{\varepsilon}(x) \subset X$ is closed? I think I can show this to show that the complement is open. But I don't know how.

Prove that any closed ball in a metric space is closed.   (Note that this is not a duplicate as this is a proof verification question and have a different proof, in my opinion, as compared to other proofs on this site)  My Attempted Proof:   Let $(X, d)$ be a metric space. Pick a closed ball $\Phi = \overline{B(x, r)} = \{y \in X \ | \ d(x, y) \leq r\}$. Note that at this moment in time $\overline{B(x, r)}$ is just a notation, we don't know if $\Phi$ is actually closed.  We now show that $\Phi$ is closed. To do this we show that $X \setminus \Phi$ is open. Observe that $X \setminus \Phi = \{y \in X \ | \ d(x, y) > r\}$. Pick $y \in X \setminus \Phi$. For this $y$ we have $d(x, y) > r$ which implies that $d(x, y) = r + \epsilon$ for some $\epsilon > 0$.   We claim that $B(y, \epsilon) \subseteq X \setminus \Phi$. To prove this claim, pick $z \in B(y, \epsilon)$. We now show that $z \in X \setminus \Phi$ by showing that $d(x, z) > r$. To that end observe that the triangle inequality gives us   \begin{align*}    & d(x, y) \leq d(x, z) + d(z, y) \\    & \implies \epsilon + r \leq d(x, z) + d(y, z) \\   & \implies \epsilon + r < d(x, z) + \epsilon \ \ \ \ \ \  \ \ \  \text{since $d(y, z) < \epsilon$} \\   & \implies r < d(x, z)   \end{align*}  as desired. Hence $z \in X \setminus \Phi$ and we have $B(y, \epsilon) \subseteq X \setminus \Phi$, and since $y$ was arbitrary we have that $X \setminus \Phi$ is an open set in $(X, d)$ and thus $\Phi$ is a closed set. $\square$    Is this a rigorous and satisfactory proof? Can it be improved in any way?


I've read "JavaScript. The Core by Dmitry Soshnikov" and i don't understand very well this code (refactoring). Why k is increment ?  var data = [];  for (var k = 0; k < 3; k++) {   data[k] = (function () {     console.log(k);   })(k) }  data[0]; data[1]; data[2];   this portion of code :   (function () {     console.log(k); })(k)   So when we add a parameter (k) to the end of a function, if i understand well, the value (k) is take from the current context/scope ?

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


I have watched 2 movies "The way back" & "Just mercy". I noticed that some African American actors say "it don't..." in the movie. I could not find the scripts  of these films.  Didn't the director correct the script?  Or is that a correct expression?  Why do some African American people say "it don't..." in some movies?

Does it sound unnatural to you (natives) when people skip 's' ending of the verb in 3rd person? Heard it many times (e.g. in 50 cent songs - she go, she have, etc.) and always wondered how much it sounds ok.


Let $a_n$ be a sequence in set of real numbers. Assume $a_n$ converges to $a$ in $\mathbb{R}$. Show that $\left\{a_{n}:n\in\mathbb{N}\right\} \cup \left\{ a\right\}$ is closed  Recall. $X\in\mathbb{R}$ is closed if and only if the complement of $X$ is open.  Let $X=\left\{a_{n}:n\in\mathbb{N}\right\} \cup \left\{ a\right\}$ be a set.   I need to show that $X^c$ is open. Let $t\in X^c$. Then, $t\not\in X$.   So what should I do?

Can someone please check whether the following simple proof is "mathematical"? Is it correct, complete, rigid? Can it be simplified? I'm a complete autodidact so I'm looking for someone to give me feedback to gain experience in writing proofs... This is also my first question on MSE.  The proposition:  Let $(X, d)$ be a metric space and $x_n \to x$ where each $x_n \in X$ and $x \in X$. Let $A$ be the subset of $X$ which consists of $x$ and all of the points $x_n$. Prove that $A$ is closed in $(X, d)$.  My tentative to prove this:  We first show that all infinite sequences in $A$ converge to $x$: Let $y \in X$, $y \ne x$. Then there is some open ball $B_\epsilon(x)$ with $\epsilon < d(x,y)$ containing all but finitely many elements of $A$. As $y \notin B_\epsilon(x)$ there can be no infinite sequence in $A$ converging to $y$. Consequently all infinite series in $A$ converge to a point in $A$ which therefore must be a closed set.  Edited: As rightly pointed out in the comments, I should have written in the first sentence "...sequences with infinitely many distinct terms and which converge to some point of $X$" and the last sentence should be "Consequently all infinite sequences...".


I'm trying to read data using SqlDataReader. When using SQL Server 2014 I've added the code to my query:  . ORDER BY STATEMENT_ID ASC    OFFSET @beginRow ROWS    FETCH NEXT @offs ROWS ONLY   This works for me in SQL Server 2014 whereas in SQL Server 2008 r2 it doesn't. What is the equivalent to this operation in SQL Server 2008 R2? Is there any, or should I change my approach!?  Thanks in advance.

What is the best way (performance wise) to paginate results in SQL Server 2000, 2005, 2008, 2012 if you also want to get the total number of results (before paginating)?


Currently, although the SE Inbox does include responses from Meta.SE the recent activity tab at SE does not include Meta.SE activity.

I just visited my own profile on stackexchange.com and noticed that the  is missing all activity from , while it seems to be a complete aggregation of the rest of my activity:  You can see comments, badges, etc. from many other sites, and no activity from The Workplace.  All of the following  is missing:  I clicked through all 5 pages, and couldn't see any Workplace activity. The same seems to be true of other users, such as moderator  (). Is this intentional for some reason, or a bug?


i was reading and a question popped into my head and i could not find the answer  anywhere  if photon destruction is instantaneous doesn't it mean that space-time is quantised?  here is my problem:  if space-time is continues and i can define the separate events of ""last point where a photon exists" and "the first point where said photon doesn't exist" there are infinitely many point in between all of witch have to be in some "in between" state and so the destruction of a photon is not instantaneous.  on the other hand:  if a photon is absorbed instantaneously then when an electron is absorbing a photon it "gets" the photons momentum and starts to move instantaneously witch means that if space-time is continues i can define the event of "last point that the electron had no velocity" and the event of "the first point that the electron had some velocity due to the absorption of the photon" and the same problem arises as before.  it all builds up on that "last point" "first point" argument is it valid?  i don't expect a simple answer but if someone can help me start to tackle the question that will be great  just to clarify i am not asking if space-time is quantised but if instantaneous events require a non continues function and there are instantaneous events like the the destruction of a photon how can space-time be continues (the electron does not experience a continues change in velocity?)

On a quantum scale the smallest unit is the , which is a discrete measure.  There several question that come to mind:   Does that mean that particles can only live in a discrete grid-like structure,  i.e. have to "magically" jump from one pocket to the next? But where are they in between? Does that even give rise to the old paradox that movement as such is impossible (e.g. )? Does the same hold true  for time (i.e. that it is discrete) - with all the ensuing paradoxes? Mathematically does it mean that you have to use difference equations instead of differential equations? (And sums instead of integrals?) From the point of view of the space metric do you have to use a discrete metric (e.g. the ) instead of good old Pythagoras?   Thank you for giving me some answers and/or references where I can turn to.  Update: I just saw this call for papers - it seems to be quite a topic after all: Is Reality Digital or Analog? FQXi Essay Contest, 2011. , , . One can find some pretty amazing papers over there.


I have 25 screen named sc1, sc2, sc3 , etc running and when i open screen via screen -r sc1 command it opened sc19 How to fix this?

Screen version 4.01.00devel (GNU) 2-May-06, running on Ubuntu Server 14  I make a screen, detach, make another screen with a name matching the first few characters of the other screen's name, and detach. When I try to attach to the first screen again, it attaches me to the second screen instead. The first screen is inaccessible unless I attach to it by PID.  screen -S py_dev [detached from 11572.py_dev] screen -S py_dev2 [detached from 29615.py_dev2] screen -r py_dev [detached from 29615.py_dev2]   I don't see this behavior in the manual (it simply says screen -r (pid.sessionname)) or anywhere online. screen -x has the same problem. If I do screen -r 11572, I can attach to the first screen, but that's annoying. Any way to avoid this?


I want to write equation system like this.   I used this code:  \begin{tabular}{rcrcrcr} $k_1$ & $+$ & $2k_2$ & $+$ & $3k_3$ & $=$ & $5$\\ $2k_1$ & $+$ & $9k_2$ & $+$ & $3k_3$ & $=$ & $-1$\\ $k_1$ & $+$ & & & $4k_3$ & $=$& $9$\\ \end{tabular}   Is there any simpler way than to write all math-mode with $...$? I want the space more narrow. Any idea?


I have a 500 GB hard disk but unable to use the entire space. The only space available to use is around 200GB. The rest is mounted on /usr. Here is what I get after doing df -h.      munam@munam-Inspiron-3521:~$ df -h     Filesystem      Size  Used Avail Use% Mounted on     /dev/sda1       184G  143G   32G  82% /     none            4.0K     0  4.0K   0% /sys/fs/cgroup     udev            3.9G  8.0K  3.9G   1% /dev     tmpfs           798M  1.5M  797M   1% /run     none            5.0M     0  5.0M   0% /run/lock     none            3.9G   80M  3.9G   2% /run/shm     none            100M   60K  100M   1% /run/user     /dev/sda5       275G  5.1G  256G   2% /usr     /dev/sda3        88M   64M   19M  78% /boot   I want to utilise that 300 GB mounted on /usr. I  will be really thankful if someone helps me do that. Thanks & Regards.

Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions?


I'm not really sure if this would be better suited over on SE's user experience site, but here goes: Say I'm writing a blog post or, even better, a question on one of the various SE sites. My example blog post or question is about HTML, and I have three similar elements that I want to collectively refer to. If the element I'm talking about is a "section", which of the following should I use?   Three sections. Three sections. Three section elements.   In the first example, the "s" is contained within the code highlighting. In the second example, the "s" is directly after the highlighting. In the final example I've dropped the "s" from the inline code altogether and instead pluralised the name of the group "section" belongs to.

In my blog (which is about programming) I often use reserved words from different programming languages.  Like this:     When column is nullable in both tables, this query won't return a match of two NULLs for the reasons described above: no NULLs are equal.   Here, NULL is a programming language keyword.  For numerous reasons, I mark them with <code> tag so they are rendered with a fixed width font, not translated into the foreign languages by Google Translate, can easily be seen on the page etc.  In the example above, which would be the best way to mark the plural?   NULLs NULL s NULL's NULLs NULLS   Option 1 looks ugly on the page (the word and the plural marker are rendered in different colors and fonts)  Option 2 adds a space between the word and the plural marker  Option 3 looks nicest but is not correct  Options 4 and 5 may leave the reader under impression that NULLS is a reserved word (which is not true) and this may be confusing. Also, Google Translate would leave the word as is which would be definitely wrong in other languages.  What would be the least of 5 evils?


Can I use 3.5 expansion books for pathfinder?? I want to because I want to use different things I read in 3.5 expanisions. Also tell me in your answer which are compatible and which aren't. I'm reading up on pathfinder a bit and am curious of how it would play out.  I haven't gotten to play either yet and wanted an outside opinion.  Thank you in advance

Anything I should keep in mind before I start mixing and matching between D&D 3.5e and Pathfinder?  Off the top of my head, the biggest difference is feats every 2/3 levels. Would it affect balance if I picked every 3 levels instead of 2? I think PF options are still pretty solid regardless...


I'm working on a driver, and I'm having trouble finding a way to manipulate the bits I want to on a digital register.  The register has 20 bits (0-19) and I'm only concerned with writing over the last two (19,18).  These bits are part of a hex representing that section, so to visualize, the #'s are what I want to change:  Hex    5    B    0    F  [##00 0101 1011 0000 1111]  All of the other bits must be kept as they are—the example above is arbitrary, so the masking has to handle any combination of bits.    I've tried creating a mask with any combination of & and | with 0xFFFFF and also 0x00000 but neither change just the first two bits of the hex that will be written.  Any ideas to get this to function would be great; and if you could explain how the solution works, even better.

How do you set, clear, and toggle a bit?


I installed Ubuntu 13.10 on my laptop (Acer Aspire E1 572G) I installed over my win 8.1 partition.  I just erased the disc, but while doing so I had control over my mouse and was able to connect to the wireless via the wireless symbol on the top right of the screen.  I think I wiped any drivers that were there though, I did the initial install in work and while doing so I was called out of the office and when I got back I saw a message saying,  The system is running in low graphics mode Your screen, graphics card and, input device settings could not be detected  correctly. You will need to configure these yourself.   Is there a way I can configure them?

Note: This is an attempt to create a canonical question that covers all instances of "low-graphics mode" error that occurs to a user, including but not limited to installation of wrong drivers, incorrect or invalid lightdm greeters, low disk space, incorrect installation of graphics card like ATI and Nvidia, incorrect configuration of xorg.conf file while setting up multiple monitors among others. If you are experiencing the "low-graphics mode" error when trying to login but none of the following answers work for you, please do ask a new question and then update the answers of this canonical question as and when your new question gets answered.   When I try to boot into my computer, I am getting this error:  The system is running in low-graphics mode Your screen, graphics cards, and input device settings could not be detected correctly. You will need to configure these yourself.   How do I fix the failsafe X mode and login into my computer?  Answer index:


I was told that $\sup\emptyset=-\infty$ and $\inf\emptyset=\infty$, where $\emptyset$ is the empty set. This seems paradoxical to me as to how supremum can be less than infimum. Is there any proof for this or is it taken for granted ?

Let $E$ be an empty set. Then, $\sup(E) = -\infty$ and $\inf(E)=+\infty$. I thought it is only meaningful to talk about $\inf(E)$ and $\sup(E)$ if $E$ is non-empty and bounded?   Thank you.


I'm having some trouble with the following exercise:  Find the last two digits of the decimal representation of $3^{400}$.  This exercise Is under the Euler's theorem and Fermat's little theorem section of the worksheet so I think that we are supposed to use those to solve this. My problem is that this is the first time I'm seeing an exercise of this kind and I don't know how to proceed. Can someone give me a tip on how to do this or show me how it's done?

How do I efficiently compute $a^b\bmod c$:  When $b$ is huge, for instance $5^{844325}\bmod 21$? When $b$ is less than $c$ but it would still be a lot of work to multiply $a$ by itself $b$ times, for instance $5^{69}\bmod 101$? When $(a,c)\ne1$, for instance $6^{103}\bmod 14$?  Are there any other tricks for evaluating exponents in modular arithmetic?  This is being asked in an effort to cut down on duplicates, see  and .


Attached is my attempt at a globe. You will see that the rendered image is not sharp and smooth at the edges. I have highlighted a few of these areas. How do I render images that are sleek and smooth.

When I hit F12 to render an image and zoom in it is quickly pixelated. How can I render a higher res display? I have looked through the settings and couldn't find a solution.


when is the force due to gravitation positive and when negative? i.e.  $$ F=+\frac{GMm}{r^2} ~~\mbox{or} ~~ F = -\frac{GMm}{r^2}. $$  we know that GPE $U=-\int F\cdot dr$, here $F$ will be $+GMm/r^2$ or $-GMm/r^2$  and if so why?

From universal law of gravitation, gravitational force exerted on a body of mass m by another body of mass M is                 $$ \mathbf F = \frac{GMm}{x^2}  $$ where x is the distance between the centres of both the objects.  So, work done by gravitational force in bringing the object of mass m from infinity to a distance r from the centre of body of mass M is           $$ W = \int_\infty^r \vec{F(x)}.\vec{dx}$$                   $$=\int_\infty^r \frac{GMm}{x^2}\hat x.\vec{dx}$$ (where $\hat x$ is the unit vector in the direction in which the body of mass M is attracting the body of mass m, i.e. the direction of $\vec{dx}$ which results the angle between both vectors $0$) $$ =\int_\infty^r \frac{GMm}{x^2} {dx}\ cos0$$  $$  = - GMm\left(\frac{1}{r}-\frac{1}{\infty}\right) $$ $$= -\frac{GMm}{r}$$  Now, we know that $$W=-(∆U)$$ $$-\frac{GMm}{r} = -(U_r - U_\infty)$$ $$-\frac{GMm}{r} = (U_\infty - U_r)$$ Since, Zero of potential energy is at infinity by convention, so $U_\infty$ = 0 $$-\frac{GMm}{r} = -U_r$$ $$\frac{GMm}{r} = U_r$$  I get potential energy at a distance r as positive, then why is it that gravitational potential energy is $$-\frac{GMm}{r}$$  What is wrong in my derivation?


How to demonstrate $(p→r)∧(q→r) ⇔ p∨q→r$ using the laws of logic?

I am looking to for a way to prove that the statement $(p \vee q) \wedge (\neg p \vee r) \rightarrow (q \vee r)$ is a tautology. I am unable to use the truth table or the rules of inference for this. I can only solve this by using Laws and Theorems such as De Morgans Law and Distributive Law. Any help would be greatly appreciated. Thank you


I am Vietnamese. I am studying in Canada. In this December I will fly from Canada to Vietnam. In my fight schedule, I must transit in Amsterdam for 1.5 hours and then in Paris for 3 hours. I wonder if I need a Schengen Visa to flight from Amsterdam to Paris in my schedule?

I am travelling form Delhi (DEL) to San Francisco (SFO), I have to make a connection flight in Vienna that would take me to Frankfurt (FRA). My flight to SFO is from FRA, I have one ticket for entire journey and the flights are operated by Lufthansa or its subsidiaries.  Do I need a transit visa? My flight arrives at Vienna international airport and leaves from the same, and for second leg it arrives at Frankfurt international airport.  I asked this question as an addendum to my  but was advised to make a new post.  I hold Indian passport and valid US visa.


I'm trying to understand at a fundamental level what is the difference in C/C++ between a pointer to an int and a pointer to a char. Consider the following: #include <iostream>  int main() {      int n = 4;     int* pn = &n;      std::cout << pn << std::endl;      char c = 't';     char* pc = &c;      std::cout << pc << std::endl;      return 0; }  The output is: 004FFC38 t╠╠╠╠╠╠╠╠8ⁿO  Why does the int pointer return an address as expected but the char pointer returns the actual character followed by seemingly junk values? After searching I was unable to locate a direct answer to this one.

I'm using C++ to understand how exactly pointers work. I have this piece of code using arrays, which I'm using just to understand how the equivalent works with pointers.  int main() {         int arr[10] = {1,2,3};         char arr2[10] = {'c','i','a','o','\0'};     cout << arr << endl;     cout << arr2 << endl; }   However when I run this, arr outputs the address of the first element of the array of ints (as expected) but arr2 doesn't output the address of the first element of the array of chars; it actually prints "ciao".  What is it that I'm missing or that I haven't learned yet about this?


Enhance Ability (PHB 237) is a 2nd level spell granting either temporary hitpoints or advantage on any one of the 5 core skills (Str,Dex,Int,Wis,Cha).  It has already been answered several times that , like Cat's Grace would bestow from Enhance Ability.  I am wondering now about other types of d20 rolls: namely, can a Wizard gain advantage on spell attacks with Fox's Cunning? A rogue or fighter on their weapon attacks with Bull's Strength and Cat's Grace? A cleric or sorcerer on spells with Eagle's Splendor or Owl's Wisdom?  N.B. I am not concerned about the balance of this, only whether it is permissible based on the rules.

Is a melee attack a Strength ability check, or a missile attack a Dexterity one?  Say a cleric enhances the Fighter's Strength — the spell effect says the Fighter now gets advantage on Strength checks. Does that apply to attacks, as they are a form of Strength check?


Can Ubuntu dual boot w/ Windows 7 and Data,  on one SSD, in a 10 year old Acer Notebook w/ AMD Phenom II(Quad Core)?

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?


Let $R$ be an integral domain, let $Q$ be its field of fractions, and let $M$ be an $R$-module with nontrivial annihilator. Determine if $\mathrm{Ext}_{R}^{n}(Q,M) = 0$ for all $n \geq 0$.   Intuitively, I believe it is true, because the most natural example $R = \mathbb{Z}$, $Q = \mathbb{Q}$, and $M = \mathbb{Z}_m$ looks promising. However, this example is "bad", because $\mathbb{Z}$ is a PID, and therefore divisible is equivalent to injective.  My first thought is constructing a short exact sequence, for example, $0 \to Ann_R(M) \to Q \to M \to 0$ and look at its induced long exact sequence on the cohomology. However, I never succeed. My professor suggests that I should somehow use the fact that $Q$ is the field of fractions, maybe though the fact that $Q$ will kill all the torsions (considering the induced cohomology on $Tor$).  Can anyone give me some more suggestions? Thanks!

I am currently working through a problem in Rotman:       Let $R$ be a domain and let $Q=$Frac$(R)$.  If $r\in R$ is nonzero and $A$ is an $R$-module for which $rA=0$, prove that for all $n\geq 0$, $\mathrm{Ext}_R^n(Q,A)=0=\mathrm{Tor}_n^R(Q,A)$.   I think I have the Tor part:  Since $Q$ is flat, Tor$_n^R(Q,A)=0$ for all $n\geq 1$.  And Tor$_0^R(Q,A)=Q\otimes_R A=0$ because: for each $\frac{t}{s}\otimes a\in Q\otimes A$, $\frac{t}{s}\otimes a=\frac{tr}{sr}\otimes a=\frac{t}{sr}\otimes ra =0$.  However, I am having trouble with the Ext part.  To do it directly I either need a projective resolution for $Q$ or an injective resolution for $A$, but I am not sure how I would resolve either of these.  Or I considered using a long exact sequence for the short exact sequence $0\rightarrow R\rightarrow Q\rightarrow Q/R\rightarrow 0$, but that didn't seem to get me anywhere either.  I have been stuck on this problem for far too long so any help or hints are greatly appreciated.


I am using Ubuntu 14.04. with Unity DE.  How can I make keyboard shortcuts work on key release, not on key press?   For example, if I want to use the windows key for multiple shortcuts, it works only for the one that's triggered by the win key alone, because the shortcut works before the next key press is registered.

I have Ubuntu 16.04 with GNOME shell. I set ctrl+shift for the "Modifiers-only switch to next source" option.   This shortcut conflicts with apps hot-keys. I can't use ctrl+shift+i to open devtools in Chrome, it just switches the layout. In VS code IDE if I press shortcuts with ctrl+shift (for example ctrl+shift+f), shortcuts work but always switch a keyboard layout. When I used Windows this problem didn't exist.  Can I set the ctrl+shift shortcut in such a way that it causes a switch action only after the keys are released and only if this 2 keys were pressed (without additional keys)?


I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


Suppose a developer does not use prepared statements in mysql, so are the following three functions enough to prevent any SQL injection. I would be grateful if someone improves the following functions:  function SanitizeForSQL($str) {     if( function_exists( "mysql_real_escape_string" ) )     {         $ret_str = mysql_real_escape_string( $str );     }     else     {         $ret_str = addslashes( $str );     }     return $ret_str; }  /* Sanitize() function removes any potential threat from the data submitted. Prevents email injections or any other hacker attempts. if $remove_nl is true, newline chracters are removed from the input. */ function Sanitize($str,$remove_nl=true) {     $str = $this->StripSlashes($str);      if($remove_nl)     {         $injections = array('/(\n+)/i',             '/(\r+)/i',             '/(\t+)/i',             '/(%0A+)/i',             '/(%0D+)/i',             '/(%08+)/i',             '/(%09+)/i'         );         $str = preg_replace($injections,'',$str);     }      return $str; }     function StripSlashes($str) {     if(get_magic_quotes_gpc())     {         $str = stripslashes($str);     }     return $str; }       Edit: Due to the response from the experts, it seems above code is a crap. So I will be using prepared statements. I thank all of you it was an eye opener.

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?


For context, this lemma is later used to prove that $1 \equiv a^{\phi(m)}$ (mod $m$). However, I don't understand why $r_j$ is the least residue of $ar_i$ for some $i$ and $j$ in $[1, \phi(m)]$. The proof seems to imply that this follows from the fact that $ar_i$ is relatively prime to $m$, but I don't understand the reasoning. Simple explanations if possible, my background is high school math and a bit of self study. I must say, though. The theorems in number theory are quite beautiful.

Say we have two integers $n$ and $k$, such that $0 < k < n$ and $gcd(n, k) = 1$.  Why is it that if we take every integer $x\in\{0,\dots, n-1\}$ and compute $k\cdot x \ (mod \ n)$, we get as remainders all numbers from $0$ to $n-1$, with no repeats?  In other words, why is $\ f:\{0,\dots,n-1\}\rightarrow\{0,\dots,n-1\}$, $\ f(x)=k\cdot x\ (mod\ n)$ a bijection for $k,n\in\mathbb{N},\ gcd(k,n)=1$?


cat package.yaml > package.yaml   The above will truncate package.yaml, and hence the file will be empty - cat will have empty output.  How can I avoid truncating the file? Is there an alternative to using a temporary file? A variable maybe?

Possible Duplicate:          I frequently connect to amazon ec2 using their public DNS names (ec2-12-34-56-78.compute-1.amazonaws.com) and because of this my known_hosts file gets overwhelmed with a lot of ec2 entries I will never use again.  I know I could probably use sed -i to edit in place but I wanted to use grep and so I did this:  grep -v ec2 ~/.ssh/known_hosts > ~/.ssh/known_hosts   That leaves known_hosts as an empty file. If I do:  grep -v ec2 ~/.ssh/known_hosts > ~/.ssh/tmp mv ~/.ssh/tmp ~/.ssh/known_hosts   then things are fine, but I am confused why reading and writing to the same file leaves it blank, and if there is any way around this when using grep, cat, etc.


For a  when you pay and place a +1/+1 on it making it monstrous.  Is the counter targeting Fleecemane Lion.  If someone casts an effect or activates an ability to change the target does this mean Fleecemane Lion is not monstrous?

Note: this is intended to be a canonical question about whether or not a spell or ability targets so there are multiple sub-questions.   Can Hexproof or Shroud save my creature from ? What about a  that was cast for it's Overload cost? Does shroud prevent me from using the Monstrosity ability of a creature, or from giving it more counters with Proliferate? Can I cast an Aura Enchantment on one of my creatures with Shroud, or an opponent's creature with Hexproof? Or can I use the Equip ability to attach an equipment to one of my creatures with Shroud? Will 's ability trigger when my opponent plays ? And will I have to sacrifice my  if my opponent casts ? Will Shroud or Hexproof prevent an opponent from choosing me with 's ability? Will Hexproof keep one of my creatures from being affected by ? If an Aura or Equipment is attached to a creature with Hexproof, does the Hexproof protect the attached permanent?


I wrote a new text file in /bin named ram which contains:  watch -n 1 free -h   and a file sen:  watch -n 1 sensors   in the same folder, in order to avoid typing   watch blahblahblah...  every time.  Also, I changed permissions of these two from  -rw-r--r--   to  -rw-r--r-x   and achieved my goal. It worked even after reopening shell, i.e. then I could type ram instead of watch -n 1 free -h  But, problem was encountered after I tried the same procedure for   cd /home/myname/Downloads/   and new text file saved in /bin and named dow, same with permissions.  This time dow does nothing in terminal, even not showing any message.  I tried saving the same file in /usr/bin, but again terminal does nothing and my working directory doesn't change.  How is this possible?

I just want to write a script which changes my directory.  I put the below commands in the file /home/alex/pathABC  #!/bin/sh cd /home/alex/Documents/A/B/C echo HelloWorld   I did   chmod +x pathABC   In the Terminal, while in /home/alex, I ran ./pathABC, but the output is just HelloWorld and the current directory is not changed.  So what is wrong?


Random Color Noise Border Ubuntu 16 I am getting a noise border on my Ubuntu 16 machine. Any ideas?    Thanks!

After some gorgeous updates I witness this:


I have a simple code responsible for pressing the button and then sending the data from the form to the checking file and sending it back to the main file, the problem appears after entering the page - for the data to be sent I have to press the button twice - then it works the first time this button, after refreshing the page again I have to press the button twice again.    $(document).ready(function() {   $('#myBtn').click(function(e) {     e.preventDefault();     var text_1 = $("#text_1").val();     var text_2 = $("#text_2").val();     var text_3 = $("#text_3").val();      $.ajax({       type: "POST",       url: "execute.php",       dataType: "json",       data: {         text_1: text_1,         text_2: text_2,         text_3: text_3       },        success: function(data) {         if (data.code == "200") {           alert("Success: " + data.msg);         } else {           var modal = document.getElementById("myModal");           var btn = document.getElementById("myBtn");            btn.onclick = function() {             modal.style.display = "block";           }            window.onclick = function(event) {             if (event.target == modal) {               modal.style.display = "none";             }           }           $(".modal-content").html("
" + data.msg + "
");         }       }     });   }); });

 <form role="form" data-toggle="validator">   <input type="text" id="text_1" placeholder="Text 1">   <input type="text" id="text_2" placeholder="Text 2">   <input type="text" id="text_3" placeholder="Text 3">   <button type="submit" id="myBtn">Send</button> </form>

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


While reading about one of the Chinese experiments I see that they propose to hold one half of a pair of entangled photons(meaning holding one photon for an amount of time) until they manage to send it from a satelite to a ground station.  Because I'm not a physicist I'm curious as to what kind of apparatus they would use for such a task and what is the maximum amount of time that a photon can be kept in the apparatus?  I'm talking about this :     Then he wants to demonstrate intercontinental quantum key distribution between stations in China and Austria, which will require holding one half of an entangled photon pair on board until the Austrian ground station appears within view of the satellite.

discusses the recent invention of a "quantum radar" that works by bouncing one photon off of something, storing a photon that's entangled with it, and watching for interference on the stored photon that indicates the radar photon has bounced off an object.  Most of that makes sense, (about as much as anything in quantum physics makes sense, at least,) but... how exactly do you "store" a photon?  To my mind at least, the concept of storage involves putting something in a location and keeping it there, unmoving, but photons are not capable of not moving at the speed of light.  So what's going on in this scenario?


I have this php pdo:  try {                         $STH = $db->prepare("INSERT INTO racuni (napomene) VALUES (:12)");                  $STH->bindParam(':12', $_POST['napomena'], PDO::PARAM_STR);                } catch (PDOException $e) {                 echo $e->getMessage();             }   and now when I try to add this data to mysql:  <script>alert('heheheheheheh')</script>   there is no string escapes? And in database I have the same data:<script>alert('heheheheheheh')</script>  SO,  What is the best, safe way to insert data to mysql using php pdo?


I have four properties A, B, C, D and I am trying to summarize the logical implications between them into a single diagram. So far I have the following picture but I would like to have some of the implication arrows to be negated (say, the arrows from A to C, A to D, B to A, C to D and B to D).     \documentclass{article}     \usepackage{tikz-cd}  \begin{document} \begin{tikzcd}   A      \arrow[Rightarrow, shift left=0.6ex]{d}      \arrow[Rightarrow, shift left=0.6ex]{dr}     \arrow[Rightarrow, shift left=0.6ex]{r} & B     \arrow[Rightarrow, shift left=0.6ex]{l}      \arrow[Rightarrow, shift left=0.6ex]{d}  \\   C      \arrow[Rightarrow, shift left=0.6ex]{u}     \arrow[Rightarrow, shift left=0.6ex]{r} & D      \arrow[Rightarrow, shift left=0.6ex]{l}     \arrow[Rightarrow, shift left=0.6ex]{ul}     \arrow[Rightarrow, shift left=0.6ex]{u} \end{tikzcd} \end{document}   This is likely to be strongly related to this , but I wonder if there is a simple solution, as it is a quite common situation.

Is there a way to put $\nLeftarrow$ instead of some arrows in TikZ? Specifically, how do I change it to "B does not imply A" in the following code.  \documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd}[arrows=Rightarrow]    A \arrow[out=30,in=150]{r}{}\arrow{d} & B \arrow[out=210,in=330]{l}{}\arrow{d}  \\    E  \arrow{r}{} & F \end{tikzcd} \end{document}   One very primite way is to do something similar to the following, where at the description part in the middle of the arrow, use \Big\backslash.  \documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzpicture} \matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]              { A & B \\           & C \\ }; \path[->,font=\scriptsize] (m-1-1) edge node    {$\Big\backslash$} (m-1-2) edge node {$\Big\backslash$} (m-2-2);     \end{tikzpicture}  \end{document}   But then, how do I put a description in the middle of an arrow in the first code?


I have 10 GB Ubuntu 16.04 LTS on virtual disk in Virtual Box.   When I am trying upgrade, installer says me not enough space. I was enlarged disk image for 20 GB and Gparted partitions to whole new space. But still can´t upgrade and no space error:

How do I resize a LVM partition using system-config-lvm?  As per   I clicked on the partition and tried to resize, but got a pop-up error from system-config-lvm.     Logical volume is not mounted but is in use. Please close all applications using this device (eg iscsi).     What's the problem and how can I fix it?    See also .


I am trying to write a base class Problem with a nested class State. My idea is that any class I derive from Problem will also derive its own version of the nested class. Two of the functions (the constructor and printInit()) both pass to methods of State; however if I try calling these in a derived class the function that gets called is the one belonging to the base class rather than the version of the same function in the derived nested class. If I recreate the same functions in the derived class it works properly but I'd like to avoid the duplication if possible. Is there a way to set this up so that the functions that get inherited refer to the derived versions of State instead? class Problem { public:      Problem(std::ifstream& in) { init = State(in); }     void printInit() { init.print(); }      class State {     public:         State() {             f = h();             g = 0;         }         State(std::ifstream& in) {}         bool goal() { return false; }         void print() {}     protected:         int f, g;         int h() { return 0; }         std::priority_queue<State> kids;     };  protected:     State init; };   #include "Problem.h" #include <stack> #include <iostream>  class Solitaire : public Problem { public:      Solitaire(std::ifstream& in) : Problem(in) {         init = State(in);     }     void printInit() { init.print(); }      class State : public Problem::State {     public:         State() : Problem::State() {             Pos = 0;             Draws = 0;         }          State(std::ifstream& in) : Problem::State(in) { }          bool goal() {             return (Deck.size() + Pile.size() == 0);         }          void print() {             std::cout << Deck.size() << " " << Pile.size() << std::endl;         }      private:         int h() {             int total = 0;             total +=  7 * ceil(Deck.size() / 3.0);             total += 20 * (Deck.size() + Pile.size());             return total;         }          int Pos, Draws;         std::stack<int> Deck;         std::stack<int> Pile;     };  private:     State init;  };

Someone mentioned it in the IRC as the slicing problem.


For $n\in{N}$ let $P_{n}$ denote the vector space of all polynomials with real coeffecients of degree at most $n$. Define $$ T: P_{n}\rightarrow P_{n-1} $$ by   $$T(p)(x) = p'(x)-\int_{0}^{x} {p(t)dt} $$  Then how to find dimension of the null space of $T$?

For any $n\in \mathbb{N}$, let $P_{n}$ denote the vector space of all polynomials with real coefficients and of degree at most $n$. Define linear transformation $T \colon P_n \rightarrow P_{n+1}$ by $T(p)(x) = p'(x)-\int _0^xp(t)dt$. How to find out the dimension of the null space of $T$, where $p'(x)$ is the derivative of $p(x)$?


I was trying to understand the usage for the word "current limiting resistor." Taking an example of a simple LED with a resistor in series, the way I understand this is we are trying to limit the amount of current entering into the LED. I'll start with two situation. Situation 1. LED connected to a bench power supply. The power supply is tuned at 3V at current output set to 2A. If I connect an LED to this power supply where Vf for led is 3V the LED draws the rated current and doesn't consume 2A. Situation 2. The power supply is at 5V and the max output current is set to 2A. Connecting an LED directly would burn because the Vs is more than Vf hence more current will flow through the LED burning it. Whereas as soon as I add resistor in series we are dropping the voltage and hence by that limiting the current. So with this understanding can we say that the current limiting resistor is not only current limiting but voltage dropping resistor? Therefore we can say that the resistor is primarily there to reduce the voltage fed to the LED and the current required by the circuit is the amount of total resistance i.e Series resistance and normal operation of LED resistance.

I'm having a bit of trouble understanding currrent limiting resistors in simple LED circuits. I know that I can determine the optimal resistor like so:  \$\displaystyle R=\frac{V_{s}-V_{f}}{I_{f}}\$  But I'm having a hard time understanding how this one value modifies the voltage and the current to the correct values for the LED. For example, if my calcuations for a super bright blue LED (with \$V_{f}\$ being 3.0-3.4 V and \$I_{f}\$ being 80 mA, and a voltage source of 5 V) gives me 25 ohms (using the lower bound of the forward voltage), that's fine. So the current throughout should be 80 mA and the voltage drop for the resistor and LED should be 2 and 3 volts, respectively.  But what if I used a 100 ohm resistor instead? Or any other value—how would I calculate the voltage drops and current? Would I assume one of them stays the same?


I'm reviewing the Hamilton-Jacobi equation because I'm working on a research project about Kerr black holes and the geodesics of particles gravitating them (This is not really relevant to the question, but I'm saying it for the sake of context). I was working on the equations of motion and many papers use conserved quantities to integrate the equations and find the geodesics... and they usually use the Hamilton-Jacobi formalism.   In the Hamilton-Jacobi formalism, we find a canonical transformation that transformation that goes from the original hamiltonian $H$ to a new one that is identically zero $\tilde{H}$ such that in the new variables the canonical variables and their momenta are just conserved quantities  \begin{equation} \frac{\partial \tilde{H}}{\partial P}=\dot{Q}=0 \\ \frac{\partial \tilde{H}}{\partial Q}=-\dot{P}=0 .\\ \end{equation}  Then one uses the canonical transformation formalism to find the equation  \begin{equation} H(q,\frac{\partial S}{\partial q},t)+\frac{\partial S}{\partial t}=0 \end{equation}  where $S(q,P,t)$ is the generating function. When one solves the equations one finds the original canonical variables as a function of time and $N$ constants of motion $\alpha_i$ which are usually some combination of the new variables $Q$ and $P$.   My question is: Does this formalism guarantee that for any given system with $N$ degrees of freedom $q_i$ ($i=1,2,\dots N$) that has a hamiltonian that behaves nicely (derivable, etc.) there are always $N$ constants of motion $\alpha_i$?   If that is so, then I don't understand why such enphasis is put on how conserved quantities are a special thing that systems with symmetries have. I thought that ugly systems with no symmetries are impossible to integrate precisely due to the lack of conserved quantities. If you can address how the number of conserved quantities relates to integrability that would be awesome.

Integrable systems are systems which have $2n-1$ time-independent, functionally independent conserved quantities ($n$ being the number of degrees of freedom), or $n$ whose Poisson brackets with each other are zero.  The way I understand it, these conditions correspond directly to us being able to do the Hamilton-Jacobi transformation, which is roughly equivalent to saying that the $2n-1$ conserved quantities are the initial conditions of the problem, which itself is a way of saying that the map from the phase space position at some time $t_0$ to that at time $t$ is invertible. But, if the last statement is right, why are there systems which are non-integrable at all? Shouldn't all systems' trajectories be uniquely determined by the equations of motion and initial conditions? Or is it that all non-integrable systems are those whose Lagrangians can't be written (non-holonomic constraints, friction etc)?  I've heard that Poincare proved that the gravitational three-body problem in two dimensions was non-integrable, but he showed that there were too few analytic conserved quantities. I don't know why exactly that means non-integrability, so if someone could help me there that would be great too.


I need to show that $$ 1-x\leq e^{-x} (*) $$ Now we know that $e^x:=\sum_{k=0}^\infty \frac{x^k}{k!}$, which means $$ e^{-x}:=\sum_{k=0}^\infty \frac{(-x)^k}{k!}=1-x+\frac{x^2}{2!}-\frac{x^3}{3!}+\frac{x^4}{4!}-\frac{x^5}{5!}... $$ So after we subtract $1-x$ from both sides of the inequation (*) we have to show: $$ 0\leq \sum_{k=2}^\infty \frac{(-x)^k}{k!}=\frac{x^2}{2!}-\frac{x^3}{3!}+\frac{x^4}{4!}-\frac{x^5}{5!}... $$  1.) $x=0$ : $\sum_{k=2}^\infty \frac{(-x)^k}{k!} = 0$  2.)$x=1$: $\frac{1}{2n+1}\leq \frac{1}{2n}$ for all $n\in\mathbb{N}$  3.) $x<0$: This is obvious since ever summand is positive.  4.) $0<x<1$: This is also obvious (?) because for such $x$ it holds that $x^{2n}>x^{2n+1}$ for all $n\in\mathbb{N}$ and also $\frac{1}{(2n)!}>\frac{1}{(2n+1)!}$. So $\sum_{k=2}^\infty \frac{(-x)^k}{k!}=\sum_{n=1}^\infty \frac{x^{2n}}{(2n)!} - \frac{x^{2n+1}}{(2n+1)!}>0 $ since all summands are positive.  5.) $x>1$: Here is where I struggle and need help please. This is the a bit of the opposite of 4 maybe.

The elementary but very useful inequality that $1+x \le e^x$ for all real $x$ has a number of different proofs, some of which can be found online. But is there a particularly slick, intuitive or canonical proof? I would ideally like a proof which fits into a few lines, is accessible to students with limited calculus experience, and does not involve too much analysis of different cases.


I want to get the values of a column based on max of a different column grouped by another column.  I have this table:  KEY NUM VAL A   1   AB B   1   CD B   2   EF C   2   GH C   3   HI D   1   JK D   3   LM   And want this result:  KEY VAL A   AB B   EF C   HI D   LM   I could actually use this query to get it.  select KEY, VAL from TABLE_NAME TN where NUM = (     select max(NUM)     from TABLE_NAME TMP     where TMP.KEY = TN.KEY     )   However is there a more elegant way in ORACLE SQL (10g or above) to get the result?  Reason behind it is that there are actually multiple KEYs and it just looks a bit ugly.

Table:   UserId, Value, Date.   I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle)  Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date.


A certain function operation, an external service, and sometimes fails. I want to try it N times before giving up. For this reason I wrote the retry code as a decorator, and now I want to unit-test it.  I made a simple mockup function for the possibly faulty operation: the function fails with exception for N-1 times, and succeed the N-th time.  This is the code:  def mock(retry):     def repl(*xs, **ks):         if retry == 0:             return 1         retry -= 1         raise error('boom')     return repl   This is how I want to apply it:  somemodule.library.operation = mock(N - 1) somemodule.run() # calls somemodule.library.operation   Unexpectedly, by running mock(N -1)() I get the following error on the if retry == 0 line:  UnboundLocalError: local variable 'retry' referenced before assignment   After trying to understand why, I figured out that the error disappears as soon as I get rid of the retry -= 1 line.  I'm a bit puzzled by this fact, since in my opinion the retry variable should fully belong to the mock scope, and not just when it is accessed in read-only. If anything, I should always get the error, not only if I modify it.  Why is this a problem? And what is in your opinion the correct way of doing it?  Note:   I can see this behavior both with Python2 and Python3 I also tried to define global retry just before the if retry == 0 conditional

Where X is any programming language (C#, Javascript, Lisp, Perl, Ruby, Scheme, etc) which supports some flavour of closures.    Some limitations are mentioned in the  (compared to Ruby's closures), but the article is old and many limitations do not exist in modern Python any more.  Seeing a code example for a concrete limitation would be great.  Related questions:


I came across these lines of code in machine learning using python.   z = np.linspace(-10, 10, 100) # Compute sigmoid  Activation function A_sigmoid, z = sigmoid(z)   Please, what is line three saying? Basically, I want to know how to separate 2  inputs with a comma on the lefthand side. A_sigmoid was never predefined.  Thank you.  z = np.linspace(-10, 10, 100) # Compute sigmoid  Activation function A_sigmoid, z = sigmoid(z)

The canonical way to return multiple values in languages that support it is often . Option: Using a tuple Consider this trivial example: def f(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return (y0, y1, y2)  However, this quickly gets problematic as the number of values returned increases. What if you want to return four or five values? Sure, you could keep tupling them, but it gets easy to forget which value is where. It's also rather ugly to unpack them wherever you want to receive them. Option: Using a dictionary The next logical step seems to be to introduce some sort of 'record notation'. In Python, the obvious way to do this is by means of a dict. Consider the following: def g(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return {'y0': y0, 'y1': y1 ,'y2': y2}  (Just to be clear, y0, y1, and y2 are just meant as abstract identifiers. As pointed out, in practice you'd use meaningful identifiers.) Now, we have a mechanism whereby we can project out a particular member of the returned object. For example, result['y0']  Option: Using a class However, there is another option. We could instead return a specialized structure. I've framed this in the context of Python, but I'm sure it applies to other languages as well. Indeed, if you were working in C this might very well be your only option. Here goes: class ReturnValue:   def __init__(self, y0, y1, y2):      self.y0 = y0      self.y1 = y1      self.y2 = y2  def g(x):   y0 = x + 1   y1 = x * 3   y2 = y0 ** y3   return ReturnValue(y0, y1, y2)  In Python the previous two are perhaps very similar in terms of plumbing - after all { y0, y1, y2 } just end up being entries in the internal __dict__ of the ReturnValue. There is one additional feature provided by Python though for tiny objects, the __slots__ attribute. The class could be expressed as: class ReturnValue(object):   __slots__ = ["y0", "y1", "y2"]   def __init__(self, y0, y1, y2):      self.y0 = y0      self.y1 = y1      self.y2 = y2  From the :  The __slots__ declaration takes a sequence of instance variables and reserves just enough space in each instance to hold a value for each variable. Space is saved because __dict__ is not created for each instance.  Option: Using a  (Python 3.7+) Using Python 3.7's new dataclasses, return a class with automatically added special methods, typing and other useful tools: @dataclass class Returnvalue:     y0: int     y1: float     y3: int  def total_cost(x):     y0 = x + 1     y1 = x * 3     y2 = y0 ** y3     return ReturnValue(y0, y1, y2)  Option: Using a list Another suggestion which I'd overlooked comes from Bill the Lizard: def h(x):   result = [x + 1]   result.append(x * 3)   result.append(y0 ** y3)   return result  This is my least favorite method though. I suppose I'm tainted by exposure to Haskell, but the idea of mixed-type lists has always felt uncomfortable to me. In this particular example the list is -not- mixed type, but it conceivably could be. A list used in this way really doesn't gain anything with respect to the tuple as far as I can tell. The only real difference between lists and tuples in Python is that lists are , whereas tuples are not. I personally tend to carry over the conventions from functional programming: use lists for any number of elements of the same type, and tuples for a fixed number of elements of predetermined types. Question After the lengthy preamble, comes the inevitable question. Which method (do you think) is best?


I want to insert unicode text into my mysql database. when i put "আবুল কাশেম"(Bengali language) in input field to insert. it's inserted properly but it's not showing "আবুল কাশেম" it shows "à¦†à¦¬à§à¦² à¦•à¦¾à¦¶à§‡à¦®" this.how can i solve it.   data type: VARCHAR and Collation: utf8_unicode_ci  <!doctype html> <head> <title><title> </head> <body>  <label for="date">আপনার পূর্ণ নাম</label>  <input type="text" name="fullname" id="fullname" placeholder="আপনার পূর্ণ নাম">  <button type="submit" name="register" >রেজিস্ট্রেশন</button>  </body> </html>  <?php   if(isset($_POST['register'])){         $name = mysqli_real_escape_string($con,$_POST['fullname']);   $insert = "insert into users (name) values ('$name')";         $run_insert = mysqli_query($con,$insert);             if($run_insert){             echo "<script>window.open('home.php','_self')</script>";             }          }   ?>

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I created Ubuntu live usb stick and I wanted install vlc on it.  I downloaded the package but it didn't install.  I tried the sudo apt-get method, but it didn't work.  Is there any way how to install vlc on Ubuntu live without installing it on computer?

How do I get to the Universe Repository in supported versions of Ubuntu?


I have a DataGrid with three columns.  There is a delete button in the third column. Its visibility depends on boolean property called 'ControlsEnabled'.  DataGrid is populated by items in 'ObservableCollection'.  The problem is that 'ControlsEnabled' is not a property of items in our 'ObservableCollection' and it should not be. 'ObservableCollection' is property of another class.  Question: how should I change my XAML description to solve my problem?  <DataGrid.Columns>     <DataGridTextColumn Binding="{Binding Path=field1}"                          Width="140"                          Header="head1"/>     <DataGridTextColumn Binding="{Binding Path=field2}"                          Width="140"                          MinWidth="50"                          Header="head2"/>      <DataGridTemplateColumn>         <DataGridTemplateColumn.CellTemplate>             <DataTemplate>                 <Button Padding="5"                          Click="DeleteButton_Click"                          Tag="{Binding}"                          Content="X"                          Visibility="{Binding Path=ControlsEnabled, Converter={StaticResource boolToVisibilityConverter}}">                     <Button.ToolTip>                         <TextBlock>                             Delete                         </TextBlock>                     </Button.ToolTip>                 </Button>             </DataTemplate>         </DataGridTemplateColumn.CellTemplate>     </DataGridTemplateColumn>  </DataGrid.Columns>   Thank you!

How do I use RelativeSource with WPF bindings and what are the different use-cases?


Every walkthrough/guide/faq I've found for FEZ just has the answer to the number cipher, but not the steps you're supposed to take to solve it on your own. How is it intended to be solved?

In the same spirit as :   I was able to crack the language code using tradition substitution cipher breaking techniques.  But I ended up cheating on the number/tetris symbols by looking on the Internet.  The number code is logical enough now I know it -- but I can't see how I would have arrived at it without help.  With regard to tetris shapes:      What would cause you to go down the path of associating Tetris shapes with controller inputs?


In the code below, the program should read values from a xml file. I declared the double variables as instance variables, and I initialized them in the main method. The problem is the program does not see the initialized values to a1,a2....a7. and I get a  NullPointerException  error. My question is it something has to do with static thing or it's not possible to declare a variable in one place and in another place.   public class ParseXml extends RoboticsAPIApplication {      private Controller kuka_Sunrise_Cabinet_1;     private  LBR lbr_iiwa_14_R820_1;      private static double a1, a2, a3, a4, a5, a6, a7;      public void initialize() {         kuka_Sunrise_Cabinet_1 = getController("KUKA_Sunrise_Cabinet_1");         lbr_iiwa_14_R820_1 = (LBR) getDevice(kuka_Sunrise_Cabinet_1,                 "LBR_iiwa_14_R820_1");      }      public void run() {          lbr_iiwa_14_R820_1.move(ptp(a1, a2, a3, a4, a5, a6, a7));     }      public static void main(String[] args) {          try {             // get instance of the class and use it to parse new file xmlfile              File xmlfile = new File("C:/Users/Acer/Desktop/neues.xml");             DocumentBuilderFactory factory = DocumentBuilderFactory                     .newInstance();             DocumentBuilder db = factory.newDocumentBuilder();             Document doc = db.parse(xmlfile);              // Normalize             doc.getDocumentElement().normalize();              // get the frame Element             NodeList nlist = doc.getElementsByTagName("frame");              // cycle through the Elements             for (int i = 0; i < nlist.getLength(); i++) {                  Node nnode = nlist.item(i);                 if (nnode.getNodeType() == Node.ELEMENT_NODE) {                     Element fframe = (Element) nnode;                      // Initialization                     a1 = Double.parseDouble(fframe.getElementsByTagName("A1")                             .item(0).getTextContent());                     a2 = Double.parseDouble(fframe.getElementsByTagName("A2")                             .item(0).getTextContent());                     a3 = Double.parseDouble(fframe.getElementsByTagName("A3")                             .item(0).getTextContent());                     a4 = Double.parseDouble(fframe.getElementsByTagName("A4")                             .item(0).getTextContent());                     a5 = Double.parseDouble(fframe.getElementsByTagName("A5")                             .item(0).getTextContent());                     a6 = Double.parseDouble(fframe.getElementsByTagName("A6")                             .item(0).getTextContent());                     a7 = Double.parseDouble(fframe.getElementsByTagName("A7")                             .item(0).getTextContent());                  }             }          } catch (ParserConfigurationException e) {             // TODO Automatisch generierter Erfassungsblock             e.printStackTrace();         } catch (SAXException e) {             // TODO Automatisch generierter Erfassungsblock             e.printStackTrace();         } catch (IOException e) {             // TODO Automatisch generierter Erfassungsblock             e.printStackTrace();         }          ParseXml app = new ParseXml();         app.runApplication();      } }

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?


I've read a couple things about memory management/virtual memory and I need a little more details on one important point.  If I compile a program and it does an access to a hard-coded address without any allocation calls, when I run it the process gets an error signal, terminated by signal SIGSEGV (Address boundary error).  Example program:  #include <stdio.h>  void main() {     int * x = 0x1312;     printf("%d\n", *x); }   Compiled with mere:  $ gcc accessing-random-address.c -o random-address-access   Here I don't get what exactly happens when a program is turned into a process. The compiled program is all-machine-code, isn't it? The address access should look like mv (0x1312) regN. If this code runs -- how could the OS detect that the code accesses a memory outside of its' memory range?  So, my question is -- what mechanism is used in Linux/Unixes to catch such rogue memory accesses and send the signal to the process? At what moment is it done?  In fact, the same question applies to the way how a program is converted to a process. If the program has been compiled for some architecture -- it should use the physical addresses and registers of the processor. But the process uses the virtual memory, with page-tables etc. So, is there some intermediate executable Linux-specific format, which gcc compiles to? And this format is somehow converted to real machine code when the program is loaded into memory as a process? And then in the real machine code the memory access is not just mv A B but some procedure with kernel's page tables, page numbers and offsets?  PS  Probably this question would be clarified with more reading. But I would like to have this knowledge upfront -- so that "the main picture" is complete before getting other details.

If I write a program that tries to read memory at every possible address, and I run it on a "full" Unix, it will not be able to access all of the physical RAM.  But how does the operating system prevent it from doing so?  I am more familiar with small CPU architectures where any piece of assembly code can access everything. I don't understand how a program (the kernel) can detect such malicious operations.


Where is a good description of how comment notification (e.g. @ripper234) works?  Does it work the same on Stack Exchange?

How do the comment replies (aka "pinging users") work?  Who can I send an @reply to? How do I respond to a specific user when entering my comment? Will they be notified? What do people mean when they talk about "pinging" another user?  Related:


I am reading the book C++ Primer and at the file input output chapter it uses:  ifstream infile(ifile.c_str());   to open a file whose name is in the string ifile.  I tried the code and it works perfectly even without c_str(). So what is the point of using it?  Should I use c_str() when I am trying to open a file from a command line argument? I mean which is the correct usage:  ifstream fin( argv[1] )   or   ifstream fin( argv[1].c_str() )

This isn't a design question, really, though it may seem like it. (Well, okay, it's kind of a design question). What I'm wondering is why the C++ std::fstream classes don't take a std::string in their constructor or open methods. Everyone loves code examples so:  #include <iostream> #include <fstream> #include <string>  int main() {     std::string filename = "testfile";           std::ifstream fin;      fin.open(filename.c_str()); // Works just fine.     fin.close();      //fin.open(filename); // Error: no such method.     //fin.close(); }   This gets me all the time when working with files. Surely the C++ library would use std::string wherever possible?


I'm looking for an addon to fill fast and simmetrically some area that needs to be closed with vertices. Doing it manually it takes a lot of time. Check the attached screenshot. thanks.     I tried to do what's explained in the duplicate question,but it didn't solved my problem. For example,I tried to select two or more edge loops with Alt + Shift + RMB and then connect them with W > Bridge,but this is what happened :    and this :    and i tried also activating the F2 addon and then pressing the F key :    none of these solutions worked for me...  errata corrige : by pressing CTRL F and then grid fill worked for me...thanks.

I'm trying to fill empty space in my mesh, and I looked at the knife tool page on the Blender Wiki, and I'm not sure if there's a way to make it so that a new edge is made using the knife tool. I took a screenshot, and hopefully it'll explain better than I can of what I'm trying to do. Oh and I'm using Blender version 2.71, by the way.


I am having a bit of a problem with a paper I am working on in Sharelatex. For some reason I can not get the bibliography to sort alphabetically.  The code looks like this:  \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{hyperref} \usepackage[swedish]{babel} \usepackage{csquotes} \usepackage{dirtytalk} \usepackage[backend=biber,authordate,sorting=nyt,cmsdate=both,maxcitenames=3]{biblatex-chicago}  \addbibresource{bibliography.bib}  \urlstyle{same}  \begin{document}  Text \nocite{*}  \printbibliography  \end{document}   And my bib-file looks like this:  @book{almqvist1984, author={Solveig Almqvist}, title={Geng{\aa}ngarf{\"o}rest{\"a}llningar i svensk folktro ur genreanalytisk synpunkt}, publisher={Almqvist {\&} Wiksell international}, address={Stockholm}, year={1984}, titleaddon={(\bibstring{phdthesis})}, }   @book{hall2013, author={Mikael Häll}, title={Skogsrået, näcken och Djävulen: Erotiska naturväsen och demonisk sexualitet i 1600- och 1700-talens Sverige}, year={2013}, publisher={Malört}, address={Stockholm}, titleaddon={(\bibstring{phdthesis})}, }  @book{stattin1984, author={Jochum Stattin}, title={Näcken: spelman eller gränsvakt?}, year={1992}, origdate={1984}, publisher={Carlsson}, address={Stockholm}, titleaddon={(\bibstring{phdthesis})}, }  @book{worsley1968, author={Peter Worsley}, title={The trumpet shall sound: A study of ”cargo” cults in Melanesia}, year={1968}, publisher={Schocken Books}, address={New York}, }   For some reason the output I get sorts the bibliography in way that puts Worsley 1968 first in the list:    What am I doing wrong?

I'm having 2 problems with  references  in my thesis.  First when a last name starts with letter W, it always comes at the top. Before A. But if I change the authors lastname from Wolf to Solf it works. W isn't a special character in this context... or is it?  Second problem is when I have two names like 'Ivan and Me', in the references list I get 'Ivan, A and B Me' not 'Ivan, A and Me, B'. Does anyone have any suggestions? Thanks in advance.  My mwe is:  \documentclass[12pt,a4paper,swedish]{report} \usepackage[latin1]{inputenc} \usepackage[swedish]{babel} \usepackage[style=authoryear,natbib=true,backend=biber,sorting=nyt]{biblatex}  \addbibresource{incl/tgene.bib}  \begin{document} Foo \parencite{ivan} bar \parencite{wolf}. \printbibliography[heading=bibintoc] \end{document}   And my .bib looks like:   @book{ivan,     author = {Ivan, A and Me, B},     title = {Title A},   }   @book{wolf,   author={Wolf, Ceasar},   title={Title B},   }


I'm asking about the main cover used by the novel (found on most of the 1985 and 1991 editions), not about the movie tie-in cover.  The four individual items that I notice:   The planet (Earth? Bugger home planet? Ender's World?) Big artificial satellite (Battle School? Eros? Something else?) Small, yellow ship. (Shuttle to/from battle school? Fighter in third invasion? Colony ship?) Dots in space (ships? coordinates?)   Any ideas? Is it even one scene or is it just several stuff collaged together?

To me, it seems that whatever is on the cover of Speaker for the Dead--it appears to be a docking location for starships--is entirely unrelated to the story.  Am I missing something?  Is it depicting something from one of the other stories? (This seems highly unlikely, considering that Speaker was the second book written in the Ender saga)  Or is it just a science-fictiony looking picture that the publishers thought would sell more books than an image of anything that is actually in the story?


Compute the following sum in terms of an expression having only one binomial coefficient: For $m,n \in\mathbb{N}$  $$\sum_{k\leq m}(-1)^k {n\choose k}$$  I have started with   $$\sum_{k\leq m}(-1)^k {n\choose k} = \sum_{k\leq m}(-1)^k  \frac {n!}{k!(n-k)!}$$   But I am having trouble proceeding from there! I feel as if I am doing something wrong and am not able to find any results that could help. If I could get any hints that would be ideal! Thank you!

It is easily checked that $\displaystyle\sum_{i\ =\ 0}^{n}\left(\, -1\,\right)^{i} \binom{n}{i} = 0$, for example by appealing to the binomial theorem.  I'm trying to figure out what happens with the truncated sum $\displaystyle\sum_{i\ =\ 0}^{D}\left(\, -1\,\right)^{i}\binom{n}{i}$.  How far away from $0$ can this get, as a function of $D$ ?.  I'm mostly interested in the case of when $D \ll n$, such as $D \sim \,\sqrt{\,n\,}\,$.  Thanks !


I have 2 questions on Programmers:       I'm fairly certain I have the 2nd question in the right place. However, as you can see from the comment on the first question, there is concern that it should be on SO.    Well, I was pretty certain that, because I am not including any code, nor expect code in an answer, the question is on the right site.    It makes no difference to me which site the question is on. I am trying to read through FAQs and other questions to get a clear understanding of how I can consistently post to the correct site. Is there a specific link that gives me guidelines comparing what should be on SO vs. Programmers?

There seems to be more than a few computer science/programming Stack Exchange networks (is that the correct term?). Stack Overflow, being the first, has by far the most users, questions, and answers.  What is the reasoning for creating the others, and are there clear guidelines for which kinds of questions should be posted? I can see a large amount of potential overflow, many cases of people not getting a good answer to their question, because the person who has the answer isn't browsing that particular network at the moment.  I understand that they were probably created for organizational purposes, but wouldn't it almost make more sense to just have them as categories under Stack Overflow, keep them separated but still connected, instead of making people have to create multiple 'account's, one for each network?  I am sure there was a very good reason to break them up, but as someone that is new to SE, it can be somewhat intimidating to decide which one to post in to ensure you get a good answer. For example, if I am a computer science student, my first instinct might to be to post in the computer science network, until I see that it literally has 1% of the users as the Stack Overflow network, which still seems to be for programming/computer science related questions.  So my second instinct would then to be to post it into the Stack Overflow site on the basis that I have a significantly higher chance of my question being seen and getting a good answer. Then I notice that there is also a 'programmers' network, and I don't even begin to know where that fits in. I, and I am assuming most people, will probably just post on Stack Overflow to be safe.  My question is, other than the short little description blurb of each one, is there a clear cut set of guidelines which what each network is intended for, what kinds of questions should go to each one, and is anything being done to encourage people to post in these newer, smaller (more specialized?) networks as opposed to just posting in big daddy Stack Overflow?  Now again, this is for computer science/programming/"why isn't this code doing what I want?" related questions, I am not saying that if I had a question about Linux or WordPress or something I would have the same confusion.


I saw a film when I was very young.  There were a group of people who wake up at the start of the film, one of them woke from a drug induced coma of some kind.  Everyone in the world seems dead apart from them and they discover this is because the sun is reproducing and had emitted a load of deadly rays that only seemed to kill people conscious at the time.  The people in the film have a certain amount of time before this happens again.

This was a TV show aired in the UK probably sometime between 1990 and 1993, if memory serves it was only a one-off. The plot starts with the protagonist waking up in bed and being disappointed. He eventually goes outside and everyone is dead, whatever they were doing at the time they died doing it (driving, working, etc.) The protagonist is in a state of panic running around town (I seem to remember it being set in the UK) and he discovers that he's is 'alive' because he'd attempted suicide and died at the exact moment this mysterious event happened. I think he encounters others that 'died' at the time of the event and that's when he realises. I think the protagonist was a bald, white man, probably mid-thirties. Sorry for any vagaries, I was VERY young when it was on. Until recently I assumed it was The Quiet Earth but I've checked and it definitely isn't. It was in colour and was contemporary at the time so it would have been made around 1990.


I'm a student in electrical engineering, and my interests lie primarily in areas with a large overlap between physics and electrical engineering. I'm currently doing research with a professor of computer engineering, doing computer engineering research, which doesn't exactly line up with my interests, but it is research experience.  Now, when I'm applying for graduate schools, I believe I'll have to write a statement of purpose. How does it affect my chances of getting into graduate schools if I write about how I want to do research in [certain area of EE], but the school sees that all of my actual research experience is in an entirely different branch of electrical engineering?  Or in other words--do graduate admissions committees care about what field I do my undergrad research in, or do they only care that I do research in general?

I am a economics major undergraduate student who will apply for grad schools in the coming semester. I think I have quite a strong research experience in mathematical statistics (asymptotic statistics to be specific), but, unfortunately, not much in economics itself. So I am curious if economics departments in graduate schools will care about my research experience in statistics?  Maybe a broader question is if grad schools care about applicants' research experience in a different (maybe even unrelated) field at all? I guess in my case statistics and economics are still quite correlated, but what about other more distant combinations of target departments and previous research experience?


In many pop physics books I have read that an electron has no internal structure.  How do we know that and how can we rigorously prove that it has no such structure at all?

I'm writing a piece about the electron, and I'm having trouble finding evidence to back up the claim that the evidence is pointlike.   People  the observation of a single electron in a Penning trap shows the upper limit of the particle's radius to be 10-22 meters. But when you look at Hans Demelt’s  you read about an extrapolation from the measured g value, which relies upon "a plausible relation given by Brodsky and Drell (1980) for the simplest composite theoretical model of the electron". This extroplation yields an electron radius of R ≈ 10-20 cm, but it isn't a measurement. Especially when "the electron forms a 1 μm long wave packet, 30 nm in diameter".    It's similar when you look at  by Brodsky and Drell. You can read things like this: "If the electron or muon is in fact a composite system, it is very different from the familiar picture of a bound state formed of elementary constituents since it must be simultaneously light in mass and small in spatial extension". The conclusion effectively says if an electron is composite it must be small. But there's no actual evidence for a pointlike electron.   Can anybody point me at some evidence that the electron is pointlike?


Would like to know the compatibility with respect to hardware of a current Lenovo Laptop. The model is - IdeaPad Gaming 3 (15, AMD). It has the option of customization with respect to OS but Ubuntu is not listed. It has Windows & DOS. The model is being sold in India where I am from. The link to the model is as given below.....  Any information would be highly appreciated. Regards Sid

Is there an easy way to check a notebook's hardware compatibility with ubuntu before you buy it?  I really don't want to buy a notebook home and find several bugs caused by the hardware.  I know that DELL has some notebooks which are pre-installed ubuntu12.04LTS, i.e. the new xps. But what about other notebooks? isn't there a way to quickly check a notebook's compatibility with ubuntu?  A way I can see is using a LiveCD/ubuntu stick and boot in ubuntu first, then run some tests. But the problem is: how to make these tests in a short time automatically??? and how can I check the hardware compatibility? I know that I can use lshw or hardinfo to get informations, but only having the information is not enough, there are still some possibilities that your hardware has a bug. For instance, Lenovo T410i's wireless driver has a bug which causes extremely low speed internet connection, I googled a lot and recompiled the driver to fix that bug. So this is the kind of situation I'm trying to avoid.  Any help is appreciated.


Assuming a miraculous arrangement of a string of black holes for slingshot purpose, and a solid ball slinging by these black holes one after the other, gaining speed with each slingshot, is it possible in theory, that the ball reaches/exceeds the speed of light at some point? If not, then assuming the string of black holes extends for ever, at what point will the ball stop accelerating and why? I got couple of answers that basically limit the speed to c. If that is the case, then it is obvious that the acceleration has to be less and less with each sling. What is the reason for that reduction in acceleration? Is it because ball itself will turn into a black hole and it will start imparting as much energy to other black holes as it gains from them? Or because, there is some other relativistic mechanism involved here? Like, it will start emitting GWs to protect c. The question was closed sighting another question. That is not the right question for this purpose. Because the other question is about light. Light can gain energy without gaining speed, just by gaining frequency. So, it does not need to gain speed.

Wikipedia has this page on  using planets. In some cases this effect was used to accelerate the spacecraft to a higher velocity. This diagram shows this in a very oversimplified manner.   That got me thinking that if light is affected by gravity, and if it slingshots around the black hole/massive object, can't it gain a higher speed than $c$? What limitations are stopping it from doing this?  Forgive me if the answer to this question is pretty straight-forward or staring-you-in-the-face kind. I haven't fully understood the mechanics of the gravitational slingshot fully yet, but I couldn't wait to ask this. Note: If it is possible (I highly doubt that!), could you provide an explanation using Newtonian mechanics, I'm not very familiar with general relativity because I'm in high school.


print(0.1 + 0.2 == 0.3)   returns  False   Why?

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


I am Implemented Drop down cascading in SharePoint online list.   I have used below code,its working in Google Chrome browser but it shows error in IE browser and Firefox browser    Error:  Unable to get property 'SPCascadeDropdowns' of undefined or null reference    <script language="javascript" src="/sites/ABC/SiteAssets/jquery-1.11.1.js"        type="text/javascript"></script>   <script language="javascript" src="/sites/ABC/SiteAssets/jquery.SPServices-0.7.2.min.js" type="text/javascript"></script>  <script language="javascript" type="text/javascript">   $(document).ready(function() {    $().SPServices.SPCascadeDropdowns({      relationshipList:"States",      relationshipListParentColumn:"Country",      relationshipListChildColumn:"Title",      parentColumn:"Country",      childColumn:"State",     });  $().SPServices.SPCascadeDropdowns({    relationshipList:"Cities",    relationshipListParentColumn:"State",    relationshipListChildColumn:"Title",    parentColumn:"State",    childColumn:"City",    });  });

I am trying to implement cascading so I have loaded two files.  <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.01/jquery.SPServices.min.js"></script>   But I am getting the error as     Uncaught TypeError: Cannot read property 'SPCascadeDropdowns' of   undefined   in below code  $(document).ready(function() {   $().SPServices.SPCascadeDropdowns({     relationshipList: "Teams%20List",     relationshipListParentColumn: "Team_x0020_Name",     relationshipListChildColumn: "Team_x0020_Member_x0020_Name",      parentColumn: "Team",     childColumn: "Subsystem_x0020_Owner",     debug: true   });   });


$$\tan20\tan40\tan60\tan80$$  I tried to bring $\tan20$, $\tan40$ in $\tan(a+b)$ form but couldn't get the answer. Using calculator I got it has $3$. Can anybody please tell me how to solve this?

Prove that $\tan20^°\tan40^°\tan60^°\tan80^°=3$    \begin{align} \tan20^°\tan40^°\tan60^°\tan80^°&=\frac{\sin20^°\sin40^°\sin60^°\sin80^°}{\cos20^°\cos40^°\cos60^°\cos80^°} \\ &=\frac{2^4(\sin20^°\sin40^°\sin60^°\sin80^°)^2}{\sin 160^°} \end{align}  I am stuck here.


I'm getting this error occasionally when my device wakes up from suspend,  iwlwifi: Log capacity -1515870811 is bogus, limit to 1 entries iwlwifi: Log write index -1515870811 is bogus, limit to 1 iwlwifi: Start IWL Event Log Dump: display last 1 entries wlp3s0: HW problem - can not stop rx aggregation for 9c:1c:12:24:0e:18 tid 0 iwlwifi: Command REPLY_ADD_STA failed: FW Error wlp3s0: HW problem - can not stop rx aggregation for 9c:1c:12:24:0e:18 tid 1 p3s0: CTRL-EVENT-DISCONNECTED bssid=9c:1c:12:24:0e:18 reason=4 locally_generated=1 arn>  [1530059866.2378] sup-iface[0x5575dbb13da0,wlp3s0]: connection disconnected (reason -4) ieee80211 phy0: Hardware restart was requested  ... lots of stuff and a stack track  iwlwifi  iwl_trans_wait_tx_queues_empty bad state = 0 iwlwifi: Radio type=0x1-0x2-0x0 iwlwifi: Could not load the [0] uCode section iwlwifi: Failed to run INIT ucode: -5 iwlwifi: Unable to initialize device.  ... another stack trace,   I'm using this Wifi Card in a Lenovo x230 (from lspci, and syslog)  Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34) iwlwifi: Detected Intel(R) Centrino(R) Advanced-N 6205 AGN, REV=0xB0   I see a lot of errors pertaining to this card, but not with a failure to load uCode (microcode?) When things work, I see this in my syslog,  iwlwifi: can't disable ASPM; OS doesn't have ASPM control iwlwifi: loaded firmware version 18.168.6.1 op_mode iwldvm   According to the , I am running the latest version (18.168.6.1).  From all syslog messages PCI Address (0000:03:00.0) and timestamps cut out.

After using my laptop for a while, wifi drops and kernel returns  iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0 iwlwifi 0000:03:00.0: Could not load the [0] uCode section iwlwifi 0000:03:00.0: Failed to run INIT ucode: -5 iwlwifi 0000:03:00.0: Unable to initialize device.   I'm running on an x230 running     03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)


Recently I plan to study graph theory. I tried to read the book , yet I found the text hard to follow and problems too difficult. I'm just midway in chapter 2 and I already found several problems that I can't solve even after reading the hint and thinking for hours. (Is it just me or is it that the problems in this book are indeed really hard? And should I pursue reading this book?) So I want another book that (hopefully) satisfies the following:   Comprehensive. Has good problems with detailed hints (compared to the book above).

I was asked to read about Graph Theory. First got the book "Graph Theory with Applications" by Bondy and Murty. As a Computer Science student its becoming difficult to read and understand. Then I started reading "Graph Theory-Modeling, Applications and Algorithms" by Agnarsson and Greenlaw. They presented the same topics little bit easier but from a different point of view. I found the definitions are bit different. But they essentially mean the same.  I am looking for some books on Graph Theory for a Computer Science student from a beginner point of view. I am looking for books like "Graph Theory-Modeling, Applications and Algorithms".


Is it statistically sound to dummy code a continuous variable (effect modifier) into quartiles and compare the odds ratios of an IV vs. DV in Q1 and IV vs. DV in Q4 in logistic regression?  If so, how would I quantify a difference?

I'm wondering what the value is in taking a continuous predictor variable and breaking it up (e.g., into quintiles), before using it in a model.   It seems to me that by binning the variable we lose information.   Is this just so we can model non-linear effects?  If we kept the variable continuous and it wasn't really a straight linear relationship would we need to come up with some kind of curve to best fit the data?


Let $A_1, \dots , A_n$ be commutative unitary Rings and $A = \prod_{i=1}^{n} A_i$. Then every prime Ideal $\frak{p}$ $\subset A$ is of the form $\pi_i^{-1}(\frak{p}_i)$ where $\pi_i: A \to A_i$ are the canonical projections and $\frak{p_i}$ $\subset A_i$ is prime. I know that every Ideal in $A$ is a direct product of Ideals in the $A_i$, so we have $\frak{p}$ $= \frak{a}_i \times \dots \times \frak{a}_n$ for some Ideals $\frak{a}_i$ $\subset A_i$. They are also prime since $\frak{p}$ is prime. Now, since the $\pi_i$ are surjective $\pi_i(\frak{p})$ $\subset A_i$ is prime as well. Then we have $\pi_i^{-1}(\pi_i(\frak{p})) \supset \frak{p}$. Now I don't know how to finish the proof. Hints and/or improvements are greatly appreciated!

Is it true that any prime ideal of a finite direct product ring $R=\prod_{i=1}^nR_i$ is of the form $P=\prod_{i=1}^nI_i$, where $I_j$ is a prime ideal of $R_j$ for some $j$ and $I_i=R_i$, for $i\neq j$?   Any ideal of the form above is prime in $R$. Indeed, if $X=\prod_{i=1}^nA_i$ and $Y=\prod_{i=1}^nB_i$ are ideals of $R$ (where $A_i$'s and $B_i$'s are ideals of $R_i$) such that $XY\subseteq P$, then either $A_j$ or $B_j$ is a subset of a  prime ideal $I_j$, for some $j$. Hence either $X$ or $Y$ is a subset of $P$.  Any help/suggestion would be appreciated!


I have a 32 bit machine and had planned to install ubuntu 14.04 on it. I am confused because on the ubuntu download page it says 32 bit (for machines less than 2 gb ram) , since I have 4 gb of ram on my machine should i go ahead with installating the 64 bit . Also what about the other applications should i need to install 32 bit or 64 bit version of the app ?

What different Ubuntu derivatives are there? And what is special with them?


Hi assume I have a files that look like:  x x x A B C 1 2 3 D E F x x x   and what need the files to look like:  x x x A B C D E F 1 2 3 x x x   I know I could do this with a few sed -i s/search/replace/g lines but am wondering if there's a better, easier way to move x number of rows by y numbers in either direction?

Imagine an output of a command like  44444 55555 11111 22222 33333   how can I yank the first N lines (first two in the example above) and append them at the end, but without using temp file (so only using pipes)?  11111 22222 33333 44444 55555   Something along the lines of | sed -n '3,5p;1,2p' (which obviously doesn't work as sed doesn't care about the order of the commands).


I'm using package hyperref to write a book in Portuguese. Appendices should appear in TOC as in Apêndice A Title of the appendix.  When I compile it with LuaLatex on a computer with Ubuntu 16.04, I get this error message:  ! Missing \endcsname inserted. <to be read again>  \char  l.2 ....a.A}{Ap\352ndice T\355tulo de ap\352ndice}{}   The file main.out looks like this:  \BOOKMARK [0][-]{chapter.1}{Blabla}{}% 1 \BOOKMARK [0][-]{Ap\char "00EA\relax ndice.a.A}{Ap\352ndice T\355tulo de ap\352ndice}{}% 2   But, when I compile the same project with LuaLatex on a computer with Ubuntu 18.10, I get no error message and the file main.out looks like this:  \BOOKMARK [0][-]{chapter.1}{Blabla}{}% 1 \BOOKMARK [0][-]{Apêndice.a.A}{Ap\352ndice T\355tulo de ap\352ndice}{}% 2   What can possible be wrong with LuaLatex on my Ubuntu 16.04?  MWE:  \documentclass[10pt]{book}  \usepackage[utf8]{luainputenc} \usepackage[title,titletoc]{appendix} \renewcommand{\appendixname}{Apêndice} \usepackage{fontspec} \usepackage[breaklinks=true]{hyperref} \usepackage{tocloft} \usepackage[notlof,notlot,nottoc]{tocbibind}  \title{TÍTULO DO LIVRO} \author{Nome do Autor}  \begin{document}  \frontmatter \pagestyle{empty}  \maketitle  \tableofcontents\thispagestyle{empty} \cleardoublepage   \mainmatter  \chapter{Blabla}  Blablabla.  \begin{appendices}  \chapter{Título de apêndice}  Texto. \newpage Mais texto. \end{appendices}  \end{document}

Dear friends: there is a problem with appendix and ápendice.  I have a scrbook document and I use appendix package,   \usepackage[title, titletoc]{appendix}    because I like the word "Apéndice" in the toc  \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc}   However, when I compile with latex there is an error in file.toc (maybe in file.aux before). The reason is that in the file.aux there is a line like this:  \@writefile{toc}{\contentsline {chapter}{Ap\IeC {\'e}ndice \numberline {A}Sobre el \LaTeX  }{27}{ApÈndice.1.Alph1}}   and in the second compilation the character "È" produces and error. If I compile with lualatex I have not any error.  I have tried to modify \indexname, \@chapapp but I can not find any solution.    Yes, that is a solution. I am going to clarify the problem with a MWE. In my opinion the problem is motivated by UTF-8 codify and inputenc package, as it is possible to see with this code:  \documentclass[paper=a4,10pt, twoside]{scrbook}%  \usepackage{etoolbox}  \usepackage{tgheros}    % (Una versión libre de Helvetica) \renewcommand{\sfdefault}{qhv} %qhv  %:Fuente para todo lo demás (Una versión libre de Times) \renewcommand{\rmdefault}{qtm} \usepackage{textcomp} \normalfont  \usepackage[T1]{fontenc}         \usepackage[utf8]{inputenc} %para LaTex   %:Paquetes relacionados con el idioma y codificación \usepackage[english, spanish, es-nosectiondot, es-noindentfirst, es-nolists, activeacute]{babel}  \spanishdecimal{.}  %:Para poner las referencias y los nombres de figuras y tablas en castellano \addto\captionsspanish {% \def\figurename{Figura}% \def\tablename{Tabla}% \def\listfigurename{Índice de Figuras} \def\listtablename{Índice de Tablas} \def\contentsname{Índice}% \def\chaptername{Capítulo} \def\Agradecimientos{Agradecimientos} \def\Prefacename{Prefacio}% \def\refname{Referencias}% \def\abstractname{Resumen}% \def\bibname{{Bibliografía}} \def\appendixname{Apéndice} \def\miapendice{\appendixname} \def\glossaryname{Glosario}% \def\indexname{{Índice Alfabético}} }  %:Para definir APÉNDICES \usepackage[title, titletoc]{appendix}  \usepackage{hyperref}   \begin{document}  \cleardoublepage \phantomsection \tableofcontents  %:Empieza el contenido del libro \mainmatter  \chapter{Primer capítulo} \section{Primera sección, primer capítulo}  \chapter{Segundo capítulo} \section{Primera sección, segundo capítulo}  \begin{appendices}  \chapter{Primer apéndice} \section{Primera sección, primer apéndice}  \chapter{Segundo apéndice} \section{Primera sección, segundo apéndice}  \end{appendices}  \end{document}   If you compile, you obtain this error message:     Package inputenc Error: Unicode char \u8:énd not set up for use with La- TeXSee the inputenc package documentation for explanation.Your command was ignored.Type I   to replace it with another command,or  to continue without it.ice.alph1.Alph11ice.alph1.Alph20P   But the solution proposed it is perfect. Thank you


With Lua how can I get the current date-time with milliseconds.  In this format 'YYYY-MM-DD hh:mm:ss'.

Is there a common way to get the current time in or with milliseconds?  There is os.time(), but it only provides full seconds.


I am trying to install Ubuntu 14.04.3 LTS on the second partition of my PC. I have created created a bootable stick and copied the image using a program called rufus. I have modified my boot sequence and Ubuntu starts properly from the stick.  When I choose the option of installing Ubuntu, the keyboard is set to EN, but I have a FR keyboard. I have found the keyboard options, but it does not offer FR as an option. This problematic, since I have to enter keywords during the installation (Wifi, etc...).  How can I solve this? Thanks.

I want to install Ubuntu in ENGLISH (UK) but I have an ITALIAN keyboard, which has a different layout to the English keyboard. How can I install Ubuntu in English but select an Italian layout for the keyboard. I tried, but it would only allow me to select an English keyboard. Thanks


I've search in Google answer for it, but no one knows. Usually people say that when ice particles collide with water droplets, they get different charge. Small light particles get positive charge and go to the top of the cloud and big heavy go to the bottom. How exactly this happens? I only know that if we rub against each other, for example fur and ebonite rod, electrons go to material which has greater attraction for electrons. But what with water? How does it get charge due to friction? Water is water. I think there is no difference in attraction to electrons between one molecule of water and another. Or may be the phase matters? How do you think?

I am curious what causes the charge build up in a cloud before lightning occurs. I have seen in a few places such as , that the process is not fully understood. Is this some form of static electricity? Here are a few of my thoughts:   It seems that rain or ice particles occur are present in the clouds where this happens since thunderstorms are usually accompanied by rain. These clouds tend to be cumulus or cumulonimbus clouds which are much taller than other types that are commonly encountered. Is the physical size of the cloud related to this type of buildup of charge or is it a result of the moisture content?  If the charge buildup is caused by static electricity which two surfaces are contacting to create the charge? Is this just rain and ice particles? Can it be something else? (I think I recall something about lightning storms without rain in the desert) Why do some clouds with lightning have rain and others do not if the rain drops are the source of the static? Is there a minimum solid or liquid particle density needed for static electricity within a cloud?    Any thoughts would be interesting to hear!