Please Let me know.How to write TEST class for the following code?  trigger TriggerForACC on Account (before insert) {     List<Contact> conUpdatedList=new List<Contact>();      List<Contact> ExistingList=[Select Id,Name FROM Contact];     for(Account acc: Trigger.New){         acc.Name='MyAccount';         acc.BillingCity='Bangalore';         acc.BillingCountry='India';     }     for(Contact cont:ExistingList){         cont.FirstName='Kavya';         conUpdatedList.add(cont);     }     update conUpdatedList;  }

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How do I start writing my first unit test?  How do I unit test this code?  I need help writing this unit test.   Salesforce Stack Exchange looks for detailed, specific questions that the community can help you with, and can't write tests on your behalf. We feel that working with the resources below can help you get started, and we encourage you to make an attempt to write your test and return to SFSE with your specific questions when you encounter challenges you can't resolve.


I have been working through the Exercises at the end of Chapter $1$ of Bollobas' Linear Analysis. Chapter $1$ is on inequalities, and the text is fairly brief. I have found the problems unexpectedly hard - I guess I am simply not familiar enough with the subject. In particular, I am stuck on this one:     Let $f(x)\ge0$ be a convex function. Prove that $$\int_0^\infty\ f^2 dx\le\frac23\max f\int_0^\infty f\ dx$$ Show that $\frac{2}{3}$ is best possible.   It is easy to show that $f$ is monotone decreasing $($unless $\int_0^\infty f\ dx=\infty$ in which case the inequality is trivial$)$. It is also easy to show that if $f(0)=a,~f(b)=0$ with $f$ linear on $[0,b]$ $($and $0$ for $x>b$$)$ then we get equality, so that $\frac23$ is indeed best possible. But I still cannot hit on the right way to prove the inequality.

Prove $$\int _0^\infty f^2(x) dx \leq \frac{2}{3}\cdot  \max_{x \in \mathbb R^+} f(x) \cdot  \int _0^\infty f(x) dx$$ for $f(x) \geq 0$ and convex.   I know via Holder's we can get without the constant $\frac{2}{3}$ but that should also be true for $f$ not convex. I tried some approaches using convexity but didn't get the desired result.   A hint or reference would also help. Also, it would be interesting to know when equality holds.


I am writing a research paper about data collectors, but there is no existent terminology for the activity of such collectors. Would it be data collecting? Or data collection?  Example from my paper:   Data collecting/collection is defined as the large accumulation of data with a cohesive theme with the aim of enriching a personal collection.

Could anyone explain when to use a noun or a gerund?  Are these sentences correct? What is the difference between usage of gerund and noun there?        I worked on the improvement of the article.   I worked on the article improving.   I worked on the improving of the article.                The investment idea was published.   Investing idea was published.


I was solving the "Coin Flip" problem on Codechef(Problem Code: CONFLIP) and confronted this issue. My first program is resulting in successful submission while in the second program I am receiving "Wrong Answer" status on submission. Can anyone tell why 2nd program is wrong? Note: There are no compilation errors, 2nd program is also giving correct output on visible test cases and many other test cases which I tested myself, but on submission, I receive "Wrong Answer" status. The logic of both the programs is same. All the header files are included properly, just not mentioned here for a clean look. [Compiled using C++14(GCC 6.3)] FIRST Program:- int main() {   int t,g,n,i,q;   cin>>t;   while(t--)   {     cin>>g;     while(g--)     {       cin>>i>>n>>q;       if(i!=q)       {         cout<<n-(n/2)<<endl; //This line is different in both the programs.       }       else       {         cout<<n/2<<endl;  //This line is different in both the programs.       }     }   }   return 0; }  SECOND Program:- int main() {   int t,g,n,i,q;   cin>>t;   while(t--)   {     cin>>g;     while(g--)     {       cin>>i>>n>>q;       if(i!=q)       {         cout<<ceil(float(n)/float(2))<<endl;  //This line is different in both the programs.       }       else       {         cout<<floor(float(n)/float(2))<<endl;  //This line is different in both the programs.       }     }   }   return 0; }

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


In  my home directory, I have a folder named symlinks in which all my symlinks live. I've added this folder  to my CDPATH, so that I can do:  ~$ cd FarAwayDirectory ~/symlinks/FarAwayDirectory$   I’ve noticed that if I pwd, I get:  ~/symlinks/FarAwayDirectory     ->    A  rather than:  .../.../.../FarAwayDirectory    ->    B  which is what I would've gotten through consecutive cd’s.  So my question is: Is working in directory A identical to working in directory B?

Say I do the following:  cd /some/path ln -s /target/path symbolic_name   If then do:  cd /some/path cd symbolic_name pwd   I get:  /some/path/symblic_name   and not:  /target/path   Is there a way to have the shell "fully resolve" a symbolic link (i.e. updating CWD, etc.), as if I had directly done:  cd /target/path   ?  I need to run some programs that seem to be "aware" or "sensitive" about how I get to my target path, and I would like them to think that I arrived to the target path as if had done cd /target/path directly.


There is no common edges or vertices on intersection

I'm looking for a way to introduce a cut to a plane where it is intersected by another plane.  The plane is a single face for simplicity.  Here's the setup:   Add a plane Add another plane and rotate it by 90 degrees at X or Y so it is not coplanar      Join the two meshes together using Ctrl + J and enter edit mode Notice that in edit mode face select allows selecting one or the other face Notice that no edge has been introduced where the two planes intersect     The first solution I came up with was to just use two loop cuts, one on each plane. In this setup the plane dimensions were left unchanged as was their location so it just so happens that the intersection edge coincides with what you get if you loop cut both the planes.  The second solution I found was to use a boolean modifier on both planes, selecting the other plane as the object for the boolean operation in both cases. This correctly introduces an edge where the planes intersect. The can be joined after both boolean operations have been applied, giving a single mesh with four faces as desired.  I am wondering about the general case, though. What if one plane was twice the size of the other, or shifted by half the size?  My solutions do not work in those cases. Loop cut needs to share origin in order for the cut offset (half the face size) to coincide with the intersection edge. Boolean doesn't work if the faces are different sizes or shifted against one another so that their edges do not connect anymore.  Is there a general purpose tool in Blender for selecting two faces which may or may not intersect and saying "introduce edges where they do"? Obviously some sort of logic needs to be applied when the faces are shifted so that their edges do not connect with each other, my thinking is in that case both faces should be cut as if the other face was infinite in size and not finite? Or some other logical fallback behavior.  Is there such a tool? This question is primarily for Blender 2.8.


I have a BLE Nano device:    It comes with something called MBED on it.  I think this helps us flash the code that we write onto it.  We are using a library called Nordic SDK to program the device.  What I am wonder is what is my firmware, what is my software, and what is my operating system?

In computing, firmware is a computer program that is "embedded" in a hardware device, that is, an essential part of the hardware. It is sometimes called embedded software.  I got this definition from Wikipedia and I am getting confused of the terms firmware and software. Can you give me clarification about these.


I know that you can manage snapshots with the CLI with the command "tmutil". Unfortunately I don't know where exactly these snapshots are stored in the operating system? Edit: Suppose I don't have a backup hard drive at hand at the moment. Therefore I create a snapshot of the currently running hard disk with the command tmutil under the terminal. I can view these snapshots later with the command "tmutil listlocalsnapshots /" The only question is, where exactly are these snapshots on my hard drive? There must be a path where these files are saved? And I would like to know this

Out of curiosity, I'm wondering where in the file system Time Machine stores its local backups/snapshots.


I have received a few offers for PhD programs in the US that I am interested in, and several of these have open-house events coming up in the next few weeks.  I have been in contact with potential advisors at several of these programs, but have had very limited or no contact with current graduate students there.  My current information on these programs comes from offer letters, interactions with professors (both my undergraduate advisor, and professors at institutions hosting these open-houses), and departmental websites.  My primary goals with these events are:   Meet with potential advisors, and determine who I could work well with, and Talk to current PhD students; see if I can learn anything about departmental politics, the funding situation, and anything else that the department doesn't advertise to prospective students.    Which questions should I be sure to ask, and to whom?  What opportunities do I have at open-houses that I will never have again before I need to accept an offer?  If it matters, the programs I am considering are in physics, geophysics and Earth sciences departments, depending on which department the space sciences faculty happen to be in.

I'm in mathematics, though I don't know if the answers to this will be field-dependent. There have been previous good questions that answer what to ask graduate students  and only somewhat relatedly  (about what to ask students of potential advisors). However, I don't know what good questions are to ask professors themselves. The big question is, of course, "will I be happy at this school?", but it's not clear to me what the 'right questions' are to help me get a feel for this.   Essentially, what should I know about the program/school that are suitable questions to ask a professor during a meeting at these visit days?


Trying to learn LaTeX, I'm using a very simple document to see if I can import C# code using the listings package. I've installed MikTex, and made sure it's up to date, and I'm using pdfLateX. The code is as follows: \documentclass{article}  \usepackage[T1]{fontenc} \usepackage{color}  \definecolor{bluekeywords}{rgb}{0.13,0.13,1} \definecolor{greencomments}{rgb}{0,0.5,0} \definecolor{redstrings}{rgb}{0.9,0,0}  \usepackage{listings} \lstloadlanguages{[Sharp]C} \lstset{     language=[Sharp]C,     showspaces=false,     showtabs=false,     breaklines=true,     showstringspaces=false,     breakatwhitespace=true,     escapeinside={(*@}{@*)},     commentstyle=\color{greencomments},     keywordstyle=\color{bluekeywords}\bfseries,     stringstyle=\color{redstrings},     basicstyle=\ttfamily }  \begin{document}  \lstinputlisting{DoDickey.cs}  \end{document}  My problem is that when I import the C# code, some junk characters are appended at the beginning.  Tried a bunch of different code files, tried using \lstinputlisting[[Sharp]C]{DoDickey.cs}. This just results in the error "Package Listings Error: File `C(.tex)' not found." I'm assuming it's an encoding issue, but I honestly have no idea how to solve it.

When I used listings package to import C# code snippet from within my LaTeX file, I got an output as follows.    At the first line, there is an unnecessary white space because of the BOM (Byte Order Mark) that is intentionally added by Microsoft (R) Visual Studio.  I really want to remove it from the output rather than from the C# file, how to do that?   Here is my LaTeX code:  \documentclass{article} \usepackage{listings,xcolor} \lstset{% language={[Sharp]C}, backgroundcolor=\color{yellow!20}, basicstyle=\tiny, keywordstyle=\color{blue}, identifierstyle=\color{magenta}, breaklines=true}   \begin{document} \lstinputlisting{Program.cs} \end{document}


I have a structure which contain a long array. I know that possible initialize an array when defined:  uint8_t array[] = {0x10, 0x11, 0xa2, 0xa5};   My question is: is it possible to set all elements of an array after declaration in one operation? Actually, this is a variable of a stucture.  struct example {     uint8_t long_array[256]; };   And after creating an instance I want to set all elements for long_array to different values in one operation. If it is not possible, what is the simplest way to set all elements?  There is a pseudocode what I want to do:  struct example ex; ex.long_array[] = {0x01, 0x07, 0x9a, 0xd1, <...>};   Thanks for your help!

I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value.  I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax?


I have over 500 irregular shapes with different sizes on artboard, total area of them is less than artboar's area . align/arrange all of them and control overlaps manually is not possible , are there any script to re-arrange (put each shape on free space) all these shapes inside of artboard without overlaps ? (maybe with  algorithm)  Edit : this picture is good sample for my need. many shapes with different size.

So I've got a file with loads of simple objects. This will later be used to cut out these shapes out of plastic. So, using the material optimally is of outmost importance. I was wondering if there is any script or plugin that could automaticly arrange the objects within the artboard so they could fit best.


What is the difference between the two statements?   I saw you recently I have seen you recently   Are both the statements correct? If correct, then why?  Explain the difference between specified timing and unspecified timing with examples.

Non-native speakers often get confused about what the various tenses  and aspects mean in English. With input from some of the folk here I've put together a diagram that I hope will provide some clarity on the matter.  I offer it as the first answer to this question. Consider it a living document. Input is welcome, and good suggestions will be  incorporated into the diagram.    Nota bene: What this is not is a discussion of whether there are  more than two tenses in English. , to which this question is not intended to supply arguments one way or the other.  Here, the aim is to provide an overview of what constructions English-speaking people use for conveying information about actions referring to past, present, and future, and to provide it first and foremost to precisely the people who are likely to use "tense" as a catch-all term in their search, rather than to linguists who know better.  Breaking News There is now an excellent ELU blog article titled  . It is highly recommended reading.


Let $f$ and $g$ be a real valued continuous functions on $\mathbb{R}$ such that $f(x+1)=f(x)$ and $g(x+1)=g(x)$ for all $x\in \mathbb{R}$. Prove that $$ \lim_{n\to\infty}\int_0^1 f(x)g(nx)\,dx=\int_0^1 f(x)\,dx\int_0^1 g(x)\,dx. $$

I have some problems understanding  of this problem:  Given $f,g : \mathbb{R} \rightarrow \mathbb{R}$ - continuous functions with period $1$, prove that  $$\lim _{n \rightarrow \infty} \int_0^1 f(x)g(nx) \, dx = \int_0^1 f(x) \, dx \cdot \int_0^1g(x) \, dx$$  It says there that if we split this integral into $n$ parts to get  $$\int_0^1 f(x)g(nx) \, dx = \sum_{r=0}^{n-1} \int_{\frac{r}{n}}^{\frac{r+1}{n}} f(x)g(nx) \, dx$$  we will have   $$\int_0^1 f(x)g(nx) \, dx = \sum_{r=0}^{n-1} f\left(\frac{r}{n}\right) \int_{\frac{r}{n}}^{\frac{r+1}{n}}g(nx) \, dx$$  because for large $n$, $f$ is roughly constant over the range.  Could you tell me why $f$ is roughly constant over the range for $n$ large enough?  I would really appreciate all your insight.


How do I evaluate this limit: $$\lim\limits_{x\to \infty}\frac{\sin x}{x}$$  Is it $0$? If yes, how so?

I've just started learning about limits. Why can we say $$ \lim_{x\rightarrow \infty} \frac{\sin x}{x} = 0 $$ even though $\lim_{x\rightarrow \infty} \sin x$ does not exist?   It seems like the fact that sin is bounded could cause this, but I'd like to see it algebraically.   $$ \lim_{x\rightarrow \infty} \frac{\sin x}{x} =  \frac{\lim_{x\rightarrow \infty} \sin x} {\lim_{x\rightarrow \infty} x}   = ? $$  L'Hopital's rule gives a fraction whose numerator doesn't converge. What is a simple way to proceed here?


We know that:       $a_1,...,a_n\in \mathbb R , \forall a_i\neq0 \\ b_1,...,b_n\in \mathbb R : b_j\neq b_k : \forall j\neq k$      Prove that there are $n-1$ roots in $(0,\infty)$:       $$a_1x^{b_1}+a_2x^{b_2}+...+a_nx^{b_n}=0  $$   Using induction, for n=1 it's obvious that there are 0 roots.  Suppose the statement is true for n-2 and prove for n-1:  From here on I'm not sure how to continue, I noticed that $x^{b_1}(a_1 + \ldots + a_n x^{b_n - b_1})=0$ but at what point can it come into the induction process ? Also, how does the IVT is applied here ?

I have two related problems that are causing me big trouble:  Let $\;a_1,...,a_n\in\Bbb R\;,\;\;a_i\neq 0\;\;\forall\;i\;$ , and let $\;b_1,...,b_n\in\Bbb R\;,\;\;b_i\neq b_j\;\;\forall\,i\neq j\;$ .  (1) Prove that the equation  $$a_1x^{b_1}+\ldots+a_nx^{b_n}=0$$  has at most $\;n-1\;$ different zeros in $\;(0,\infty)\;$ (Hint: Use induction)  (2) Prove that the equation  $$a_1e^{b_1x}+\ldots+a_ne^{b_nx}=0$$  has at most $\;n-1\;$ different zeros in $\;\Bbb R\;$ .  Now, the following is what I've done so far: for a differentiable function $\;f\;$ ,  I can prove that if $\;f'(x)=0\;$ has $\;n-1\;$ different zeros, then $\;f(x)\;$ has at most $\;n\;$ different zeros, using the mean value theorem, say.  But I can't see how to use induction in this case: if I differentiate in the first problem, I get $$0=f'(x)=a_1b_1x^{b_1-1}+\ldots +a_nb_nx^{b_n-1}=\frac1x\sum_{i=1}^na_ib_ix^{b_i}$$  ...and now?! How does induction kick in here? I though perhap something like: if we suppose WLOG $\;b_1<b_2<...<b_n\;$ , then perhaps inducting on $\;\lfloor b_n\rfloor\;$, but it gets messy and blurry if $\;b_n<0\;$...  Any help, hints are very much appreciated.


I have a product field which is by default in the woocommerce and i have added another field custom field (ACF) which is stock_number on my product/shop page i can search for products by title only i want to include the custom field stock_number data in the search as well e.g. so if some one search for something which is in custom field the result should apear the below example will explain it  bit more.  Title   Stock_number  A          B  C          D   currently what woocommerce does is if i search for A or C it will show the result but if i search for B or D it will not show the result so i want to make the stock_number field searchable

I have a site using  to create and store various bits of relevant info. These need to be included in the main general search, which by default only searches the title and main content.  I've found plenty of info about getting search results based on specific bits of postmeta, but I have an issue with that. There are a potentially unlimited amount of potential fields in postmeta to search.  The solution could either search anything in postmeta or anything with a meta_key that matches this regex: content_section_[0-9]{1,4}_content_.{2,8}  Example meta_keys to match are:  content_section_0_content_title content_section_0_content_title content_section_4_content_subtitle content_section_8_content_text   Any way that I can alter the fields searched to include the postmeta would be very much appreciated.


I clicked on the "Link my next chat message as a reply to this" arrow after a comment (as shown here):        and when I did, I got this in my chat window:       so I then clicked on the upload button, selected a picture from my computer, and clicked on the upload button.    However, when my picture posted, it did not show as being linked to the original comment. Any ideas?

When I click the arrow icon to start a reply to a chat message, the text field is prepended with a colon followed by the message ID. This also works even if you've entered something in the text field, so  Replying to somebody   becomes  :1234567 Replying to somebody   But since an image upload will submit immediately, I have to start the reply before uploading.  But that doesn't work either. The message ID that's prepended ends up being erased and replaced with the image URL before the upload submits. I have to edit to include the message ID to turn it into a reply, and since editing a message with a onebox causes the onebox to reload, it can get distracting.  Can we please preserve the message ID so  :6059107   becomes  :6059107 http://i.stack.imgur.com/uzFM3.png   and not  http://i.stack.imgur.com/uzFM3.png   instead so I don't have to edit it or upload it separately?  EDIT [11/20]: just found out that the upload button is totally disabled when the field isn't empty now. I guess it's to stop any message being completely replaced with the upload URL, so perhaps seeing it from that perspective, it's a good thing. It doesn't exactly help matters here, though.


I'm making a simple program that I'm trying to add multiplayer for. I currently have byte arrays (byte[]) for the data that's being sent to the server and to the clients. When I send a byte array after I move the player on the screen I get a java.lang.NullPointerException and I know that it is not null. I've even tried putting an if statement checking if it's null and eclipse said it was dead code.  if (data == null) {     System.out.println("Data is null!"); }   Here is my code where it gives me the exception.  byte[] data = new byte[10];  byte packet00 = (byte) ((byte) x/8); byte packet01 = (byte) ((byte) x/8); byte packet02 = (byte) ((byte) x/8); byte packet03 = (byte) ((byte) x/8); byte packet04 = (byte) ((byte) x/8); byte packet05 = (byte) ((byte) x/8); byte packet06 = (byte) ((byte) x/8); byte packet07 = (byte) ((byte) x/8);  byte type = 39;  data[0] = 2; data[1] = packet00; data[2] = packet01; data[3] = packet02; data[4] = packet03; data[5] = packet04; data[6] = packet05; data[7] = packet06; data[8] = packet07; data[9] = type;  client.sendData(data);   x is an int that is changed by a key press, and the method sendData from client takes a byte[].  I couldn't find anything to help me fix this, and I want to know if I'm missing something and/or a fix to this.  Here's a portion of the stacktrace:     Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException           at com.dripgames.main.Main$1.keyPressed(Main.java:132)           at java.awt.Component.processKeyEvent(Unknown Source)

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 started using blender couple of days ago but i think i have come a long way. I finished my first project. I did all the coloring, camera angels etc. When i finished my project i rendered it. But when it comes to saving, saving options not working. I can only save it as a .blender. I cant change it to jpeg or png. When i save it as a .blender and i open it up i cant see the image i rendered. I can only see the tiles like pictures u can see in microsoft excel. When rendering ends i pressed f3 to save it but i can only save it as a .blender and cant change it to any other form. I downloaded the Blender couple of days ago i think its the latest version. How can i solve this issue. TLDR: I cant save the finished project as i wanted to be.

Every time I render an image and try to save it, it just disappears. How do you exactly save a render? I am using a mac.


I'm currently working on Regular Expression to check the decimal input in JavaScript. Below are the mock-up test case:  HTML:  <input type="text" id="checkValue" onkeypress="checkKey(event)"/>   JavaScript:  function checkKey(event) {     if(event.which == '13') {     //Enter is pressed         var checkVal = $('#checkValue').val().trim();         if(checkVal.match("(\d{1,7}\.\d{1,2})|(\.\d{1,2})|(0)")) {             alert("Matched!");         } else {             alert("Not matched!");         }     } }   Supposed I type in "123.456" will return "Not matched!", but it returns "Matched!".  The desired result would be:  Match type:  .01 1 1.01 0 1234567.89   Unmatch type:  .012 1.098 123.456   As conclusion, the value input should be in 9 digits at most, with or without decimal. And id with decimal, it only takes 2 places, such as "1234567.89".  It's my first time stepping in Regex, so any advice in getting this well?  Any help in helping fixing the Regex above would be great :)  Edited  function checkKey(event) {     if(event.which == '13') {     //Enter is pressed         var checkVal = $('#checkValue').val().trim();         alert(checkVal.match(/^\d{0,7}\.?\d{0,2}|\.\d{0,2}|0$/));     } }   Same, the input I typed "123.456", but the alert message I get was "123.45"...  Second edit  function checkKey(event) {     if(event.which == '13') {     //Enter is pressed         var checkVal = $('#checkValue').val().trim();         alert(checkVal.match(/^\d{0,7}(\.\d{0,2}|\d{0,2})$/g));     } }   I've changed from  /^\d{0,7}(\.\d{0,2}|\d{0,2})$/g   to  /^\d{0,7}\.?\d{0,2}$/g   , which is simplified :)  And it works for numbers, but how if I would like when user key in only "." and is not acceptable? Also, zero as starting is not acceptable as well. Do I need to separate into 2 regex checking?

What is the regular expression for a decimal with a precision of 2?  Valid examples:  123.12 2 56754 92929292929292.12 0.21 3.1   Invalid examples:  12.1232 2.23332 e666.76   The decimal point may be optional, and integers may also be included.


I've learned that, for optimization reasons, Python's inner functions do not actually have a pointer to their parent frame but they store the parent variables in a special object called "cell" (func.func_closure)   I've figured that those vars are been copied to that cell, so if it's true I cannot use setters and getters as inner functions because each of them has a copy of the variable.  In order to test that theory I've written the following code:  def foo(x):     def getter():             x     def setter(y):             x=y     def adder(y):             if isinstance(y, list):                     x += y             else:                     print "not a list"     return (getter, setter, adder)   But when I ran it I found something even more odd: its seems that only the function getter saves its parent's (foo) variables, although I would think that setter and adder should also save it.  I tested it using Python 2.7 and found out that after calling   (g,s,a) = foo([1])  g.func_code.co_freevars  # contains ('x',) s.func_code.co_freevars  # is empty a.func_code.co_freevars  # also empty   Does anyone know why that is?

What exactly are the Python scoping rules?  If I have some code:  code1 class Foo:    code2    def spam.....       code3       for code4..:        code5        x()   Where is x found?  Some possible choices include the list below:   In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop   Also there is the context during execution, when the function spam is passed somewhere else. And maybe  pass a bit differently?  There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.


I cannot find studs on my firewall but, when I drilled a hole on the wall, it seems to me that either the plaster or drywall was thick enough (like 1/2"). Can I Mount a 60" TV and Mount Weighing a Combined 95 pounds to that Drywall or Plaster?

Can I use drywall screws with plastic contraption 3/8" diameter to put a TV on the drywall?  What is the load limit for 1 inch drywall and how many screws and how close apart they can be put to carry 60..65 lbs TV ?


Unfortunately, Java has no syntax for multi-line string literals. No problem if the IDE makes it easy to work with constructs like     String x = "CREATE TABLE TEST ( \n"              + "A INTEGER NOT NULL PRIMARY KEY, \n"             ...   What is the fastest way to paste a multi-line String from the clipboard into Java source using Eclipse (in a way that it automatically creates code like the above).

How is it possible in Eclipse JDT to convert a multiline selection to String. Like the following  From:  xxxx yyyy zzz   To:  "xxxx " + "yyyy " + "zzz"   I tried the following template   "${line_selection}${cursor}"+   but that way I only get the whole block surrounded not each line separately. How can I achieve a multiline processing like commenting the selected block?


My question is:  show $$\sum_{k=0}^{m} \binom{n-k}{m-k}=\binom{n+1}{m}$$ $$n\geq m\geq 1$$ I tried to do this via induction and failed. there has to be another way of doing this.  We could either explain combinatorically that we are counting the same thing in 2 different ways, in this sense, we are counting the number of ways to choose $m$ elements from a set with $n+1$ elements.  Or we could try like me to prove it algebraically, both ways are valid...I'd like some help, or a push in the right direction.

Let $n$ be a nonnegative integer, and $k$ a positive integer. Could someone explain to me why the identity $$ \sum_{i=0}^n\binom{i+k-1}{k-1}=\binom{n+k}{k} $$ holds?


I know conj(x) and x.conj() do the same thing, but what is the main difference?. Is that we can do any function as method such as sum(x) written as x.sum()?

Can someone provide a simple explanation of methods vs. functions in OOP context?


Recently I discovered the definition of topological group. So, topological group is an abstract group $G$ endowed with topological structure such that the maps $mult: G\times G\longrightarrow G$ and $inv:G\longrightarrow G$ (multiplication and inversion) are continuous. I'd like to understand if it is enough just to suppose $mult$ to be continuous. Could you give me some slight hint?

According to , a topological group $G$ is a group and a topological space such that  $$ (x,y) \mapsto xy$$ and $$ x \mapsto x^{-1}$$  are continuous. The second requirement follows from the first one, no? (by taking $y=0, x=-x$ in the first requirement)  So we can drop it in the definition, right?


I re-asked the following the serverfault.com questions on superuser.com and I did not allow me to delete them on serverfault.com because of the following reason:        Sorry, this question cannot be   deleted: too many existing answers, or   upvoted/accepted answers   I did not like this feature because they were closed and I am the original author.

What circumstances can cause a question or answer to be deleted, and what does that actually mean?    How can a post be deleted? When can't I delete my own post? Can I still see my post even after it's deleted? Can I see a list of my deleted posts? How can I undelete one of my posts? What does deletion mean for a post? How do votes to delete work? What are the criteria for deletion? What else should I know about deleted posts? If I flag my question with a request to delete it, what will happen?       For more information, see the articles about  and  in the .


Here are the propositions:  $$i=\sqrt{-1}$$ $$i^2=-1$$ $$(i)(i)=-1$$ $$\sqrt{-1}\sqrt{-1}=-1$$ $$\sqrt{(-1)(-1)}=-1$$ $$\sqrt{1}=-1$$  There's an error in the propositions above. I think it's in the fifth line where $\sqrt{(-1)(-1)}=-1$.  Are $\sqrt{ab}=\sqrt{a}\sqrt{b}$ and $a=(\sqrt{a})(\sqrt{a})$ different from each other?

I know there must be something unmathematical in the following but I don't know where it is: \begin{align} \sqrt{-1} &= i \\\\\ \frac1{\sqrt{-1}} &= \frac1i \\\\  \frac{\sqrt1}{\sqrt{-1}} &= \frac1i \\\\  \sqrt{\frac1{-1}} &= \frac1i \\\\  \sqrt{\frac{-1}1} &= \frac1i \\\\  \sqrt{-1} &= \frac1i \\\\  i &= \frac1i \\\\  i^2 &= 1 \\\\  -1 &= 1 \quad !!? \end{align}


I am from optimization and control society. I would like upload a paper in a non-description way, probably, like.     Could you please help figure out how the format can be generated ? It appears easy and common since many other papers share nearly same layout.  Thank you in advance

I want to basically upload a research preprint to arXiv. I want my paper to exactly look like this paper  including the hyperlinks in the bibliography.   Can someone please tell me how the scratch tex file should look like to achieve this.  Any help is appreciated.


When I visit the C:\$RECYCLE.BIN on Windows 10, I can see not only a link to the Reycle Bin but also two other directories, which I cannot access. Upon taking ownership of one of the directories and giving myself full permissions, it no longer appeared as "S-1-5-18", but as another "Recycle Bin". It only reverted back to "S-1-5-18" once I changed all of the settings back and toggled the "read-only" attribute.  What are these additional directories, and why do they display such unusual behaviour?

What does the Recycle Bin in Windows actually do?  Is it just a glorified folder and a holding place for soon to be deleted files, or does it do something specific?  Specifically, are files that are "moved" to the Recycle Bin actually moved on the hard disc, or are just the pointers to the files moved?  I am a fairly experienced user, I just wanted a more depth explanation of the Recycle Bin.


We know that $\lim_{n \to \infty}$ $(1+\frac xn)^n=e^x$. How to prove that $\lim_{n \to \infty}$ $(1+\frac xn-o(\frac 1n))^n=e^x$?  Attempt of the proof:   Let $\epsilon>0$ $\exists n_0$ such that $\forall n\ge n_0$ $|o(\frac 1n)|<\epsilon\frac 1n$ and $|n*o(\frac 1n)|<\epsilon$.   Thus  $(1+\frac{x+\epsilon}{n})^n>(1+\frac xn-o(\frac 1n))^n>(1+\frac{x-\epsilon}{n})^n$.  So $e^x*e^\epsilon \ge \lim_{n \to \infty}$ $(1+\frac xn-o(\frac 1n))^n \ge \frac{e^x}{e^\epsilon}$ $\forall \epsilon>0$.   Say $\lim_{n \to \infty}$ $(1+\frac xn-o(\frac 1n))^n=y$, it can not be that $y<e^x$, because if it is so, then $\exists \epsilon>0$ such that $e^\epsilon y<e^x$ and the second inequality above is violated. By the similar talking $y>e^x$ is impossible.   This completes the proof.

I was hoping to show that  $$\left(1-\frac{x}{n}+o\left(\frac{2x}{n}\right)\right)^n \xrightarrow{n\to\infty} e^{-x}$$  which would be just fine without the little-$o$.  Trying binomial formula:  $$\left(1-\frac{x}{n}+o\left(\frac{2x}{n}\right)\right)^n = \sum_{k=0}^n \binom{n}{k} \left(1-\frac{x}{n}\right)^{n-k} \left( o\left( \frac{2x}{n} \right)  \right)^k$$  Yet it doesn't look like it leads me somewhere where I could use  $$\frac{o\left( \frac{2x}{n} \right)}{\frac{2x}{n}}\xrightarrow{n\to\infty} 0$$  What is the proper way to handle it?  Edited after the comment by Claude Leibovici.


I have this code for an Export MySQL table to excel file the code is working fine, but Arabic language not working appear as icons how can fix that please!!  Code :  <?php   $stmt = $DB_con->prepare("SELECT * FROM `users` ORDER BY id DESC"); $stmt->execute();  $filelocation = 'file/'; $filename     = 'export-'.date('Y-m-d H.i.s').'.csv'; $file_export  =  $filelocation . $filename; header( 'Content-Type: text/csv; charset=utf-8; encoding=UTF-8' ); header("Cache-Control: cache, must-revalidate"); header("Pragma: public"); header( 'Content-Disposition: attachment;filename='.$filename.'' ); $data = fopen($file_export, 'w');  $csv_fields = array();  $csv_fields[] = 'id'; $csv_fields[] = 'firstname'; $csv_fields[] = 'lastname'; $csv_fields[] = 'email'; $csv_fields[] = 'city'; $csv_fields[] = 'nationality'; $csv_fields[] = 'phone'; $csv_fields[] = 'mobile'; $csv_fields[] = 'personal'; $csv_fields[] = 'education'; $csv_fields[] = 'interests'; $csv_fields[] = 'skills'; $csv_fields[] = 'hobby';  fputcsv($data, $csv_fields);  while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {     fputcsv($data, $row); }  ?>

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


I have just installed Ubuntu 14.04 under VirtualBox 4.3.20 on a Windows 8.1 host. I can't get any internet access over WiFi (and I can't get an Ethernet connection anywhere near the computer). All of the help I can find when I Google this problem either a) tells me to change Windows 7 settings that I can't find in Windows 8.1, or b) tells me to sudo apt-get install something, which doesn't work because I have no internet connection.  Can somebody tell me in easy steps (I don't really know Linux, and I certainly don't know networking) how to get the internet connection working?  Thanks.

I just installed my first Ubuntu Server (12.04) instance and immediately ran into the following problems:   Running apt-get install or update fails (see below) Running ifconfig produces peculiar IP addresses starting with 10.x.x.x and my router does not see the server at all in its "Attached Devices" page (its a consumer grade Netgear)   When I run apt-get I get 50+ of the following errors:  Failed to fetch <some-http-url>. Temporary failure resolving <blah>.ubuntu.com   I read up on this error for 12.04, and found some similar posts on this forum and on server fault that recommended going into /etc/resolv.conf and adding an entry:  nameserver 8.8.8.8   To my surprise, I found that /etc/resolv.conf was a symlink pointing to somewhere else  and I had to delete it first, then create a new one with the entry indicated above.  I restarted the server and tried running apt-get again, same results.  How do I start diagnosing the problem (I'm a relatively new Linux/Ubuntu user)?  Additional details that may help:   This is actually a virtual machine running as a VirtualBox guest OS The physical host that is running this VM is my laptop which has a wireless connection; I'm wondering if (somehow) the laptop is getting the network wirelessly, but perhaps either the VBox VM and/or the Ubuntu server OS isn't configured for wireless and so nothing is "getting through"?   Thanks in advance for any pointers!  Edit:  Here is a snapshot of my VM's Network settings (only Adapter 1 has any information populating its fields, so I assume my VM has only 1 adapter):    Here is the output when I run ifconfig from the terminal:    And here is the output when I run route from the terminal:    Running ping google.com:


I have come across need to do something and need do something. My question is what's the difference between each other? My grammar book doesn't mention it

The verbs dare and need do not require auxiliaries when used in the interrogative; for example, “need I?” is as acceptable as “do I need?”  Excluding the auxiliaries themselves (like be, do, have), are there any other such verbs that work that way?


I have flight booking  SIN - KUL(stopover) - CDG  Its on December 17. SIN - KUL is at 11am, Paris flight is 11pm so almost an 11 hour stopover.  Now I'm booking another flight. MLE-KUL(stopover)-SIN.   It lands in KUL December 17th 6am.   So now my question is can I skip the KUL-SIN part of my MLE-JUL-SIN journey thereby also skipping the SIN-KUL part of my SIN-KUL-CDG flight.   *Its Malaysian Airlines *Its booked this way because the alternative routes are very expensive even if i picked the same exact flights.

I've a friend that booked a round-trip journey. He booked A-to-B and B-to-A. Somehow he needed to be earlier at location B, so he took a train and did not take the flight from A to B.  When he went to the airport to take the "back home" flight (B-to-A), he was informed that his ticket was canceled because he did not take the A-to-B flight. They canceled the ticket and sold it to someone else.  Is this normal? The company said it was their right to do so, and he could not get the flight back. The company was Iberia.


I have a set of points in 2 dimension plan : A(x1,y1), B(x2,y2), C(x3,y3) ....   How can I know which point of these points (A,B,C, ...) is the centroid of the other points

While searching the web, solutions for finding centroids of polygons come up rather often. What I'm interested in is finding a centroid of a cluster of points. A weighted mean of sorts.  Can you provide some pointers, pseudo code (or even better, an R package that has already solved this) or links of how this issue can be tackled?    @iant has suggested a method to average coordinates and use that for the centroid. This is exactly what crossed my mind when I saw the right picture on .  Here is some simple R code to draw the following figure that demonstrates this (× is the centroid):  xcor <- rchisq(10, 3, 2) ycor <- runif(10, min = 1, max = 100) mx <- mean(xcor) my <- mean(ycor)  plot(xcor, ycor, pch = 1) points(mx, my, pch = 3)       cluster::pam()$medoids returns a medoid of a set of cluster. This is an example from @Joris Meys:  library(cluster) df <- data.frame(X = rnorm(100, 0), Y = rpois(100, 2)) plot(df$X, df$Y) points(pam(df, 1)$medoids, pch = 16, col = "red")


I know this is a Mordell's equation and I found paper about the general case x^3=y^2-k but nothing about this specific case

Why does $x^2+41=y^3$ have no integer solutions?  I know how to find solutions for some of the Mordell's equations $(x^2=y^3+k)$ (using $\mathbb{Z}[\sqrt{-k}]$, and arguments of the sort). Still, I can't find a way to prove this particular equation has no integer solutions.   I know it doesn't because there are lists of solutions for $k \in [-100,100]$, like this one  and for what I've seen, the argument one uses to say a given Mordell equation has not solution is based on congruences, like in .  Still, I can't seem to figure out why the one with $-41$ (meaning $x^2=y^3-41$) has no solutions. There's a theorem in the Apostol book (p191) that says that such an equation has no solution if $k$ has the form $k=(4n-1)^3-4m^2$, with $m$ and $n$ integers such that no prime $p\equiv -1 \pmod 4$ divides $m$. I've tried with this but can't find $m$ and $n$.  Any ideas?


When I downvote an answer, it costs me 1 reputation point. When that answer is deleted, the reputation cost due to downvoting is refunded. When that happens, every once in a while I get a ‘+1’ badge appear on top of the ‘Achievements’ icon:  However, when I click the icon, I don’t see anything telling me how I earned that point back: no specific notification item appears in the Achievements menu. I have to scour through the ‘reputation’ tab on each site I am registered on to even take a guess, since there usually isn’t a reputation change item in there either (I can usually see one on Retrocomputing, but not on Stack Overflow; I don’t know what it depends on). I have to infer that from what I remember having downvoted before. Which often doesn’t work either; if I cast the downvote long enough ago, I may have already forgotten it. Since I am left no wiser than before, the whole notification seems like pointless distraction. Can something be done about this? Either:  Tell me which answer was deleted, or at least on which site it was, or Suppress the notification altogether.

The topbar only tells us about reputation gains (see ).  But sometimes it only half-tells us:    The explanation of that +1 is nowhere to be found here.  An answer that I downvoted was deleted (hence the return of my 1 rep), but I'm active on several sites and sometimes it takes days (or weeks or months) for such posts to be deleted, so asking myself "what have I downvoted recently?" doesn't necessarily help.  If we're going to show the notification, shouldn't we also show the explanation?


I try to start an application, when a special USB device is added.   In the windows event system I can use the event: Microsoft-Windows-DriverFrameworks-UserMode -> Event ID: 2100  This event is raised, when a new device is added. This works fine, but I will find out which drive was added.  Within the event system I found, that additional information is available, but how I can use this information?  Is it possible to get the information, which drive was added? Or is it possible to hand over the additional data of the event system to a user program (command line parameter)?

I know it has been discussed that it is not possible to start an application from an usb drive upon connection due to limitations of autorun (or autoplay??) in Win 7. But it is possible to create a scheduled task having an event type trigger. Surely there must be an event occurring when the drive -- or any USB device, for that matter -- is connected.    Does anybody have the slightest idea which Event ID should I use? Or at least what type of event? Where can I find the event in event viewer?


2 elements {a,b} result:   a, b, ab   3 elements {a,b,c} result:   a, b, c, ab, ac, bc, abc   4 elements {a,b,c,d} result:   a, b, c, d, ab, ac, ad, bc, bd, cd, abc, abd, acd, bcd, abcd   5 elements {a,b,c,d,e} result:   a, b, c, d, e, ab, ac, ad, ae, bc, bd, be, cd, ce, de, abc, abd, abe, acd, ace, ade, bcd, bce, bde, cde, abcd, abce, abde, acde, bcde, abcde   and so on...

I don't understand why a set with n elements has 2^n subsets. How is this calculated? I realize that {123} has empty set - 1-2-3-1,2-1,3-2,3-1,2,3 but how is the formula derived?


I'm working through , and in the chapter on homomorphisms, it has this question:     Let $f:G\to H$ be a group homomorphism. Let $p$ be a prime. If $\mathrm{range}(f)$ has an element of order $p$, then $G$ has an element of order $p$.   I actually can't see how this could be true. Take G = the set of all integers, H = the parity group (odd, even). The homomorphism maps every integer to odd or even. H has one element of order 2: odd. 2 is prime. But there's no element with order 2 in G -- every element has infinite order.

Let me ask Prob.F6 in Pinter's algebra book.  'Let $p$ be a prime and $f$ be a homomorphism from $G$ to $H$ where $G$ and $H$ are groups.  If range of $f$ has an element of order $p$, then $G$ has an element of order $p$.'   If $f$ is injective, life gets easier. But without the injectivity of the homomorphism, i feel lost... Would somebody help please?


I have an image that's currently wrapped in a uboot header from using the Uboot mkimage utility. I don't have the original of that image, so I want to take off the uboot header to turn the uimage back into a normal one. Is there any way this can be done?

Buildroot is generating images for an embedded device where they should run. This is working very well. In those images, the rootfs is included.  Due to some research, I'd like to look into that generated file (e.g. different compression modes set by the Buildroot were applied and now shall be checked if they were correctly done), but I can't find something useful in the Net.  As far as I know, the difference between a uImage and zImage is just a small header, so u-boot is able to read that binary file. But I can open neither uImage nor the zImage.  Can anyone give me a hint of how to decompress those (u/z)Images on the host?


I need to evaluate, for a certain worded question:   If n is even $$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n}$$  If n is odd $$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n-1}$$   I havent been able to reduce this using the binomial expansion.

Show that $$\sum_{k=0}^n(-1)^k\binom nk=0$$ So for odd $n$ we have an even number of terms. So $\binom nk=\binom n{n-k}$ which have opposite signs. Thus the sum is 0.  For even $n$ we have that $$\sum_{k=0}^n(-1)^k\binom nk= \binom n0+\sum_{k=1}^{n-1}(-1)^k\binom nk+\binom nn$$ Now $$\sum_{k=1}^{n-1}(-1)^k\binom nk= \sum_{k=1}^{n-1}(-1)^k\left[\binom{n-1}k+\binom{n-1}{k-1}\right]$$ What would that sum be in the square brackets?


I need to close the browser window using the java script.  I have tried using window.close but it is not working.   I have also googled and checked stack overflow for any similar posts. I have also gone through following link but in vain.    What I am trying to do is load a page and on load of the page call a java script method which does window.close  Below is the code  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <script> function closeBrowser(){     window.close(); } </script> </head>  <body onload="closeBrowser();">  </body> </html>   It is properly working in IE8 though. Its not working in the fire fox.   And even in IE it gives the alert prompt before actually closing the browser. Can we avoid the alert in IE?  Why it does not work in fire fox?

How can I close a browser window without receiving the Do you want to close this window prompt?  The prompt occurs when I use the window.close(); function.


I have a Postfix server with authentication running. However I recently found out, that anyone authenticated may send mail from any account. Meaning user1 is logging in and may send the e-mail from user2@domain.com  Is there a way to "bind" user1 only to send mail from user1@domain.com (and his assigned account alias)? Thank you.

Even though my postfix server cannot be used without authentification (open relay), sending mail in another users name after logging in is still possible like this:  EHLO domain.org auth plain eW91IGxpdHRsZSBkaXJ0eSBiYXN0YXJkIDstKQ== 235 2.7.0 Authentication successful mail from: otheruser@domain.org 250 2.1.0 Ok rcpt to: recipient@otherdomain.org 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> Please send me your account info. . 250 2.0.0 Ok: queued as D40692A61AA quit   How can this be prevented?


Situation : We have table It has millions of records. Table has 1 Clustured Index and 1 Non Clustured Index. It was found that Clustured Index is not used by any of SQL Query. But Insert Execution plan has 86% cost on Clustured Index.   Action: If I convert Clustured Index to Non Clustured Index, Execution plan gives me Table Cost 90%.  Which one is better for performance, If I convert clustered index to non clustered index, will it be helpful.  Thanks, Virul

compares the performance for individual select/insert/delete/update and range select statements on a table organized as a clustered index vs that on a table organized as a heap with a non clustered index on the same key columns as the CI table.  Generally the clustered index option performed better in the tests as there is only one structure to maintain and because there is no need for bookmark lookups.  One potentially interesting case not covered by the paper would have been a comparison between a non clustered index on a heap vs a non clustered index on a clustered index. In that instance I would have expected the heap might even perform better as once at the NCI leaf level SQL Server has a RID to follow directly rather than needing to traverse the clustered index.   Is anyone aware of similar formal testing that has been carried out in this area and if so what were the results?


If two bodies are travelling at speed $0.9 \, c$ in opposite directions, what will be the speed of one, as observed by another? Newtonian mechanics won't apply at such speeds. As such, how will we calculate the actual speed? The speeds can obviously not cross $c$. How to intuitively understand this?

Lorentz contraction and time dilatation can be deduced without Lorentz transformation. Can you deduce also the theorem of    $$w~=~\dfrac{u+v}{1+uv/c^2}$$   without Lorentz transformation? Using just the constancy of light speed.


When a solder joint is reheated without applying flux, the solder might get dull. Or, when I solder a joint (maybe with the temperature set higher than enough), the solder looks shiny when melted, then turns dull upon solidifying. The solder joint might still have good electrical connection, but I just wonder what makes the joint not shiny.

I'm currently reading an article () and the author compares two devices (hard disks) of the same model one manufactured by Company A and the other manufactured by Company B. One of the things he compares is how solder looks like on the boards.  Company A device board has soldered parts looking like this:    and this is claimed to be "low quality tin-coating". What I see is that solder spots are not shiny and the solder layer is thinner near the spot edges and thicker far from the edges (a bit concave).  Company B device has soldered parts looking like this (that's exactly the same area of the board as on the Company A device):    and this is claimed to be "high quality tin-coating". What I see is that solder spots look shiny and the solder layer looks having uniform thickness across each spot.  So to me the first board just looks neater. From what I know about soldering once the surfaces have been properly degreased with soldering flux and the solder was melted properly the connection will be just fine regardless of how shiny and neat looking it is.  However the author claims that the Company B device is of higher quality and should be preferred because of (among other factors) the "better quality" of tin-coating. How reasonable is such claim? Can device reliability be judged based on such tin-coating analysis?


Tried installing it from command line (sudo apt-get install gwget)  and I get this:  Reading package lists... Done Building dependency tree        Reading state information... Done Package gwget is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'gwget' has no installation candidate   what does it mean?  I'm using Ubuntu 13.10

What does the above Error mean? What is an installation candidate?  I was trying to do  sudo apt-get install munin-memcached     and I get this message:  Reading package lists... Done Building dependency tree        Reading state information... Done Package munin-memcached is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package munin-memcached has no installation candidate   I googled for the problem and someone said to do a apt-get upgrade but it still did not solve my problem.


I created the scatterplot on the left in Tableau and ran the regression line, which resulted in an R^2 of 0.63 (confirmed this in excel as well).  Then, I used the "Force y-intercept to zero" option in line settings and was surprised to find that the R^2 value of my regression line actually increased (see scatter on right with intercept of 0 and R^2 of 0.67).  This is counter-intuitive to me because I thought that the purpose of a regression line was to create the line that results in the highest R^2 value.  How could forcing it go to go through (0,0) increase the R^2?  Thanks in advance for your help.  Link to Raw Data is here (not sure how to force through origin with google sheets):

In a simple linear model with a single explanatory variable,  $\alpha_i = \beta_0 + \beta_1 \delta_i + \epsilon_i$  I find that removing the intercept term improves the fit greatly (value of $R^2$ goes from 0.3 to 0.9). However, the intercept term appears to be statistically significant.  With intercept:   Call: lm(formula = alpha ~ delta, data = cf)  Residuals:      Min       1Q   Median       3Q      Max  -0.72138 -0.15619 -0.03744  0.14189  0.70305   Coefficients:             Estimate Std. Error t value Pr(>|t|)     (Intercept)  0.48408    0.05397    8.97   <2e-16 *** delta        0.46112    0.04595   10.04   <2e-16 *** --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1   Residual standard error: 0.2435 on 218 degrees of freedom Multiple R-squared: 0.316,    Adjusted R-squared: 0.3129  F-statistic: 100.7 on 1 and 218 DF,  p-value: < 2.2e-16    Without intercept:   Call: lm(formula = alpha ~ 0 + delta, data = cf)  Residuals:      Min       1Q   Median       3Q      Max  -0.92474 -0.15021  0.05114  0.21078  0.85480   Coefficients:       Estimate Std. Error t value Pr(>|t|)     delta  0.85374    0.01632   52.33   <2e-16 *** --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1   Residual standard error: 0.2842 on 219 degrees of freedom Multiple R-squared: 0.9259,   Adjusted R-squared: 0.9256  F-statistic:  2738 on 1 and 219 DF,  p-value: < 2.2e-16    How would you interpret these results? Should an intercept term be included in the model or not?  Edit  Here's the residual sums of squares:  RSS(with intercept) = 12.92305 RSS(without intercept) = 17.69277


**preamble**     \documentclass[12pt]{amsart}     \usepackage{geometry}      \usepackage[utf8]{inputenc}      \usepackage{booktabs}      \usepackage{tabularx}      \usepackage{graphicx}      \graphicspath{ {./documents/} }      \usepackage{array}      \usepackage{tabularx}          \geometry{a4paper}     \begin{document}     **table**     \begin{table}[] \begin{tabular}{@{}ll@{}} \toprule Organisation                      & Role                                                                                \\ \midrule Courts                            & \begin{tabular}[c]{@{}l@{}}Judges and lawyers were Nazi members and enforced an improvised "Nazi law"\\ \\ Special courts set up to prosecute political crimes\end{tabular}                                                                                \\ Gestapo                           & \begin{tabular}[c]{@{}l@{}}Secret state police set up by Göring in 1933. Himmler gained control after 1933, and by 1936, an established part of the SS\\ \\ Enforce political conformity, but relied on denunciations by the German population. In Würzburg, 54\% of race-related charges were initiated by private citizens.\end{tabular}    \\ SS (Schutzstaffel - Defense Unit) & \begin{tabular}[c]{@{}l@{}}Private army and security system set up by Hitler's personal guards in 1925, led by Himmler after 1929. \\ \\ Key role in Kristallnacht -\textgreater replaced the SA as main military unit\\ \\ Enforce racial policy and run concentration camps\\ \\ Sub units: 1) Death's Head Units 2) Waffen SS\end{tabular} \\ SD (Sicherheitsdienst)            & \begin{tabular}[c]{@{}l@{}}Set up in 1932 by Himmler\\ \\ Internal security force of SS. Main role was intelligence eg. reports of SD, popularity of party, situation of Church\end{tabular}                                                                                \\ Concentration Camps               & \begin{tabular}[c]{@{}l@{}}First used to detain political opponents (communists and socialists), later anybody who spoke out against the regime\\ \\ Forced labour from prisoners. Camps were then built near stone quarries and brick making factories\end{tabular}                                                                          \\ \bottomrule \end{tabular} \end{table} \end{document}  When I compile, it cuts off the page. I've tried looking at other stack exchange solutions but they didn't work for me (or at least my solo troubleshooting). Will tabularx automatically create new sentences when they are long?

I have a table that I want to insert on a page, but at least one (perhaps both) of the following conditions are met:   The table is too wide to fit within the text block or page. That is, I'm exceeding some horizontal restriction. The table is too tall to fit within the text block or page. That is, I'm exceeding some vertical restriction.   What are my options to make this table fit? If it doesn't fit, regardless of my attempts, what other options exist?


The shebang operator is used to tell which shell will be used for running the script. what will happen in the following case:  #!/bin/bash   if I enter 'ksh script_name' what will happen?

This may be a silly question, but I ask it still. If I have declared a shebang  #!/bin/bash    in the beginning of my_shell_script.sh, so do I always have to invoke this script using bash  [my@comp]$bash my_shell_script.sh   or can I use e.g.  [my@comp]$sh my_shell_script.sh   and my script determines the running shell using the shebang? Is it the same happening with ksh shell? I'm using AIX.


I'm having a few issues with Blender.. 1. I'm trying to make a loop cut in this area:   But it won't let me make a loop cut there! There are other areas that I want to do loop cuts as well. I noticed in certain areas if I dissolved edges, I wasn't able to make loop cuts there anymore. How can I fix this?   I am trying to move a specific vertices, but it's doing this:    How can I move it to where I want to if that happens?

Alright so I've seen some postings about loop cuts and done some research. I am very new to blender and modeling overall. I am trying to loop cut this concrete barrier. Now I'm following a tutorial and kind of did my own thing in some areas. I cleaned it up following some instructions in another answer here on stack exchange.  I can't for the life of me figure out why I can loop cut around the whole bottom:   ...but not the whole middle:   I see this marked as answered by another question. That question refers to ngons and inside faces. Now once again I'm totally new to this. I looked on the inside. I don't believe I have inside faces or any ngons by the terms I've read online in my research.  Here is a wireframe picture and the inside view:     Maybe I'm missing something the answers on other posts are saying. If so and you know what it is I'd be very appreciative of what it is.


Simplify the expression    $$\binom{n}{0} - \binom{n}{1} + \binom{n}{2} - \binom{n}{3} + \cdots + (-1)^n \binom{n}{n}$$    for positive $n$.   I tried to find a one-to-one correspondence but I'm stuck.  Can anyone help?

Given a positive integer $n$. How to prove that $\sum\limits_{k=0}^{n}(-1)^k \dbinom{n}{k} = 0 $ ?   I've tried using mathematical induction, then:  $$p(1)=\sum_{k=0}^{1}(-1)^k \binom {1}{k}=0 $$  And my induction hypothesis is: $$p(n)=\sum_{k=0}^{n}(-1)^k \binom {n}{k}=0 $$ So, i need prove: $$p(n+1)=\sum_{k=0}^{n+1}(-1)^{k} \binom {n+1}{k}=0 $$ Let $\sum_{k=0}^{n+1}(-1)^{k} \binom {n+1}{k}$, $$\begin{align} \sum_{k=0}^{n+1}(-1)^{k} \binom {n+1}{k} &= \sum_{k=0}^{n}(-1)^{k} \binom {n}{k}+(-1)^{k} \binom {n+1}{n+1} \\ &=0 + (-1)^{k} \end{align}$$ What am i doing wrong?


I recently stumbled upon this:    (From page 13 of .)  Can anyone identify where the math symbols are coming from? It looks similar to the default LaTeX math font, but it's not quite. The curly braces, in particular, have real curl to them, and the asterisk and angle brackets are also different. I'd like to copy some of these features, if anyone can help me find where they've come from.

Is it possible to identify the font used in a specific document/picture?  Answers to this question should identify:   Possible methods to do this (perhaps one answer per method) and adequately describe how to use it (as opposed to merely stating it); Ways of finding the identified fonts, if possible (free or not); and Any prerequisites associated with the method used, if required (for example, "In order to use method X, your document has to be in format Y").   This question is meant as an FAQ, based on an . Its aim is to facilitate the community with the general procedures involved in font identification. Similar cases are solved on a per-usage basis on 's  tag.


I'm searching for a workaround for creating a folder which will be fully co-used with root and user including new subdirectories.    Example of usage:  I have an application which sometimes needs to run under root. The application has some global configuration files and project configuration files and some project files. While it is working the application can create, edit, delete files and create, edit, delete folders. I want to run the application after under user and not have any issues with permissions.  Are there any workarounds for a scenario like this?  Update: All "duplicate answers" were not able to resolve my issue. You still can't create subdirectories which will inherit permission rules.   I need to allow this scenario: We have a shared folder called "test".    root:     mkdir dir1 // under test folder cd dir1 touch file1    user:    cd test/dir1 rm file1

I don't want the shared folder to be accessible by anyone on the system, I want it to be accessible just to a restricted set of users.  How to I do that?


I have 7 classification rasters.  Each raster has probability values from 1 to 10. All of the rasters overlap each other at some areas.  I would want to create a new raster that carries the maximum probability value on the overlap of the 7 rasters, and at the same time keeps the classification of the original raster.  For example:  In one location: raster 1 (max is 10) overlaps with raster 2 (max is 9) and raster 3 (max is 5) ----> expected output of the pixel should have the value of raster 1  In another location: raster 1 (max is 2) overlaps with raster 2 (max is 9) and raster 3 (max is 4) ----> expected output of the pixel should have the value of raster 2  I tried "Mosaic To New Raster" tool with "maximum" but the output is simply a map showing the maximum value of the pixels, without me knowing from which raster it was coming from.  So it is possible to use ArcGIS to create this new raster (without the overlap because the overlap has already been assigned to the classification raster that carries the maximum value)?  I have been looking at existing questions, but I am not finding one that answers my question.  Or if there is any, can someone point me to it?  I am using ArcGIS 10.4.    From comments by @FelixIP, this could be solved using Spatial Analyst Tools --> Local --> Highest Position!

I have 3 rasters for water use and 1 raster for water supply.   I want to know which one has the highest values which will mean that it has the greatest influence on available water supply.  What tools can I use for this in arcmap 10.0 and how do I do this?


I was asked this question by a friend today, and the question really beats me. I know that gracias and merci are like practical workarounds, but is there no synonym for Thanks in English?

The context for my question might be a bit strange.   I have stuttering and therefore I have some difficulties pronouncing some words starting with particular phonetics. And I've found that if a sentence starts with a /th/ sound, it makes me feel uncomfortable.  Especially in the word is "thanks" or "thank you".  So I want to know if there's a popular alternative for "thank you" that may not seem strange and that unnatural. I've searched the website and I know there are alternatives like "I appreciate your help." but that sounds a bit overly formal for me. (Or is it? correct me if I'm mistaken.)


How do I disable automatic iTunes launch when iPhone is plugged in via USB (for charging)?    In fact, I would like to disable automatic launch of anything when an iPhone is plugged in (including photo sync).

When I connect my iPad or iPhone to my Mac iTunes automatically launches. What is the simplest way to prevent this from happening?


, could a werewolf or other shapechanger be subject to Polymorph?  What I'm reading of Polymorph, RAW PHB p.266,  is:   "an unwilling creature must make a Wisdom saving throw to avoid the effect", and "a shapechanger automatically succeeds on this saving throw"   Interestingly, the wording for True Polymorph, PHB p.283, is different, being simply: "Shapechangers aren't affected by this spell." So, naturally, I simply seek clarification on whether I am interpreting this correctly:  Could a werewolf or other shapechanger be subject to Polymorph assuming it were charmed into being willing via Suggestion or similar?  ( covers True Polymorph, though non-true Polymorph has different wording.)

Going through the spells, I see the phrase "Willing creature" used to determine who you can cast some spells on. I don't ever see a proper definition of what a willing creature is, but I would assume that it would go something like if you asked them "Can I perform this spell on you" they would answer yes. Is there a more formal definition of what makes a target willing in 5e?  What are the ways I could make an otherwise unwilling creature willing? Suggestion spells, for instance, should probably work but what other options do I have?


Is there anything such as LaTeX documentation? When I am looking for some syntax on google, I only get to forums, but never a site with actual documentation, such as when looking for the meaning of \thechapter or \let. It seems everyone knows meaning of things like secnumdepth but where does this knowledge come from other than going through the sources and hoping the developer left a useful comment? I know for packages to go to ctan but other than that...

Which book (free or otherwise) was the most useful to you when you started learning LaTeX?  I am frequently asked this question by friends who want to learn LaTeX, and I recommend the book which got me started, , but I feel that there might be better options around.  Also see .


Should I mention in my application form that I am entering a different country first and later I will be staying longer in the country which Schengen visa will be issued to me?  Please help me before I submit my application forms.

In case, if I get a multiple-entry Schengen visa in one of the embassies in Ukraine, Kyiv - should my first trip be to the country which issued the visa?  Any there any requirements of this sort? Does this condition vary depending on embassy which issued the visa?  What are the possible consequences on not visiting that country first? Does it somehow depend on country where the embassy is (i.e. non-Schengen and not EU members)?


Use induction to prove that when $n≥1$, $a_i\in R$, $a_i > 0$, if $a_1a_2\cdots a_n=1$, then $(1+a_1)(1+a_2)\cdots(1+a_n)≥2^n$.*  The base case is simple, but I do not know how to complete the inductive step:  If $a_1a_2\cdots a_{n+1}=1$, then $(1+a_1)(1+a_2)\cdots(1+a_{n+1})≥2^{n+1}$.  I made a case when $a_{n+1}=1$, but could not complete the other cases.  There are other proofs of this inequality, but I do not think they use the "if" part require in this proof.  *Another way to write this inequality is as follows: $$ \left(\frac{1+a_1}{2}\right)\cdots \left(\frac{1+a_n}{2}\right) \ge 1 .$$

Hello I have been blasting at this inequality proof and it is just not doing what I want it to do:     Prove that $2^{n-1}(a_1a_2\ldots a_n + 1) \geq (1+a_1)(1+a_2)\ldots(1+a_n)$ assuming that $a_1,a_2,\dots, a_n \geq 1$.$\:\:\:$   So the base case is pretty trivial, which leads me to assume that this inequality holds for $k$, so I want to prove $P(k+1)$. I do the following:  $$ (1+a_1)(1+a_2)\ldots(1+a_k)(1+a_{k+1})\leq 2^{k-1}(a_1a_2\ldots a_k + 1)(a_{k+1} + 1)  $$ I tried methods like setting the second "$1$" to $a_{k+1}$ and then I have $2^k(a_1\ldots a_k + 1)a_{k+1}$ but I can't assume from there that $2^k(a_1...a_ka_{k+1} +a_{k+1})$ and the second $a_{k+1}$ becomes $1$. So maybe my method is not good from the get-go. Thank you!


I have a laptop with Windows 8.1 installed, which has a lot of bugs and I'm thinking to reinstall it from scratch. The recovery tool doesn't work either, so the only option that comes to my mind is to use a USB bootable key to reinstall Windows 8.1; but the problem is that it will probably ask me for the product key. Is there a way to reuse the old one?

I recently purchased an ASUS laptop with Windows 8 installed. The hard disk capacity is 750 GB. I checked the C drive and could see that they have used almost 40/50 GB for installing Windows 8, including all the graphics drivers and other drivers.   I would like to format my machine and reinstall Windows 8 from scratch. I don't want to use the recovery drive or any other means. Is it possible to install only Windows 8 with the existing product key?   The rest of the software or drivers for my computer will be installed manually.


On Win 7 Enterprise 64bit V6.1.7601 SP1 Build 7601, I cannot create *.csv files with specific names, i.e. CON.csv or PRN.csv.  This is the error I get when I try to rename:    Also, if I try to rename it from cmd.exe:    I also tried lowercase, still problems. Why do I get those errors?

In all versions of Windows, we are unable to rename a file or a folder name as CON without third-party file renaming software. Trying to do this in Windows 7 results in an error:     The specified device name is invalid.   Trying to save a file as con.txt in Notepad leads to a similar error:     This file name is reserved for use by Windows.   Choose another name and try again.   Why can't we name a file or folder CON in Windows?


Does anybody have an idea why this is not working?

I am trying to use the Alt+Right Click to select edge loops in Linux Mint but this shortcut doesn't work it is already used for Linux to reduce a window. I have checked the keyboard shortcut but it doesn't appear.


I recall reading a story in the 1970s (USA paperback) about a small group of people (anywhere from a dozen to 50?) stranded on the wrong side of the continent from their rescue. (There was some time limit because either the rescue ship would leave on set date, or had to get there before their food ran out.) They were under a strict No Interference with the natives culture/tech/knowledge. (Like Star Trek's Prime Directive) So I believe they had to destroy or disguise all their high tech equipment/weapons before they start the journey. I think  the natives were similar in shape/coloring that the survivors could say they were natives from a distant land to account for the small differences. But don't remember for sure. The land is quite populated and probably a European Middle ages time period (1000-1400) I don't remember if they had firearms, or were only using swords, bows and spears. Pretty sure they had to interact with the natives much like in Weber/Ringo's "Empire of Man" series. (Sometimes diplomacy, sometimes fighting) The main thing I remember, was when they finally arrived and were rescued, they got in trouble because they had accidentally introduced a different style of harness similar to a horse collar or oxen yoke.   Previously the natives tied their carts to a collar like a dog collar which choked their beast of burden when they tried to pull heavy loads so it limited them to loads maybe only 10% of what the new collars/yokes could handle. (The survivors needed to transport heavy loads, which is why I think they needed to carry their own food.) Previously the native animals either pulled light carts or carried cargo on their backs like mules. The new collar/yoke allowed an animal to pull the load with their shoulders instead of their necks which is what makes the new collar/yoke so effective.

The book is written in the 1980s. The storyline is about an early 20th century level technology planet getting visited by a spaceship which causes quite a stir. The visitors start helping to consolidate all of the countries on the planet. Everyone thinks this is good but some people accidentally find out they're actually being conquered by using the planets own people to do the fighting.   They also find out that when all the planet's countries are defeated and under the control of a single government, the planet will be colonized by a space federation that is reclaiming long lost planets.  Through trickery they learn that if they can somehow get space travel they wouldn't be colonized and would have rights and a higher place in the federation. They start sneaking around trying to make a spaceship with their early 20th century tech.


I'm a Sri Lankan national. I'm currently doing my M.Sc. in Norway. So I have a Schengen Student visa (temporary resident permit) which I renew every year.  My question is that if I want to transit via London Heathrow without entering the UK do I need a transit visa? Because the www.gov.uk site does mention that there are exemptions for people with long stay visa (Category D Visa) in EEA countries. I couldn't find any information about my specific situation. Is my Schengen Student visa (temporary resident permit) a category D visa which qualifies for transit in the UK without a visa?  Thank you!

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.


When I try to do anything that needs elevated privileges in Windows 10 (such as run a program downloaded from Internet), I get the question  Do you want to allow this app to make changes to your PC?   but it has no yes option, only no button. This happened after I changed my account's type to user (it was administrator). However, for whatever reason, the laptop seems not to have any other administrator account, or it is not enabled. Commands like  net user administrator /active:yes   show the same dialog, without a yes button.  I tried substituting SETHC.EXE with CMD.EXE as  recommends, and five times pressing Shift really brings a command prompt, but it does not have admin rights: it runs under the same user account.  Anything else I can try?

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


\begin{align} \displaystyle Γ(2.7) &= \int_{0}^{∞} x^{(2.7-1)} \cdot e^{(-x)} dx  \\[7pt] Γ(2.7)               &= 1.54968  \end{align}   I got this answer online, but I do not know how to get it. Would you please explain how to get the value of this gamma function?

All I know of the Gamma function is $$\Gamma(\alpha) = \int\limits_{0}^{\infty}x^{\alpha - 1}e^{-x}\text{ d}x$$ and the recursive formula $$\Gamma(\alpha) = (\alpha-1)\Gamma(\alpha - 1)\text{.}$$ A friend asked me to try to find $\Gamma(2.7)$. I assume this involves complex analysis, which I have absolutely no background on (except for the basic Euler formula). Using Wolfram, I found that  $$\Gamma(2.7) = e^{0.434821}$$ which suggests to me perhaps writing out $e^{-x}$ as a Taylor series: $$\Gamma(\alpha) = \int\limits_{0}^{\infty}x^{\alpha - 1}\sum\limits_{i=1}^{\infty}\dfrac{(-x)^{i}}{i!}\text{ d}x$$ but alas, this doesn't look helpful.  How does one derive that $\Gamma(2.7) = e^{0.434821}$?


Prove if $n\in N$ is composite then there exists an equivalence class $a\bmod n$ that does not have a multiplicative inverse    I know that the if $n=j*k$ with $j,k<n$ that $j\bmod n$ or $k\bmod n$ probably don't have inverses, but I don't remember the theorem for it.

Whilst reading I came across the strange claim that multiplicative inverses exist for only prime values of $n$ in $Z_n$. I am a little puzzled as contrary to that, I know that additive inverses exist for all values of $n$. What would be an approachable proof of the above result?  Thanks in advance.


This is a follow up question to     Recently I decide to stop ignoring LaTeX warnings :), and start trying to discover what's behind them and how to avoid them in future (or solve the problems informed when they are real).   One of those warnings, which I thought I had already understood, was pdfTeX warning (ext4): destination with the same identifier. Now I know that it is related to a  hyperref package confusion regarding subequations (at least).  Why are these warnings displayed? Are they unimportant? How can avoid them or at least silent if they don't afect my texts? What are the known incopatible packages with hyperref?  Below is a MWE. Compiling it just like it is showed will result five warnings of the same type. More and more warnings show up using subnumcases and empheq packages for creating subequations in the same project (to test them uncomment \usepackage{empheq}, \usepackage{cases}, and the three final equations).  \documentclass{article}  %\usepackage{silence}  \usepackage{hyperref}    \usepackage{mathtools} %loads amsmath %\usepackage{empheq}  %\usepackage{cases}  \begin{document} \section{\LaTeX~MWE}  hyperref + subequations problem:  \begin{subequations}\label{group1} \begin{align} a1 \label{a1} \\ a2 \label{a2} \\ a3 \label{a3} \end{align} \end{subequations}  \begin{subequations}\label{group2} \begin{align} b1 \label{b1} \\ b2 \label{b2} \\ b3 \label{b3} \end{align} \end{subequations}  %\begin{subnumcases}{}   %X \label{X} \\   %Y \label{Y} \\   %Z \label{Z} %\end{subnumcases}  %\begin{subequations}{}   %\begin{empheq}{align}   %A  \label{A} \\    %B  \label{B} \\   %C  \label{C}  %\end{empheq}  %\end{subequations}  %\begin{subequations}  %\begin{empheq}{align}          %l \label{l} \\      %q \label{q} \\      %x \label{x}   %\end{empheq} %\end{subequations} \end{document}   I found many topics topics that may be related but in none of them I found a definitive answer to my questions. In the post  a workaround that can be usefull in my case was suggested (but I don't know the cleveref package yet).

The hyperref documentation says: "Make sure it comes last of your loaded packages". The reason is that it redefines many LaTeX commands. It's a rule of thumb that helps to avoid errors.  However, there are exceptions, for instance the amsrefs user's guide notes that amsrefs has to be loaded after hyperref.  To avoid problems when adding hypertext functionality: do you know further such exceptions?


On a form that I made I check a lot of checkbooks and set values accordingly. For example, if checkbox1 is check I set $somevalue equal to Yes, else it is equal to No. I later than call $somevalue in an sql query.   Is this secure? I know you're never supposed to trust user input. I am parsing my input boxes with mysqli_escape_string and checking if drop down boxes contain values I expect. I'm just not positive if I have to do anything extra for my check boxes.

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


Let $I(a,b):= \int_0^{\pi/2}\ln(a^2\cos^2x+b^2\sin^2x)\,dx$  Calculate $I(a,b)$.  My attempt:  Define function $F(a,b,x)$ as following $\frac{\partial f}{\partial a}F(a,b,x)=\ln(a^2\cos^2x+b^2\sin^2x)$  Then $I(a,b):=  \int_0^{\pi/2}\ln(a^2\cos^2x+b^2\sin^2x)dx= \int_0^{\pi/2}\frac{\partial f}{\partial a}F(a,b,x)= \frac{\partial f}{\partial a}\int_0^{\pi/2}F(a,b,x)$  The last equality is done by using Leibniz integral rule, I must prove that the function is well defined in a 3-dimension cube.  Calculating F:  $F(a,b,x)=\int \ln(a^2\cos^2x+b^2\sin^2x)\,da$  Using the integral by parts, $u'=1, u=a, v=\ln(a^2\cos^2x+b^2\sin^2x), v'=\frac{2a\cos^2x}{a^2\cos^2x+b^2\sin^2x}$  $F(a,b,x)=uv-v'u=a\ln(a^2\cos^2x+b^2\sin^2x)\space-\space \int\frac{2a^2\cos^2x}{a^2\cos^2x+b^2\sin^2x}\,da= a{\ln(a^2\cos^2x+b^2\sin^2x)} \space-\space \int\frac{2a^2\cos^2x}{a^2\cos^2x+b^2\sin^2x}da= a{\ln(a^2\cos^2x+b^2\sin^2x)}\space-\space \int\frac{2a^2\cos^2x+b^2\sin^2x-b^2\sin^2x}{a^2\cos^2x+b^2\sin^2x}da= a{\ln(a^2\cos^2x+b^2\sin^2x)}-\int 1-\frac{b^2\sin^2x}{(a^2\cos^2x+b^2\sin^2x)}da$  And I am stuck.. I don't know how to handle that integral. I am not even sure I am solving it correctly..  Any tips?

I have been attempting to solve this integral for several days in preparation for an exam and keep reaching dead ends.  I(a,b) = $\int_0^{\pi/2} \ln(a^{2}\cos^2(x)+b^{2}\sin^2(x)) dx$, where $a,b>0$  My best approach so far is defining:  $F(x) = I(x, b)$  Then, I know:  $F(b) = I(b, b) = \pi/2 * \ln(b^2)$  Then I am now attempting to find $F'(x)$ using differentiation under the integral sign, and integrating from b to a.  This is where I am stuck - no matter what I do, I cannot solve the integral. Am I in the right direction or should this be solved in a different manner? I also considered something elliptical due to the acos, bsin in the original integral, yet it has also reached a dead end.


Yesterday, I tried to send a text through iMessage on my MBP 13" (2020) only find it not sent about 10 minutes later. I tried sending it again, the same outcome. I sent the message directly through my iPhone SE (2020) without any problems. Fact: text service is working fine. I decided to logout/login to iCloud on my MBP. This of course necessitated me to reconnect my iPhone and iPad to my iCloud account. Those reconnect without any problem. The problem came with the MBP. iMessage asks me to log in with my Apple ID and I get the following error message:   Could not sign in to iMessage. An error occurred during activation. Try again.  I have tried multiple times to connect/authenticate iMessage without success. I am wondering if a preference file has been corrupted and is unable to authenticate. How can I fix this error and reconnect iMessage to iCloud? MBP 13" (2020): running 10.15.6

I couldn't log in to FaceTime so I did a factory reset of my MacBook. It worked for a brief period of time and then suddenly it just logged out.  I believe it might have been after iCloud synced with keychain or after I changed my local host name and computer name.  I have seen other users facing this issue but no solutions. Is there a troubleshooting guide or should I just contact Apple support since I can't use their service without activation to my Mac?


Can anyone please show me how to solve this problem? I'm stuck $$\sum_{k=1}^n k = \frac{n(n+1)}{2}$$ $$ and $$ $$\sum_{k=1}^n k^3 = \left(\sum_{k=1}^n k\right)^2$$  To prove by induction, it has to be as following: 1) Base Case: Show that P(n) is true. 2) Induction Hypothesis: Assume P(k) is true. for $k\in\Bbb N$  3) Induction Step: Show that P(k + $1$) is also true.

How can I prove that     $$1^3+ 2^3 + \cdots + n^3 = \left(\frac{n(n+1)}{2}\right)^2$$    for all $n \in \mathbb{N}$? I am looking for a proof using mathematical induction.  Thanks


I just posted a  from android app and now trying to view it but it says "Loading the Question Failed".  Steps to reproduce:   Post a Question from Android app Now ask some one to comment on your question. (So that it can appear in your feed screen, Unfortunately in my case  did the job :) ) Delete Question from web (Oh yeh, there is no facility in app to delete question yet) Do pull to refresh in Feed screen of android app. Now click on that question/comment feed and get question loading failed dialog!

Just noticed this:  Someone @replied to me in a question which appropriately showed up in my feed.  I go to click on that notice in the feed, and it presents me with "Loading the question failed."  I'd show a picture, but I don't think that it's entirely relevant - I believe it's reproducible if an answer is posted, someone makes a reply, the answer is removed, then that someone else goes back in the feed to try and revisit the post.  Alternatively, why not synchronize the interface between what a 10K user sees on the site, and what they see in the app?  As a 10K user, I would expect to see deleted questions and answers.


Find the derivative of $y=x^x$.  My Attempt: $$y=x^x$$ Taking $\textrm {ln}$ on both sides, we get: $$\textrm {ln} y= \textrm {ln} x^x$$ $$\textrm {ln} y = x \textrm {ln} x$$  How do I procees further?

I am having trouble finding the derivative of the following:  $$y = x^x+x^3+3^x+3^3$$  $$\frac{dy}{dx}= x \times x^{(x-1)}+3x^2+3^x\ln3+0$$  I think the $x^x$ part is wrong. Any help would be appreciated.


I've been running Kubuntu for about a month now, still learning.  All of a sudden as of about two days ago, if I try to install or update software using Muon, it asks for the root password.  I'm assuming this is my administrative password, but that password won't work.  I know I'm typing it in correctly (case sensitive) and I haven't forgotten my admin password because I can log in to my laptop when I first turn it on using the same password.  If the administrative password is not the root password, then what is the root password?  I followed some directions online regarding booting in safe mode, but i can't get the passwd command to work.  I tried that twice and I keep getting an error message telling the password was not changed.  Then I don't know how to exit out of safe mode.  I kept hitting the escape key and that didn't work.  I ended up just powering off my laptop to get out of safe mode.

I'm working on a Ubuntu system, and my client has completely forgotten his administrative password. He doesn't even remember entering one; however it is there.  I've tried the suggestions on the website, and I have been unsuccessful in deleting the password so that I can download applets required for running some files. Is there a solution?


I can't change space bar shortcut from preferences after I made my own panel, space bar shortcut has disappeared.

I want to switch to right click but, there is no option to do that in the User Preferences. I should be located at the top of the Keymap section.


I read a fantasy novel in the 1998 or 1999 that I'm trying to identify.   The most specific thing I remember was a scene where the main character was sneaking through a building and he saw a naked armless troll writhing around on the floor and there was a very specific description of the troll's penis as being worn raw. Pretty gross, but that's why it stuck with me.  The book was in English and was probably American. It was a dark urban fantasy novel with lots of explicit sex and violence, probably over the top to the point of cheesiness. It had all the standard fantasy creature like elves and trolls and I'm pretty sure it was set in a fantasy world not in a variant of our world.   I can't confirm when it was written, but it was on the new books shelf at my library so it was likely written in the late 90s. I don't recall the cover image as the book didn't have a jacket. I'm pretty sure it was hardcover.  I don't think it was written by a major fantasy author like Michael Moorcock or Terry Brooks, as I was reading those authors and probably would have remembered. I also don't think it was explicitly part of a series of books, but it could have been the first book in something that became a series. It also wasn't part of a some larger franchise, like a Dungeons and Dragons or Magic: The Gathering novel.  I wish I remembered more, but that one scene was all that really stuck with me.

Read the book once in the late 90's The only things I can remember are:   Dragons were some sort of war machine (built and maintained, rather then real, living creatures) A bunch of somewhat magical creatures working in a factory. The pilot of the dragon has small needles inserted into their arms. Lastly, I'm associating the color green with the cover.   Anyone got any ideas?


I have the classes  abstract class MyGeneric<T> {     ... }  class A : MyGeneric<int> {     ... }   How can I check, using the is operator, if any object is an instance of class MyGeneric?  Something like this:  bool isGeneric = anyObj.GetType() is MyGeneric;

I have a generic class in my project with derived classes.  public class GenericClass<T> : GenericInterface<T> { }  public class Test : GenericClass<SomeType> { }   Is there any way to find out if a Type object is derived from GenericClass?  t.IsSubclassOf(typeof(GenericClass<>))   does not work.


I've been trying to find the answer to this question, but haven't been able to find it yet, as I seem to find conflicting answers online. The description of Portent is as follows:  When you finish a long rest, roll two d20s and record the numbers rolled. You can replace any attack roll, saving throw, or ability check made by you or a creature that you can see with one of these foretelling rolls. You must choose to do so before the roll, and you can replace a roll in this way only once per turn. Each roll can only be used once.  My group has been having some questions:  An enemy has to roll 1d20 + 5 for an ability check. The wizard uses portent to replace the ability check with 2.  Does the enemy still add +5 (2+5 = 7)?  The Portent text doesn't mention it only replaces the roll, but the "ability check", so we're unsure if only the die is changed, or the entire check. An ally would roll for an attack roll, but the wizard replaces it to 20 with Portent. Is that considered a critical hit and roll critical damage as appropriate? (same for replacing an enemy roll with 1. A character would roll with disadvantage/advantage. The wizard uses Portent. Does the character still roll one die, and check for advantage/disadvantage (higher/smaller between his roll and the Portent number), or the check itself is replaced in it's entirety, no need to roll the second die?  So, it's three questions:  Do bonuses (+/- to roll) apply to the Portent chosen number? Does critical success/failure apply to the Portent chosen number? Does Portent both rolls in the case of advantage/disadvantage rolls?  As we understand, the die is never really rolled, as it's result is defined by the Wizard in the foretelling. So far, we've been considering if the Portent roll was 8, then no bonuses are applied at all, no advantage/disadvantage second die is rolled, and the result is just a flat 8.

The 's  feature states (PHB, p. 116; emphasis mine):  You can replace any attack roll, saving throw, or ability check made by you or a creature that you can see with one of these foretelling rolls. You must choose to do so before the roll, and you can replace a roll in this way only once per turn.  In the introduction to the PHB (p. 7) and basic rules, the 3rd paragraph under  describes saving throws, attack rolls, and ability checks as (emphasis mine):  [...] the three main kinds of d20 rolls, forming the core of the rules of the game.  All three of them consist of a d20 roll and then modifiers are applied to this die roll. The description of Portent is quite foggy. The first sentence suggests that it allows to replace the final result (d20 + modifiers); however, the second part of the description mentions the roll, without specifying if it just refers to the d20 roll or to d20 + modifiers. Does the Portent feature allow the Divination wizard to replace just the d20 roll? Or does it replace the final result?  This topic is covered in several answers and questions related to Portent working with other rules/aspects of the game, but I believe that this aspect of Portent needs a dedicated question. Some of these answers cite tweets by rules designer Jeremy Crawford. On one hand, the  ("Official Ruling" section) states that ; on the other hand, in the very same section it also states that Crawford's tweets could be a preview of rulings that will appear in the SAC. Crawford's tweets about this issue  and  have not been still included in any version of the Sage Advice Compendium, to the best of my knowledge.


I'm trying to prove the converse of the following theorem. I think suggestion available at this website are mistaken or I didn't understand them correctly.  Theorem. Let $R$ be a commutative ring with $1$. Then $f(X)=a_0+a_1X+a_2X^2+ \cdots +a_nX^n$ is a unit in $R[X]$ if and only if $a_0$ is a unit in $R$ and $a_1,a_2, \ldots, a_n$ are all nilpotent in $R$.  Let $f,g$ be two polynomials of degree $n$ and $m$. Then the coefficients of their product will be given by the following relation: $c_k = \sum_{i=0}^k a_i b_{k-i}$. Here we don't get $a_n b_m = 0$ because it is not yet the coefficient of $x^{m+n}$. If I would prove that $a_n$ is nilpotent, the proof will be followed... Any comment where I'm confused?  Why this question isn't duplicate? This question is answered but all argue that coefficient of $x^{m+n}$ are $a_n b_m$ which I believe is wrong. $c_{m+n} = \sum_{i=0}^{m+n} a_i b_{m+n-i}$. If you expand this, it will be sum of product of those coefficients such that $X^iX^j$, where $i+j = m $

I am trying to prove a result, for which I have got one part, but I am not able to get the converse part.  Theorem. Let $R$ be a commutative ring with $1$. Then $f(X)=a_{0}+a_{1}X+a_{2}X^{2} + \cdots + a_{n}X^{n}$ is a unit in $R[X]$ if and only if $a_{0}$ is a unit in $R$ and $a_{1},a_{2},\dots,a_{n}$ are all nilpotent in $R$.  Proof. Suppose $f(X)=a_{0}+a_{1}X+\cdots +a_{n}X^{n}$ is such that $a_{0}$ is a unit in $R$ and $a_{1},a_{2}, \dots,a_{r}$ are all nilpotent in $R$. Since $R$ is commutative, we get that $a_{1}X,a_{2}X^{2},\cdots,a_{n}X^{n}$ are all nilpotent and hence also their sum is nilpotent. Let $z = \sum a_{i}X^{i}$ then $a_{0}^{-1}z$ is nilpotent and so $1+a_{0}^{-1}z$ is a unit. Thus $f(X)=a_{0}+z=a_{0} \cdot (1+a_{0}^{-1}z)$ is a unit since product of two units in $R[X]$ is a unit.   I have not been able to get the converse part and would like to see the proof for the converse part.