Is it possible to add an image to static resources using apex code and metadata?  On a detail page I want to click a button that says upload image and store that Url in metadata Field and than pass it to Static resource rather than in attachments on the individual record.  Is the possible and if so do you have any sample code?

Is there a way to create a StaticResource within a Apex code.  this the code i am doing:          StaticResource sr = new StaticResource();         sr.Body = file;         sr.Name = 'testLicence';         sr.ContentType = 'zip';         sr.CacheControl = 'Public';          sr.create();   but i am getting this error:   Method does not exist or incorrect signature: [StaticResource].create  and when i consulted the documentation in this link:                         it says that the create() method is supported.  What's wrong with my code ?


"Have you seen him run" or "have you seen him running"? Which of these sentences is more accurate?

Which one of the following is the correct one?   I should have seen it glow. I should have seen it glowing.   Or are both correct? Would you parse them please?


What is the probability that you are dealt a "full house"? (Three cards of one rank and two cards of another rank.)  why can't I calculate the probability in the following way?  The number of ways I can select 2 suits from one rank = $$13 \choose 2$$ The number of ways I can select 2 suits from one rank = $$4 \choose 2$$ The number of ways I can select 3 suits from another rank = $$4 \choose 3$$  so p should be $$\frac{{13 \choose 2}{4 \choose 2}{4 \choose 3}}{52\choose5}$$  My question is how can I tweak my approach and reach the right answer.

I was trying to answer      Find the probability of getting a full house from a $52$ card deck. That is, find the probability of picking a pair of cards with the same rank (face value), and a triple with equal rank (different from the rank of the pair of course).   My idea was this:  Take one rank. The number of ways you can get a pair from a rank is $C(4, 2)$.   Take another rank. The number of ways you can get a triple from that rank is $C(4, 3)$.   Therefore, the number of ways you can get a full house from just $2$ ranks is $C(4, 2) \cdot C(4, 3)$. But there are $13$ different ranks, and the number of ways you can select $2$ ranks out of $13$ is $C(13, 2)$. For each of these pairs of ranks, you can have $C(4, 2) \cdot C(4, 3)$ full houses. Therefore the number of possible full houses is $C(4, 2) \cdot C(4, 3) \cdot C(13, 2)$, and the probability of selecting a full house is  $\dfrac {C(4, 2) \cdot C(4, 3) \cdot C(13, 2)}{C(52, 5)} \approx 0.000720288$  However, this is way lower than the actual answer of $.00144$. Where did I go wrong here?


Why is the holder space with $\alpha >1$ a constant set? Is it related to the lipschitz condition? But, this seems to fail, as a continuous function may not be Lipschitz continuous.

I want to show that if a function $f:[a,b]\rightarrow \mathbb R$ satisfies a Hölder condition of order $\alpha > 1 $ then it is constant.  The way I think of it is as follows:  $$|f(x) - f(y)| < K|x-y|^\alpha$$  $$\frac{|f(x) - f(y)|} {|x-y]}  < K|x-y|^{\alpha -1}$$  $$\lim_{y\rightarrow x} \frac{|f(x) - f(y)|} {|x-y]} \le \lim_{y\rightarrow x}  K|x-y|^{\alpha -1} =0 $$ As the limit is $0$, we can remove the modulus, so we get:  $$\lim_{y\rightarrow x} \frac{f(x) - f(y)} {x-y} = 0$$ So $f$ is derivable and $f'(x) = 0$ for all $x$ in $[a,b]$. Note that the reason we can add the limit $y\rightarrow x$ is because $[a,b]$ is closed in $\mathbb R$.  However, the question gives as a hint using the mean value theorem. I am not sure why one should do that. You would first have to prove that $f$ is derivable in a similar manner to what I did, and then prove that $f$ is constant. Or is there a simpler way to do it and I am missing it?  Also please inform me of any mistakes I did in the proof (if any)/ Thank you!


I punched him and he cried.   or   I punched him, and he cried.   Are both acceptable? Is one better than the other? Personally, I like the first one best, as it better shows the cause/effect relationship of the two clauses, but I am not confident that it is gramatically correct.  He told me to do it or I would have to leave.   or  He told me to do it, or I would have to leave.

I often see people on the Internet using a comma before and in many cases (not adversative cases). Is it ok? In my language it is stricly prohibited to use a comma before an and except for adversative cases or when an apposition is in the front of that and. Examples (which I consider not ok):  He is a great player, and he prefers to play Counter-Strike. John joined the Army, and George joined the Marines.  What I consider exceptions:  Yes, and what is the problem? I called John, my brother, and now I’m speaking with him.


I have written stored procedure for calling URL using http_get function but getting error that http_get not exist    DELIMITER $$     CREATE DEFINER=`root`@`localhost` PROCEDURE `Demo`()     BEGIN     SELECT http_get('abc.com/aa') ;      END$$     DELIMITER ;

I'd love to do this:  UPDATE table SET blobCol = HTTPGET(urlCol) WHERE whatever LIMIT n;   Is there code available to do this? I known this should be possible as the  include an example of adding a function that does a DNS lookup.  MySQL / windows / Preferably without having to compile stuff, but I can.  (If you haven't heard of anything like this but you would expect that you would have if it did exist, A "proly not" would be nice.)  EDIT: I known this would open a whole can-o-worms re security, however in my cases, the only access to the DB is via the mysql console app. Its is not a world accessible system. It is not a web back end. It is only a local data logging system


I'm really struggling with the different tutorials as I keep getting errors or I keep getting told that what I'm doing isn't recognised as a command so I would really appreciate it if someone could walk me through this. I've been trying to install HaskellToolStack because I think it's something I need? I don't know, I'm starting university soon and they suggested that learning some Haskell before starting is a good idea. Near the end of my installation I get this message in my terminal.  Stack has been installed to: /usr/local/bin/stack  WARNING: '/home/kester/.local/bin' is not on your PATH.     For best results, please add it to the beginning of PATH in your profile.  And I've tried to follow the tutorials and have found no success so I would really appreciate it if someone could just tell me step by step what I should type into my terminal

How do I add a directory to the $PATH in Ubuntu and make the changes permanent?


I have a question regarding a paper:  let $φ, ψ: ℝ^3 \to ℝ$ two linear maps with $φ(v)= 〈a,v$〉 and $ψ(v)=〈b,v$〉with $a,b ∈ ℝ^3$. We define the map with $ℝ^3 \times ℝ^3 \to ℝ$ by  $$s(v,w):=  φ(v) * ψ(w).$$  I need to show that s is a bilinear form and determine the transformation matrix of s regarding the canonical basis of  $ℝ^3$.  I have no clue how to do this, so help would be much appreciated

Let $\mathbf{v}=(v_1,\cdots,v_n)^T, \mathbf{w}=(w_1,\cdots,w_n)^T, \mathbf{a}=(a_1,\cdots,a_n)^T     \in\mathbb{R}^n$, and let  $$ A = (\mathbf{w}\cdot\mathbf{a})(\mathbf{v}\cdot\mathbf{a})=\left(\sum_{i=1}^{n}w_ia_i\right)\left(\sum_{j=1}^{n}v_ja_j\right) $$ Is there any way of simplifying this quantity? Into one sum, maybe?


Why does  Be(8) never exist and decay into 2 alpha particles?  Here, given Binding energy of Be(8)=7.064MeV & Binding energy of He(4)=7.08MeV.

Just a quick question.   How does Beryllium 8 decay into 2 alpha particles?  Beryllium 8 has a binding energy of 56.499508 Mev An alpha particle has a binding energy of 28.3 so two of these would have 56.6 Mev  So how does this reaction happen?   Beryllium doesn't have enough energy.


I would like to see something that gives closed posts that have been edited a little more visibility.  All edits bump the thread back to the front page, but there it tends to be drowned out in the noise. In particular, there is no indication as to whether the question has been edited after closing. There's no way to distinguish between “closed question, 99% chance that I won't disagree with the closing, I'm not even looking” and “closed question that's been edited, maybe I should see if it warrants reopening”.  While flagging for reopening is an option, this requires that the editor can flag and knows that he should flag. Besides, it would be better if reopening could be achieved by the community in practice (not really the case on less-trodden SO tags or on smaller sites). Replying to a comment can also bootstrap the reopening process, but only if high-enough-reputation users commented. When the asker is a new user, passively waiting for reopen votes is often all they can do and know how to do.  Since there are new review queues in the works, I think this should be part of one of them, perhaps together with the questions with reopen votes, but I don't have a precise implementation in mind. What I'm asking for is some way of having these closed-then-edited questions reach potential reopeners, without being lost in a sea of other boring stuff.  Note that this feature request is purposely different from . I don't think the people who did the closing should necessarily be the ones judging to reopen. Once edited, the post should be thrown back to the community in general — if only because the closers might not be around.

As implied by user bemace , what if the new /review included a "Questions edited after closing"  list? This would make it much more likely that improved questions would be reopened, making SO a friendlier, happier place, with more unicorns and waffles all around.


You can test the output of a television infrared remote control by photographing it with a digital camera - you see on the image if the infrared LED lights up.  Is there a method, without an oscilloscope, to find out if 27 MHz radio remote control is still sending a signal?

In my project, I use a use an  and . One of the RF components seemed to fail because the connection between my Arduinos no longer works. I cannot determine whether the RF Receiver or Transmitter works. I want to see if my RF Transmitter gives an output, but I do not own an oscilloscope to view it's waves. I've seen this , but it only shows if the Arduino is sending data to the RF Transmitter. Is there any alternative way to check if the RF Transmitter works or not? Thanks!


When I select the walls and assign them as a vertex group and then select this vertex group it selects the wall but the floor too. How can I make it select only the walls ?

I'm trying to find a way to save selection faces, tried Vertex Group, the issue with Vertex Group is that it adds the faces that are marked by 4 vertices that are added to the Vertex Group, there are some cases were this doesn't apply, the image explains what I mean. So is there a way to save my selected faces, so I don't have to go through the whole process of reselecting them each time I need to do so? If you check the image, I didn't assign the hatched faces to the Vertex Group, still when I select the Vertex Group, they get selected, I understand that they got selected because the four boundary vertices are assigned to the Vertex Group, I need to save only face selection, not vertex selection.


I try to check  if string is Match GetInvalidFileNameChars()  i would like to use regex  So i put the chars of GetInvalidFileNameChars() into a string and then check   if Regex.IsMatch(id, stringInvalidFileName)   I thought if id = "4711./" then Regex.IsMatch(id, stringInvalidFileName)  should be true, but it's false  What is my mistake, why is it false ?! Thanks in advance

I want to include a batch file rename functionality in my application. A user can type a destination filename pattern and (after replacing some wildcards in the pattern) I need to check if it's going to be a legal filename under Windows. I've tried to use regular expression like [a-zA-Z0-9_]+ but it doesn't include many national-specific characters from various languages (e.g. umlauts and so on). What is the best way to do such a check?


I'm trying to make an orbit animation and I did so by using this video:   When the keyframes were set I went to graph editor. There I used the key option to make the movement linear by using the interpolation mode, and I add a cycles modifier like this to keep the motion going[ for both objects (small and big sphere, I'm not refering to the objects in the centre). The difference is that I can't seem to get the big sphere to keep on turning after the offset of the object has achieved 100% (one round around the orbit) while the little one just keeps going until the end of the animation. The orbits are made with BezierCircles and I noticed that the orbit with the ongoing animation also had an animation:   When I go to the graph editor I see the following differences:   I also noticed that the correct working orbit in the dope sheet editor has an keyframe at the start of the timeline while the incorrect working orbit does not. Maybe somebody in here knows what I'm missing or how to fix the problem so I can keep them both spinning even after they reach an offset of 100%?

Just trying to do my first animation and am struggling to make it loop seamlessly. I think the differing rotational speeds of the 2 objects are the thing to overcome but I'm not sure how.  I basically want the earth to do one revolution to the teapot's 2 orbits around the earth.  Can anyone have a look at this  and advise me?  Thanks in advance.


I have previously learned about the volume of a solid of revolution about the x axis and that equation makes sense to me since it's taking the integral between points a and b of the area of a circle at each point.   $$ \int_{a}^{b} \pi [f(x)]²dx = \int_{a}^{b}Area(x)dx $$  But now when I've come across the formula for the area of a solid of revolution I can't quite understand why the slope factor is there. From looking at the volume of a solid of revolution I would assume counting the surface area is just the same as counting the volume except the area is replaced by the circumference. And looking at the equation that seems to be true, but the slope of the function on a small interval has also been added as a factor.  $$ \int_{a}^{b} 2\pi f(x)\sqrt{1+[f'(x)]²}dx $$  From the picture of it in the book it takes the arch length $$ ds = \sqrt{dx²+dy²} $$ of a small dx. But taking this ds and the integral from a to b aren't we counting every part twice since the integral already goes over every dx?

Suppose we rotate the graph of $y = f(x)$ about the $x$-axis from $a$ to $b$.  Then (using the disk method) the volume is $$\int_a^b \pi f(x)^2 dx$$ since we approximate a little piece as a cylinder.  However, if we want to find the surface area, then we approximate it as part of a cone and the formula is $$\int_a^b 2\pi f(x)\sqrt{1+f'(x)^2} dx.$$  But if approximated it by a circle with thickness $dx$ we would get $$\int_a^b 2\pi f(x) dx.$$  So my question is how come for volume we can make the cruder approximation of a disk but for surface area we can't.


There is some dialogue in a movie I saw:     I don't want him knowing about this.   I always thought it was     I don't want him to know about this.   I've been confused for days. What is the difference between them, if any?

This is what I read in an answer to a :     Verbs Followed by Either Gerund or Infinitive      Sometimes the meaning changes according to the verb used.         <…>   (dis)like   <…>      I’d like to ask a more specific question: What is that change in the case of (dis)like, exactly? What is the difference between, say, I like being married and (?) I like to be married, I like to eat paper and I like eating paper?


I’m watching this video  giving a smart proof. Check from 12:23 the question   And 15:50 the solution by promoting it to 3D :   But I’m not so convinced. Is there a more strict proof?

Three circles intersect pairwise but let's assume there is no point   shared by all three of them. There are three pairs of circles. Two   circles in any pair share a chord. The problem is to prove that the   three chords meet at a point.   This  gives a solution:     Consider each circle as the equator of a sphere. Let the plane of the   circles be horizontal. It cuts the spheres in two (of course   symmetric) halves so that a circle is the projection of the   corresponding sphere onto the horizontal plane. Any two spheres   intersect at a circle. The chords at hand are the projections of three   such (vertical) circles. However, the three spheres share two points   which are symmetric with respect to the plane. Those points belong to   all three pairwise intersections of the spheres - vertical circles.   Therefore, projections of the three vertical circles - our chords -   share a point which is the projection of the common points of the   spheres.   The part(in bold type) I don’t understand is why it is certain that the three vertical circles(pairwise intersection of the spheres) intersect at a common vertical line. Isn’t it possible that these three vertical circles only intersect pairwise but don’t have common intersection by all three?


I have a method that return an array of files in a given directory that is giving me a null pointer exception when executed. I can't figure out why.  private ArrayList<File> getFiles(String path) {      File f = new File(path);     ArrayList<File> files = new ArrayList<>(Arrays.asList(f.listFiles()));      return files; }   thanks for your help

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?


Ubuntu 13.10 64-bit latest version is installed in the HP EliteOne 800 all-in-one touch screen PC. Display is breaking over and over.  is 13.10 stable yet? Its not working at all.    Tried with Dell Inspiron One same 13.10 is unstable.

All operating systems freeze sometimes, and Ubuntu is no exception. What should I do to regain control when...   just one program stops responding? nothing at all responds to mouse clicks or key presses? the mouse stops moving entirely? I have an    In what order should I try various solutions before deciding to pull the power plug?  What should I do when starting up Ubuntu fails?  Is there a diagnostic procedure I can follow?


Here's my beamer frame:  \defverbatim[colored]\sleepSort{         \begin{lstlisting}[language=python,tabsize=2]     var = 3 list print       \end{lstlisting}}       \begin{frame}{Variáveis}        \begin{itemize}         \item Armazenamento de dados         \Declaração        \end{itemize}           \sleepSort        \end{frame}   My piece of code is on the same background everything else. How can I put the code on a rectangle of another color?

I want to typeset source code with tcolorbox package. How is possible in this package not to create static boxes but rather boxes that adjust according to the width of the code I write both vertically and horizontally? Also I want if a line is too long to break into a new line. Can I do that?


What is it that makes an electron maintain a distance from the positively charged nucleus? Why aren't electrons merely pulled into and absorbed by the nucleus ?

I'm having trouble understanding the simple "planetary" model of the atom that I'm being taught in my basic chemistry course.   In particular,    I can't see how a negatively charged electron can stay in "orbit" around a positively charged nucleus. Even if the electron actually orbits the nucleus, wouldn't that orbit eventually decay?  I can't reconcile the rapidly moving electrons required by the planetary model with the way atoms are described as forming bonds. If electrons are zooming around in orbits, how do they suddenly "stop" to form bonds.     I understand that certain aspects of quantum mechanics  to address these problems, and that there are  of atoms. My question here is whether the planetary model itself addresses these concerns in some way (that I'm missing) and whether I'm right to be uncomfortable with it.


Could you please suggest a good book on statics and dynamics. The portions I have to cover include   Statics : Equilibrium in 2&3 dimensions, Virtual work,Common catenary etc  Dynamics : Rectilinear motion,SHM,Work and energy,Work and energy,Central orbits

Which book is the best for me to self-study/improve at static mechanics problems?  I am looking for a book with a lot of ( only ) problems, not a theoretical book.  Not only basic problems, the ideal is a book with a lot of problems going from easy to hard.


I tried it like here   However, hp folio 13 doesn't have HID key and FlipFlopWheel there. Touchpad key is in ACPI. So I added there in Device Parameters FlipFlopWheel DWORD key, set it to 1 and restarted and to 0 also. No luck with both ways. Is there another way to set this simple option?

I just switched to Windows 10 on my  and installed related drivers from the support page of ASUS. The touchpad works great, but for some reason the direction of scrolling on touchpad is inverted. I couldn't figure out how to change the direction of the scroll on touch pad, how can I do it?


EDIT: The following code is run through Microsoft Visual Studio 2013  I have the following script:  #include "stdafx.h" #include <iostream> #include <boost/filesystem.hpp>  using namespace boost::filesystem;   int main(int argc, char* argv[]) {      if (argc < 2)     {         std::cout << "Usage: tut1 path\n";         return 1;     }     std::cout << argv[1] << std::endl;     std::cout << "File Size is: " << file_size(argv[1]) << std::endl;       return 0; }   But when I run it with ctrl+f5, I get this message (which is predicted by an if-condition in the code itself:  Usage: tut1 path   It seems the number of arguments is lower than 2.  Why this happens? How should I avoid this problem?  EDIT:  When I remove the following line:  std::cout << "File Size is: " << file_size(argv[1]) << std::endl;   I get the "Filing.cpp" printed on my console which means argv[0] value is Filing.cpp that further shows argv is getting the commands from command arguments of Debuger of project correctly.  But when I add the line again, I see the message "Filing.exe not found or not built by the last incremental link;"

I'm developing a C++ command-line application in Visual Studio and need to debug it with command-line arguments. At the moment I just run the generated EXE file with the arguments I need (like this program.exe -file.txt) , but this way I can't debug. Is there somewhere I can specify the arguments for debugging?


I got the following text:  Code = ABCD123 | Points = 30 Code = ABCD333 | Points = 44   At the end, I want to removing anything except the Code, output:  ABCD123 ABCD333   I actually tried it with Code = | P.+  But I don't know how to get "|" removed. Currently, I have just ÀBCD333 | left as an example.  I'm struggling there.

I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?


I want to remove duplicate values from array a and get a new array b without duplicate values. What  am doing wrong. HELP!!!  <?php  $a = array('pasta','vegetables','vegetables','salad','salad');  $b=array();     for ($i=0;$i<=count($a);$i++){       if(!in_array($b,$a[$i])){        array_push($b,$a[$i]);         }  }  print_r($b);  ?>

How can I remove duplicate values from an array in PHP?


I am trying to add roman numerals to the sections of a paper and then letters to denote the subsections. It seems the default is arabic numbers for both.  So what I have currently is:     1.        1.1        1.2   2.   2.1   And I would like:     I.       I.A       I.B II.       II.A   Currently I am just using \section and \subsection, so I guess the default is numbers, but not sure how to modify section and subsection labelling for the case of roman numeral-letters I would like.  Thank you

I want to have my sections numbered using Roman numerals. However, I can only get the section number to be a Roman numeral, not the subsection. Here is some code:  \renewcommand{\thesection}{\Roman{section}}  \renewcommand{\thesubsection}{\Roman{subsection}}   This will print, e.g. I. , whereas it should be I.I.  Commenting out the second line gives the result I.1, which is not demanded.


Why would the cast (to a System.Guid type) statement be invalid (second line in try block)?  For example, suppose I have a string with a value of "5DD52908-34FF-44F8-99B9-0038AFEFDB81". I'd like to convert that to a GUID. Is that not possible?      Guid ownerIdGuid = Guid.Empty;     try     {         string ownerId = CallContextData.Current.Principal.Identity.UserId.ToString();         ownerIdGuid = (Guid)ownerId;     }     catch     {         // Implement catch     }

I want to try to convert a string to a Guid, but I don't want to rely on catching exceptions (   for performance reasons - exceptions are expensive for usability reasons - the debugger pops up  for design reasons - the expected is not exceptional   In other words the code:  public static Boolean TryStrToGuid(String s, out Guid value) {     try     {         value = new Guid(s);         return true;     }     catch (FormatException)     {         value = Guid.Empty;         return false;     } }   is not suitable.  I would try using RegEx, but since the guid can be parenthesis wrapped, brace wrapped, none wrapped, makes it hard.   Additionally, I thought certain Guid values are invalid(?)    Update 1   had a good idea to catch only FormatException, rather than all. Changed the question's code sample to include suggestion.    Update 2  Why worry about thrown exceptions? Am I really expecting invalid GUIDs all that often?   The answer is yes. That is why I am using TryStrToGuid - I am expecting bad data.  Example 1 . I might be parsing folder names, checking to see if the text after the final . is a GUID.  c:\Program Files c:\Program Files.old c:\Users c:\Users.old c:\UserManager.{CE7F5AA5-6832-43FE-BAE1-80D14CD8F666} c:\Windows c:\Windows.old   Example 2 I might be running a heavily used web-server wants to check the validity of some posted back data. I don't want invalid data tying up resources 2-3 orders of magnitude higher than it needs to be.  Example 3 I might be parsing a search expression entered by a user.     If they enter GUID's I want to process them specially (such as specifically searching for that object, or highlight and format that specific search term in the response text.)    Update 3 - Performance benchmarks  Test converting 10,000 good Guids, and 10,000 bad Guids.  Catch FormatException:    10,000 good:     63,668 ticks    10,000 bad:   6,435,609 ticks  Regex Pre-Screen with try-catch:    10,000 good:    637,633 ticks    10,000 bad:     717,894 ticks  COM Interop CLSIDFromString    10,000 good:    126,120 ticks    10,000 bad:      23,134 ticks   p.s. I shouldn't have to justify a question.


I want to really understand the Euclidean Algorithm. A key component in the algorithm is fact that common divisors of two integers are common divisors of their difference. I can see from the perspective of symbolic manipulation that for all common divisors of $a$ and $b$: $d|a \land d|b$ means $a = kd \land b = ld \therefore a - b = kd - ld = (k - l)d$. The trouble is, this doesn't convince me. I need am image or some way of grasping this beyond just the symbols. The same for the rest of the algorithm. I get that the division/modulo version is really just applying subtraction multiple times, so understanding the subtraction part should help with that. Then there is the issue of the last non-zero remainder being the GCD. Again, I can kind of understand via algebraic proof, but it's not convincing for me. I wouldn't bet much money on being able to convince an expert that I really understand. So, any and all visual proofs, intuitions etc. that don't rely on that vertical list of divisors becoming dividends and remainders become divisors would be much appreciated.

I find myself able to mechanically apply the "extended" Euclidean algorithm to find the gcd of two integers and to write a linear combination by working backwards. However, I do not have a good grasp as to why this works. Artin gives a paragraph-long explanation of it, but I am not able to follow it, nor do I have any good intuition for why this process works.     One can compute a greatest common divisor easily by repeated division with remainder. For example, if $a = 314$ and $b = 136$, then    $$314 = 2 \cdot 136 + 42, \; 136 = 3 \cdot 42 + 10, \; 42 = 4 \cdot 10 + 2.$$   Using the first of these equations, one can show that any integer combination of $314$ and $136$ can also be written as an integer combination of $136$ and the remainder $42$, and vice versa. So $\mathbb{Z}(314) + \mathbb{Z}(136) = \mathbb{Z}(136) + \mathbb{Z}(42)$, and therefore $\gcd(314, 136) = \gcd(136, 42)$. Similarly, $\gcd(136, 52) = \gcd(42,10) = \gcd(10,2) = 2$. So the greatest common divisor of $314$ and $136$ is $2$. This iterative method of finding the greatest common divisor of two integers is called the Euclidean Algorithm.    I'm fine with the first line. If I have an integer combination $$314x + 136y,$$ I can use the first given equation to write instead $$314x + 136y = (2 \cdot 136 + 42)x + 136y = 2x \cdot 136 + 42x + 136y = (2x+y) \cdot 136 + 42x.$$ I can then write $136$ in terms of $42$ and $10$ and get a linear combination of $42$ and $10$, and so forth, and since the integers are closed, my coefficients will always be integers, so I end up with another integer combination.   I cannot understand anything beyond this point in the text, though. I do not know what Artin means by the notation $\mathbb{Z}(314)$. Further, I have no intuition for why the $\gcd$ remains constant all the way down the chain or, even, why the last remaining, non-zero remainder in the algorithm is the $\gcd$.   Any help with the intuition would be greatly appreciated.


Code on sender class:  public void sendQuestion(){        Random randomNumber = new Random();        final int rand = randomNumber.nextInt(19)+1;        Intent numbers = new Intent(this, Questions.class);        numbers.putExtra("randomNumber", rand);        startActivity(numbers);   Code on receiver class:  public class Questions extends Activity{ @Override protected void onCreate(@Nullable Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     question(); }  int questionNumber = getIntent().getExtras().getInt("randomNumber"); public void question() {     String questionString = "Wrong";     switch (questionNumber) {   Why am I getting this error?  Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras()' on a null object reference

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?


This might be really stupid but... if P = 11 and q = 13 N = 143 and r = 120 Say we choose e = 7 where gcd(r, e) = 1 and e < r. And therefore our public key is (7, 143) can there be multiple valid private keys? In that... Where: e*d mod r = 1 d could be 103 or 223, since 103 * 7 = 721 and 223 * 7 = 1561. They both feel like valid numbers to me... Does this mean that if I lock the message with e and N. They can be unlocked with both possible Ds?

In an RSA-encryption scenario, Bob's public key pair $(n, e)$ is $(143, 43)$. An attacker Mallory tries brute-force and comes to $d = 7$ as the private key. The value of $φ(143) = 120$ is not known to Mallory. However from $43 \cdot d \equiv 1 \bmod 120)$, one can calculate the first positive element $d = 67$ from multiplicative group $d = 120 + 67n$ and $n \in \mathbb{Z}$ $d = 7$ clearly doesn't fit in that multiplicative group, so how come it can successfully decrypt the encryption?


I'm trying to put Google structured data in my website but it works for one page but not another. However I have the same HTML code for Google tags and Google structured data tester gives me the same result for those URL:       You can try but searching pieces-suz suzuki-moto in Google search. The first link doesn't display stars and the second displays those.  Why stars are not displayed on the first link ?

I have added  to my site and I can confirm that  has no issues with my code. After waiting some time Google has enabled review stars on all pages apart from the home page.  Using Google's Site Search Command: site:http://www.example.com reveals:    Question:   How do I enable rich snippets on the homepage so Google displays review stars using Schema Aggregate Rating?


Please add a search field where one could search for a question that had been asked before, without having to use a search engine in browser. Please if there exist such a feature, you can make it easily accessible by users.

Is it possible to search for a question across all Stack Exchange sites in the Android app?   Right now I can search in only one specific site at a time.   If not, can you add that feature?


This question is different from .  If the SE network can receive some extra funding; they can (and should) the following improvements:   Increase the server strength, and avoid server . Increase the memory space to safely host more question-answers. Evolving multiple, powerful sync and back-up networks, at different part of world;  so that if the data in the site get damaged anyhow; the sync and back-up network will recover it. Installing more long-lasting and good-quality hardwares. Better troubleshooting and hardware repairing. Better feature-update and support service. Better maintenance of all aspects of the site.   This   question; does not tell about requesting a button. Also  similar question, also not requesting a button; includes a PayPal option or a contribution code; but does not tells about adding a button.

I have learned so much from SE sites and I am really thankful for it. I sometimes feel that I am under debt from SO, so in order to satisfy me and my principles, I think I should give some donation.  I want to contribute but I don't have much technical expertise to use in helping others, so maybe if I can give a donation, this would help me to feel better.  I have been a member of various other forums and I have always given some amount (not much, though) to them as thanks.


I have an array:  classes = ["banana","mango","apple"]   I am trying to print this array in a specific format where in each element has to be numbered in a particular sequence.  The desired output is as follows:  classes = [{"banana" : 1, "mango" : 2, "apple" : 3}]   I tried using a for loop as follows:  classes = ["banana","mango","apple"] counter = 0 dat = [] for x in classes:     counter=counter+1     d = x,":", counter     dat.append(d) print(dat)   While this prints   [('banana', ':', 1), ('mango', ':', 2), ('apple', ':', 3)]   this is far from what I require.  Can someone help?

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


I have attempted multiple times, with multiple different possible solutions from around Stack Overflow to accomplish this task, yet frustratingly, I cannot seem to be able to center the input box in the div.  My code essentially looks like this at the moment:    div {   width: 100vw;   position: relative }  h1 {   text-align: center; }

Title
   <input type='text'>
     As of the moment, the word "Title" is centered on the screen, but the input box is still on the left hand side.   Is there any way to be able to center the  horizontally in the div?

How can I horizontally center a
 within another
 using CSS?

Foo foo


I have a posts_per_page query to paginate multiple post types, which works great! Now though, as it paginates it to show (in this case) 100 posts per page, I'm wondering if you can show 100 on page one, then 300 on page 2 onwards. My markup is as follows:  <?php query_posts( array(      'posts_per_page' => 100,      'post_type' => array( 'regularproducts', 'wpsc-product' ),      'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ), )); ?>  <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>      <?php if ( 'regularproducts' == get_post_type()  ) : ?>          //CONTENT HERE      <?php endif; ?>      <?php if ( 'wpsc-product' == get_post_type()  ) : ?>          //CONTENT HERE      <?php endif; ?>  <?php endwhile; endif; ?>  <?php wp_reset_query(); ?>   I'm not sure if it is at all possible or not, but yes I'd like to show 100 posts on the first page, and 300 on each page thereafter. Any suggestions would be greatly appreciated!

I have a filter using pre_get_posts to change the number of posts per page from 4 on the news landing page to 8 on all other pages (page 2, 3, etc). However I don't seem to have got the offset correct, or something, because my get_next_posts_page_link doesn't show a page 3, even though it does exist if I go to the url manually. The current offset is something I somehow managed to conjure up accidentally, I thought it worked as page 2 was correct but as I added more test posts, I realised it didn't work.  function page_2_posts_per_page_filter( $query ) {      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;      if ( !is_admin() && $query->is_paged && $query->is_main_query() ) {          $offset = 4 + (($paged - 2) * 8);         $query->set( 'offset', $offset );         $query->set( 'posts_per_page', 8 );      } else if (!is_admin() && $query->is_main_query()) {          $query->set( 'posts_per_page', 4 );      }     return; } add_action( 'pre_get_posts', 'page_2_posts_per_page_filter', 1 );   EDIT: SOLUTION  function page_2_posts_per_page_filter( $query ) {      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $offset = 4;      if ( !is_admin() && $query->is_paged && $query->is_main_query() ) {          $offset = (($paged - 1) * 8) - $offset;         $query->set( 'posts_per_page', 8 );         $query->set( 'offset', $offset );      } else if (!is_admin() && $query->is_main_query()) {          $query->set( 'posts_per_page', 4 );      }     return; } add_action( 'pre_get_posts', 'page_2_posts_per_page_filter');  function found_offset( $found_posts, $query ) {      $offset = 4;      if( !is_admin() && $query->is_main_query() ) {         $found_posts = $found_posts + $offset;     }     return $found_posts; } add_action( 'found_posts', 'found_offset', 10, 2 );


I have a figure drawn in Word. I would like to include this in my LaTeX document without redrawing it.

I am trying to include a figure into LaTeX from a paper originally created using MS Word. I have already converted all the text/equations into LaTeX but I can't figure out how to get the figures over without re-drawing them using LaTeX code (which I do not want to do). The image is a plain box (like a tabular) one row by 7 columns with numbers inside each cell. Then I inserted arrows of varying length above and below the box (several short ones and one much longer).    I am trying to use the  package with the \includegraphics command.   I copied the figure (box and arrows) from my original article into a blank Word doc. The figure only takes up the first 4 or 5 lines of the blank document. I then selected/highlighted the image and printed the selection using 'PDFCreator'. This allowed me to save the image as a .eps file. I then copied and pasted the eps file into the folder where all my .tex files are saved.  When I compile the document using pdftexify there is a blank space where the image should be. In the console I get the following message when I compile the document:  [27] <Fig3-eps-converted-to.pdf, id =105, 391.4625pt x 74.2774pt> <use Fig3-eps-converted-to.pdf> Overfull \hbox 1.46153pt too wide) in paragraph at lines 511--516 []   My code looks like this:  \documentclass[12pt]{article}  \usepackage{graphicx} \usepackage{epstopdf} \begin{document}  %Text  \includegraphics{fig3.eps}  %text  \end{document}   I have read the sections on graphics in 'LaTeX: A Document Preparation System' and 'The Not So Short Introduction to LaTeX2e' but I still can't figure this out. Should I maybe use a PNG image since it is a pretty basic figure? Any advice on how to properly transfer images from a word doc to .eps format and/or how to get those .eps files into LaTeX properly would be a huge help.


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


I got a little problem with transparency in Blender.  If I load a texture and use it as foliage, for example gras, I recieve a visual bug. Check it out. Even if I use transparent maps or seperate alpha maps it happens. Do you know how to solve this? (This is my gras-texture)  For any sugestions I would be very glad.

Using v2.73, cycles and a very simple scene: an array of cubes, no big deal.   If I set the shader's material to transparent, the cubes in the foreground do become transparent but those far away in the back do not disappear completely and this strange dark things appear (visible in rendered mode and in final renders)    I've played with the clipping distance on the viewport and camera, but I can't figure out how to make those ghosts go away...


I am making an amplifier and came across the fact that, if I want to operate a microphone then I will need a pre-amp.   What is the difference between power amplifiers and pre-amplifiers? Do both of them have the same gain, and if so then why do we need pre-amps?  Detailed explanation would be more more helpful to get the concept.

I find in many places mentions of pre-amplifiers being used to boost audio signals prior to feeding to a power amplifier.  Wikipedia's article on  gives some hints at their usage, but it doesn't really explain why it would be necessary to have two amplifiers in series rather than a single one with greater gain.  If a pre-amp is just a power amp with a smaller gain, what's the point, and why the distinction between the two kinds? Is the distinction in function, or simply purpose?


Let $T_k = 1 + (1/2) + (1/3) + (1/4) ... + (1/k)$  for any $k  \in\  \mathbb{N}$ Show that for $k = 2^n$ for any $n \in\ \mathbb{N}$,   we have $T_k \geq 1 + (n/2)$ I have been working on this problem for a few hours now. I've shown that it works for P(1): $$P(1): 1 + (1/2) \geq 1 + (1/2) ✓$$ Now I need to show $P(n+1)$. This is my setup: $$\sum_{m=0}^{2^{n+1}} \frac{1}{2^n} =   (\sum_{m=0}^{2^n} \frac{1}{2^n})  +\frac{1}{2^{n+1}} $$ which is: $$\frac{1}{2^{n+1}} + (1+\frac{n}{2})$$ I'm not sure where to go from here. I know I need to show that this is greater than or equal to $(1+\frac{n+1}{2})$

I am wondering how to prove both of this by induction: $1+\frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\cdots+\frac{1}{2^n}\leq 1+\frac{n}{2}$ In general, how should I think of how to prove such an inductive step for these types of inequalities? If there is any other way to prove please feel free. Any help would be appreciated.


So i am new to programming and I have been trying to make a simple program for practice.  It asks you questions and you answer it.   I can't seem to get it to work right. It either Says its correct when it's not or that it isn't correct when it is.   Here is my code   // Questions      String q1;     JOptionPane.showInputDialog(null, "1). What is the name of our sun?");      if(q1 == "Sol") {         JOptionPane.showMessageDialog(null, "Correct!");     }     else {         JOptionPane.showInputDialog(null, "Sorry that is incorrect :(");         }   What am I missing?

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


If i have two random variables X and Y, then $E[X+Y]=E[X]+E[Y]$ . However, do X and Y have to be independent ?  Do you know where i can find a proof of this principle ?

Linearity of expectation is the property that the expected value of   the sum of random variables is equal to the sum of their individual   expected values, regardless of whether they are independent.   My understanding of random variables (both continuous and discrete) is that they assign a number to each possible outcome of a random experiment.   For example, if we roll a die, we can land on any number between 1 and 6, and we can create a random variable $X$ that takes each of those values. Here, $X$ represents each possible outcome.   The expected value of $X$ would then be   $\text{E}[X] = 3.5$  by taking the weighted sum of each of the possible outcomes. It's all good until this part. Here is what I don't understand,   What is this notion of adding two random variables? I mean they don't have distinct values, so how can we say  $\text{E}[X + X] = \text{E}[X] + \text{E}[X] = 7$  This is just the linearity of expectation applied to when two dies are rolled, we are asked to get the expected sum of the numbers on both dies. But how are we adding two random variables?   What if we wanted to get the product of the number on two dies. Or the difference or quotient?   $\text{E}[X * X] = \text{E}[X] * \text{E}[X] = 12.25$  $\text{E}[X - X] = \text{E}[X] - \text{E}[X] = 0$  $\text{E}[X / X] = \text{E}[X] / \text{E}[X] = 1$   Are all of these operations valid? I'm really confused, please help. How am I supposed to think about these random variables?  This is in connection to my  that I will hopefully be able to make sense of.


Hi im new to blender (started about a month ago) im trying to make a coiled cable for my so called imaginary "desk setup"  Heres what im trying to make    Ive tried using screw modifier but the thing is I dont know how to make it like a cable as you need the ends to not be coiled. I searched all over the internet on how to make this but i cant find them.  If you could just direct me to what I could do and explain in detail so that i can follow step by step on how to do this.  Extra, and if, just if you can help me with rigging the cable so that I can move it around to make it more natural in the scene, example photo below:      Thanks in advance for any help.

Hello. I am a beginner in Blender. I started modeling this phone and when I got to the curly cable part it was a real challenge. Could someone guide me on this.


I want to increase the font size for a single word. I need to be about 20% larger than the \Huge command, but I otherwise do not wish to affect font sizes within the document. Is there a simple command to accomplish this, by scaling the single word or otherwise?  Because an MWE is always required:  \documentclass[a4]{article} \begin{document}  This is \Huge{NOT} what I had in mind. \Huge{Because} it is your fault.  \end{document}   I need the word "NOT" in the example to be about 20% larger than the word "Because," so re-defining \Huge globally won't work.

I wanted to amplify the effect of specifying the font size. So I tried: {\tiny\tiny Super tiny text!} But that doesn't seem to work. I needed suggestions to achieve the same goal.


How do I change this direct speech into reported speech?  Father said,"Never say never."

I've been told that I should use simple past in reported speech when the direct speech is in simple present such as I **am** the best   ~>   He said he **was** the best  but what happens for imperative mood direct speech     "Mom said dont trust strangers"   Or     "Mom said didn't trust strangers"   I think I should maintain the first form. But I'm not sure. And I'm not even sure this relates to the sentence mood. I need the best choice and a further explaination for this :)


What is $\left|\mathbb{N}^\mathbb{N}\right|$?  I know that $\forall n\in\mathbb{N}: \left|\mathbb{N}^n\right|=\left|\mathbb{N}\right|$. But is this also true for the limit?

My motivation for asking this question is that a classmate of mine asked me some kind of question that made me think of this one. I can't recall his exact question because he is kind of messy (both when talking about math and when thinking about math).   I'm kind of stuck though. I feel like the set $A^{\mathbb{N}} = \{f: \mathbb{N} \rightarrow A, f \text{ is a function} \}$ should have the same cardinality as the power set of A, if A is infinite. On the other hand, in this , it is stated that the sequences with real coefficients have the same cardinality as the reals.   It's easy to see that $A^{\mathbb{N}} \subseteq P(A)$, but (obviously) I got stuck on the other inclusion. Is there any general result that says anything else? References would be appreciated.  EDIT To clarify the intetion of this question: I want to know if there are any general results on the cardinality of $A^{\mathbb{N}}$ other that it is strictly less than that of the power set of A.   Also, I was aware that the other inclusion isn't true in general (as the post on here I linked to gave a counterexample), but thanks for pointing out why too. :)


I first noticed this problem when I only put the objects in listOfRates and then created inverseListOfRates by copying it. But even using this method, I can't alter one list without altering the other.  How do I solve this issue?   List<HistoricRate> listOfRates = new ArrayList<HistoricRate>(); List<HistoricRate> inverseListOfRates = new ArrayList<HistoricRate>();  for (HistoricRate rate : rates){     listOfRates.add(rate);     inverseListOfRates.add(rate); }  inverseListOfRates.forEach(r -> r.setMid(1 / r.getMid()));

It's a bit difficult to implement a deep object copy function. What steps you take to ensure the original object and the cloned one share no reference?


A few days ago, a friend and I were discussing how every "rule" of English spelling or pronunciation has an exception, and every exception has an exception as well. Then I brought up the rule of a ph cluster equaling an f sound (as in phonetic, elephant, morph, etc.) as a pronunciation rule that didn't have any exceptions I could think of. Is this a true hard-and-fast rule or does it have some exceptions as well? I'm not counting abbreviations such as pH scale.

Is haphazard the only word where ph is not pronounced like /f/?


I'm trying to figure out the exact behavior of the conditional logic in Regex with Python. For this, I have made up a test that works as I would have expected in Regex101 using the Python flavor, but not in Python. The pattern is: (hello)?(?(1) world| bye) And test cases: hello world hello bye something bye  In Regex101 this matches hello world in full and the  bye in something bye. In Python, this only matches hello world - I would have expected it to match the  bye in something bye too? Would be amazing if someone could help me understand where I'm misunderstanding this implementation? In Python, my code is: tests = ['hello world', 'something bye', 'something world']  for t in tests:     print(re.match("(hello)?(?(1) world| bye)", t))

What is the difference between the search() and match() functions in the ?  I've read the  (), but I never seem to remember it.  I keep having to look it up and re-learn it.  I'm hoping that someone will answer it clearly with examples so that (perhaps) it will stick in my head.  Or at least I'll have a better place to return with my question and it will take less time to re-learn it.


so i have a website which comes up in Google local listing for the keyword "plastic surgery in mycityname" but does not come up when i enter "plastic surgery mycityname". Notice the missing word "in". Though the website comes up in organic search at 1st and 2nd position. What could be the reason for that? Is this algorithm driven or am i missing something?

What are your strategies for local SEO? For example, if you had a web design company in Lincoln, Nebraska, what would you do for your website from an SEO perspective?


This is something I wasn't expecting. I know these numbers are not 100% exact, but I wasn't expecting complementary angles giving different results of sin and cos: This following function returns 0.70710678118654746000000... sin(45 * PI / 180.0);  while this following function returns 0.70710678118654757000000... cos(45 * PI / 180.0);  so, it's: 0.707106781186547**46**000000... vs 0.707106781186547**57**000000...   and not only those... sin(1 * PI / 180.0) also returns a slightly different number than cos(89 * PI / 180.0) although they should be the same. Moreover it's not only a sin vs cos problem, it's also a sin vs sin problem: sin(1 * PI / 180.0) returns a different value than sin(179 * PI / 180.0), again they should be the same. I tried to use radians and not degrees, and there is exactly the same difference, I tried to use a small PI value, a huge PI value (around 100 decimals and more) and they're still different, I tried to use cmath instead of math.h, I tried to use M_PI instead of a PI defined by myself. The difference is always the same, around the 16th decimal. Don't get me wrong, I know I will never get a 100% precise value of these numbers, but AT LEAST I was expecting to get the same "imprecise" value of sin and cos of complementary angles. What the hell is wrong with all this?  I need them to be the same because the program I'm working on (a gravity simulator I was asked to do) uses objects that have double (I also tried float) variables which are basically angles (degrees or radians, I've tried both). Those are the directions the objects use to move, also I need the angles to calculate the interactions between the objects. The angles change in every iteration of the program, and in every iteration, the angles change basing on the calculations on the previous iteration's angles, so if there is any minimally wrong angle value at any point, that error gets amplified more and more in every iteration. The program runs thousands and even millions of iterations, so the value's error gets absurdly huge! To put it clear, planets eventually get out of their balance and everything becomes a disaster, I'm really mad :( P.s. I'm on Windows 7, 32 bits.

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


I am new to Java and android development. I am interested to build an app that can sync a folder from my android phone (Nexus5) to Amazon Web service (AWS). I am trying to build based on an open source project. But, I get the following error for this snippet and unable to locate my mistake. Your feedback will be highly useful at this point.  private void loadFileList(File path) {     this.currentPath = path;     List<String> r = new ArrayList<String>();     if (path.exists()) {         if (path.getParentFile() != null) r.add(PARENT_DIR);         FilenameFilter filter = new FilenameFilter() {             public boolean accept(File dir, String filename) {                 File sel = new File(dir, filename);                 if (!sel.canRead()) return false;                 if (selectDirectoryOption) return sel.isDirectory();                 else {                     boolean endsWith = fileEndsWith != null ? filename.toLowerCase().endsWith(fileEndsWith) : true;                     return endsWith || sel.isDirectory();                 }              }              {                 FileDialog a = FileDialog.this;                 //a.super();             }         };         String[] fileList1 = path.list(filter);         for (String file : fileList1) {     <-- Error in this line             r.add(file);         }     }     fileList = (String[]) r.toArray(new String[0]); }   Error:   11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime: FATAL EXCEPTION: main  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime: Process: pavan.syncfile, PID: 24102  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime: java.lang.NullPointerException: Attempt to get length of null array  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at pavan.syncfile.FileDialog.loadFileList(FileDialog.java:149)  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at pavan.syncfile.FileDialog.<init>(FileDialog.java:45)  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at pavan.syncfile.SendFile$1.onClick(SendFile.java:56)  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at android.view.View.performClick(View.java:5198)  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at android.view.View$PerformClick.run(View.java:21147)  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:739)  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95)  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148)  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417)  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  11-30 01:03:23.880 24102-24102/pavan.syncfile E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

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?


If killing break one's soul to create a Hocrux, then why didn’t Voldemort create more Hocruxes when he killed people after he came back?

Once Voldemort realized that Harry Potter was hunting for Horcruxes and knew where they were (e.g. after visiting the cave), why wouldn't he simply pause, and make at least one MORE replacement Horcrux that Harry wouldn't know the location of (because obviously the locations were figured out by the now-dead Dumbledore and not Harry, as far as Voldemort's thinking would go)? This way, there's less risk for him on the chance that Harry succeeds. We know he can make extra Horcruxes since he created Nagini. If it was because he was racing against Harry, then why didn't he pause and create a new Horcux (say, by killing Lucius Malfoy) once Harry was "dead" and he could afford to pause? Canon based answers strongly preferred.


I am asked to sum the series $$1+\frac1{2}+\frac1{3}+\frac1{4}+\frac1{6}+\frac1{8}+\frac1{9}+\frac1{12}+\cdots$$ where the terms are the reciprocals of all positive integers whose only prime factors are two and threes. What I tried so far is:  $$\frac1{2^03^0}+\frac1{2^13^0}+\frac1{2^03^1}+\frac1{2^23^0}+\frac1{2^13^1}+\frac1{2^33^0}+\frac1{2^03^2}+\frac1{2^23^1}+\cdot\cdot\cdot$$ The equence is in the form: $$\frac1{2^n3^m}$$ but what do I do know? I am stuck!

My problem is to find the sum of the series $$ S = 1+\frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\frac{1}{6}+\frac{1}{8}+\frac{1}{9}+\frac{1}{12}+\cdots $$ where the terms are the reciprocals of the positive integers whose only prime factors are $2$s and $3$s.   I can see that every term in $S$ is of the form $\dfrac{1}{2^m3^n}$ where $m,n\geq 0$. I can also see that each term only occurs once, but I'm not really sure how to use this information effectively. Any ideas (apparently geometric series was a hint)?


Let $S = [{(-1)^n+ \frac{1}{n}}$] and $n \in \mathbb{N}$   Find the accumulation point of S.  I don't think there are any, but I am not sure. Can anyone shed some light on this?

I was recently asked to find the accumulation points of the set $$S = \{(-1)^n + \frac{1}{n} \mid n \in \mathbb{N}\}$$  I answered that the accumulation points are $\{-1,1\}$, because despite the fact that $\frac{1}{n}$ diverges, we can still use $\frac{1}{n}$ to find an element arbitrarily close to either $1$ or $-1$, i.e. to show that there is an element in an arbitrarily small neighborhood of $1$ or $-1$. (No proof was required for this question --- this is my intuition.)  Am I right at all?


I have been struggling to preload database in the android app.  I am making a dictionary app in which i have a database containing word and meaning.  I need to preload this database with the app and make the user directly start using it.  The only successful way i have been able to implement is making a db file externally and putting it in the assets folder and on app startup copy that file to the internal memory of android phone. But this way reduces the efficiency of the app. Copying such a huge database reduces the speed of the app and during the first time use the app becomes useless. i need a way to include the database right from the start of the app  I have seen so many android offline dictionary apps which come with a complete preloaded database which start working right from the first time with high speed.  Please help

If your application requires a database and it comes with built in data, what is the best way to ship that application? Should I:   Precreate the SQLite database and include it in the .apk? Include the SQL commands with the application and have it create the database and insert the data on first use?   The drawbacks I see are:   Possible SQLite version mismatches might cause problems and I currently don't know where the database should go and how to access it. It may take a really long time to create and populate the database on the device.   Any suggestions? Pointers to the documentation regarding any issues would be greatly appreciated.


Now Enel have the strong weapon. But when he face luffy, he lose. And then he go. In my opinion i think enel going back to one piece story and then will be the man whose destroy a New World.  According you, where is enel? When he back?

As shown in the Manga and the Anime, Enel survived along with the Ark.  He then Embarks to Fairy Verth      The Moon.   In the Manga it shows his adventures on the Moon.  But what happened?  I didn't understand the situation that happened.  What exactly happened on the Moon?


What are different ways of proving this theorem, using different definitions for a tree (e.g. maximally acyclic graph, minimally connected graph, there's a unique path between any two vertices, etc.)

I'm having some trouble proving the following theorem:     Theorem:   A connected graph on $n$ vertices is a tree iff it has $n-1$ edges   I sort of proved it one way, and I'm stuck the other way around.  Necessity ($\Rightarrow$):  A tree with $n$ vertices has $n-1$ edges.  Basis step ($n=1$):  A tree with one vertex has no edges  Assume a tree with $k\leq n$ vertices has $n-1$ edges  For $k+1$,  Let the added vertex be $u$, if $deg(u)=0$ then we don't have a tree, so $deg(u)>0$. If $deg(u)>1$ then we have a cycle (how do I argue about this?) so again we don't have a tree , so $deg(u)=1$.   Total number of edges = $(n-1) +1 = n \therefore$   $\therefore  P(1) \land \forall k,  P(k)\Rightarrow P(k+1)$  Sufficiency ($\Leftarrow$)  A connected graph with $n-1$ edges is a tree  How can I prove this part? Also, is my induction ok?


ORIGINAL POST   This I would imagine is going to be a simple answer. I have Apache2 running on my Ubuntu server but it seems PHP is not installed. When I try to load a php page it does not load properly.   Example:  (My Site)   At first I thought the php module was simply not loaded but when I try to run sudo a2enmod php but it did not work and I get this error: ERROR: Module php does not exist!  Thanks for help in advance!   EDIT  After trying to load a simple PHP page to show the php version I have gotten a new error trying to load the page. that error is visible here:  . This makes me think I have more of an Apache issue than a php issue. I have a main Apahce sever that proxys all incoming traffic to each server inside my network. The Apache config for the main server looks like this:   <VirtualHost *:*>         ServerName MaxKulik.net         ServerAdmin max@maxkulik.net         ProxyPreserveHost On         ServerName "www.MaxKulik.net"         ServerAlias "MaxKulik.net"         ProxyPass / http://192.168.1.5/         ProxyPassReverse / http://192.168.1.5/         ErrorLog ${APACHE_LOG_DIR}/error.log         CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>  <VirtualHost *:*>         ServerName MaxKulik.net         ServerAdmin max@maxkulik.net         ProxyPreserveHost On         ServerName "www.MaxKulik.net"         ServerAlias "MaxKulik.net"         SSLProxyEngine On         SSLProxyCheckPeerCN on         SSLProxyCheckPeerExpire on         ProxyPass / https://192.168.1.5/         ProxyPassReverse / https://192.168.1.5. </VirtualHost>  <VirtualHost *:*>         ServerName USI         ServerAdmin max@maxkulik.net         ProxyPreserveHost On         ServerName "www.UrbanTurtles.servegame.com"         ServerAlias "UrbanTurtles.servegame.com"         ProxyPass / http://192.168.1.28         ProxyPassReverse / http://192.168.1.28         ErrorLog ${APACHE_LOG_DIR}/error.log         CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>

I set up a new VPS instance of Ubuntu and am wondering what the easiest way is to get up and running with a basic LAMP stack (i.e. which packages are required, which configuration options need to be tweaked, if any, etc.).


I have heard that when a user has over 10k reputation the person will become a moderator automatically. That is true partly, but the user still may not be a comments moderator, who can review flagged comments.     Here are my questions:   Who are the comments moderators on Stack Exchange sites, like Stack Overflow? And how can one become a comments moderator?

Comments can now be upvoted and flagged. How do those features work? Do users get rep for their upvoted comments? Do upvoted comments have any effect on comment sorting? And can users see their own comment upvote number somewhere?  Related:  The  about comments


Here's the code for the query:  \documentclass[12pt,twoside]{article} \usepackage{amsmath} \usepackage[makeroom]{cancel} \usepackage{amssymb} \usepackage{amsthm} \usepackage{amsfonts} \begin{document} \[ \Longrightarrow \frac{\displaystyle \partial v^*}{\partial \gamma} = \frac{\frac{\partial \beta}{\partial \gamma}}{\frac{\partial \alpha}{\partial v^*} - \frac{\partial \beta}{\partial v^*}}. \] \end{document}   The fractions that appear in the numerator and the denominator on the right and left hand sides are smaller in size. How can I make them comparable in size to the one on the left side, which is of normal size?

What is best practice for typesetting fractions with large objects in the numerator and denominator?  For example, fractions with limits, integrals, summations, etc... cause the expressions to look contracted and somewhat odd.  I understand that it is probably best to leave this as is when writing mathematics inline, but as a stand-alone fraction I feel it would be much less distracting if the symbols were typeset at normal size and the fraction was given more height in which to place itself.  Are there standards (for pure mathematics) regarding this problem? And what are the options - if it's generally permitted - for expanding the fraction size to incorporate large objects?    Example  \frac{\sum_{i=0}^{n} i^2}{\iint_{D}\frac{\partial (x,y)}{\partial (u,v)}\,\mathrm{d}u\,\mathrm{d}v}   Both the summation and the integral look somewhat cramped.


I have DEM (*.tif) from which I need to create shaded relief in GRASS/QGIS. Problem is that it appears to have some parallel stripes all across the raster, as on picture below.  I used resampling method (Warp(Reproject)) to visually increase resolution, and I filtered the raster with GRASS function r.neighbors.   Then I created shaded relief using r.relief and the stripes become more visible.   How can I remove those stripes?  original DEM   shaded relief

I am using Windows 7 enterprise and QGIS version 2.12.2 Lyon.  Have found an unexpected result when I use QGIS to generate a topographic position index (TPI) raster from a 30m by 30m DEM.  I find a pattern of what I believe to be aberrantly valued pixels forming a square grid pattern that are approximately 900 m on each side.  I expected the resulting raster to not have this grided appearance.  UPDATE: I have looked at my hillshade, slope, aspect, terrain ruggedness index and roughness rasters generated using the same tool and they all have this same "grid" (although it is much less apparent than in the TPI raster).  Here's a screenshot of the original DEM I used:   Here's a screenshot of the resulting TPI.  Notice the grid pattern formed over what I suspect to be an accurate TPI raster layer.   Here's how I created the TPI Raster: Raster – analysis – DEM:


I want to place a list of files into individual directories I create from each filename.  So given the files in the root directory:  Movie1.avi movie2.m4v movie3.mp4   I want to mkdir Movie1, movie2, and movie3, then move each file into the corresponding directory.  Any simple way to to generate the directories and then move the files.  mkdir << find /Video/Movies/ -maxdepth 1 -type f | sort mv << find /Video/Movies/ -maxdepth 1 -type f | sort

I have a directory filled with various files, differently named (i.e. not named with a specific pattern) and with different extensions, and I want to put each file in a newly created subdirectory named after each file; what's the best way to accomplish that from the command line under Linux? This sounds a bit confusing, let me make and example: let's call a random file in the directory ./filename.ext, I'd like to put it in a subdirectory called ./filename so that effectively the new path will be ./filename/filename.ext.  I did some trials with the following steps:   I've created some test files, from file-1.txt to file-9.txt, inside a test directory with for num in {1..9}; do touch file-$num.txt; done  I've created a directory named after each filename with for name in $(eval ls | cut -b 1-6); do mkdir $name; done I've moved the source files in their respective directories with for name in $(eval ls | grep -e ".txt" | cut -b 1-6); do mv $name.txt $name/$name.txt; done   As you can see, this solution works, but its huge drawback is that it works just in this case, with files of that extact filename lenght and with that particular extension. If I have some files with different names and extensions, this would be of no use at all. The use of cut command is not the ideal solution here, I suppose, but I haven't found anything better at the moment.  As a bonus, it would be cool to find a way to create the subdirs automatically when moving/renaming the files, without having to use mkdir previously (so when I ls to actually rename, I don't have to worry about excluding the newly created directories); but in the end this is a secondary problem.


I would like to stop a function after a fixed execution time. Here i've written an sample for you:                      Stopwatch timer = new Stopwatch();                     timer.Start();                     while (timer.Elapsed.TotalSeconds < timeLimite)                     {                        //my functions                     }                     timer.Stop();   In my own test, it does not limit  the  execution time inside my functions. In other words, it tests the stopping criterion before and after the execution of my functions but does not interrupt  the algorithm inside "my functions".

I am looking for good ideas for implementing a generic way to have a single line (or anonymous delegate) of code execute with a timeout.  TemperamentalClass tc = new TemperamentalClass(); tc.DoSomething();  // normally runs in 30 sec.  Want to error at 1 min   I'm looking for a solution that can elegantly be implemented in many places where my code interacts with temperamental code (that I can't change).  In addition, I would like to have the offending "timed out" code stopped from executing further if possible.


I am working on a project, which is to create a calculator, but part of the project is to copy the output to the clipboard. The requirement state:  It must automatically copy the result to the operating system  clipboard Solutions that require the user install any software will NOT be accepted (in case you are not sure, this means NO Pyperclip.)       import math #for the math functions  def addition(x, y):     return x + y #function addition  def substraction(x, y):     return x - y #function for substraction  def multiplication(x, y):     return x * y #function for multiplacation  def division(x,y):     return x / y #function for division  def square_root(x):     return math.sqrt(x) #function for square root  Restart = "Y" #variable used to restart the calculator  while Restart == "Y": #while loop to keep the calculator looping      print("Select Operation Number:")     print("1 = Addition")     print("2 = Substraction")     print("3 = Multiplication")     print("4 = Division")     print("5 = Square Root (Of the First Number)") #Statements to let the user know what operations are available      operationInput = int(input("Enter Operation Number (1/2/3/4/5)")) #operationInput is where the user will pick the operation by typing in the correlating number      firstNumber = float(input("Enter First Number: ")) #User inputs the first number     secondNumber = float(input("Enter Second Number: ")) #User inputs the second number      if operationInput == 1:          print(firstNumber, "+", secondNumber,"=",addition(firstNumber, secondNumber)) #If the input is 1 then it will add the two numbers      elif operationInput == 2:          print(firstNumber,"-",secondNumber, "=", substraction(firstNumber, secondNumber)) #If the input is 2 then it will give you the difference of the two numbers      elif operationInput == 3:          print(firstNumber, "*", secondNumber, "=", multiplication(firstNumber, secondNumber)) #If the input is 3 then it will multiply the two numbers      elif operationInput == 4:          print(firstNumber, "/", secondNumber, "=", division(firstNumber, secondNumber)) #If the input is 4 then it will divide the two numbers      elif operationInput == 5:          print("The Square Root of ", firstNumber, "is ", square_root(firstNumber)) #If the input is 5 then it will find the square of the first number       else:         print("Invalid Input") #If a character other than 1-5 is entered then this will show invalid      Restart = input("Type Y to start over the calculator or N to stop") #This will ask if the user wants to restart the calculator      if Restart == "N":         print("Thank you for using!") #If no it will print thank you for using

I'm trying to make a basic Windows application that builds a string out of user input and then adds it to the clipboard. How do I copy a string to the clipboard using Python?


I recently found JavaScript code like this:  someFunction()()  Function immediately invoked right after function without classic IIFE syntax.   What is that kind of syntax called? And how it works?

I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!)


Im trying to get a DELETE request working but it concat's to this: "" it doesnt go trough my app.js listener I have a console log. This is my code. (Oh and Im trying to get it to work with no ajax.  This is the HTML(with ejs):  <form method="DELETE" action="/users/delete">     <input type="hidden" value="<%= users[i]._id %>" name="userid">     <input type="submit" value="Submit"> </form>   And this is the Listener:    app.delete('/users/delete',function (req, res) {     console.log(req); })  What I do know that the ejs function works as you can see its being passed in the url and Ive tried printing it inside the html.

I've seen a couple questions around here like , which mentions:     Unfortunately that same browser won't allow me to test HTTP PUT, DELETE, and to a certain degree even HTTP POST.   I've also heard that browsers support only GET and POST, from some other sources like:        However, a few quick tests in Firefox show that sending PUT and DELETE requests works as expected -- the XMLHttpRequest completes successfully, and the request shows up in the server logs with the right method. Is there some aspect to this I'm missing, such as cross-browser compatibility or non-obvious limitations?


On Stack Overflow site, it's okay that deleted questions stick around since high rep users can see the question and see that it is pink.  This visually indicates the question is deleted. However, why does the mobile app  have the link to a question that has been deleted and you click on it and get a spinning circle only to then be alerted that the question cannot be found?  Why even bother showing it?  Can the mobile app (android) please filter out deleted questions from the feed?  I don't see any purpose in showing them.

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.


I am facing a havoc situation, I choose install Ubuntu in place of Windows 10, and now I don't have any OS on my computer and Installation of Ubuntu showing error 5 every time I reached out to install it.  It shows Errno 5 input/output error message and suddenly installation gets stop.  Type of installation: through Bootable USB drive 16 Gb  Hard drive of computer: 78 Gb RAM of computer: 2 Gb  What to do?  😢😢😢😢😢 I don't have any other computer, I tried it so many times but nothing works.  Now I have a pc which is not more than a Brick.

Today I downloaded Ubuntu for my laptop. It runs great from a bootable USB, but when I tried to install it, I got the following error message: The installer encountered an error copying files to the hard disk:  [Errno 5] Input/output error  This is often due to a faulty CD/DVD disk or drive, or a faulty hard    disk. It may help to clean the CD/DVD, to burn the CD/DVD at a lower   speed, to clean the CD/DVD drive lens (cleaning kits are often    available from electronics suppliers), to check whether the hard disk   is old and in need of replacement, or to move the system to a cooler   environment.     I tried everything to install it on my laptop including redownloading the Ubuntu ISO image, but nothing worked.


Lame question, but quite irritating. I am doing a small WPF application.  Added a unit test project to the solution and a reference to my main project. When I am accessing the main project namespace from the unit test, I cannot see custom classes created by me.  Any hints?

by default is a class:   private ? internal ?  sealed ?


I’m looking for a single word or short word group that describes doing the right thing for the right reason, or a person who does the right thing for the right reason

I'm looking for a word to describe someone who is very driven by morality, constantly trying to do what they believe is morally right.  This word would be used in a sentence like "I really admire her; she truly is a (...) person."


I don't understand why a switch-case statement requires you to explicitly insert a break after each case. Isn't the whole point of it to stop once a case is made?  Can someone give me a circumstance where a case is found true but for some reason [you insert reason here] you still need the code block to execute through.  This is a vaild PHP switch-case statement     switch ($error) {     case 'empty':         $msg = 'Field cannot be empty.';         break;      case 'invalid':         $msg = "Field may only contain number.";         break;     }    This is a invaild PHP switch-case statement     switch ($error) {     case 'empty':         $msg = 'Field cannot be empty.';     case 'invalid':         $msg = "Field may only contain number.";     }    So is this break useless or does it serve a purpose in some situations?

Given a simple switch statement  switch (int) {     case 1 :     {         printf("1\n");         break;     }      case 2 :      {         printf("2\n");     }      case 3 :      {         printf("3\n");     } }   The absence of a break statement in case 2, implies that execution will continue inside the code for case 3. This is not an accident; it was designed that way. Why was this decisions made? What benefit does this provide vs. having an automatic break semantic for the blocks? What was the rationale?


Quite simple question really, I am using Blender 2.80 on Windows 10, Intel + Nvidia based system. Blender runs really well, no problems, however, when I have finished with Blender and close the app there is a console (command) window that briefly flashes up. It is too quick to read the messages, but I do see "error" in the list of messages. I would like to somehow keep this console open on Blender quit so I can read the messages and fix any issues. Or is it possible to get Blender to log the messages to a file for later reading?

I am testing a script in Blender game engine. I can view the helpful message on the external system console when the script throws exception. Sometimes the bugs of the script cause the Blender to crash and close the console immediately.    Is there any way to view the message after the Blender crashes? How to write the message to a text file for later viewing? Any suggestion?


I've loaded everything suggested and almost all the multimedia apps available, and my DVD's will not play.  The device is found, /dev/sr0 as well as the required links to /dev/dvd (for some programs). Every lib...so has been found and installed.  The codecs are current.  Somethings missing still.  I removed and reloaded the addon's to MPlayer, Totem and several others. I added the Ubuntu Restricted (MP..., AVI etc) additions. I've removed and reloaded Totem, MPlayer, VLC and several others and reloaded the addon's and plugins again.   I verified that the links to the Devices are correct. I removed and reloaded the available codec's. Note: Those Videos I created on DVD from my BeOS System Play just fine. Further the digital copies play fine. It is only Original DVD's that are giving me fits. Windows Vista play them on an alternate boot drive.

My machine can't play encrypted DVDs on a fresh install.  How do I add this capability?  Another useful bit of information would be what programs are best for playing DVDs, once I'm able to do so.  See the .  Will I be able to play DVD movies from ?


A project with C# 3.0 and .NET Framework 3.5 can use a dll with the most recent version of C# and .NET Framework ? A project with C# 3.0 can use a dll with the most recent version of C# but similar .NET Framework version ? A project with .NET Framework 3.5 can use a dll with the most recent version of .NET Framework but similar C# version ?

What are the correct version numbers for C#? What came out when? Why can't I find any answers about C# 3.5?  This question is primarily to aid those who are searching for an answer using an incorrect version number, e.g. C# 3.5. The hope is that anyone failing to find an answer with the wrong version number will find this question and then search again with the right version number.


Want to show theme corresponding the user's operating system theme settings. For that, need to use Javascript in css like below but it will cause error @media (prefers-color-scheme: dark) {   localStorage.setItem("os-prefered-dark", true) }

Is it possible to use Javascript inside CSS?  If it is, can you give a simple example?


i need help parenting my armature to my mesh all i get is a bone heat weighting error and when i do get that to work my mesh doesn't move with the armature and it wont let me weight paint this is in blender 2.82 i didn't have this problem in an older version i used which was blender 2.3. heres my file if anyone can find out why here -->

Here is the .  Picture:   It's nothing special but I cant figure out why I get problems rigging this mesh. It would be important and a great Help! Thanks for reading and I know there are a lot of guides answering this question but I tried all and it doesn't seem to work.


I am developing a search application using elasticsearch and I would like to keep the development cost as low as possible. What are the minimum  requirements for elasticsearch to run properly inside a docker container?  I am especially interested in the RAM as I believe this is the bottle neck.  I have been looking all over the place for this, but I can't seem to find any documentation on the minimum hardware requirements for elasticsearch what so ever. Maybe my googlefu isn't good enough, or maybe everyone working on elasticsearch have a big server budget.

This is a  about  Related:      I have a question regarding capacity planning. Can the Server Fault community please help with the following:   What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application?


I am trying to execute following code and found that for loop is not executing at all. Even not getting any error. Let me clear that "dateList" is a list of string and it's not empty, I already tried printing that. "monthList" is an ArrayList of string.  private ArrayList<String> monthList = new ArrayList<String>(Arrays.asList("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")); private List<String> dateList = new ArrayList<>(); private List<Date> finalDatesInMMMDDYYYYFormate = new ArrayList<>(); private int year = 2019;     for (int m=0; m<dateList.size(); m++){         System.out.println("Date at position ------ "+m+" is -------"+dateList.get(m));     } // length of this list is 9 & it prints eberything from 0 to 9. It is not empty.     int assignYear = year;     for (int k=1; k<dateList.size(); k++){         if (dateList.get(k).substring(0,2)==dateList.get(k-1).substring(0,2) || dateList.get(k).substring(0,2) == monthList.get(0)){             finalDatesInMMMDDYYYYFormate.add(Utils.parseDate(dateList.get(k)+Integer.toString(assignYear).replaceAll("[^a-zA-Z0-9]",""), new SimpleDateFormat("MMMddyyyy")));         }         else if (dateList.get(k).substring(0,2) == monthList.get(11)){             finalDatesInMMMDDYYYYFormate.add(Utils.parseDate(dateList.get(k)+Integer.toString(assignYear-1).replaceAll("[^a-zA-Z0-9]",""), new SimpleDateFormat("MMMddyyyy")));             assignYear = assignYear-1;         }         else {             for (int l=0; l<monthList.indexOf(dateList.get(k-1).substring(0,2)); l++){                 if (dateList.get(k).substring(0,2) == monthList.get(l)){                     finalDatesInMMMDDYYYYFormate.add(Utils.parseDate(dateList.get(k)+Integer.toString(assignYear).replaceAll("[^a-zA-Z0-9]",""), new SimpleDateFormat("MMMddyyyy")));                     break;                 }                 else {                     finalDatesInMMMDDYYYYFormate.add(Utils.parseDate(dateList.get(k)+Integer.toString(assignYear-1).replaceAll("[^a-zA-Z0-9]",""), new SimpleDateFormat("MMMddyyyy")));                     assignYear--;                     break;                 }             }         }     }

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


I'm basically trying implement merge sort in Java. For doing so, I've created a class called Array, which has an integer array a[]. The class also has a method called slice(int left, int right) that produces the slice of array and returns the object. Henceforth , there is a sort() method that recursively calls itself and breaks down the array and returns an Array object at the end.  import java.util.*; class Array {     int a[];      public Array()     {         a = null;     }      public Array(int x)     {         a = new int[x];     }        public void input()     {         Scanner sc = new Scanner(System.in);         for(int i = 0; i < a.length; i++)         {             System.out.print("Enter a No. = ");             a[i] = sc.nextInt();          }     }      public void display()     {         for(int i = 0; i < a.length; i++)             System.out.print(a[i] + "\t");         System.out.println();     }      public Array slice(int left, int right)     {         Array ob = new Array(left + right + 1);         for(int i = left; i <= right; i++)             ob.a[i] = this.a[i];         return ob;     }      public static Array merge(Array A, Array B)     {         Array C = new Array(A.a.length + B.a.length);         int i, j, k;         i = j = k = 0;          while(i < A.a.length && j < B.a.length)         {             if(A.a[i] < B.a[j])                 C.a[k++] = A.a[i++];             else if(A.a[i] > B.a[j])                 C.a[k++] = B.a[j++];             else             {                 C.a[k++] = A.a[i++]; j++;             }         }          while(i < A.a.length)             C.a[k++] = A.a[i++];          while(j < B.a.length)             C.a[k++] = B.a[j++];          return C;     }      public Array sort()     {         if(this.a.length == 1)             return this;         else         {             return merge(this.slice(0, (this.a.length - 1) / 2).sort(), this.slice(1 + (this.a.length - 1) / 2, this.a.length - 1).sort());         }     }      public static void main()     {                 Array x;         Scanner sc = new Scanner(System.in);         System.out.print("Enter the No. of Elements = ");         Array ob = new Array(sc.nextInt());         ob.input();         System.out.println("\n ORIGINAL ARRAY");         ob.display();         System.out.println("\n SORTED ARRAY");         x = ob.sort();         x.display();     } }   Suppose if I have an object A, which has an integer array a[], then on calling A.sort() must return an object in which all the array elements will be sorted in ascending order.  Error(s) I Got: java.lang.StackOverflowError: null

What is a StackOverflowError, what causes it, and how should I deal with them?


Torbjorn's turret is his main feature. It provides area denial and slows down offensive pushes. As a Mercy, if I damage boost Torbjorn, does his turret also see this benefit, or only his rivet gun? Same goes for Symmetra, are her sentries impacted by damage boost or not?

Mercy's Caduceus staff has an alt-fire that increases an ally's damage while channeled.  Does this damage buff also extend to structures, such as Torbjörn's turrets or Symmetra's sentries, if their owner is currently receiving the buff? If so, is it global -- that is, is there a maximum range the structures can be from Mercy or her target to receive the buff?


I tried to install opera from .deb file downloaded from their website. But it got stuck at 55%. So I closed the window. Then i discovered that it got installed and opened nicely. But after i couldn't run sudo apt update or install any app and even remove opera. When i run "sudo dpkg --configure -a" I get this and it just stays like this forever. Can anyone help me? sudo dpkg --configure -a  [sudo] password for xxxxxxx  Setting up opera-stable (73.0.3856.329) ...  dpkg: error processing package opera-stable (--configure):   installed opera-stable package post-installation script subprocess returned error exit status 1  Setting up pepperflashplugin-nonfree (1.8.6ubuntu1) ...  --2021-01-08 01:06:46--  https://get.adobe.com/flashplayer/webservices/json/?platform_type=Linux&platform_arch=x86_64&browser_dist=Chrome  Resolving get.adobe.com (get.adobe.com)... 193.104.215.66 Connecting to get.adobe.com (get.adobe.com)|193.104.215.66|:443... connected.  HTTP request sent, awaiting response... 302 Found Location: https://www.adobe.com/products/flashplayer/end-of-life.html?platform_type=Linux&platform_arch=x86_64&browser_dist=Chrome [following] --2021-01-08 01:06:47--  https://www.adobe.com/products/flashplayer/end-of-life.html?platform_type=Linux&platform_arch=x86_64&browser_dist=Chrome Resolving www.adobe.com (www.adobe.com)... 103.15.244.233, 103.15.244.232, 2600:140f:7::1739:4c1d, ...  Connecting to www.adobe.com (www.adobe.com)|103.15.244.233|:443... connected. HTTP request sent, awaiting response...

I recently moved to Linux, and I am in love with the experience. Opinions apart, I am having problems when running sudo dpkg --configure -a  My computer stops processing the command here:  You may know Adobe Flash Player is no longer supported, and I believe that could be why the command is unable to load pepperflashplugin-nonfree. I have tried fixing the problem by checking older posts here, but none of them was able to fix this problem.


When logging in to my PC, and the password is correct, the login takes place nearly instantaneously. When the password is wrong, it takes a few seconds of waiting until the hint "The password is not correct." shows up.  The same thing happens on the terminal with sudo. But why?    I am pretty sure that the passwords hashes are saved and get compared to the hashes of entered passwords. But wouldn't it take longer to confirm the hashes are identical?

I notice a weird (well, according to me) thing about passwords. For example, if I type an incorrect password during login, there will be a few seconds' delay before the system tells me so. When I try to sudo with a wrong password I would also have to wait before the shell says "Sorry, try again".  I wonder why it takes so long to "recognize" an incorrect password? This has been seen on several distributions I use (and even OSX), so I think it's not a distribution specific thing.


I would like to hide the UserSecurity menu point from users who have employee value in the database field. My code is:     String employee = "employee";     String SQL_USERSECURITY = "SELECT UserSecurity FROM user WHERE (UserSecurity = ?);";     String userSecurity = null;     try {         Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/worker","admin","");         PreparedStatement stat = conn.prepareStatement(SQL_USERSECURITY);         stat.setString(1, userSecurity);          ResultSet rs = stat.executeQuery();         while ( rs.next() ) {             userSecurity = rs.getString("UserSecurity");         }         conn.close();     } catch (Exception e) {         System.err.println("Got an exception! ");         System.err.println(e.getMessage());     }          JMenuItem Company = new JMenuItem(Labels.LIST_COMPANIES);     if (userSecurity.equals(employee)) {         Company.setVisible(false);     } else {         Company.setVisible(true);     }  May I ask your kind support to find out what can be the reason for the error?

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 believe I downloaded UBUNTU OS correctly, and tried to load it onto a usb stick, but I am unable to boot-up from the stick. any help would be much appreciated

I would like to see a full how-to guide on how to install Ubuntu.


This query is executed many times as part of an application, but runs slow:  SELECT [c2], [c1], [c5], [c4], [c3], [c6]   from [MyBigTable]  where [c7] = 1    and [c3] in ('a','b','c','d','e')    and [c4] is not NULL   It takes routinely more than 3 seconds, which is already bad, but sometimes the IN has 250 arguments, and the query takes more than one minute. This is the estimated execution plan:    Table has 11 millions rows.   In about 11% of rows [c3] and [c4] are both not null. In about 88% of rows [c3] is null and [c4] is not null. In only 0.4% of rows [c3] is not null and [c4] is null. Both [c3] and [c4] can never be null at the same time. [c7] is 1 in 97% of cases   There is a nonclustered index on [c3], [c4], [c7], [c8] (in order) including [c2], [c5], [c6]  Every time the query has to be run, the PHP code prepares a SQL statement, executes once and discard. I am discussing with the coders whether this can be improved, but I don't hold my breath.  What can I do to improve the performances of the query?  Could a conditional index, "WHERE [c7]=1 AND [c4] is not NULL" seriously improve the situation?

I have an application written in PHP with Laravel that regularly prepares and executes statements like this:     -- All parameters are varchar(10)    SELECT c1, c2, c3, c4       from MyBigTable      where is_active = 1        and c1 in (@P1, @P2, @P3, @P4 ... @P250)        AND c2 is not NULL   Users have a big data grid, and they can select many rows (there is even a button to select 'ALL'). If they select 250 rows, this statement is what happens. But it takes more than one minute to run, which is unacceptable.  Table MyBigTable has about 10 millions rows. The estimated execution plan shows that 100% of time is spent on an "index seek, non-clustered". From this I deduce that the situation can not be improved using indexes, and that the only issue is in the use of prepared statements. (If you think I am wrong, just let me know). Moreover, I understand that these prepared statements are prepared, used once and discarded, so I don't think they are really beneficial.  What recommendation should I give to the developers?  Should I just tell them to stop using prepared statements, and hardcode the 250 values in the query?  Or should I give them some workaround, like the use of temporary tables (make a temporary table, insert 250 values, then make a query on MyBigTable JOINed with temp)?  Or any other idea?  EDIT: execution plan