for education I have to write a programme involving different objects and inheritance. The project is about different Locks with Transponders to open them. Let me explain with a simplification of my programm: class Lock { public :      Lock(int ID, int Transponder1, int Transponder2);     void OpenLock(int Transponder); protected:     int _ID = 0, _Transponder = 0; }; class SafetyLock : public Lock { public:     SafetyLock(int ID, int Transponder1, int Transponder2);     void OpenLock(int Transponder1, int Transponder2); protected: };  There are Normal Locks and safetylocks. The Safetylocks are inherited from the normal Locks. Normal Locks need only one Transponder to open, thus OpenLockhas only 1 parameter. The SafetyLock needs two Transponders to open, its OpenLockhas two Parameters. class Managment { public:     void StartSimulation(); protected:     Lock allLocks[2] =     {         Lock(1,10,20),     //"A normal Lock can be opened by either Transponder 10 or 20"         SafetyLock(4,40,10)//"A safety Lock with needs BOTH 40 and 10 to open"     }; };  Managment handles everything, this is why I listed all Locks there are(in my simplification only 2) in a List of type Lock. void Managment::StartSimulation() {     allLocks[0].OpenLock(10);                                                                          allLocks[1].OpenLock(40, 10); //Here the problem occurs since OpenLock only has one parameter in                                   //Lock   }  When I know try to open both Locks with their respective transponders all goes well for the Normal one but for the Second one, it tells me that I have too many arguments even though I declared a different OpenLock for the type SafetyLock. I can only guess that my problem is that I have an Array of type Lock but I tried to google my problem and don't know how to proceed now. Send help. Whole Test Code I wrote: #include <iostream> using std::cout; using std::cin; class Lock { public :      Lock(int ID, int Transponder1, int Transponder2);     virtual void OpenLock(int Transponder); protected:     int _ID = 0, _Transponder = 0;  };      class SafetyLock : public Lock { public:     SafetyLock(int ID, int Transponder1, int Transponder2);     virtual void OpenLock(int Transponder1, int Transponder2);  protected:    };  class Managment { public:     void StartSimulation(); protected:       Lock allLocks[2] =     {         Lock(1,10,20),     //"A normal Lock can be opened by either Transponder 10 or 20"         SafetyLock(4,40,10)//"A safety Lock with needs BOTH 40 and 10 to open"     }; }; void Lock::OpenLock(int Transponder) {     if (Transponder == 10 || Transponder == 20)     {         cout << "succes!";     }      } void SafetyLock::OpenLock(int Transponder1, int Transponder2) {     if (Transponder1 == 40 && Transponder2 == 10)     {         cout << "succes!";     } } void Managment::StartSimulation() {     allLocks[0].OpenLock(10);     allLocks[1].OpenLock(40, 10); //Here the problem occurs since OpenLock only has one parameter in                                                                  //Lock }    int main() {     Managment A;     A.StartSimulation(); }

Someone mentioned it in the IRC as the slicing problem.


I have created this simple 5x5 matrix in python but when I try to modify one cell, eg. a[1][1], it modifies the first element of every row. a = [[False] * 5] * 5 print("Original matrix : \n", a) a[1][1] = True print("Modified : \n", a)  I get the output as : Original matrix :   [[False, False, False, False, False], [False, False, False, False, False], [False, False, False, False, False], [False, False, False, False, False], [False, False, False, False, False]] Modified :   [[False, True, False, False, False], [False, True, False, False, False], [False, True, False, False, False], [False, True, False, False, False], [False, True, False, False, False]]  Does python ignore the second dimension? Why does this happen?

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


could someone tell me how long the cycle length must be in stream ciphers, so a security exists. how to compare the cycle length to the state space?  I investigate the algorithm spritz and I have the attainability of the states under investigation with key lengths of 1 - 10 and n = 6. now I have the values but I still do not know how to interpret them. the maximum cycle length for N = 6 is 660.390 and the smallest 12. But how should I evaluate this with regard to the safety? I hope I have described it somewhat better.

For all PRNGs (including CSPRNGs) lets say there is a sequence x, y, z, then when the PRNG cycles back to x, then the sequence following it will be exactly the same as before. Is this true for all PRNGs?  Are there any rules about minimum cycle length for CSPRNGs used for Stream Cipher? Because if a cycle happens, then the One Time Pad is no longer a One Time Pad and becomes insecure, right?   What are the average cycle lengths for commonly used Stream Cipher algorithms?    Is it not possible to prevent cycling by making the algorithm dependent on what it is encrypting - i.e. something like   The stream cipher is used for encrypting communication between Alice and Bob. Alice's key is K1 & Bob's is K2. This is the conversation  Alice: Hello, Bob Bob: Hello, Alice Alice: How are you?    So    K1 is used to generate the stream for encrypting "Hello, Bob" and it's sent.   The next stream generated not only depends on state of the PRNG after generating the stream for "Hello, Bob" but "Hello, Bob" is also used as input for this stream. And this will be used for encryption "How are you?" and so on.


I am currently using mod_rewrite to redirect all subdomains to https, but multiple sources have suggested that      Using mod_rewrite to do this isn't the recommended behavior. See      The  suggest Redirect and RedirectMatch:     A common use for RewriteRule is to redirect an entire class of URLs.   For example, all URLs in the /one directory must be redirected to   , or perhaps all http requests must be   redirected to https.      These situations are better handled by the Redirect directive.   Remember that Redirect preserves path information. That is to say, a   redirect for a URL /one will also redirect all URLs under that, such   as /one/two.html and /one/three/four.html.   Unfortunately, both of these documents (and anything else I have found) are only considering matching a single domain, rather than all subdomains. RedirectMatch seems like a good candidate for a relatively simple task like this, but I can't seem to get "http" to match as I expect:  RedirectMatch permanent "^http://(.*)$" "https://$1"   My guess as to why that doesn't work is because the redirectMatch is looking for a path and not a URI, but at this point I am stuck. Is it possible to accomplish a redirect of all subdomains to https without mod_rewrite, or is that the best available method?

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


This is probably just a minor notational issue, but I am unsure whether I should write $z=a+bi$ or $z=a+ib$ when denoting complex numbers. Though the former notation seems more common, Euler's identity tends to be written as $$ e^{i\pi}+1=0 $$ where the exponent is written as $i\pi$, not $\pi i$. I don't doubt that they mean the same thing, but I was wondering if one of the notations is more readable than the other. Perhaps someone can explain this apparent discrepancy between how we write $z$, and how we write $e^{i\pi}$.

Should I write complex numbers as $a+ib$ or $a+bi$? Maybe there are certain cases where I should write it one way and other cases where I should write it the other way. What do you think?


I need help with this question number 8, at least some hints or approaches to start with. Sorry for posting an image, I am only doing so , because I don't have a pc to type the question in latex and I don't know how to do so using mobile in any other way.

Let $R$ be commutative ring with identity that contains a field $K$ as a subring. If$ $R is a finite dimensional vector space over the field $K$, prove that every prime ideal in $R$ will be maximal.   My idea was to prove the integral domain $R/p$ (if $p$ is a prime ideal) was a field as for any ideal $P$, $R/P$ will be a field iff $P$ is maximal in $R$. But how can I use the fact that $R$ is finite dimensional over $K$? I don't understand.


How is it possible that a force that affects mass (gravity) can affect massless particles like photons?

Light is clearly affected by gravity, just think about a black hole, but light supposedly has no mass and gravity only affects objects with mass.  On the other hand, if light does have mass then doesn't mass become infinitely larger the closer to the speed of light an object travels. So this would result in light have an infinite mass which is impossible.  Any explanations?


If I have zram installed on Ubuntu and I want to enlarge it. By default, I only have a 935 megabytes and I need more zram! Does anyone know how I could get more zram? I would like to have at least 3 gigabytes of zram.

I installed zram with sudo apt-get install zram-config. After that it started automatically and when I verified with cat /proc/swaps it's running properly  But when I used sudo echo 128M > /sys/block/zram0/disksize to change the zram size like in the  I always get bash: /sys/block/zram0/disksize: permission denied  Even when I turned it off with sudo swapoff /dev/zram0 then changed I still got permission denied  So how can I change the zram size? And is disksize the space it consumes on RAM or just the maximum zram disk size?


Question is to prove :   Irreducibility of $(x-1)(x-2)\cdots (x-n)- 1$ over  $\mathbb{Z}$ for all $n\geq 1$ Irreducibility of $(x-1)(x-2)\cdots (x-n)+ 1$ over  $\mathbb{Z}$ for all $n\geq 1$ and $n\neq 4$   Hint for first bullet is      If the polynomial factors consider the value of the factors at $x=1,2,\dots,n$   For second bullet :  Suppose $p(x)=(x-1)(x-2)\cdots (x-n)-1$ is reducible we have:  $p(x)=q(x)r(x)$ with $\text {Max {degree of p(x), degree of r(x)}}<n$  Hint is suggesting me to use that $p(i)=-1$ for all $1\leq i\leq n$   i.e., $q(i)r(i)=-1$ for all $1\leq i\leq n$  i.e., $q(i)=-1; r(i)=1$ or $q(i)=1;r(i)=-1$  for all $1\leq i\leq n$  For second bullet :  Suppose $p(x)=(x-1)(x-2)\cdots (x-n)+1$ is reducible we have:  $p(x)=q(x)r(x)$ with $\text {Max {degree of p(x), degree of r(x)}}<n$  Hint is suggesting me to use that $p(i)=1$ for all $1\leq i\leq n$   i.e., $q(i)r(i)=1$ for all $1\leq i\leq n$  i.e., $q(i)=r(i)=1$ or $q(i)=r(i)=-1$  for all $1\leq i\leq n$  I am getting some vague ideas but could not bind them to prove this.  I would be thankful if some one can help me to clear this.  Thank you.  P.S : Please give "just hints". Do not write whole answer at once. This is a "request". Thank you :)  Edit : I have changed the title from   Irreducibility of $(x-1)(x-2)\cdots (x-n)\pm 1$ over $\mathbb{Z}$  to   Existence of Irreducible polynomials over $\mathbb{Z}$ of any given degree  for two reasons :   Irreducibility of $(x-1)(x-2)\cdots (x-n)\pm 1$ over $\mathbb{Z}$ for any $n\geq 1$ implies Existence of Irreducible polynomials over $\mathbb{Z}$ of any given degree The title looks atractive

I try to solve this problem. I seems to come close to the end but I can't get the conclusion. Can someone help me complete my proof. Thanks          Show that the polynomial $h(x) = (x-1)(x-2)\cdots(x-n) + 1$ is irreducible over $\mathbb Z$ for all $n\ge1$ and $ n\ne4$.      Suppose $h(x) = f(x) g(x)$, then we must have $f(i)g(i) = 1$ for all $i = 1,2,...n$. So both $f(i)$ and $g(i)$ are $1$ or $-1$. In either case, $m(x) = f(x) - g(x)$ has degree smaller than $n$ and have $n$ different roots ($1,2,...,n$). So we must have $m(x) = 0$. Then $h(x) = f(x)^{2}$. So $n$ must be even. Let $n = 2k$. Because $f(x)$ has degree $k$, there are $k$ values from $\{1,2,...,2k\}$ at which $f(x)$ is $1$ and $k$ values at which $f(x)$ is $-1$.  This is where I got stuck. Hope some one can help me solve this. Thanks.


According to , they should be but it's buggy.

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 recently bought a lumia 521 and was wondering if it would be able to run ubuntu touch. I did not see this question anywhere else, but please tell me if it is.

With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time.  Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions


Some months ago I did a Ubuntu 14.04 to 16.04 upgrade on my Dell Inspiron - 5000 series.  After performing the upgrade I noticed the two finger scroll is not working any more. The option in the settings menu is available and active but the two finger scroll does not work. The other mouse functions on the touchpad work though. Previous questions on this forum did not result in a solution.  Does somebody has some experience concerning this matter? I would love to use my two finger scroll again  thanks  output of xinput terminal command:  ⎡ Virtual core pointer                      id=2    [master pointer  (3)] ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)] ⎜   ↳ DLLC6AD:00 06CB:75BF Touchpad             id=11   [slave  pointer  (2)] ⎜   ↳ PS/2 Synaptics TouchPad                   id=13   [slave  pointer  (2)] ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]     ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]     ↳ Power Button                              id=6    [slave  keyboard (3)]     ↳ Video Bus                                 id=7    [slave  keyboard (3)]     ↳ Power Button                              id=8    [slave  keyboard (3)]     ↳ Sleep Button                              id=9    [slave  keyboard (3)]     ↳ Integrated_Webcam_HD                      id=10   [slave  keyboard (3)]     ↳ AT Translated Set 2 keyboard              id=12   [slave  keyboard (3)]     ↳ Dell WMI hotkeys                          id=14   [slave  keyboard (3)]     ↳ DELL Wireless hotkeys                     id=15   [slave  keyboard (3)]

I just got my laptop in the mail and I installed Ubuntu 14.04 LTS. It all went smooth until it booted up and I noticed my touch pad doesn’t work at all. It works perfectly on Windows and when I use a wireless mouse it works as well.  Here's my xinput:  ⎡ Virtual core pointer                          id=2    [master pointer  (3)]   ⎜   ↳ Virtual core XTEST pointer                    id=4    [slave  pointer  (2)]   ⎜   ↳ 2.4GHz RF  KEYBOARD  AND  MOUSE               id=11   [slave  pointer  (2)]   ⎜   ↳ DLL06AB:00 06CB:78F1                          id=13   [slave  pointer  (2)]   ⎜   ↳ SynPS/2 Synaptics TouchPad                    id=15   [slave  pointer  (2)]   ⎣ Virtual core keyboard                         id=3    [master keyboard (2)]       ↳ Virtual core XTEST keyboard                   id=5    [slave  keyboard (3)]       ↳ Power Button                                  id=6    [slave  keyboard (3)]       ↳ Video Bus                                     id=7    [slave  keyboard (3)]       ↳ Power Button                                  id=8    [slave  keyboard (3)]       ↳ Sleep Button                                  id=9    [slave  keyboard (3)]       ↳ 2.4GHz RF  KEYBOARD  AND  MOUSE               id=10   [slave  keyboard (3)]       ↳ Integrated_Webcam_HD                          id=12   [slave  keyboard (3)]       ↳ AT Translated Set 2 keyboard                  id=14   [slave  keyboard (3)]       ↳ Dell WMI hotkeys                              id=16   [slave  keyboard (3)]     I would love to have my track pad working and I've done some googling and browsing of this site and nothing I've tried has worked. Any input would be great. Let me know if there’s any other information that can help remedy this. I'm pretty new to Linux. Thank you very much.  Edit: I've updated the kernel to 3.19 and checked my Additional Drivers which had nothing for me. Neither of which worked.


I have a Wi-Fi dongle with the RTL8188EUS chipset. I'm using it to make a access point from a computer that has Windows 7. However, I have noticed that the dongle shuts off when 12 or more people are connected to it and I have to restart the hostednetwork.  When I do      netsh wlan show hostednetwork   it shows that the maximum amount of clients is 100.  Mode                   : Allowed SSID name              : "name" Max number of clients  : 100 Authentication         : WPA2-Personal Cipher                 : CCMP   Is there any way to reduce this number with the netsh command, does it require some additional work?  Thanks for answering.

I've set up a wifi hotspot on my computer using netsh commands.  I would like to know if it is possible to change the max number of clients ("netsh wlan show hostednetwork" shows maxclients=100).  I suppose it is using the command "netsh wlan set profileparameter" but I do not manage to use it.  Thank you for your help.


I don't know exactly if the terminal is the handler of keystrokes like CTRL + C or CTRL + D and many others or the shell.   When I press a keystoke I think about it this way, as the picture describes:     When a keystroke is pressed, the keystrokes is handled by the shell, the shell interprets the keystrokes and do whatever it needs to do, perhaps sending a signal when CTRL + C is pressed or clearing the screen with CTRL + L and so on. Therefore, the shell plays the role of the middle-man for the program's inputs. Inputs go from shell to the program's stdin.   The program's stdout goes to the shell, and the shell redirects the output to a terminal or files or pipes.   The terminal sends the shell the bytes of the pressed keys.   Am I right?

Suppose I press the A key in a text editor and this inserts the character a in the document and displays it on the screen. I know the editor application isn't directly communicating with the hardware (there's a kernel and stuff in between), so what is going on inside my computer?


Examining the A records for youtube.com (for example), I see only one IP address.  How can this be possible, given the volume of traffic they handle?  Do they use anycast with load balancers behind it?

Youtube as we know, is massive. It has thousand of concurrent users streaming at least 2 megabytes per video. Obviously, that gets to be a lot of traffic... far too much for any one server.  What networking technologies allow pushing


My machine is AMD A8 / RADEON R5 graphics  with WIN 7 and I want to add ubuntu in it (aim is dual boot machine)  when i tries to install ubuntu 17 its says System running low graphics mode

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'm doing exercise 17 in Atiyah-MacDonald, where I am proving that the prime spectrum of a ring is (quasi-)compact. I have shown that an open covering of sets $X_{f_i}$ for $i\in I$ for some index set $I$ implies that $f_i$ for $i\in I$ generates the unit ideal $(1) = A$. In the hint it is claimed that this means there is a finite combination of the generators $f_i$ which is equal to $1$, and I am having trouble proving this. Even on the Columbia stacks, this step is stated without much reason. Maybe I am just overlooking something simple. Here is my attempt at reasoning. We can create a chain of ideals by adding more and more of the $f_i$. Supposing that no finite combination of the $f_i$ is equal to $1$, we can create an infinite chain of ideals. Now, I imagine Zorn's lemma might come in handy here? But again, I would like to think there is a simpler way to resolve this problem.

In an exercise in Atiyah-Macdonald it asks to prove that the prime spectrum $\operatorname{Spec}(A)$ of a commutative ring $A$ as a topological space $X$ (with the Zariski Topology) is compact.   Now because the basic open sets $X_f = \{\mathfrak{p} \in \operatorname{Spec} (A) : \{f\} \not\subseteq \mathfrak{p} \}$ form a basis for the Zariski Topology it suffices to consider the case when   $$X = \bigcup_{i \in I} X_{f_i}$$   where $I$ is some index set. Then taking the complement on both sides we get that   $$\emptyset = \bigcap_{i \in I} X_{f_i}^c$$  so there is no prime ideal $\mathfrak{p}$ of $A$ such that all the $f_i$'s are in $\mathfrak{p}$. Now from here I am able to show that the ideal generated by the $f_i$'s is the whole ring as follows. Since there is no prime ideal $\mathfrak{p}$ such that all the $f_i \in \mathfrak{p}$, it is clear that there is no $\mathfrak{p}$ such that $(f_i) \subseteq \mathfrak{p}$ for all $i \in I.$ Taking a sum over all the $i$ then gives $$\sum_{i \in I} (f_i) = (1).$$  Now here's the problem:          How do I show from here that there is an equation of the form $1 = \sum_{i \in J} f_ig_i,$ where $g_i \in A$ and $J$ some finite subset of $I$?       This part has been giving me a headache. I am not sure if the finiteness bit has to do with algebra, topology or the fact that we are dealing with prime ideals.  This is not a homework problem but rather for self-study.  $\textbf{Edit:}$ I have posted my answer below after the discussion with Dylan and Pierre.


If time is like space, why entropy always increases with time  I should not be able to distinguish whether I am going forwards or backwards in time.   As entropy always increase with time. I can distinguish past from future in a four dimensional space-time.  Edit:  It looks like, it is an unresolved problem  There are some solutions  but nothing generally acceptable

From what I understand, entropy is a concept defined by the experimentalist due to his ignorance of the exact microstate of a system. To say the number of accessible microstates $W$ of the universe is constantly increasing is nothing more than saying 'ignorance begets ignorance'.  I have often encountered the argument of ever increasing entropy for the presence of an inherent time asymmetry, most prominently in the works of Penrose. It just doesn't seem to make sense.  Let us imagine alien beings who are experiencing time in reverse. For them, increasing ignorance is in the direction of our decreasing ignorance. So how can perpetual increase in entropy indicate an 'arrow of time'?  One possible explanation (I thought of) for this argument was the fact that there may never be a mechanism to reduce ignorance. I will pose this as a question:  An observer determines the number of possible microstates of system+observer to be $W_0$ at time $t_0$. After improving his measurements, can he (at a later time) measure $W'$ (where $W_0>W'$) as the number of possible microstates? Assume that all the microstates are equally probable in this case.  Unless the above in false in general, how else can anyone claim that entropy reveals an arrow of time?  EDIT: I am performing this discussion for isolated systems (the universe or it's parts if relevant). The means I propose to reduce entropy in the present, is by redefinition of macroscopic variables and of microscopic models used to count the number of distinguishable micro-states (that obviously yield the same macro-state). This is essentially an argument against the robustness of entropy via redefinition.


I found a unique index on (RetailerID, ID) in our database.  The ID column is the primary key so it's already uniquely indexed.  I can't see how an index on (RetailerID, ID) could help when looking up an individual record by RetailerID and ID (or just ID).  I suspect it might be helpful when querying all the IDs under a particular RetailerID, since it covers such a query.  Is that true?  But then why not just make the index on RetailerID include ID?  Perhaps the unique index on (RetailerID, ID) covers the query in the same way but performs better as a result of being a unique index.    As I said, there's a unique primary clustering key on ID alone.  There's also a unique index on (RetailerID, ID). Since ID is already unique, querying where RetailerID = x and ID = y shouldn't be any more efficient than simply querying where ID = y.  (ID) is unique and (RetailerID, ID) is unique, so ID is associated with at most one RetailerID.  Therefore, if a predicate has ID, then including RetailerID in the predicate is redundant.  The clustered index would always be faster.  An index on (RetailerID, ID) could be helpful for a query where the predicate is just on RetailerID and the select is on just ID, because it would cover the query, but for queries where ID is in the predicate, RetailerID in the predicate is redundant, and since it has no other included columns, it would be less-efficient than the clustered index when selecting any column other than ID.  That's why I'm not seeing the point of this index, given the predicates used (which always involve ID).

I inherited a project using SQL Server 2005.  Recently there were some performance problems and I started looking at the indexes, and found  _dta_index_survey_25_135059617__K1_K10_K19:     id ASC, sent_date ASC, group_id ASC   and  _dta_index_survey_21_364632442__K18_K1_K2_K9:     group_id ASC, id ASC, campaign_id ASC, sent_date ASC   which appears to be generated by some kind of automatic performance tuning tool.  I think SQL Server comes with something like that but I'm not familiar with it.  Anyway, id is the primary key, and what I'm trying to understand here is how it could possibly be beneficial to include the primary key within a secondary index... because you have to have the leftmost pieces of information to use an index and if you know id then you've got the row anyway.  Can someone explain why a tool would have generated these indexes and if there's any point in keeping them?  Just because the indexes are getting used doesn't mean they're a good design.  SQL Server is using the wrong indexes lately, and I'm trying to determine why. More specifically, queries against this table that ran in milliseconds a month ago are now taking multiple seconds.  The table is huge (4M rows), and growing steadily, but at the same pace it's been going at for years.  Almost every query joins across group_id or campaign_id.  Often both.  The application almost never specifically selects or sorts by the PK, but I could see how ID could be useful when comparing or merging lists of IDs within the database engine.  ... But id is also an identity column, and an index holds lists of row ids, so it still seems redundant to have the ID in the key when it's also in the index "buckets".  And the additional fields could still be covered by the index without being part of the key.  I discovered that (id, sent_date, group_id) hardly ever gets read.  Meanwhile (group_id, id, campaign_id, sent_date) is one of the hottest indexes.  Next I found that an index which I thought was pretty reasonable (campaign_id, sent_date, group_id, id) also has a index_columns_include of every other column in the table, and occupies more space than the primary clustered index on id!  (but it's also pretty hot...)  Surely I can replace it with a simple (campaign_id, sent_date, group_id)?


Set<String> uniqueSet = new HashSet<String>(list); for (String temp : uniqueSet) {     System.out.println(temp + ": " + Collections.frequency(list, temp)); }   Above is the java code that i got from one of the forum, the for loop was looking little mysterious, can some one please explain.

Consider:  List<String> someList = new ArrayList<String>(); // add "monkey", "donkey", "skeleton key" to someList     for (String item : someList) {     System.out.println(item); }   What would the equivalent for loop look like without using the for each syntax?


A database table can only have one primary key not two or more .. why is that so?

Can I have multiple primary keys in a single table?


My code is not working, how can I solve this problem? I want to receive mail on my Yahoo ID.  <?php   // the message   $msg = "First line of text\nSecond line of text";    // use wordwrap() if lines are longer than 70 characters   $msg = wordwrap($msg,70);    // send email   mail("faisalkhan00668@yahoo.com","My subject",$msg); ?>   The error:     Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\mail\mail.php on line 9

I'm using Windows Vista OS. PHP, MySQL as the database and Apache web server.  I want to send notification to those who want to join in my site. But the problem is when I click submit. It doesn't send anything to the email address of the user.  What to do you think is the best solution for this?  <?php $to = "recipient@example.com"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) {   echo("
Message successfully sent!
");  } else {   echo("
Message delivery failed...
");  } ?>


The Summation Identity is: $\dbinom{n}{r}+\dbinom{n}{r+1}=\dbinom{n+1}{r+1}$. Is there a way to prove the hockey stick identity with this?  Hockey Stick Identity: $\dbinom{n}{r}+\dbinom{n+1}{r}+\dbinom{n+2}{r} + \cdots + \dbinom{f}{r}=\dbinom{f+1}{r+1}$

After reading , the most popular answer use the identity $$\sum_{t=0}^n \binom{t}{k} = \binom{n+1}{k+1}.$$  What's the name of this identity? Is it the identity of the  modified.  How can we prove it? I tried by induction, but without success. Can we also prove it algebraically?  Thanks for your help.    EDIT 01 : This identity is known as the  because, on Pascal's triangle, when the addends represented in the summation and the sum itself are highlighted, a hockey-stick shape is revealed.


For example:  p = 5, q = 11, n = 55  $\phi$(55) = 40  e = 3, $\phi$(55) and 3 are relatively prime  m = 3, then: $3^3 mod(55) = 27$  m = 113, then: $113^3 mod(55) = 27$  I heard that e and $\phi$(n) have to be relatively prime in order for the encryption to give unique solutions, but it seems that even if they are, multiple values for m gives the same encrypted c value. Is this not a problem? Or am I missing something or doing something wrong? I am asking if it is a problem that multiple values of m give the same cipher text c.

I'm going to encrypt the characters Zhu, and decrypt them using RSA. I'm using the public key $\{e, n\}$ and private key $\{d, n\}$. The values of $e$, $d$ and $p$ I get from my textbook: $e = 17$, $d = 53$, $n = 77$.  It works fine when the number is smaller than 76, but in my example below, it doesn't work:  z = 90  h = 104  u = 107  e = 17 d = 53 n = 77  print z,h,u  c_z = z ** e % n c_h = h ** e % n c_u = u ** e % n  print c_z, c_h, c_u  p_z = c_z ** d % n p_h = c_h ** d % n p_u = c_u ** d % n  print p_z, p_h, p_u   The outputs are:  90 104 107 62 69 46 13 27 30     Do you have any idea what's going wrong?


If you have a graph with 1 node and no edges and you then remove this 1 node, is the remaining a graph with 0 nodes or is it not anymore a graph?  Alternative formulation: Is there something such as a empty null graph?

Standard definition of graph says that it is an ordered pair G=(N,L) where N is set of nodes and L is set of lines which connect the nodes.   From what I've read, the set L can be empty, but can set N be empty too?  I'm mainly asking this because for my exam, I found numerous problems that go like this: Graph X is given. How many subgraphs with property Y exist? Often the number depends on the definition of graph.


My Dell Inspiron 15R 5521 charger was stolen from my University desk.   I have an old (about 4-5 years old) HP charger of my previous HP laptop.   The Dell laptop on the bottom says: 19.5V and 3.34A / 4.62A.   The HP charger says on Output: 18.5V and 3.5A, 65W.   The plug fits fine. After I plugged it in, the laptop works fine, but the battery is not charging. On the battery icon (bottom right) it currently says "Plugged in, not charging".   I have talked with Dell and they said it might pose a risk to the motherboard and that I should buy an original adapter from them.   Can I use it temporarily or is it risky? Any help?   Thanks!!

I have a Toshiba Satellite laptop. My charger has stopped working.  I have access to a Lenovo charger. Can I use this charger on my laptop?


Acronyms and initialisms are almost always capitalized, think:  BBC HTML ASAP  etc. Sometimes though acronyms are not capitalized. Even the license at the bottom of this page is written as:  cc by-sa 3.0  which contains a few acronyms but is not capitalized. Is there a standard for acronym capitalization?

I'm writing a rather tehnical report with a lot of abbreviations such as QoS (quality of service), AES (Advanced Encryption Standard) and HMAC (Hash-based Message Authentication Code).  When should the explanation of the abbreviation be capitalized? For example, should it be quality of service or Quality of Service? How does one know what to use for the vast majority of technical abbreviations?


I have recently started using Ubuntu and I think it's better than Windows. The only problem is Skype, whenever I have to do a group video call or group screen sharing I still have to revert to Windows. My question is why does Ubuntu not support the latest version of Skype? Thanks for any help!   I guess my query is being wrongly interpreted. I already have Skype installed, the thing is there is no possible option for me to do group video call or group screen share. The interface itself resembles the times when Skype was newly born. While on Windows, Skype's latest version is around 6.(something), here it's only 4.3. In Windows group video call is now free on Skype, here I can't even do video call! I think this is a major drawback for an otherwise so good OS! Is there anything that can be done about it?

Note: The legacy Skype for Linux application (v4.*) is now discontinued and was removed from Canonical’s partner repositories, so this question and its answers are obsolete. Please refer to  of our .  Skype 4.3 is just released with considerable improvements. As a regular Skype user I want to use the latest Skype on my Ubuntu 14.04, but there is no updates from Update Manager. Even in Skype website only Skype 4.3 is available only for Ubuntu 12.04. Is there anyway to use this latest Skype on Ubuntu 14.04 or how much we have to wait for the update?


I did an upgrade of Ubuntu on WSL from 18.10 to 19.04 with do-release-upgrade.   $ cat /etc/os-release NAME="Ubuntu" VERSION="19.04 (Disco Dingo)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 19.04" VERSION_ID="19.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=disco UBUNTU_CODENAME=disco   But now I notice that repositories/sources.list are still pointing to cosmic.  $ grep -li cosmic /etc/apt/sources.list /etc/apt/sources.list* /etc/apt/sources.list*/* /etc/apt/sources.list /etc/apt/sources.list grep: /etc/apt/sources.list.d: Is a directory /etc/apt/sources.list.distUpgrade /etc/apt/sources.list.save   $ grep -li disco /etc/apt/sources.list /etc/apt/sources.list* /etc/apt/sources.list*/* grep: /etc/apt/sources.list.d: Is a directory    So I guess something must have failed during the upgrade that I didn't notice.   How can I dig out any upgrade errors and fix them? Where can I find the sources list for 19.04?

I am looking for the best method to restore /etc/apt/sources.list to default from the command line.  Is there no way to reference the source code of the package which generates this file or something like that? I want a trusted and version-independent way of restoring this file.  Solutions Ruled Out  Before you mark this as a duplicate, note that I have reviewed  already. It is only applicable if you have the Ubuntu GUI available. This question is specific to the command line.  I have also reviewed  where the accepted solution is someone pasted the contents of their sources.list file. This is not an appropriate way to restore the file as the intentions of the person providing the file contents cannot be verified and the file is subject to change with new releases.  I checked out the , but this is also not from Ubuntu so I do not plan to use it.


I have a requirement to convert two list into a dictionary. Just wondering if there is an easiet and pythonic way of doing it.  i can acheive that using the code below but wanted to know if this is the right way of doing it  a = ['1.1.1.1','1.1.1.2'] b = ['225.1.1.1','225.1.1.2'] d = {} for i,j in enumerate(a):     d[j]= b[i]  print(d)

Imagine that you have the following list. keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam']  What is the simplest way to produce the following dictionary? a_dict = {'name': 'Monty', 'age': 42, 'food': 'spam'}


I recently had somebody tell me that a mutual friend of ours who is  prefers that people refer to him/her using the gender-indefinite pronoun they.   In some cases, this almost seems okay:   Kris left their umbrella at our house.  On the other hand, if Kris is sitting right next to you, it feels very odd to say       They (meaning just Kris) would like more cake.   Or even odder,      Kris would like some more cake, can you please pass it to they/them?"   Are these usages grammatically correct? Are they in the process of becoming grammatically correct? Are there more correct alternatives?

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


Regarding tiny nonbreaking spaces, is there a difference between using a ~ (tilde) and using \, (backslash comma)? If so, what is the difference, in terms of length, properties, situations where you would use one over the other, etc.?

I know that \: in LaTeX produces a space when rendered.  Are there any alternatives, because my LaTeX renderer doesn't support \: (it renders it as text), and there is no help / FAQ that I can find.


I have two classes: public class Hello {     public static void main (String[] args)     {         Animal dog=new Animal();         dog.bark();     } }  and public class Animal  {     void bark()     {         System.out.println("Woof");     } }  When I put these 2 class in a same package, it compiles successfully. But when I create a new package called "samples" and put the class Animal into the new package, I modified my code into import samples.Animal;  public class Hello {     public static void main (String[] args)     {         Animal dog=new Animal();         dog.bark();     } }  and package samples; public class Animal  {     void bark()     {         System.out.println("Woof");     } }  and it shows error: Exception in thread "main" java.lang.Error: Unresolved compilation problem:  The method bark() from the type Animal is not visible at Hello.main(Hello.java:8)

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


What is the difference between the following approaches of placing a lock with concurrency?  public synchronized ArrayList<Player> getPlayers() {      return players; }  public ArrayList<Player> getPlayers() {      synchronized(players) {           return players;      } }  public ArrayList<Player> getPlayers() {      synchronized(GameHandler.class) {           return players;      } }   How do we decide which one should be used in which scenarios?  Edit:  I have edited my thread title and post to prove this is not a duplicate. Thank you.

Can any one tell me the advantage of synchronized method over synchronized block with an example?


I'm trying to understand the difference between S&P 500 trackers. Example:     SPY   IVV   VOO     They all have different prices (IVV being $1 more, on average than SPY, and VOO being about 50% of the others). Additionally in short observation today, IVV seems to be tracking more closely to the S&P 500.  Am I miss understanding the purpose of trackers -- surely they should all be pretty much tracking the S&P500?  Is there a good explanation of this somewhere?

From :     Exchange-traded funds (ETFs) that replicate the performance of the index are issued by The Vanguard Group (), iShares (), and State Street Corporation ().   If I look up the quote for each ETF, I get these prices:   VOO at $210.74 IVV at $231.16 SPY at $228.80   Why aren't prices closer to each other, if they all replicate the S&P 500 index? Is it because each ETF comes packaged with various non-S&P 500 stocks inside?


I am new in python programming for geospatial development. I want to create an app to allow users to click on a shapefile to get the data associated with that clicked point.   Which python libraries can I use?   and another suggestions to start in python programming for geospatial development?

With ArcGIS 10, Python has become the de-facto scripting language for ESRI. While leading Open source software like QGIS, GeoServer, PostGIS all supports Python. Thus it became important to know/learn Python for GIS developers a well as users.  Can anybody make a list of such tools/modules/add-ins in Python that are crucial in GIS?


I want to play a champion fighter and am considering whether or not to get the Great Weapon Master Feat which states:  Before you make a melee attack with a heavy weapon that you are proficient with, you can choose to take a - 5 penalty to the attack roll. If the attack hits, you add +10 to the attack’s damage.  If I take the -5 to attack roll and roll a critical hit, will that crit still be in effect, or will the -5 counteract that? Also, in the event that I do crit with a -5, would I add the +10 damage before, or after I double damage, like with other modifiers. It doesn't say that the +10 is a modifier specifically, so I was a bit confused (note: for critical hits, my group usually has house-rule to double the damage and then add modifiers instead of the normal double dice.)

My apologies if my unfamiliarity with the rules makes this an easy question to answer...  I am considering taking Great Weapon Master, but was curious how this would affect my critical hits. I am currently a level 20 Half-Orc Barbarian, meaning that when I land a crit, I can add a bunch of extra damage dice (I believe I am able to add 3 extra dice from Brutal Critical, and Savage Attacks allows me to add another extra die).  However, how are critical hits affected by Great Weapon Master? If I take the -5 penalty before rolling, and then roll a nat 20, will the critical still hit, AND will I then get to add the extra +10 to damage dealt? Or would the roll become a 15, thereby negating the critical hit altogether?   states:     Before you make a melee attack with a heavy weapon that you are proficient with, you can choose to take a -5 penalty to the attack roll. If the attack hits, you add +10 to the attack’s damage.   This becomes even more important given the other feature of Great Weapon Master:     On your turn, when you score a critical hit with a melee weapon or reduce a creature to 0 hit points with one, you can make one melee weapon attack as a bonus action.   So how does Great Weapon Master affect critical hits?


I'm thinking about the scenario of using a set of (potentially untrusted) hosts to store (potentially private) files. Think something like distributed backup where you contribute some disk space and in exchange you get to store N copies of your data in other nodes. The issue is how to combine key management + deduplication and I saw the following approach somewhere which looked really promising:   split up the data in fixed-size chunks (not really a necessity, just makes the balancing of the storage simple) hash the chunk using SHA-512 for example using the hash as key, encrypt the chunk and store it   The idea is that if two people have the same data (like "kernel32.dll" for a particular version / patch level of Windows for example), they will independently come up with the same chunks and the data will be deduplicated without them having to coordinate. At the same time if you don't have access to the data, you can't compute the key (hash) and thus this is usable for private data also.  Do people see any problem with the security of this scheme?

Recently a company called  demonstrated a product of cloud storage. they indicated that they would use "Convergent Encryption" to secure your data and de-duplicate, essentially one copy of the same file between users.  From what I can read on a  about Secure Data Duplication which makes mention of "" and assuming this is what this is referring too.  My question is, what security implications of using this technology and is it truly secure that you cannot get the key based on chunk data being used to generate different keys between users.  Reference interview on


i want to create search suggestion. input type is created in this way:

           title

        <input type="text" class="signup_searchType">

    my jQuery function to find key up is:  $('.signup_searchType').keyup(function(event){   $.ajax({url:"http://localhost:8000/auth/search/",success:function(result){         id=event.target.id;         var parent=event.target.parentElement.parentElement;         var add=parent.getElementsByClassName('signup_suggestion')[0];         add.style.display='block';         var child=add.firstChild;         while(add.firstChild){             add.removeChild(add.firstChild);         }         for(var i=0;i<Object.keys(result).length;i++){             var div=document.createElement('div');             div.innerHTML=result[i];             div.className='signup_oneSuggestion';             add.appendChild(div);         }     }}) });   and my jQuery click function is:  $('.signup_oneSuggestion').click(function(event){     console.log('click'); });   when i type in search type search suggestions appear but when i click on them does not print anything in console.

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.


A little ago, I found  in the review queue. The asker is reporting a bug he found in the android SE app.  The suggested edit proposed to add a second tag to the question to indicate that the bug seem to be present on the IOS app too. I approved the edit and added that info to the question.  Soon after, an user on the Tavern chat room made me notice that this way the staff can't actually mark the bug as fixed until both app are fixed. I am left now wondering... what is the preferred way to handle this situation? Have two copy of the question, each one referencing to one app?   I am especially interested in any info that can provide indication about the staff preferences, ie - finding the posting pattern that is simpler for them to manage.

If I see a bug in Android app and the same bug is in iOS app, is it recommended to create two separate bug reports for  and ?   Or can I create a bug report just for  and add some note in the post that states the same issue is in iOS app too?  Note: I got this question after seeing the comments of this


According to Newton's third law of motion, every force have an equal and opposite reaction. So, using that law, is there a reaction of gravitational force that acts in the opposite direction and is repulsive? If you throw a ball towards the ground, it would bounce up to a certain height. This bounce happens in opposite direction and is repulsive, so is it a clue that repulsive gravitational force exists?

Is  (i.e. repulsive gravity) possible in string theory?  I have read some articles about scientists making assumptions about the existence of anti-gravity, but is it possible in string theory?


Can someone explain me why "pyt11" take "yes" If I type it manually but if I take it from Scanner and put String "a" that doesn't see my variable.  From pyt11(a) (If I type "yes" in Scanner) gives me b value 0.  From pyt11("yes")   gives me b value 20.  Someone knows why ?  public static Scanner into; public static void main(String[] args)  {     into = new Scanner(System.in);     String a = into.nextLine();     System.out.println(a);     System.out.println(pyt11(a));     System.out.println(pyt11("yes")); } static int pyt11(String odp11)  {      int b = 0;     if (odp11 == "yes")     {         b = 20;     }     else if (odp11 == "maybe" || odp11 == "partially")     {         b = 10;     }     else if (odp11 == "no")     {         b = 0;     }     return b;  }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


This specific issue isn't tied to just Ubuntu, It seems to effect a whole range of distributions. As I use Ubuntu as my main OS I ask this question here.  The issue is to do with soft locks and constant freezing I can't quite work out what the issue is. It may be a kernel bug, or it might just be tied to specific CPUs.  I've ruled out the possibility of it being my hardware, my brand new laptop has the exact same issue, and so do my older 1151 socket computer.  This issue doesn't seem to happen on my spare core 2 duo machine that I've used with Ubuntu for some time.  Both my desktop and laptop have different processors and different graphics cards, one being a AMD R7 360 and the other being integrated so it can't be graphic driver related.   My desktops CPU is a Haswell 1150 LGA Intel Core I3 4170. My laptop has a baytrail can't remember the rest, but it's a Intel pentium.  Completely ruled out ram as being the issue two, tested ram on both the laptop and desktop, put new sticks in. Hard drives have been tested, replaced them not long ago as general maintenance.  These freezes happen at random, and always require a hard reset, or they mouse just jumps very slowly than freezes.  I was thinking it could be the hard drive, as the hard drive light usually stays red before the lockup, but it's a brand new SSD and windows seems to work absolutely fine, and even happens with a LIVE USB with the hard drive taken out.  Older Linux distros like puppy linux don't seem to have this issue on either of my hardware, so I'm tying it to a kernel bug.  I surely can't be the only one with this issues, is there any known fixes for this? updating the kernel doesn't really do anything other than improve performance.  Only difference between the two computers is that, desktop seems to freeze randomly every couple hours, while my laptop would be anywhere from 10 minutes, to an hour.  I should add I think its related to this.

My system freezes completely at random, frequent intervals. I started to have the same problem in Ubuntu 14.04 but after recent upgrade to 16.04 there is no improvement, in fact it seems worse.  When it happens, it's impossible to do anything. I've tried everything in this thread:  but nothing works, I have to hard reset. I have read all the system logs and journalctl but there is never any information that could help diagnose the problem.  This is a dual-boot system with Windows 10 and there's no problem there, so it's not defective hardware.  My laptop has an Intel Bay Trail processor (Pentium N3540)


I am working on a java program and I need to store some integers starting from 0 to 16 as  00, 01 and so on...  Now when I store '09' for 9 or '08' for 8 it starts giving me error.  From   and  question I know that it is octal notation.  My question is :  IS there a way to store 08 or 09 in integer in JAVA?  I HAVE to store numbers as 00, 01 .. only what is alternative?  Thanks a lot!

Is there a better way of getting this result? This function fails if num has more digits than digits, and I feel like it should be in the library somewhere (like Integer.toString(x,"%3d") or something)  static String intToString(int num, int digits) {     StringBuffer s = new StringBuffer(digits);     int zeroes = digits - (int) (Math.log(num) / Math.log(10)) - 1;      for (int i = 0; i < zeroes; i++) {         s.append(0);     }     return s.append(num).toString(); }


Situation  Let's say my organization does pro bono work for company X - a non profit  I pay 3 employees Y amount and can write that off to the Federal Government  Question  I'm in a pass-through LLC, will I still be able to pay myself? Assume that all employees including myself get equal pay.

I have spent 20 hours building a family member a website. While I am not actually sending them an invoice and having them pay it, I did spend billable time on it that I could had spent on paying clients. How would I create an invoice, and categorize it so that the time I spent is categorized as an expense?  So for example my hourly rate is $100, and I spent 20 hours, so I have $2,000 that I need to mark as an expense.  Any help would be greatly appreciated.


I was thinking about what would be necessary to change to have a different value for $c$ (speed of light in vacuum, or speed of anything massless, or the one that seems most fundamental to me: he maximum speed of 'making stuff happen elsewhere').   And, if $c$ was different, what that would change about the universe?  From Maxwell (I think): $c = {1}/{\sqrt{\mu_0\,\epsilon_0}}$. Where: $\mu_0$ = permeability of free space ('how easy it is to magnetise free space'?) and $\epsilon_0$ = permitivity of free space ('how strongly free space resists an elecectrical field'?) (I know those definitions are very simplistic, and please tell me if they're wrong.)  Which means $c$ is inversely proportional to how easy it is to  magnetise free space, and inversely proportional to how difficult it is to create an electric field in free space. (Ie, directly proportional to how easy it is?).  My initial question was: Is there a plain English explanation for why the speed of light (or the speed of causality?) is related to these two properties, and why it's inversely proportional to how easy it is to  magnetise free space and to how difficult it is to create an electric field in free space? (Or, do you just have to do the maths?!)  (With a slightly hurty brain I wondered if a comment from Emilio's link answered this: "The stiffer the [medium] is (more energy to squeeze), the faster the wave. The more inertia, the slower the wave")  BUT as PM2Ring explained below, $c = {1}/{\sqrt{\mu_0\,\epsilon_0}}$ is just the way that EM waves behave in the universe, so this original question of mine was flawed from the outset.  Part 2 of my question was if $\mu_0$ and $\epsilon_0$ were different and $c$ was slightly larger/smaller), what would the universe look like? And would the wheels fall off the apple cart if that were the case? Would I still be here to ask this question? (Ie, specifically thinking about $\mu_0$ and $\epsilon_0$, but now that i know they are not what defines $c$, that question is also moot.) I do think it's an interesting creative exercise to image a universe with $c$ = a million times as fast, or only the speed of a cart horse, though!  So my understanding (thanks to wonderful explanations below) is that: $c = {1}/{\sqrt{\mu_0\,\epsilon_0}}$ is how EM waves behave in our universe $\alpha = \frac1{4\pi\epsilon_0} \frac{e^2}{\hbar c} \approx \frac 1{137}$ is a happy coincidence. ('Happy' in that it allows wheels stay on apple carts, stars to form, and me to ask this question.)  And as for why $c = c$, the best answer might be it's a fundamental part of our universe, and no-one knows why that's the case.  If those answers look right, I'll change this to question answered.

Meaning, why is it the exact number that it is? Why not 2x10^8 m/s instead of 3? Does it have something to do with the mass, size or behavior of a photon? To be clear, I'm not asking "how we determined the speed of light". I know there isn't a clear answer, I'm really looking for the prevailing theories.


I have a outcome variable that is a percentage (proportion).  According to this, I should probably use a logistic regression:  My goal is interpretation and my goal is to interpret actually only a single variable.  So for example, Y = X1 + X2 + X3 + X4, I only care about the coefficient of X2. Now, because my Y is actually a percentage and NOT a binary value, how would someone use a logistic regression to solve this problem?  It doesn't make sense to transform my Y to 0s and 1s with a threshold of 0.5, partly because the range of Y is between 0 and 0.3 and Y is not a binary variable.  It is literally a proportion (think how full a glass of water is) and so something binary just doesn't make sense. Is there a way to transform Y to fit a logistic regression?  How would one model such a proportion? Thanks!

Although I saw a few similar threads, I don't believe I saw the specific answer to the following question:  For simple linear or multiple linear regression, if your dependent variable is a percentage, are any assumptions violated?  I know that Y should be continuous, but does it also technically have to be unbounded?  I've never seen this listed as one of the assumptions, though I understand how a bounded dependent variable can cause specific issues.    In my case, I'm doing a multiple regression project for school where the dependent variable is percentage of obese schoolchildren.  Should I do a logit transformation or beta-regression because Y is bounded?    In response to a comment: the kernel density plot for Y(pct_obese) is below:  It doesn't seem that there is bunching at the boundaries--rather, the bulk of the data hovers around 20%:


I have seen this done, and it probably has a name or another way of describing it that I have not thought of, but I cannot find information about it on the internet.  When stopped at an intersection, some cyclists will turn their front wheel to the side, and it seems to help them stay on the bike while the bike is not moving forward. Unless I'm imagining things.  I'd like to know how to do this, how it works, etc.

I want to be able to do a . I can almost come to a halt on my bike without taking my shoes out the cleats - but not quite.   In theory, on a  it should be easier, but I can't quite manage to maintain position, I always find myself rolling forward.   So I'm looking for snippets of advice, without being able to see what I'm doing wrong, can anyone tell me something to do right so as to perform a decent track stand; on either a free or a fixed hub, advice for either is fine.   What's your secret?  I promise that I'll go out and practice somewhere quiet ...


I am using qgis 2.16.1. When I change the projection (using Layer>Set CRS of layer(s), the map disappears. I have attempted to recover the map by changing back to the original projection with no success. How can I change the projection and maintain a visible map?

My QGIS project has two layers, one layer is retrieved by Google layer plugin which fetches the static Google map image whose CRS is +proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +units=m +no_defs and another vector layer is a postgis layer whose CRS is +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs.  I digitalized some polygon features from Google Layers and added it to the vector layer. However, QGIS seems do not make the automatic CRS transformation. How can I change its projection?   Thanks


How do companies get their money from being on the stock market?  I understand the reason a company will list is to raise capital.  Who gives them this money? The stock market is between buyers and sellers themselves right ? So how do companies get their capital?

I am interested in the mechanisms which a company can use the money that investors give them when they buy a public stock since they are being bought and sold constantly. How can a company spend other people's assets when the shareholders still own their stocks and they still retain a liquid value? To me it seems like stocks are a case of "having your cake and eating it too".


My command is something simple: /tellraw @a {"text":"Test","clickEvent":{"action":"run_command","value":"/scoreboard players add Jimmy test 1"}} The issue is that if a non-operator clicks on this text the command will not run. This question was asked for 1.12, but the /trigger command was removed, meaning those answers don't apply to the answer for this question. So, in 1.13+ Minecraft, how can I get around non-operators being unable to use the clickable text?

Is there a way that a non-op player can click a clickEvent command in the book he is given but not be able to do any other commands?


During updating BIOS to the new version (1.18) I got an error that computer can't read rom file. Then after reboot server did not start. Actually it starts but does not show anything, screen is blank, no system beeps or led signals.  The question is, how can I recover it? I can't find any information about.

While attempting the update the BIOS on an Asus motherboard, i learned the Asus Update Utility for Windows doesn't fully support Windows 64-bit.  It was able to erase the BIOS without problems, but failed to write the new BIOS. i knew that when i next rebooted the computer: it would be a brick.  When i rebooted the computer, it was a brick. But before i rebooted i transferred the bios backup, the new bios, and Asus DOS-based flash utility to another computer. Now the problem is how to fix it.  This Asus motherboard has a fail-safe bios recovery called Crash Free BIOS, where you put in a floppy or USB stick containing a file called p5b.rom and it will restore the bios from that file. But that doesn't work.  Is there any way to unbrick the machine?


I have two fields of multiple values. When I print render($content['field_photo']) and render($content['field_photo_caption']) I get:
caption

caption

caption
   How do I nest the values to get:
caption

caption

caption

In Drupal 6 I used to make every sort of customised markup for CCK fields with multiple values. Usually this happened when I wanted to lay out thumnails for a gallery inside a table: I used to go into the relevant tpl.php file, grab the relevant $field_fieldname variable, loop through it, and print out the 'view' key for it, which contained the styled thumbnail, often linked to the original image and whatever.  Now, I'm a bit confused on how this should be done in Drupal 7. For now, I set up a suboptimal solution that goes like

     <?php foreach($content['field_gallery'] as $k => $v) : ?>         <?php if(is_numeric($k)) : ?>             <?php echo render($v) ?>             <?php if((($k+1) % 4) == 0) : ?>

             <?php endif ?>         <?php endif ?>     <?php endforeach ?>

   but it's obviously wrong. I can't seem to get my head around this, even after having read lots of docs about the Field API and theming for D7. Ideas?


I noticed that after I log into SE I am automatically logged into most of the communities that I am a member of, but not all. Ask Ubuntu, for example, requires me to sign in again, but doesn't have the option to simply use my SE credentials. I'm not sure if there is something I missed, or some trick to logging in that would actually log me in to all of my communities.  Basically, I go to my communities page, select Ask Ubuntu, and I'm taken to my user profile, but I'm not logged in. Therefore, it would seem that the profiles are linked, so why not log me in to all communities associated with my SE profile?

When moving around the sites on Stack Exchange using Safari on my iPad (not the Stack Exchange App), I am fine when moving to any site other than SuperUser.  When logged in, I can switch sites and stay logged in, but when I switch to Super User I need to log in again. If I choose not to log in and switch to another site, I am logged in there. Is there a problem with the login handling for Super User? If it helps, I log in with a Stack Exchange account, not through Facebook or Google. Update After getting fed up with the problem, I took the advice given in the answer below which was to use Chrome, and the problem still exists. The same goes for Firefox. Have I missed something?  As you can see from the screenshots below, there are no cookie settings to be found. Chrome for iOS settings page  Privacy settings page  Content settings page  Google app settings page


Background: In Bash, $# represents the number of arguments, and # starts a comment.  Consider the following Bash script:  # This is a comment while [[ $# -gt 0 ]]; do     echo $1     shift done   Note that the syntax coloring by StackExchange here is incorrect! The # in $# is being treated as a comment marker.  Vim, for example, gets it right:    Can the StackOverflow syntax highlighting engine be improved to fix this?  (This is a partial .)    Keywords because searching for symbols is a pain: dollar hash, dollar octothorpe, dollar pound, dollar number.

I noticed that sometimes my code gets highlighted in different colors when rendered.   What is syntax highlighting? How does it work? Why isn't my code being highlighted correctly? How do I report a bug or request a new language? How do I use syntax highlighting? What languages are currently available on Stack Exchange?


Running my app I get this exception:  java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.view.inputmethod.InputConnection.finishComposingText()' on a null object reference         at android.view.inputmethod.InputConnectionWrapper.finishComposingText(InputConnectionWrapper.java:78)         at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:362)         at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)         at android.os.Handler.dispatchMessage(Handler.java:102)         at android.os.Looper.loop(Looper.java:145)         at android.app.ActivityThread.main(ActivityThread.java:5951)         at java.lang.reflect.Method.invoke(Native Method)         at java.lang.reflect.Method.invoke(Method.java:372)         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)   The problem is that this is not called directly from my app code. One or two seconds after my activity started I get the exception.   What could be causing it?   does not solve my question since I do not use the InputConnection anywhere in my code.

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 tried some values and I think I got the idea. R is the set of values used in the ring. If I use $\mathbb{Z}$, the units are $\{-1,1\}$. If I take 1 for example, I could use it to get every value in $\mathbb{Z}$ with $(1) = \{r * 1 |r\in \mathbb{Z}\}$, such that $(1) = \mathbb{Z}$ However, I don't know how to prove that formally.

Q: Let R be a commutative ring with unity. Prove that if A is an ideal of R and A contains a unit, then A=R.  This is my attempt at an answer: It suffices to show that all the elements in R are in A.  Let a be and element of A, and r be an element of R. Since A is an ideal of R then all elements ar and ra must be in A.   We know that A has a unit say 1, then we know 1r and r1 for all r in R, are in A.  Thus all elements in R are in A, therefore A=R.


I try to connect with my custom USB Device. I've done everything step by step with android doc but I still get null pointer at connection object. Here's my activity:  protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);         PendingIntent mPermissionIntent = PendingIntent.getBroadcast(this, 0, new Intent(ACTION_USB_PERMISSION), 0);         IntentFilter filter = new IntentFilter(ACTION_USB_PERMISSION);         registerReceiver(usbReceiver, filter);      usbManager = (UsbManager) getSystemService(Context.USB_SERVICE);     HashMap<String, UsbDevice> deviceList = usbManager.getDeviceList();     Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();     while (deviceIterator.hasNext()) {         UsbDevice device = deviceIterator.next();          if (device.getVendorId() == 1659 && device.getProductId() == 8963) {             this.device = device;             usbManager.requestPermission(device, mPermissionIntent);             Toast.makeText(MainActivity.this, "vendor: " + device.getVendorId() + "ID " + device.getProductId() , Toast.LENGTH_SHORT).show();             break;         }     }   And this is how I try to connect with USB device :  mTestButton = (Button) findViewById(R.id.button);         mTestButton.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 usbInterface = device.getInterface(0);                 if (connection != null) {                     connection = usbManager.openDevice(device);                     connection.claimInterface(usbInterface, false);                  for (int i = 0; i < usbInterface.getEndpointCount(); i++) {                     UsbEndpoint end = usbInterface.getEndpoint(i);                     if (end.getDirection() == UsbConstants.USB_DIR_IN) {                         usbEndpointIn = end;                      } else {                         usbEndpointOut = end;                     }                 }                  //SEND START COMMAND TO  THE USB DEVICE;                 int result = connection.bulkTransfer(usbEndpointOut, "START".getBytes(), "START".getBytes().length, 1000);                 Log.e("SEND RESULT", result + "");                   //START READING in run method                 readThread = new Thread((Runnable) MainActivity.this);                 readThread.start();              } else {                 Toast.makeText(MainActivity.this, "Connection is null", Toast.LENGTH_SHORT).show();             }   But connection is still null :/ Help, please.


I am currently working on a project and am getting a NullPointerException and can't find the location/source of the exception. The code I have used is:  public static void AccessAccount(){     try{         System.out.println("Enter your card number to access your account:");         int CardNumber = sc.nextInt();         String CardNumberStr = Integer.toString(CardNumber);         boolean Exist = false;         String LineNo;         String [] CardNum = {};         int Counter;         FileReader fileReader = new FileReader("VirtualATM.txt");         BufferedReader bufferedReader = new BufferedReader(fileReader);         line = bufferedReader.readLine();         CardNum = line.split("\\s+");         do{             for(Counter = 0; Counter < CardNum.length; Counter++){                 LineNo = CardNum[Counter];                 if(LineNo.contains(CardNumberStr)){                     Exist = true;                 }                 else if(Counter == CardNum.length){                     Exist=false;                 }             }             //add this line to read another line of the file             //and check if it exists             line = bufferedReader.readLine();         }while(!Exist && line != null);         System.out.print("Enter your pin: ");         int EnterPin = 0000;         try{             EnterPin = sc.nextInt();         }catch(InputMismatchException e){             e.printStackTrace();             System.out.println(e.getMessage());         }         boolean pinTrue = false;         String EnteredPin = Integer.toString(EnterPin);         line = bufferedReader.readLine();         String [] PinSearch = {};         PinSearch = line.split("\\s+"); /**** LINE 146 IS HERE***/         do{             for(int search = 0; search < PinSearch.length; search++){                 String SearchForPin = PinSearch[search];                 if(SearchForPin.contains(EnteredPin)){                     pinTrue = true;                 }                 else if(search == PinSearch.length){                     pinTrue = false;                 }             }             line = bufferedReader.readLine();         }while(pinTrue == false && line != null);         bufferedReader.close();     }catch(FileNotFoundException e){         e.printStackTrace();         System.out.println(e.getMessage());     }catch(IOException e){         e.printStackTrace();         System.out.println(e.getMessage());     } }   The error given is as follows:  java.lang.NullPointerException     at VirtualATM.AccessAccount(VirtualATM.java:146)     at VirtualATM.RegisterNewCard(VirtualATM.java:95)     at VirtualATM.main(VirtualATM.java:35)   If anyone could help me find the source of the problem, that would be great.


How can I set the taskbar (Ubuntu dock) to show applications running in the current workspace only? Currently clicking on it shows all the different locations where the application is running.    Here, 2 Firefox windows are running in different workspaces, so I do not want all of them being displayed in all workspaces.

I would like my Dock to show only the windows of the current workspace. Especially in the little preview window. I find it very confusing to jump around workspaces when trying to find the right window.


If you have seen 'avengers:age of ultron' there is a scene where scarlette witch shows stark what will happen in the future if he takes the scepter but at the top of the steps where all the avengers lay dead is the hulk but my intensions were that the hulk couldnt die as in the first avengers fury tells agent romanoff to escort dr banner to his room and then he says something about the cell was there just incase and then banner turns and says 'what incase you needed to kill me? Well you cant, i know because i've tried' anyone have any suggestions on this??

In  some users pointed out that the Hulk cannot age or ages really slow in relationship with normal people, which makes him an immortal.  But my question is this: Can he die in a battle?


I have a String[], and a String parameter. I have tested it with other String[] and String, it returned true. However, this one is saying false.  // toFind is a parameter of a function(defined as a String), and fileName is String[]  System.out.println("toFind length is " + toFind.length() + ", fileName length is " + fileName[i].length()); System.out.println(toFind + ", " + fileName[i]); System.out.println(toFind == fileName[i] + "\n");   toFind length is 19, fileName length is 19 lab.filestrdesc.txt, lab.filestrdesc.txt false   I know it is not supposed to say false, but it does.. how can I fix it?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I know these questions might have been asked somewhere but their solutions don't really work. I need help. I want to add a variable to a directory name then change directory to it. The approach below did not work for me. #!/bin/bash targetVmwareVersion="15.5.6" cd vmware-host-modules-workstation-$targetVmwareVersion  If I replace cd with ls, it lists contents of the folder on the terminal but the cd does not work. I want the targetVmwareVersion to be concatenated after the name vmware-host-modules-workstation- then change directory. I have tried the approach below but it didn't work. #!/bin/bash targetVmwareVersion="15.5.6" path="vmware-host-modules-workstation-$targetVmwareVersion" cd $path  The cd part does not work. The directory does not change. . ./script does not work for me. The snippet above is part of my large script which depends on that snippet to proceed.

I want to run a script to simply change the current working directory:  #!/bin/bash cd web/www/project   But, after I run it, the current pwd remains unchanged! How can I do that?


I use LaTeX on a computer running Ubuntu Linux 14.  To install , I can do   apt-get   I could determine that 'standalone' extension is included in the 'texlive-latex-extra' package by   apt-file search standalone.sty texlive-latex-extra: /usr/share/texlive/texmf-dist/tex/latex/standalone/standalone.sty   and then  sudo apt-get install texlive-latext-extra   Or   Use tlmgr   Install the package using tlmgr:  tlmgr update --self --all tlmgr install standalone   Is one method preferred than the other?

I installed TexLive through Software Center of Ubuntu. However it does not contain tlmgr which is quite useful to update the packages.  Is it possible to use tlmgr with default TexLive? If yes, how can I only install tlmgr (without installing TexLive 2011)? I ran install.pl script in the downloadable TexLive 2011 installer folder, but I could not find a way to install only tlmgr.  Thanks.


I have a set of keys, lets say  mykeys = ["I", "II", "III", "IV"]   and a set of values, let's say  myvalues = [1, 2, 3, 4]   I now want to create a dictionary like this  {"I": 1, "II": 2, "III":3, "IV":4}   What is the easy (and, if possible, idiomatic) way to do it in python?

Imagine that you have the following list. keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam']  What is the simplest way to produce the following dictionary? a_dict = {'name': 'Monty', 'age': 42, 'food': 'spam'}


I am attempting to make a class which can take a string with an image path and set it as this objects image. I have done it manually before, i.e. creating a new class with an extends main class, but this will get out of hand quickly. Here is the code I have so far:  import java.awt.Image; import java.net.URL; import javax.swing.ImageIcon;  public class Sprite { private int x;     private int y;     private ImageIcon ia;     private URL loc;     private Image image;  public Sprite(int x, int y) {     this.x = x;     this.y = y; }  public Sprite(int x, int y, String imgLoc) {     this.x = x;     this.y = y;      URL loc = this.getClass().getResource(imgLoc); //problem area is here     ia = new ImageIcon(loc); //and here     image = ia.getImage();     this.setImage(image); }   When I had a child class, It worked in the child classI put in something like this:  public class Dude extends Sprite {    public Dude (intx, int y) {       super(x, y);        URL loc = this.getClass().getResource("images/dude.png");       ia = new ImageIcon(loc);       image = ia.getImage();       this.setImage(image);    } }   But when I try to use the second Sprite Constructor, it gave me an  Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException     at javax.swing.ImageIcon.<init>(ImageIcon.java:217)     at Sprite.<init>(Sprite.java:26)   Any suggestions on how to fix this?

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?


First a minimal working sample is as following:  \documentclass{amsart} \usepackage{txfonts}  \begin{document}  \end{document}   Goal: I want a math symbol which is like a circle but misses a left part as in the following picture. Any help is welcome. I hope it has the same line weight and size as \medcirc in the txfonts package.

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


How can I select multiple objects and spread their origins apart from each other without scaling the objects themselves? I have several fragments of a shape that I want together at the first keyframe and all of the pieces separated at the last keyframe. I don't want to use the logic engine to do this. Is this possible?

I want to separate two objects along an axis, but without scaling them. I already tried S X in local mode, but it didn't work.


Is it possible to overload the meaning of different keywords in Python? I'd like to implement my own version of if and for etc.

Can you add new statements (like print, raise, with) to Python's syntax?  Say, to allow..  mystatement "Something"   Or,  new_if True:     print "example"   Not so much if you should, but rather if it's possible (short of modifying the python interpreters code)


I created a website one year ago and a friend joined me on the project seven months later. So i worked one year on it and he worked four months.  I searched on many website to understand the differences between the two words but i still not sure.  I would like to know if :   - i am the founder and he is a developper ?  - i am the founder and he is the cofounder ?  - i am a co founder and he is a co founder too ?  - or anything else  Thanks

What is the correct term to use, or what is the difference between the two?  For instance, if you describe yourself as a founder in a resume it sounds like you founded something alone. In plural form (founders), it suddenly seems more like co-founders - that you didn't do it alone. But I don't know if co-founder alone maybe sounds as if you didn't have a leading role in the founding part.   Hope anyone can clear up my confusion here! Thanks  CC (From Denmark - if the grammar isn't perfect I apologize in advance ;)


What will be the summation of this Series  $$\binom{10}{1} + \binom{11}{2} + \binom{12}{3} +\cdots+\binom{10+n}{n+1}$$

What is the sum of number of ways of choosing $n$ elements from $(n+r)$ elements where $r$ is fixed and $n$ varies from $1$ to $m$ ? Can this be reduced to a formula ?  $$ \sum ^m _{n=1} \binom{n + r}n $$


I am trying to create a menu-driven application that uses If-Else statement. Unfortunately, it always results in the Else or Exit message. What's wrong with my code? Thank you! package com.company; import java.util.*; public class Main {      public static void main(String[] args) {         Scanner console = new Scanner(System.in);          System.out.print("""                 Good day!                                                          Get to now Java programming language!                 Please enter the letter that corresponds to your choice.                 A. What is Java language                 B. How to display a message                 C. How to get users' input                 E. Exit the program                                                          Choice: """);         String choice = console.nextLine();          while (true) {             if (choice == "A") {                 String WhatIs = "Java is a Object-Oriented Programming Language \n";                 System.out.println(WhatIs);              } else if (choice == "B") {                 String display = "Just use System.out.println \n";                 System.out.println(display);              } else if (choice == "C") {                 String GetUser = "Import the package and use the Scanner method \n";                 System.out.println(GetUser);              } else {                 String Exit = "Thank you for using this application.";                 System.out.println(Exit);                 break;             }         }     } }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I am Malaysian. I will transit for 15 hours through Heathrow airport. Where can I rest? Do I need a visa to go outside the airport?

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


I am of the opinion that too many questions are being deleted, particularly those that are duplicates. It seems some people don't even blink when deleting a question with 10 or 20 answers, some of them very good, just because there's an exact duplicate.  I believe Jeff has previously stated the duplicates can be useful for providing more pathways to the answer. Sometimes people ask the same question in a sufficiently different way that the original isn't found so that link is created.  That somewhat contradicts the view that closed questions are one step away from being deleted. I'm not sure if this is the official stance or it has just come about.  I figure we can clarify this by requiring a delete reason. Unless a duplicate has no real answers whatsoever it should pretty much be left alone (imho). There's no harm in it being there and perhaps we can get some clarification on when are the right times to delete.  Edit: Ok, example was requested. Here's one: . The timeline was:  Someone posted  (now merged so original is gone). But the text was:     I'm a member on several forums that   have a subforum dedicated to   programming questions.      It is an observation that to almost   every single question about finding   data in strings, the most common   answer is "use regular expressions".   And if you're lucky, a link to a   tutorial.      For many situations that people will   generally recommend regular   expression, it's pure overkill.      Many things can be done with   substring() and split() functions, yet   people always seem to put regular   expressions on a throne. Why is this?    Does this have something to do with   the history of regular expressions   versus these OO-language functions?   Are the people who recommend regular   expressions old farts?      Why in the name of the Matrix should I   use a regular expression and test it,   to see if a string contains a question   mark, if I can just do   string1.contains("?");      While in some cases, such as form   validation, regular expressions are   useful, I find that in most cases I   don't need them.      So how often do you use regular   expressions, not because it's useful,   but because it's what you're used to   using.      EDIT: if you're gonna vote to close   this, at least have the decency to   make a comment as to why!   So until (iirc) Marc intervened, 13 answers had been unceremoniously deleted for something that would've taken one of those offended by the question two minutes to fix. It's that cavalier attitude with deleting content and those taking personal satisfaction in it that I'm hoping to temper (shog9: "I don't regret the outcome. Indeed, it ended far better than i could have hoped for").  Lastly, it's worth noting that labels are important. For example, one close reason we have is "subjective and argumentative". Some view anything subjective as bad and vote to close it. Most of programming is subjective. Even "how do I code X?" can have several answers of relative and debatable advantages and disadvantages. Argumentative (eg trolling) is something else entirely.  The point of all this is that those reasons affect what people do (as most are trying to do the right thing so if they see "subjective and argumentative" they're just doing what they think they should be doing) so having explicit delete reasons should result in a better outcome: the right questions being deleted and less of the wrong ones being deleted.

While this is an old problem, it's one that will only increase with time.  As Stack Exchange sites gain in popularity, more and more users are coming to the sites in search of answers to their specific problems.  Unfortunately, not all of them understand the basic operating principals behind Stack Exchange, and ask questions, or start discussions as separate answers.  Deleting these answers is fine, but more often (I would argue almost always) than not, a new user doesn't understand why.  Granted, comments are a way of doing this, but there are drawbacks to comments:   They require extra, replicated effort on the part of the moderator for something that they do repetitively The message will be inconsistent; messages like this would be consistent, cite the relevant resources that guide the user in the right direction The larger size would have a higher chance of grabbing the user's attention, as well as put more weight behind the action (as it's officially attached to the answer in a consistent manner). The banner will serve as an example of what not to do to other users who can see the deleted post.   Additionally, there are tools that can help with auto-commenting on posts, but these have their drawbacks as well:   Not all moderators use these tools The messages that are delivered by the tools are ultimately generated initially by the moderators, so the message will not be consistent These tools are not always available on other devices (e.g., mobile platforms)   It would be helpful to the user if they had a reason indicating why the answer was deleted.  Something along the lines of:    In order to accomplish this, I propose an additional (not a replacement) button in the moderation tools labeled "delete with reason".  Mods would still be able to delete answers outright, they just have the option now of stating why in an easy manner which will allows for more time to moderate harder.  Placement is not important (screen real estate is valuable, yes), but I envision it looking something like this in the moderator tools:    When clicking "delete with reason", a dialog, much like the "close" dialog will appear with options:    Initial options for the reasons could be:   Asking a new question Starting discussion   A mechanism like this has the potential for other benefits as well:   Users with an answer deleted with a reason might actually be directed to perform the right action now, and in the future (creating better site denizens) Users who wish to contest the deletion of an answer on meta can cite that specific reason, which mods can specifically address (which actually might reduce noise on meta about "why was my answer deleted?") Can reduce flags on answers asking "why was this deleted?" (admitted, I've not personally experienced this to be a pervading problem on Stack Overflow, but this might be the case for other mods on other Stack Exchange sites) Other Stack Exchange sites which don't have that many users will give a better experience to their users when their first action isn't ideal for a Stack Exchange site; this will enhance the chance that the site will retain the user and get good contributions from them (as per Farseeker's comments: , ).   Additionally, if this works well for the moderator tools, I imagine that it would not be such a leap to eventually have this graduated to users with the rep to cast delete votes, thus allowing non-mods to deliver a more clear message to new users about how to best participate on a Stack Exchange site.


There is "a general phenomenon known as  (Berkson, 1946), whereby observations on a common consequence of two independent causes render those causes dependent. For example, the outcomes of two independent coins are rendered dependent by the testimony that at least one of them is a tail" ().  $$ y = \beta_0 + \beta_1x_1 + \beta_2x_2 + \epsilon $$  If (a) we make a linear regression model as above in which $x_2$ is a common consequence of independent causes $y$ and $x_1$ and (b) these latter two are rendered dependent by observations on $x_2$:   Is $\hat\beta_1 \ne 0$? Why?  "Yes, because that is what Pearl must mean by "rendered dependent."  Is the true value of $\beta_1 = 0$? Why?  "Yes, because that is what Pearl must mean by "independent causes."    *Or, do we not have enough information?  *Or, is Berkson's paradox not applicable (e.g., to a linear regression model with a continuous $y$)?  Berkson, J. (1946). Limitations of the application of fourfold table analysis to hospital data. Biometrics Bulletin 2, 47–53.

If granted omniscience and we know that $\beta_1$ in a multiple linear regression model is truly 0, what does that mean in words (and math notation)?  The model is: $Y = \beta_0 + \beta_1X_1 + \beta_2X_2 + \epsilon$  Does $\beta_1 = 0$ mean:   Empirically: "If we make infinite, perfect measurements of our data, $\hat\beta_1$ approaches 0 at the limit?" [Math: ??] Formally: "In the true, finite population of our data, $X_1$ has 0 association with $Y$ and their vectors of values are perfectly linearly independent, uncorrelated, and orthogonal?" [Math: ??]   What does $\beta_1 = 0$ mean, precisely?


So, in the past few minutes I saw the following questions:      Now, I'm just thankful they had nothing to do with the review queue, so I figured I'd jump in and help the first guy.  Why is it so hard to do that, instead of just downvote the guy into oblivion?  See this post?    One thousand-plus upvotes.  So why is it that no one can just give these guys a push in the right direction instead of beating them down?  As Chris Berman would say, "C'mon, man!"

There is a distinct decline in the level of civility on all the sites here.  Some of this is due to new users coming in and posting spam and other nonsense, but the off-topic and downvote buttons are doing a pretty good job of keeping this under control. Unfortunately, a lot of this is coming from more experienced users, and the site's built-in moderation system does not (and probably cannot) handle this very well.  Folks are rushing to pound new users down with "this belongs on meta!", "this is off topic", "this is a duplicate!" and "read the Help!". (Which is correct, but should be done nicer) All this, of course, is accompanied by a flurry of downvotes.  This is not very welcoming to new users who don't know about meta, the Help, or what counts as off-topic. Now I am not proposing that we just allow off-topic, meta, or duplicate questions.  However, I think we could be gentler in the way we express these sorts of things.  Explain what meta and the FAQ are and provide useful links.  Just using please and thank-you when asking folks to read the FAQ or post something on meta would be an improvement.  I also think we could rein in the downvoting a bit.  Not that we shouldn't vote stuff down, but unless a new user's post is clearly spam, voting it down to -1 or -2 should be sufficient to send a message without piling on. I like Stack Exchange and I want it to become a resource for everyone, not just an elitist site for high-rep users on the sites.


I would like to be able to learn from my flagging "mistakes", and adapt my personal flagging thresholds. To do this, I need some idea of which items that I flagged added to or subtracted from my flag weight.  I'm suggesting some sort of a flag weight "audit", similar to the rep audit (stackoverflow.com/reputation).  You can't learn from your mistakes unless you know what your mistakes were.

The  (click on your number of helpful flags in your profile) is cool, however some posts have a gray background, some don't. What does it mean?  example:


For naming job tile or position in organizations, I found that sometimes we use plural form of noun for describing another noun. For example     Corporate Communications Supervisor   and     Corporate Communication Supervisor   I used NGram and found that Communications Supervisor is used more widely than Communication Supervisor    Is there any rule for when to make the noun ,that is describing another noun, plural or singular?

So I was taught that you should almost always use singular form of an adjective instead of plural form. But recently, I've seen people using plural form and it sounds quite weird and I don't know if it is correct.  For example,   "Salary tax" instead of "Salaries tax" "Office supplies" instead of "Offices supplies" "Product demo" instead of "Product demo"   In the above cases, the word "Salary" is used as an adjective to describe the type of "tax", so it will be in singular form. But I saw people using salaries tax and not sure if it is grammatical.  So my question is if there are any general rules on how to use the singular/plural form of an adjective?


one is 2, and ans is "000000". string ans = "000000"; ans += string("1", one); cout<<ans<<endl;  The output is: 0000001� But I want the output: 00000011 What am I doing wrong?

I want to insert 'n' spaces (or any string) at the beginning of a string in C++. Is there any direct way to do this using either std::strings or char* strings?  E.g. in Python you could simply do  >>> "." * 5 + "lolcat" '.....lolcat'