This request was triggered by the very recent blog post , which announced that now, also retroactively, the askers are given as many reputation points (10) as the answerers for each upvote. This does reward the askers, but also takes away from the answerers by diminishing their relative standing. As an arguably extreme example -- just to make the point clearer, suppose that Alice has earned a reputation of 1000 points entirely by answering, and Bob has earned a reputation of 600 points entirely by asking; then now Alice will still have 1000 points, while Bob will move ahead of her, now with 1200 points.   The mentioned blog post has generated some angry comments (as well as approving ones). Anyhow, I believe what has been said in the above paragraph is a serious concern.   In a comment at , Frank Conijn suggested to      "split the reputation into one for questions and one for answers. Yes indeed, a two-figure reputation."    This seems to be a reasonable suggestion. At least three upsides: it will     be more informative;  make the dispute between relative merits of asking and answering completely unnecessary.  alleviate the diminishing of answerers' relative standing.    I posted that suggestion , which met an overall negative response, even though I believe I addressed all the objections there. That request was closed as a duplicate of , even though the latter seems to be mainly about whether bugs, feature requests, and discussion eventually get reviewed by a moderator.   Anyhow, all the objections against the two-figure reputation, except possibly one of those objections, can be addressed by the following modification of the above two-figure-reputation suggestion:      to have the following two numbers displayed: T and Q (or T and A), where T:=Q+A+(the rest)=(the current total rep), Q is the rep earned on questions, and A is the rep earned on answers.    The mentioned possible exception is that we would have two different numbers instead of one. However, as stated above, that would be more informative, would make the dispute between relative merits of asking and answering completely unnecessary, and would alleviate the diminishing of answerers' relative standing. This trade-off seems beneficial.   Added: This question is not a duplicate of the question at  . Indeed, there the proposal was for Q&A, whereas here it is for T&Q or T&A -- see the latter "block quote" above.

This request was triggered by the very recent blog post , which announced that now, also retroactively, the askers are given as many reputation points (10) as the answerers for each upvote. This does reward the askers, but also takes away from the answerers by diminishing their relative standing. As an arguably extreme example, suppose that Alice has earned a reputation of 1000 points entirely by answering, and Bob has earned a reputation of 600 points entirely by asking; then now Alice will still have 1000 points, while Bob will move ahead of her, now with 1200 points.   Apparently for reasons like that, the mentioned blog post has generated some angry comments (as well as approving ones).   In a comment at , Frank Conijn suggested to      "split the reputation into one for questions and one for answers. Yes indeed, a two-figure reputation."    This seems to be quite a reasonable suggestion, with no apparent downsides. At least two upsides: it will     be more informative;  make the dispute between relative merits of asking and answering completely unnecessary.    A  was asked 10 years ago, which now seems to have acquired new relevance. Most of the objections there were about, again, relative merits of asking and answering, which do not seem relevant.   The only objection there of another kind was this:      "You can't really do it because you can earn a whole bunch of upvotes after you hit the daily rep cap. So any split like this could be really misleading."    I honestly do not understand at all what this problem with the cap is. Whatever it may be, can't it be solved by using caps separately for questions and answers rep points? Or by abolishing the cap altogether?     Added in response to comments and the answer by Glorfindel:  (i) About privileges, we can just use the total, as is done now.   (ii) I cannot imagine that having two numbers, instead of one, can be considered a "mental load". That would be more informative, though. The suggestion by Liam Morris - Reinstate Monica, to have the two numbers only in the profile information, also seems good.   (iii) Edits to questions, as well as to tag wikis/excerpts (which concern tagging questions), would add to the Q rep. Edits to answers would add to the A rep.   (iv) For bounty, it may be left to the users, where to take their points from.     Remark: My question is not a duplicate of , despite the title there. Indeed, that question is actually about a very different matter: namely, whether bugs, feature requests, and discussion eventually get reviewed by a moderator.


I am trying to send a value in JavaScript variable to Drupal. I am calling an external js file in hook_nodeapi(). I want to send a value from this external js file to Drupal, and want to use this value in Drupal in hook_block. For example  hook_nodeapi() {   // call(external.js) } external.js var sendData =10;  hook_block {   case view:   // need to access sendData value }   I tried this using cookies, but I think that is not the best way. How can this be done?

I have set theme handler for a form in Drupal and this handler has a template file. What is the easiest way to send a value from PHP to JavaScript in that include file?


On platter drives, when it is time to dispose of them, a degaussing takes care of the data and in most cases erases the factory pre-recorded servo tracks rendering the drive useless.  What does one do to an SSD to get the same data destructive and rendered useless assurances?  EDIT:  Would taking it out of the case an microwaving it do the trick?

When selling / throwing away / giving away HDDs I always use DBAN to do a DoD wipe first.  Is this still a valid thing to do on an SSD?  Will it have an adverse effect on the SSD's lifespan?


Prove that the zeros of the polynomial $P(z)=z^7+7z^4+4z+1$ lie inside the disk of radius $2$ centered at the origin.  Assuming the contrary that there exists an $|z|\geqslant2$ such that $P(z)=0$ I have that $$z^7+7z^4+4z+1 = 0 \implies 1+\frac{7}{z^3}+\frac{4}{z^6} +\frac{1}{z^7}=0 \implies 1+\frac{7}{8}+\frac{4}{64}+\frac{1}{128} = \frac{249}{128}\ne0$$ which is a contradiction so the zeros would lie inside the disk of radius $2$?

Problem: Prove that all the roots of the equation $z^7+7z^4+4z+1=0$ lie inside the circle of radius $2$ centered at the origin. This question came in the roots of unity section of a summer course. My attempts have been to factor and hope something nice pops out, which ended up in the following: $$z(z^3+2)^2+3z^4+1=0$$ $$\frac{z^8-1}{z-1}+3z^4=(z^4+z)(z^2+z-3).$$ They all look horrendous. Other thoughts would be to use some inequality to prove $|z|<2$ (am-gm, cauchy, etc. seem to fail me). Not entirely sure what to do from here.


when i render these 2 text objects in blender they wont show up in rendering, both objects are surface

This is meant to solve this problem once and for all. What is every reason an object isn't showing up in a render or viewport in when using the cycles render engine?


Let us assume that a gravitational field is created by a mass $M$. An agent is bringing a unit mass from $\infty$ to distance $r < \infty$, both measured from mass $M$.  The agent is always forcing the unit mass with a continuously changing force $\vec F(\vec x)$, $\vec{x}$ being the distance pointing radially out from $M$.   According to classical mechanics, it holds that $\vec F(\vec x) = \frac{GM}{x^2}\hat{x}$, with $G$ being the gravitational constant.  The work is calculated as follows: $$W = \int_\infty^r\vec F(\vec x)\cdot d\vec x$$ $$=\int_\infty^r{{F(x)}\,dx\cdot cos(\pi)}$$ $$=-\int_\infty^r{{\frac{GM}{x^2}}dx}$$ $$=-GM[-\frac{1}{x}]_\infty^r$$ $$=GM[\frac{1}{x}]_\infty^r$$ $$=GM[\frac{1}{r}-\frac{1}{\infty}]$$ $$=\frac{GM}{r}$$  The body moved against the force's direction (the angle between them was always $\pi$). So the work should have been negative. But since $r$ is the scalar distance from $M$, it is positive like $G$ or $M$, yielding the result always positive.  What is wrong here?

A solid sphere has charge $q$ and radius $R$. Find the potential at a point a distance $r$ from the center of the sphere where $r>R$, using infinity as the reference point.  My attempt:  From Gauss' theorem we may deduce that $\displaystyle\mathbf{E}=\frac{1}{4\pi\epsilon_0}\frac{q}{r'^2}\hat{\mathbf{r}}$ where $r'$ is the distance of an arbitrary point from the center of the sphere provided $r'>R$.  $V=-\int_\infty^\mathbf{r}\mathbf{E}\cdot d\mathbf{l}$  My question: What is $d\mathbf{l}$? Since we are traversing in the direction opposite to $\hat{\mathbf{r}}$, I think it should be $-dr'\hat{\mathbf{r}}$. But when I use it to find $V$, I get a sign error. Please help!


Let $P (x) = ax^2 + bx + c$ where $a,b,c$ are in arithmetic progression and are positive constants. Let $P (x) = 0$ for $t$ and $r$, where  $t$ and $r$ are integers. Find $t + r +tr$.  Answer is : $7$  I tried it as follows : $t + r = -b/a$ ; $tr = c/a$ ; $t + r + tr = -b/a + c/a = (c-b)/a = (b-a)/a= b/a - 1$    Therefore, $2t + 2r + rt = -1$  I could not figure out what to do next. Please help.

The terms $a,b,c$ of quadratic equation $ax^{2}+bx+c=0$ are in A.P. and positive. Let this equation have integral root $\alpha,\ \beta$. Then find the value of $\alpha+ \beta + \alpha \cdot \beta$ ?   please point where I'm wrong:  Let common difference be $d$  $\implies \alpha+ \beta + \alpha \cdot \beta=\dfrac{c-b}{a}=\dfrac{d}{a} \implies a|d \ \ \ \ \longrightarrow  \ \ \ \ \              \because (b=a+d$, $c=a+2d)$  Also , $ax^{2}+(a+d)x+(a+2d)=0$.   $\implies$ $\alpha,\ \beta=\dfrac{-(a+d) \pm \sqrt{(a+d)^{2}-4\cdot a \cdot (a+2d)}}{2a}$.   For this to be integer $\sqrt{(a+d)^{2}-4\cdot a \cdot (a+2d)}$ must be perfect square.  $\implies$ ${(a+d)^{2}-4\cdot a \cdot (a+2d)}=p^{2}$ for some $p$.  $\implies -3a^{2}+d^{2}-6ad=p^{2}$  $\implies -3a^{2}+a^{2}q^{2}-6a^{2}q=p^{2}$ $\because$ $a|d \implies aq=d$ for some $q$.  $\implies a^{2}(-3+q^{2}-6q)=p^{2}$   $\implies -3+q^{2}-6q\ $  has to be perfect square. By trial $q=7$  But I need to get this without trial, please help.


Lenovo Laptop Ubuntu 18.04.2 LTS 16 GB RAM Intel® Core™ i5-5200U CPU @ 2.20GHz × 4 GNOME 3.28.2 64-bit   Swap File Partition:    If I have enough memory all the time (16gb) does that mean it just doesn't need the swap file?  Does 18.04.2 even need the swap?

I read many places that the rule of thumb for swap space is to double the amount of physical RAM. However, 32 GB does seem a LOT. Do I need that much? Do I need it at all with this high amount of physical RAM?


A most respected moderator repeatedly advises against the automation of \left and \right in math mode. (Among others, .) There must be some good argument behind that. I am just curious, why?

For mathematics, is it ever disadvantageous to use \left(  and \right)  in equations?  I can't see any way that doing this would hinder the typesetting, so why isn't () just converted into \left( \right) automatically? This would save a lot of typing.  Cheers!


I want to know how to increase the distance between two paragraphs but not between two lines of the same paragraph.  For example, if I type a long line, I want to wrap that line into a paragraph, but when I deliberately press Enter or type \\ and begin another paragraph, I want the default distance to be higher. Is it possible to set this for the whole document without using \\[10pt]?

I would like to have my whole document showing a blank line (or space) between paragraphs and no indentation. I know how to do it line by line, but is there a way to change that with just one or a few lines at the beginning of the document? Like a package you can install, or a new command?


I have an ethernet 10/100 switch. this connection is working properly (to my cablemodem router, so all computers are connected to internet).   I have just bought a Gigabit switch that I am about to use instead of the other. The intented purpose is to be able to share quickly between these computers.  How to check that I am achieving Gigabit speed with my new switch between my Xubuntu / Ubuntu 14.04 computers in the lan?  I am not sharing yet between computers or created and workgroup, as I still need to learn how to do it. This is just information for anyone who will want to help to keep in mind.  Thanks   Alex

I have a gigabit network set up in my house and a few Ubuntu based boxes. Out of complete curiosity I would like to check the speed between the two boxes. I am not having any problems with speed or anything, it really is just the geek in me that is curious. Plus maybe the results will let me know if there is room for improvement, or that I have something configured wrongly.  So how do you properly test the network speed between Ubuntu boxes?


Given that $$\langle \hat{A} \rangle = \langle \psi|\hat{A}|\psi \rangle$$ Why does $\langle \hat{A} \rangle = \mathrm{tr}(\hat{\rho} \hat{A})$, where $\hat{\rho}$ is the density operator, $\hat{\rho} = |\psi\rangle \langle \psi|$? More importantly, how does trace manifest itself in a general operator, that is not a matrix? Because at the moment, all I think about when I think "trace" is the sum of the diagonal elements, which only applies to matrices...

I came across this,  \begin{post} To each state there corresponds a unique state operator.The average value of a dynamical variable \textbf{R}, represented by the operator $R$ ,in the virtual ensemble of events that may result from a preparation procedure for the state, represented by the operator $\rho$, is  $$\langle \textbf{R}\rangle=\dfrac{Tr(\rho {R})}{Tr\rho}$$  \end{post}  $\rho$ is called density matrix or statistical operator.  What's meant by this and why does this give average?


I'm facing an issue with comparing two Objects.  I'm comparing an incoming Object, with an Object Array, to see if the Object is already in the array.  I tried two methods:  (betTemps is the Array of Objects, tempBet is the current object which should be compared.)  var duplicate = false; for (let bet of this.betTemps) { console.log(tempBet);   console.log(bet);   if(bet === tempBet) {     console.log("reached");     duplicate = true;     break;   } }   The if afterwards:  .. else if(duplicate){   alert("The Bet is already in the List"); } ...   Console Output after adding an Object which is already in the Array:  Console Output Screenshot    As you can see, they are equal, still the other Object is added to the array.  I tried using this method too with indexOf:  if(this.betTemps.indexOf(tempBet) > -1){   alert("The Bet is already in the List"); }   Console Output after adding an Object which is already in the Array:  Console Output Screenshot    PS:  The code before the comparison:    addBet(bet, index){ var tempBet = Object.assign({}, bet); var select = (document.getElementById('select'+index)) as HTMLSelectElement; select = select.options as HTMLSelectElement; let count = 0;  tempBet.category = []; for(let i = 0; i < 3; i++) {     if (select[i].selected) {       tempBet.category.push(select[i].value):       count++;     } }   The code after the comparison:  if (count == 0) {   alert("There has to be at least one Category choosen!"); } else if(duplicate     <- This part changes individually which method you use ->){   alert("The Bet is already in the List"); } else {   this.betTemps.push(tempBet); }

A strict equality operator will tell you if two object types are equal. However, is there a way to tell if two objects are equal, much like the hash code value in Java?  Stack Overflow question  is similar to this question, but requires a more academic answer. The scenario above demonstrates why it would be necessary to have one, and I'm wondering if there is any equivalent solution.


During the DS9 series the Changling/Dominion society becomes a key part of the narrative. I have been trying to look online and while I can see quotes about how Odo was written to take on the role of Data and Spock, a non human looking in on human society. I can’t find anything that explains when the writers fleshed out his backstory and came up with the idea of changlings being the society they became in the series?   Was it always intended that Odo would find his fellow changlings and they would then be the main antagonist or is this something that developed over time?

I am just rewatching Star Trek: Deep Space Nine.  I was wondering whether the producers planned the Dominion plot, and especially that the Founders are changelings, from the beginning.   In the first episodes it was established that Odo was the only (known) one of his kind. It is only natural to explore his origin within the series. Was this meant to be the Founders/Dominion plot from the beginning?


The question gives all necessary data: what is an efficient algorithm to generate a sequence of K non-repeating integers within a given interval [0,N-1]. The trivial algorithm (generating random numbers and, before adding them to the sequence, looking them up to see if they were already there) is very expensive if K is large and near enough to N.  The algorithm provided in  seems more complicated than necessary, and requires some implementation. I've just found another algorithm that seems to do the job fine, as long as you know all the relevant parameters, in a single pass.

I'd like to generate unique random numbers between 0 and 1000 that never repeat (i.e. 6 doesn't show up twice), but that doesn't resort to something like an O(N) search of previous values to do it. Is this possible?


after \end{titlepage} I put \chapter*{LEMBAR PENGESAHAN} but the result is different from the next chapter's header space.  wrong space   correct space   \documentclass[12pt,a4paper]{report} \usepackage[   left=3cm,   top=3cm,   right=2cm,   bottom=2cm,   includehead,   includefoot,   bindingoffset=5mm ]{geometry} \usepackage[utf8]{inputenc} \usepackage[english,bahasai]{babel} % <---- main language last  \usepackage{lipsum}  \usepackage{titlesec}  \titleformat{\section}   {\normalfont\fontsize{16}{16}\bfseries}   {\thesection}   {1em}   {}  \usepackage{graphicx} %\usepackage[colorinlistoftodos]{todonotes} %\usepackage{showframe}  \usepackage[linktocpage]{hyperref} \hypersetup{     colorlinks,     citecolor=black,     filecolor=black,     linkcolor=black,     urlcolor=black }  \makeatletter \def\@makechapterhead#1{%   %%%%\vspace*{50\p@}% %%% removed!   {\parindent \z@ \centering \normalfont     \ifnum \c@secnumdepth >\m@ne         \Large\bfseries \MakeUppercase{\@chapapp}\space \thechapter % <--- uppercase         \par\nobreak         \vskip 0\p@     \fi     \interlinepenalty\@M     \LARGE \bfseries #1\par\nobreak     \vskip 30\p@   }} \def\@makeschapterhead#1{%   %%%%%\vspace*{50\p@}% %%% removed!   {\parindent \z@ \centering     \normalfont     \interlinepenalty\@M     \LARGE \bfseries  #1\par\nobreak     \vskip 30\p@   }} \makeatother   \usepackage{fancyhdr}  \pagestyle{fancy} \rhead{\includegraphics[height=1cm]{LOGO_P.png}} \lhead{\includegraphics[height=1cm]{LOGO_I.png}}  \begin{document}  \begin{titlepage}     \begin{center}         \includegraphics[width=5cm]{LOGO_I.PNG}\\[0.25cm]         \textbf{xxx xxx}\\[1.75cm]         \textbf{xxx xxx \\[4cm]}         \textbf{xxx xxx}\\[4cm]          \textbf{Diajukan Oleh:}\\         \textbf{xxx xxx}\\         \textbf{xxx xxx}\\[4cm]         \textbf{xxx xxx}\\         \textbf{xxx xxx}\\         \textbf{xxx xxx}     \end{center}  \end{titlepage}  \pagenumbering{roman}  \chapter*{LEMBAR PENGESAHAN} \thispagestyle{fancy} I declare that..  \chapter*{ABSTRAK} \thispagestyle{fancy} I want to thank...  \chapter*{KATA PENGANTAR} \thispagestyle{fancy} I want to thank...   \tableofcontents \thispagestyle{fancy} \pagenumbering{arabic} \pagebreak \chapter{PENDAHULUAN} \thispagestyle{fancy} \lipsum[1-15] \section{LATAR BELAKANG} \subsection{Latar Belakang} \lipsum[16-30] \chapter{Landasan Teori} \thispagestyle{fancy} \lipsum[31-45] \begin{figure}[h]     \centering     \includegraphics[width=0.25\textwidth]{LOGO_I.png}     \caption{a nice plot}     \label{fig:mesh1} \end{figure}  As you can see in the figure \ref{fig:mesh1}, the  function grows near 0. Also, in the page \pageref{fig:mesh1}  is the same example. \end{document}

How would one increase the height of the \fancyhead{} so that the text in the main body, doesn't collide with the title?  I have the following MWE:  \documentclass[a4paper,10pt,oneside]{article} \usepackage{fancyhdr} \usepackage[english]{babel} % Required to compile in Windows \usepackage[letterspace=150]{microtype} \usepackage{fontspec}  \pagestyle{fancy} \setmainfont {Adobe Garamond Pro} % Main document font  \renewcommand{\headrulewidth}{0pt}  \fancyhead[C]{     \addfontfeature{LetterSpace=20.0}\fontsize{30}{30}\selectfont\scshape Foo Bar Camp Names\\[5mm] }  \begin{document} \section*{Foo} \end{document}   However, the section foo starts right in the header, therefore I want to add some vspace in between header and main body. I tried \vspace, \bigskip, and all other sorts of vertical space commands, but none worked.  Updated MWE:  \documentclass[a4paper,10pt,oneside]{article} \usepackage{marvosym} % Allows the use of symbols \usepackage[english]{babel} % Required to compile in Windows \usepackage[letterspace=150]{microtype} \usepackage{fontspec} \usepackage{fancyhdr} %\usepackage[headheight=110pt]{geometry}  \pagestyle{fancy} \setmainfont {Adobe Garamond Pro} % Main document font  \renewcommand{\headrulewidth}{0pt} \setlength{\headheight}{110pt}   \fancyhead[C]{     \addfontfeature{LetterSpace=20.0}\fontsize{30}{30}\selectfont\scshape Foo Bar Camp Names\\ }  \fancyfoot[C]{     \lsstyle     \scshape{         \renewcommand{\\}{\ {\large\textperiodcentered}\ }         Foo Street \\Bar\\Foocountry     }\\     {\Large\Letter} foo@bar.com \ {\Large\Telefon} (+001) 000-0000000 }  \begin{document} \date{} % hide date \section*{Foo Bar} \end{document}


I'm very new to Linux. I'm trying to gain an understanding of APT and would like some clarity on the output of this command. What am I to glean from this?  apt-get update:   Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB] Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB] Hit:4 http://ppa.launchpad.net/webupd8team/sublime-text-2/ubuntu xenial InRelease                                                               Get:5 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB] Fetched 306 kB in 0s (377 kB/s)                              Reading package lists... Done   What is a hit and what is a get?  Thanks.

I had a bunch of errors in the output of sudo apt-get update:  duplicate entries and 404 not found errors.  Figured those out, I hope: I removed PPAs that didn't have any packages associated with them, then I removed out a duplicate entry in /etc/apt/sources.list.  It seems I have royally buggered it up.  Now most of the lines say Ign when I do sudo apt-get update.  How do I go about straightening out what I have screwed up?  I need to get rid of these Igns that are all over the place.  There are about 50% (eyeball guess) Igns!


Let $S = \{1,2,3,4\}$. Let $f$ be the sets of all functions from $S$ to $S$.  Now, is this statement correct?  $\forall f \in F$ , $\exists$  $g \in F$ so that $(f\circ g) (1) = 2$    I think this is false because suppose the only output $f(x)$ can produce is   $f(x)=3$ and $f(x) = 4$  Now, there is no possibility of $(f\circ g)(1) = 2$ because $2$ isn't an output of $f$.  Is that correct to say?

Let $S = \{1,2,3,4\}$. Let $F$ be the sets of all functions from $S$ to $S$.  Now I think this statement is true:  $\forall f \in F , \exists g\in F$ so that $(g \circ f)(1) =2$  I suppose $f \in F$, and I need to show that $\exists g\in F$ so that $(g \circ f)(1) = 2$  Do I just make an example  of $g$ so that $(g \circ f)(1) = 2$ ?  Like $f(1) = y$  and then  $g (y)=2 ?


I have this function that can append the first three columns of data to a new empty list. Example output is:   ['red', 'blue', 'green', 'yellow', 'purple', 'black']   I would like to enclose every two elements of this list in its own list i.e.   [['red', 'blue'], ['green', 'yellow'], ['purple', 'black']]   How can I do this? Thanks.   def selection_table(table):     atts = [1,2,3]     new_table = []     for row in table:         for i in range(len(new_atts)):             new_table.append(row[atts[i]])     return new_table

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


public String name, email, phone; NotificationCompat.Builder notification1;  Button aprv;  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main2);      aprv=(Button)findViewById(R.id.btnapp);     Bundle bundle=getIntent().getExtras();      name=bundle.getString("Name");.......................##     email=bundle.getString("Email");     phone=bundle.getString("Phone");      TextView textView1=(TextView)findViewById(R.id.tv1);     TextView textView2=(TextView)findViewById(R.id.tv2);     TextView textView3=(TextView)findViewById(R.id.tv3);     textView1.setText(name);     textView2.setText(email);     textView3.setText(phone);   Null pointer exception shown in the line with hashtags.  Here's the intent code in another activity. I set the manifest correctly.  Intent intent = new Intent("com.example.user.adminapp.Main2Activity"); intent.putExtra("Name", name); intent.putExtra("Email", email); intent.putExtra("Phone", phone); startActivity(intent);

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


is there a way to set automaticly comma-decimal separator in latex in the "environment" $$ ? I mean having a 1,23 instead 1.23 by typing $1.23$. I tried to set by my own without any success, by inserting    \sisetup{output-decimal-marker={,}}.    But it didn't work. Any ideas? Thank you

For my study of physics I have to do various lab reports. Normally I just process all my data using python, gnuplot or Mathematica and copy it from there to my TeX document. Unfortunately all these applications use the . (dot) as a decimal seperator. Because I study in Germany the german standard says that I have to use , (comma) as the decimal seperator. In most cases the supervisors of the lab are forgiving, but one of them told me to redo my whole lab report because of this. Now I don't want to search all the 15 pages to replace all dots with commas. I could have used a  but this still implied editing the whole file.


\documentclass[a4paper,12pt, twoside]{article} \usepackage{enumerate} \renewcommand{\baselinestretch}{1.5} \usepackage{amsmath,  amsthm,  amsfonts, mathrsfs, latexsym, amssymb, pstricks,graphicx,setspace,textcomp} \usepackage{pdfpages,caption} \usepackage[round]{natbib}  \bibliographystyle{apa} \usepackage{cite} \usepackage{nomencl} \usepackage{graphicx} \usepackage{float} \usepackage{underlin} \usepackage{url} \usepackage{longtable} \usepackage{titletoc} \usepackage{titlesec} \usepackage[normalem]{ulem} \usepackage{hyperref} \usepackage{caption} \usepackage{parskip} \setlength{\parindent}{20pt} \usepackage{setspace}  \usepackage{lipsum}  \usepackage{pdflscape}  \usepackage{multirow} \usepackage[utf8x]{inputenc} \begin document \begin{landscape} \chapter*{Plan of work} \begin{tabular}{|c|*7{p{32mm}|}} \hline \multirow{2}{*}{Task}  &  \multicolumn{6}{c|}{Duration}\\ \cline{2-7}  & Jan-15 to May-15 & June-15 to Dec-15 & Jan-16 to May-16 & June-16 to Dec-16 & Jan-17 to May-17 & June-17 to Dec-17\\ \hline \multirow{2}{*}{Course Work} &   &  &&&&\\ \cline{2-7} &  &  &&&&\\ \hline \multirow{2}{*}{Literature Survey} &&&&&&\\ \cline{2-7} &&&&&&\\ \hline \multirow{2}{*}{Develop CZM }   &&&&&&\\ \cline{2-7} &&&&&&\\ \hline \multirow{2}{*}{Fracture Toughness}  &&&&&&\\  \cline{2-7}  for pure modes &&&&&&\\ \hline \multirow{2}{*}{Applying to mixed }  &&&&&&\\ \cline{2-7}   mode cases &&&&&&\\ \hline \multirow{2}{*}{Publications and }  &&&&&&\\ \cline{2-7}  Thesis Preparation &&&&&&\\ \hline \end{tabular} \newpage \end{landscape} \end document

I am looking for a convenient way to set the background of tabular cells. I'd like to do two things:  (1) Set the background shaded in a color (2) Set the background hatched  I learned that the TikZ package provides means to do this but I am unable to come up with a solution that does not use matrices (such as here: ) but instead uses the tabular package.  Here's what I'd like to do:  \documentclass{article} \begin{document} \begin{tabular}{|l|l|l|} \hline   1 & \setBGGray 2 & 3 \\\hline   4 & 5 & 6 \\\hline   7 & \setBGHatched 8 & 9 \\\hline \end{tabular} \end{document}   The output should look like this:    Can someone please help me achieving this using tabular (or tabularx) and TikZ?


I searched before asking, and there are indeed similar questions, however I could not find one that matches exactly my situation. Feel free to point me to the right question answer / close this one, if you have better luck finding one.  I'm posting here, and not on meta.gaming.stackexchange, because I believe that the rules are the same for all sites, again, if that assumption is wrong, please feel free to let me know.  I asked . This question turned out to be a not so good question and was closed by the community. Because the question was not useful, and I could not improve it, I decided that I might as well delete it. When I choose "delete" I was prompted if I was really-really sure and that's usually a bad thing to delete questions with answers, but hey, what I'm deleting is a trash question that is also mine, why could this be bad? So I choose to proceed.  In response I got unspecific "the question cannot be deleted" message without any reason and an advise to flag for moderator attention.  So I flagged for moderator attention, and the flag was declined with the reason "it would be unfair to people who answered to delete it".  Now I'm completely confused. Could you please explain me   1) As a community do we care more about peoples rep then about site content and refuse to delete bad questions, only because some one answered them? 2) As a community do we want reward people who answer bad questions? 3) Can a message that a question cannot be deleted be made more user friendly and give a reason why the question cannot be deleted?

I'd like to delete a question of mine that was downvoted and has close votes, so I flagged it and asked for a mod to delete it but they didn't.  Why can it not be deleted?    I can understand that users shouldn't be able to delete questions and answers that may be useful to others but in this case the community has decided it has no value.  Also, following question edits, the answer with upvotes no longer answers it.


This is my mesh in Blender:    And this my mesh when placed in UDK:    As you can see it doesn't have the human head/chest part, parts of the hood are invisible, and it has some white lines. Why?

I've got a problem with my rendering! I'm trying to render some objects:    But, this is how it renders:    Can somebody help me out?


I'm using Blender 2.83.3, Windows 10 x64, AMD rx570 4gb GPU, and intel i5 9400f CPU. My preference is OpenCL only GPU checked. But when rendering Cycles GPU Compute some unwanted line appears as shown in the picture (like the old movies). But using Cycle CPU, this doesn't occur. Also rendering in Eevee works fine for CPU or GPU. Any solution to this? [My and drivers are updated and tried reinstalling Blender but still the same. Also when I check GPU and CPU in OpenCL in preferences and then render in Cycles, Blender crashes. Rendering in Eevee works fine for CPU or GPU.]

I'm new to blender and have been studying and starting with low poly modeling. Recently I changed my GPU from a GTX 960 to an RX 580. I uninstalled the drivers and installed new ones using DDU.  Problem: Rendering using OpenCL produces these unwanted lines. The attached image is a product of CPU + GPU render then the GPU only render, respectively. When I render using only the CPU the results are as expected, no unwanted black vertical lines, using only the GPU adds more lines on the image.  Any help is appreciated, thank you!


I am a PhD student, should I put my supervisor as the corresponding author, will this increase my chance of publication?

Papers published from an academic project (MSc or PhD) usually have two authors; the first author is the student who mainly conducted the research, and the second author is the professor who supervised the projects.  The corresponding author is the one who take the responsibility of a paper, and thus, some believe that students are not yet prepared to take this responsibility.  Ideally, who should be corresponding author for papers published by MSc or PhD projects?  I understand that it mainly depends on personal agreements and preferences, but I want to know which case is more reasonable from academic logic?


What is the transformation needed to be taken on every data point of a shape to  rotate that shape around the globe.  I'm trying to figure out the math behind this kind of transformation so I can create something similar to this using leaflet and d3   Edit: To be clear, I am looking to achieve this using leaflet, D3, and javascript not desktop GIS software. My end product will a function that takes a point (lat,lng) shifts it by an amount (shift_lat,shift_lng) and returns (new_lat,new_lng)

I am trying to translate coordinates. I have a set of coordinates for city A which I need to map to city B, given a point P1 in city A maps to P2 in city B. How do I do this? This problem would be similar to a translation transformation but in this case, it's on a sphere and not on a plane.


Or will there be?   In Newtonian formalism, we appoint a potential, then write newton's eq. which is equivolent to a initial value problem.  In Lagrangian formalism, we appoint a Lagrangian, then write Lagrangian eq.  In Hamiltonian formalism, we appoint a Hamiltonian, then write Hamilton-Jacobi eq.  Are other reasonable mechanisms that can generate dynamical systems?

I was lately studying about the Lagrange and Hamiltonian Mechanics. This gave me a perspective of looking at classical mechanics different from that of Newton's. I would like to know if there are other accepted formalism of the same which are not quite useful compared to others (because otherwise if would have been famous and taught in colleges)?


If $W=M_{n\times n}(\mathbb F)$ and $f$ is a linear functional on $W$ such that $f(AB)=f(BA)\;\forall A,B\in W$, and $f(I)=n$, then $f$ is the trace function.    I have tried to generate useful matrices that can be represented in the form $AB-BA$ for some $A$ and $B$. My idea was to generate a basis for $W$ of the form $AB-BA$ plus the identity.

We know that the trace of a matrix is a linear map for all square matrices and that $\operatorname{trace}(AB)=\operatorname{trace}(BA)$ when the multiplication makes sense.   On the , under properties, it says that these properties characterize the trace completely in the following sense: If $f$ is a linear function on the space of square matrices satisfying $f(xy)=f(yx)$, then $f$ and $\operatorname{tr}$ are proportional. A  of the page gives the justification, but I do not understand the logic of it. Thanks


First of all I am very new to Linux and I might sound stupid. I am having difficulties to understand in Ubuntu why GRUB is in two different locations: /etc/default/grub  and also /boot/grub. In order to make changes, which .cfg file should I edit /etc or the /boot one? Also what are the purpose to put GRUB in 2 different directories? Thanks in advance.

I have seen that grub2 configuration files exist in so many different locations.    /etc/grub.d /etc/default/grub /boot/grub2/grub.cfg   Can anyone tell me the purpose of each directory/file?


I'm having a problem with a script. It is meant to change a value in a file called %DIR% so that it becomes a path name. The problem is the slashes in the directory name upset sed, so I get weird errors. I need to convert the slashes in the path name into escaped slashes.  So /var/www would become \/var\/www  But I don't know how to do this.  Currently the script runs sed with this:  sed -i "s/%DIR%/$directory/g" "$config"

I have a script that reads a text stream and generates a file of sed commands that is later run with sed -f. The generated sed commands are like:  s/cid:image002\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1922/g s/cid:image003\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1923/g s/cid:image004\.jpg@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1924/g   Assume the script which generates the sed commands is something like:  while read cid fileid do     cidpat="$(echo $cid | sed -e s/\\./\\\\./g)"     echo 's/'"$cidpat"'/https:\/\/mysite.com\/files\/'"$fileid"'/g' >> sedscr done   How can I improve the script to ensure all regex metacharacters in the cid string are escaped and interpolated properly?


i have installed Ubuntu 20.04 and after installing application like CodeBlocks and Zoom i have an issue that the apps are shown in a very tiny windows and icons, i tried different resolution but it does not help, i like how the desktop and everything looks, the problem is only on couple application. I got lenovo yoga 730 with 4k resolution.    Thanks !

I recently installed Ubuntu 18.04 and discovered that the fractional scaling option that was in 16.04 is no longer there. 200% is too big for my display, and  didn't work for me (the options didn't change after running the command).  Is there another way to get fractional scaling?


Determine the group $\text{Aut}(\Bbb{Q}(\sqrt{2})$,where $\Bbb{Q}(\sqrt{2})=\left\{a+b\sqrt{2}:a,b\in \Bbb{Q}\right\}$.   First, identity and conjugation which is $a+ib\mapsto a-bi$. But I don't know whether there are some other elements in $\text{Aut}(\Bbb{Q}(\sqrt{2}))$. If we can prove that there is no other element, then $\text{Aut}(\Bbb{Q}(\sqrt{2}))\cong \Bbb{Z}_{2}$.

I am currently working to find all ring homomorphisms $\phi : \mathbb{Q}(\sqrt{2})\rightarrow \mathbb{Q}(\sqrt{2})$.   My work so far: Since $\mathbb{Q}(\sqrt{2})$ is a field extension of $\mathbb{Q}$, a field, it is obviously a field as well. Therefore, its only ideals are $\{0\}$ and itself. Since every homomorphism's kernel is an ideal, we have that either $Ker(\phi)=\{0\}$ or $\mathbb{Q}(\sqrt{2})$.   In the latter case, we have the trivial homomorphism. In the former case, we have that the homomorphism is injective (and therefore bijective).   My question: I think it is true that in the former case $\phi(1)=1$, but am not sure why. If this is the case, can I prove inductively that $\phi(x)=x, \forall x\in \mathbb{Q}(\sqrt{2})$?  Thank you in advance for your help.


The question  (asked less than ten minutes ago) was closed as a duplicate less than five minutes ago, but it lacks any semblance of a duplicate target.  The header shows:     This question already exists:   The expected link to the duplicate target is missing.  Its timeline shows that it was closed by "Jenayah, Community♦" as "Duplicate of… " That's it, duplicate of....  What happened, and can we fix it?  I suspected that the duplicate target might simply have been deleted, but then I recognized the extremely short time between closure and now (not really enough time for others to get around to deleting), and also that one generally can't vote to delete a question that is a duplicate target - one instead gets a message that the question can't be deleted.  Another example of this happening:

Obligatory: This is not a duplicate of , which is concerning the much older duplicate closure process.  Have a gander at . Notice anything weird?  The Community♦ user was invoked by the question asker to self-close as a duplicate (presumably of the comment below, which links to ), but the list of duplicates is entirely empty. So it would seem the question asker was able to close their own question as a duplicate of... nothing?  Screenshot, in case the post is altered later:    Any idea what happened here?


How do we prove that $||a|-|b|| \leq |a-b|$ ? I do know that $|a-b|<|a|+|b|$ from the triangle inequalities. As a matter of fact it does remind me of something, I studied in Complex numbers class, .   However, I can't relate both. I did also tried to expand the inequality, with no success, just too many cases for me to handle. Hopefully I can get an answer here. Thanks.

I've seen the full proof of the Triangle Inequality  \begin{equation*} |x+y|\le|x|+|y|.  \end{equation*} However, I haven't seen the proof of the reverse triangle inequality:  \begin{equation*} ||x|-|y||\le|x-y|. \end{equation*} Would you please prove this using only the Triangle Inequality above?  Thank you very much.


Here is the entire question I am trying to solve:  Implement a function getCustomerList that takes as argument filename to read the file and return it as a nested list, where each element is a list of [, <Clerk’s Desk>, ]. The filename argument doesn’t contain the extension (i.e. “input”), your program must automatically add the “.txt” extension. If the file doesn’t exist, the getCustomerList function will print the message: “Error!  not found.”, and should return None.  My Problem: I am having trouble in getting the last item (minutes) to return WITHOUT quotes. Here are my expected and actual results:  Name, Desk, Minutes   Here is my code:  def getCustomerList(filename):     current_file = filename + ".txt"     data = []      # write code to check if file exist and return List/None     try:         open_file = open(current_file, "r")             for aline in open_file:             values = aline.split(",") # Break each line into a list             lines = [(n.rstrip('\n')) for n in values]             data.append(lines) # Add the row to the list         return data[1:]         print(data)          except IOError:         print("Error! " + current_file + " not found.")

In Python, how can I parse a numeric string like "545.2222" to its corresponding float value, 545.2222? Or parse the string "31" to an integer, 31?  I just want to know how to parse a float str to a float, and (separately) an int str to an int.


I am not sure if it is trivial or if it is even true but a paper I am reading seems to use $\operatorname{Var}X \leq \frac{1}{4}$. I am fine with the obvious bound $\operatorname{Var}X \leq 1$ but curious if it can be even tighter as in $\operatorname{Var}X \leq \frac{1}{4}$. If the $\frac{1}{4}$ bound is not true, a counterexample is appreciated.

Show that. for any discrete random variable X that takes on values in the range [0,1]. Var[X] $\le$  1/4.  I translate it into a inequality like this: $x_1, x_2, x_3 \cdots ,x_n$ where $0 \le x_i \le 1$, and $p_1, p_2, p_3 \cdots ,p_n$ where $p_1+ p_2+ p_3 \cdots +p_n = 1$, prove that $\sum _1^nx_i^2p_i - (\sum _1^n x_ip_i)^2 \le {1\over 4}$ , how to prove it?  At first I tried cauchy inequatlity, but I fail :(


So I'm still learning about texturing in blender. Then after googling around i found about shader editor and uv editor. When i first open shader editor to make material the node show up okay. Then after that i go to uv editor to aligning the textures to my object. But, when i go back to shader editor to messin around with roughness and heightmap, the nodes that's there before is gone and just show up blank like this

My material node is missing in the viewer. No  matter how much I mouse around, I can't find it or add shaders to it. If I delete it, and add another material, it's still missing.


I've been given Java code by others which use curly braces on new lines, and I'd like them on the same line after I import the file without having to change them line-by-line?  How do I do it?  private void someMethod() {    //Some code here }   I want it to look like this:  private void someMethod(){    //The same code }   Thanks!

I am using the IntelliJ IDEA ide for java coding. By default it produces curly braces on the same line as the function name, like so:  function bla() { .. }   Can i change it somewhere there so that i will do this instead?:  function bla()  { .. }   Thanks!


I have a problem where 20 character string converted the JS new NUMBER method.  var x4 = "22222222222222222222"; var x5 = "22222222222222222229"; Number(x4)  parseInt(x5);     //Output 22222222222222220000 22222222222222220000   I was expecting to get the same value as the variable but in number format but I dont know whats wrong here. What is the best way to convert string to number will any number of digits.

Is this defined by the language? Is there a defined maximum? Is it different in different browsers?


I am trying to delete my linux-swap partition /dev/sda5 and allocate the free space to /dev/sda6.  But when i try to delete sda5 GParted gives an error "You have to umount sda6". But i can not umount sda6. I gives me the error "umount: /: target is busy" If i reduce the size of sda5 i can not allocate the unallocated space to sda6.  Can anyone give me some advice on how to do this the right way?  I have a multi-boot system with windows and Linux. (Grub2)

I installed Debian Jessie with default partitioning on my SSD drive. My current disk partitioning looks like this:    As I have 16GB of RAM, I assume I don't need . But since I have other disk drives I may  for example, on one of the other drives instead.  Can you tell me what steps I should take to remove the  partition correctly and permanently for it not to occupy disk space? I wish to delete the swap partition as I currently have only 128GB SSD.  Here is what I tried and rebooted each time; each of these steps being not permanent, or did not do anything:   Using the  utility:  swapoff --all  Using the  utility:  Right-clicking the  partition and clicking Swapoff. Commenting out the  partition's  in the following file:  /etc/fstab  Commenting out the  partition's  in the following file:  /etc/initramfs-tools/conf.d/resume  Running these commands in the end (both in this and the opposite order):  update-grub  update-initramfs -u


Biblatex is not working for me suddenly. I suddenly get the following log file :   Unsuccessful stat on filename containing newline at /var/folders/48/mcfj3ms5211f4zc_b6l9680r0000gn/T/par-6a61736f6e6b6861646b61/cache-6bef3f811cde577dd70e44f9f5046ebc66712c46/inc/lib/XML/LibXML/Simple.pm line 223. data source <?xml version="1.0" encoding="UTF-8"?> <bcf:controlfile version="2.7" xmlns:bcf="https://sourceforge.net/projects/biblatex">   <!-- BIBER OPTIONS -->   <bcf:options component="biber" type="global">     <bcf:option type="singlevalued">       <bcf:key>output_encoding</bcf:key>       <bcf:value>utf8</bcf:value>     </bcf:option>     <bcf:option type="singlevalued">       <bcf:key>input_encoding</bcf:key>       <bcf:value>utf8</bcf:value>     </bcf:option>     <bcf:option type="singlevalued">  .....       <bcf:field>addendum</bcf:field>       <bcf:field>afterword</bcf:field>       <bcf:field>annotator</bcf:field>       <bcf:field>com not found in . INFO - This is Biber 2.1 INFO - Logfile is 'main.blg' INFO - Reading 'main.bcf'   and in the compiling of my text there is an error that can only fixed by recompiling the biblatex. How can i fix it?

I'm trying to use biblatex and when I compile my document I get an error like the following:  Windows  data source C:\Users\<username>\AppData\Local\Temp\par-5061756c\ cache-890efc00b3ca6b775c7d44a325c1349fb2a3a3bd\inc\lib/Biber/LaTeX/recode_data.xml not found in .   Mac  data source /var/folders/v2/rld0ls7d2935gkvqv5hfr1x00000gn/T/par-616c616e/ cache-cdd483146f82a9655ce063f848d5139480fbf872/inc/lib/Biber/LaTeX/recode_data.xml not found in .   Linux  data source /tmp/par-6963617269756d/cache-f37ab610b7d79b2720a8ee3732849c6821705520 /inc/lib/Biber/LaTeX/recode_data.xml not found in .


I found this problem while studying for an analysis exam and have been puzzled ever since. If anybody has any hints on this, I would greatly appreciate it.   Prove that the lebesgue integrals $\lim_{n\to \infty} \int_{[0,1]^n} \frac{x_1^2+ \dots +x_n^2}{x_1+ \dots +x_n} \ d \mathrm{m}(\mathbf{x})=2/3$

A few days ago I found an interesting limit on the "problems blackboard" of my University: $$\lim_{n\to +\infty}\int_{(0,1)^n}\frac{\sum_{j=1}^n x_j^2}{\sum_{j=1}^n x_j}d\mu = 1.$$ The correct claim, however, is: $$\lim_{n\to +\infty}\int_{(0,1)^n}\frac{\sum_{j=1}^n x_j^2}{\sum_{j=1}^n x_j}d\mu = \frac{2}{3}.$$ In fact, following @Tetis' approach we have: $$I_n = \int_{(0,1)^n}\frac{\sum_{j=1}^n y_j^2}{\sum_{j=1}^{n}y_j}d\mu = \int_{(-1/2,1/2)^n}\frac{\frac{1}{2}+\frac{2}{n}\sum_{j=1}^n x_j^2+\frac{2}{n}\sum_{j=1}^n x_j}{1+\frac{2}{n}\sum_{j=1}^n x_j}d\mu,$$ now setting $x_j=-z_j$ and summing the two integrals $$I_n = \int_{(-1/2,1/2)^n}\frac{\frac{1}{2}+\frac{2}{n}\sum_{j=1}^n x_j^2+\frac{4}{n^2}\left(\sum_{j=1}^n x_j\right)^2}{1-\frac{4}{n^2}\left(\sum_{j=1}^n x_j\right)^2}d\mu$$ follows, so: $$ I_n-\frac{2}{3}=\int_{(-1/2,1/2)^n} \left(-\frac{1}{2}+\frac{2}{n}\sum_{j=1}^n x_j^2\right)\frac{\frac{4}{n^2}\left(\sum_{j=1}^n x_j\right)^2}{1-\frac{4}{n^2}\left(\sum_{j=1}^n x_j\right)^2}d\mu < 0,$$ $$ \left| I_n-\frac{2}{3}\right|\leq\int_{\sum x_i^2\leq\frac{n}{4}}\left(\frac{1}{2}-\frac{2}{n}\sum_{j=1}^n x_j^2\right)\frac{\frac{4}{n^2}\left(\sum_{j=1}^n x_j\right)^2}{1-\frac{4}{n^2}\left(\sum_{j=1}^n x_j\right)^2}d\mu,$$ $$ \frac{2}{3}-I_n\leq \frac{n^{n/2}}{2^{n+1}} \int_{\sum x_i^2\leq 1}\left(1-\sum_{j=1}^{n}x_j^2\right)\frac{x_1^2}{1-x_1^2}d\mu.$$ The last bound, anyway, is too crude, since the RHS is $$ \Theta\left(\left(\sqrt{\frac{e\pi}{2}}\right)^n\frac{\log n}{n^{3/2}}\right).$$  My question now is: what is the asymptotic behaviour of $I_n$?  A second one is: can we prove $I_n\geq\frac{2}{3}-\frac{C}{n}$, for a suitable positive constant $C$, without the Central Limit Theorem?    UPDATE: After a few I came out with a  of my own. The challenge is now to give the first three terms of the asymptotics, and possibly a continued fraction expansion for $I_n$.


It might seem a dumb question but I am very confused about it. I wrote a simple program as follow: #include<iostream> using namespace std;  int main()  {  float a = 12.555555555555; double b = 12.555555555555; long double c = 12.555555555555;  cout <<a<<endl;  cout <<b<<endl; cout <<c<<endl; return 0;  }  Although I am using different data type with each variable but the result of output is same for all these variables and that is 12.5556. I was expecting different precision for double and long double as compared to float. I am using DevC++ IDE.

In my  I was printing a double using cout that got rounded when I wasn't expecting it.  How can I make cout print a double using full precision?


I'm from math.SE, and I just posted some questions here that were closed. They were downvoted, and so apparently they are not really appreciated by the community here. But there is something I don't understand, that is -      When I search a little, I find many very popular questions getting closed as non-constructive.    For example:        Why would you close those questions if it is very clear that the community appreciates them? It seems like questions that don't follow some criteria are closed by some autistic, automatic procedure.  I thought that StackExchange was about what the community wants, not what some moderator(s) think is constructive. I'm glad that those questions above got very good answers before they were closed, but what about other interesting questions that had less luck. Taking the question Examples of GoF Design Patterns we see 674 users and 1 moderator who closes it.   It may be the case that StackOverflow was originally not intended for questions like these. But who cares? This doesn't look like democracy to me.

I notice a really worrying trend of some really popular questions being closed and eventually deleted. Some of them became legends already, like this one  ? Yes, it does not fit the format ideally, but what is point of obeying the letter of the law to such extent that it becomes ridiculous? Ok, closing is fine if community leaders became so pedantic, but why go so far as to even delete it? At this point it looks like burning old pictures just because you don't like them.  Update: Summary  For now I heard only two clear arguments:   Those questions pollute search results.  Those questions don't play well with enforcing question and answer standards.   Both of that statements are easily verifiable and to my experience are just false.


I have this Latex code that produces the image below. How can I get the item text to span the whole column?  \documentclass{article} \usepackage{tabularx} \newcolumntype{b}{>{\hsize=1.6\hsize}X} \newcolumntype{s}{>{\hsize=.4\hsize}X}  \begin{document}  \begin{tabularx}{\linewidth}{|s| b|}     \textbf{\Large Hello} &  Text goes here     \begin{itemize}         \item Text goes here. Text goes here Text goes here Text goes here Text goes here Text goes here Text goes here Text goes here Text goes here         \item Text goes here. Text goes here Text goes here Text goes here Text goes here Text goes here Text goes here Text goes here Text goes here     \end{itemize}\\ \end{tabularx}  \end{document}

After posting  to the query , I thought about how to generalize (and simplify) the OP's setting, e.g., by using explicit theorem-like environments in the two columns.   In the following MWE, which employs the tabularx and amsthm packages, things work fine. (The framelines in the screenshot indicate the edges of the text block.) In the first tabularx environment, the first column is narrower than the second, and in the second tabularx environment, the situation is reversed. In both environments, the filler text that makes up the body of the "theorems" occupies the full width of the cell:    \documentclass{article} \usepackage[a4paper,margin=2.5cm,showframe]{geometry} \usepackage{tabularx} \newcolumntype{L}[1]{>{\hsize=#1\hsize}X} \usepackage{lipsum}  \usepackage{amsthm}  %\usepackage{ntheorem}  \newtheorem{theorem}{Theorem}  \begin{document} \noindent % First column is narrower than second: \begin{tabularx}{\textwidth}{@{} L{0.8} | L{1.2} @{}}   \begin{theorem} \lipsum*[2] \end{theorem} &   \begin{theorem} \lipsum*[2] \end{theorem} \end{tabularx}  \bigskip\noindent % Now, first column is wider: \begin{tabularx}{\textwidth}{@{} L{1.2} | L{0.8} @{}}   \begin{theorem} \lipsum*[2] \end{theorem} &   \begin{theorem} \lipsum*[2] \end{theorem} \end{tabularx} \end{document}     However, if I comment out the instruction \usepackage{amsthm} and activate the instruction \usepackage{ntheorem} in the preceding MWE (and leave everything else unchanged), I get a rather different result: In the first tabularx environment, the text in the right-hand cell does not occupy the available horizontal space; in the second tabularx environment, both columns now take up the same width even as the width of the text in both cells is restricted to that of the second column.  Question: Have I encountered a bug in either ntheorem or tabularx, or did I set up the mechanism for generating X columns of varying widths incorrectly?  Some background information: The issue occurs with both TeXLive2019 and the current pre-release version of TeXLive2020. I use tabularx 2020/01/15 v2.11c, amsthm 2017/10/31 v2.20.4, and ntheorem Version 1.33 <2011/08/15>. AFAICT, the issue appears to be independent of the choice of document class.


the for loop is not being covered... I would like to know why. Thanks! Here the test:      @IsTest public static void testSaveDistriverloren()     {     Priority_Distribution__c fetchPd = new Priority_Distribution__c(distriVerloren__c =      FALSE, Products_list__c='Lucky Strike Original', Item_Number__c=2003);      insert fetchPd;      Boolean distri = TRUE;      Priority_Distribution__c checkDistriVerloren = new Priority_Distribution__c();     checkDistriVerloren= [SELECT distriVerloren__c FROM Priority_Distribution__c WHERE      Item_Number__c=2003 AND Account__r.Id =: fetchPd.Account__r.Id];     checkDistriVerloren.distriVerloren__c = distri;     update checkDistriVerloren;     Test.startTest();         try {             PriorityTableController.saveDistriVerloren(distri, 2003, fetchPd.Account__r.Id);         } catch (Exception ex){}    Test.stopTest(); }

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How is code coverage obtained and calculated? How do I increase my coverage?  Why can't I cover these lines? Why isn't the body of my loop or conditional statement covered?


I'm trying to install Windows 8 on a brand new drive and have encountered a few problems.  My error message (as shown in the photo) is: "We couldn't install windows in the location you chose. Please check your media drive. Here's more info about what happened 0x8007045d".    I have two other similar posts - I figured it may be less daunting to tackle if I split the large problem into individual units.

My son's laptop was failing for the second time, so he decided to erase the hard drive and try to install Windows 8.1 back onto it, but it doesn't install. My error message (as shown in the photo) is:   We couldn't install Windows in the location you chose.   Please check your media drive. Here's more info about what happened: 0x8007045d.


Consider the following case: int MyClass::MyMethod(char *myChar)  Am I able to get the amount of reserved space by myChar within memory (heap and stack) ? For example, if myChar points to the first element of an array called char myArray[10]: By use of myChar, can I get the amount of char that can be stored within myArray?

First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?


I store most of my files on a second hard drive (D:\ in this case).   When I click on my username at the top of the Start Menu to link to My Documents I get linked to C:\Users\Jonny Wright\Documents.   How can I change this path to the location where I actually save my documents?

Let's say I have Windows installed on drive C, however I install all of my programs on the D drive, and I keep my user profile on the D drive as well (things like My Documents). How can I have Windows use those folders instead of the ones on the C drive?


This question has been  before in 2010, but I am sure many of us would like to see an official app to use Stack Overflow, which allows interaction (votes, reviews, etc) instead of just reading questions.   Are there any plans to build an official app, or is the intent to use the mobile versions of the sites?

I like using Stack Overflow (or any other Stack Exchange sites) and was wondering if there was an app I could install on my phone or other device that would allow me to use the site on-the-go or straight from my desktop.  Some systems to consider:   Windows 8 Android iPhone/iOS   What are some apps that I could install to my computer or phone to enhance my Stack Exchange experience?


I provided service in December 2019 and was paid on January 10th 2020 for that service. Can I report that in the 2019 tax filing period?

I was paid a few hundred dollars to review a few textbooks. I submitted an invoice in Dec 2016, and received payment in Jan 2017. When I pay taxes on this income, does that count towards 2016 or 2017?  The context of my question is US federal taxes.


int main() { char btext[20];  for(int i=0; i< sizeof(btext); i++)     {         btext[i]= 'x' ;     }  for(int i=0; i< sizeof(btext); i++)     {         printf("%c", btext[i]);     }  printf("\nbtext: %s\n", btext);  return 0; }   This gives the output:  xxxxxxxxxxxxxxxxxxxx  btext: xxxxxxxxxxxxxxxxxxxx?  Where does that ? come from? And even worse:  int main() { char text[] = "some text";  char btext[20];  printf("text: %s\n", text);  for(int i=0; i< sizeof(btext); i++)     {         btext[i]= 'x' ;     }  for(int i=0; i< sizeof(btext); i++)     {         printf("%c", btext[i]);     }  printf("\nbtext: %s\n", btext);  return 0; }   This gives the output:  text: some text xxxxxxxxxxxxxxxxxxxx  btext: xxxxxxxxxxxxxxxxxxxxsome text   This drives me crazy. The code is so straightforward, but I can't figure it out.  Is it a bug in the IDE? Has anyone seen something like this?

I have a char array buffer that I am using to store characters that the user will input one by one.  My code below works but has a few glitches that I can't figure out:   when I execute a printf to see what's in Buffer, it does fill up but I get garbage characters at the end it won't stop at 8 characters despite being declared as char Buffer[8];   Can somebody please explain to me what is going on and perhaps how I could fix this? Thanks.  char Buffer[8]; //holds the byte stream int i=0;  if (/* user input event has occurred */)  {         Buffer[i] = charInput;         i++;          // Display a response to input         printf("Buffer is %s!\n", Buffer);  }   Output:   tagBuffer is 1┬┬w! tagBuffer is 12┬w! tagBuffer is 123w! tagBuffer is 1234! tagBuffer is 12345! tagBuffer is 123456=! tagBuffer is 1234567! tagBuffer is 12345678!  tagBuffer is 123456789!


Is there any way to move an NPC from one house to another in Terraria?


As we know that photon is its own antiparticle so how can we confidently say this is true? Is there any theory that describes it?

I know what anti-matter is and how when it collides with matter both are annihilated. However, what about anti-photons? Are there such things as anti-photons?  I initially thought the idea preposterous. However I am curious because, if anti-photons don't exist, then anti-matter could theoretically transfer its energy to normal matter - through the mechanism of light. Is it right?


I have a launchd task configured to run once an hour using the StartCalendarInterval key to set specific times at which the task will run.  However, the default behaviour of this is that, when an interval is missed (i.e- computer was asleep) the task will immediately run at the next available opportunity (i.e- on wake).  Is it possible to disable this behaviour in my plist file?  I haven't found any obvious key(s) for controlling this, and the only other thing I can think of is to check the current time in the task itself, but this means duplication of timing behaviour (set the time in the plist, and then check it in the task itself).

I have a simple launchd script that plays a sound every 30 minutes and it runs out of the user library ~/Library . It doesn't run if my machine is asleep, but does run the last event missed when the machine wakes. I think this is the expected behavior. My question is, how do I stop this happening. If I missed the half-hour event, I don't want it to be run at 20 minutes past the hour.  Here's the core of my script. It calls a Python script. I tried to put a block in the python script to check that I am within a few minutes of each 30 minutes, but that doesn't seem to work on wake. (Is it missing the system clock somehow?)  <key>ProgramArguments</key> <array>     <string>/usr/local/bin/python3</string>     <string>/Users/pheon/Documents/playsound.py</string> </array>  <key>StartCalendarInterval</key> <array>     <dict>         <key>Minute</key>         <integer>0</integer>     <dict>         <key>Minute</key>         <integer>30</integer>     </dict> </array>   Here is a snippet from the python code which checks the time before playing the sound.  time0 = datetime.datetime.now() if (time0.minute % 30) < 2:     subprocess.run(["/Users/pheon/bin/afplay-vol.sh", "1", bell],check=True)


Almost every other superhero has a mask or a hood to hide their secret identity. But all Clark Kent uses is a pair of glasses. Is that enough to conceal the identity? What is the logic behind this?

Superman's alter ego is Clark Kent. Unlike many other superheroes, Superman dresses up as a human to fit in.  What makes the world so oblivious to Clark Kent's secret; Superman? (In regards his poor disguise).


I regularly need to drop a postres database and recreate it. It has to be done as postgres user as following:  $ sudo -u postres dropdb my_database    I thought of adding sudoers rules for not being asked a password. Usually I proceed by creating a file in /etc/sudoers.d/ with a rule like this one:  Cmnd_Alias DROP_DB = /bin/bash -l -c dropdb*, /usr/bin/dropdb* emilio ALL = NOPASSWD: DROP_DB   But in this use case, I need to run the command as postgres user and it doesn't work.  What is the proper way to run a command as a different user without being asked a password?  EDIT: This might be a duplicate but it brings a different solution using visudo which is interesting.

I would like to run a script from the main ubuntu shell as a different user that has no password.  I have full sudo privileges, so I tried this:  sudo su -c "Your command right here" -s /bin/sh otheruser   Then I have to enter my password, but I am not sure if that script is now really running under that user.  How can I confirm that the script is really running under that user now?


I'm looking to implement "Ideas" in an organisation, but they have concerns as to having a "Demote" button being against the spirit of the initiative.  There doesn't seem to be any good options for getting rid of the buttons or the down votes. I can query down votes only after I specify the ID of the Idea, so it can't be caught on creation and there's no customization available for turning off the button. Anyone have any ideas?  Edit: This was an older question, but I was looking for solutions outside of hacking the side bar, it was the worst possible solution and I HATED implementing it. I would not consider this question a duplicate. It just didn't have an answer at the time and I hate seeing unresolved questions. Just because fending off zombies and banging in a nail both require a hammer doesn't mean the problem is the same.

Since it seems to me, that a lot of people still need sidebar workarounds, I would be interested to learn about the use-cases, experienced challenges and (most important) possible strategies to avoid them by using different approaches. This is related to the methods discussed here:   In my experience there are a few extremely important and constantly repeating patterns, which to my knowledge are still very hard to be solved using more official techniques. I will also contribute my own top-N use-cases, which are mostly related to UX and UI concerns. You are very welcome to add your own scenarios as answers and add comments on how you would avoid a workaround. My dream would be to team-elaborate strong and repeatable solution-patterns for the most common use-cases.  Finally I would be interested in the experiences of all of you who participate in the Aura pilot, which hopefully could make this kind of workarounds obsolete.


Might be a question asked by other people too (unfortunately I didn't find the exact answer to this) but I wanted to know this because if the universe is expanding by stretching out space, then does that stretching affect our time here?? My guesses are that it should be but since it's happening so continuously or been happening it just doesn't affect our senses. Please don't flame me if the things I have assumed by my finite understanding of the universe are wrong, look forward to probably study physics in more detail after 2-3 years.

Einstein's big revelation was that time and space are inseparable components of the same fabric. Physical observation tells us that distant galaxies are moving away from us at an accelerated rate, and because of the difficulty (impossibility?) of defining a coordinate system where things have well defined coordinates while also moving away from each other without changing the metric on the space, we interpret this to mean that space itself is expanding.   Because space and time are so directly intertwined is it possible that time too is expanding? Or perhaps it could be contracting?


Someone knows what it is that dotted cage, what it serves but especially how to remove it?

I was just getting back into using Blender a few days ago and I must have hit a couple of buttons. But now I cannot get these dashed lines to go away. Does anybody know how I can make them go away?


i ran some assumptions checks for my multiple linear regression model, but i am having trouble with interpreting the different graphs. i was wondering if anyone could offer some guidance on what they mean? i'm pretty sure some of them are violated...

I had a question about interpreting the graphs generated by plot(lm) in R.  I was wondering if you guys could tell me how to interpret the scale-location and leverage-residual plots?  Any comments would be appreciated.  Assume basic knowledge of statistics, regression and econometrics.


Context I have this code var a = 10;   // function "outer" created a closure of the global scope // the moment it was defined function outer() {     // variable a is available in this scope (execution context)     const b = 10;       // function "inner" created a closure of the global scope     // and outer function's scope the moment it was defined.     // When it's executed it can use this closure as part of     // its own scope     function inner() {         // variables a and b are available in this scope         const c = 20;         console.log(a + b + c);     }       return inner; }   The closure for inner has these scopes:  Local scope Outer function's scope Global scope  Let's execute outer and then execute the return value, which is inner : const inner = outer(); inner() // prints 40  Now here is where I am confused. I always thought that the inner function gets a "snapshot" of variables a and b as they existed the moment inner was defined. So, I thought that after const inner = outer();, then every execution of inner would always return 40. However I came to find out (while making a demonstration nonetheless) that this is not what happens const inner = outer(); a = 100; inner() // prints 130 while I expected for inner to be "locked" to 40  Question I would like someone to clarify/correct my mental model of how closures work in js. More specifically, I expected that the moment a function is defined, it gets a hold of all the outer scopes defined up to that moment and var (or const or let) values stay "locked" to the values they had the moment the function (in this case function inner) was defined. However, I just showcased that altering the value of one of the variables referenced inside inner actually changes its return value. So, values are evaluated "live" when the inner function gets executed instead of being a snapshot of what they were the moment inner was defined?

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


I am trying to understand what architecture I can use for my GIS Application. I am from a programming background, however quite inexperienced with GIS and Web development, yet the task is to create a combination of them.  I am trying to create a simple standalone application in the web (Started using PythonAnywhere as it seemed very easy to understand). A set of GIS coordinates are uploaded in a txt format and they are then plotted using MatPlotLib and saved in PDF format. However, I would like to make the UI more intuitive, by having an option to see these coordinates in the web browser itself and to move around or put layers behind it that shows the actual world map and then move around it a bit like how we manipulate them Google Maps.  Could you provide suggestions to this implementation?

I want to start working on a web map at work to map some of our statistics by city.    I have an idea, but I'm not exactly sure where to start.   Are there any definitive resources that provide step by step guidance on how to do this?


If $A_1$,$A_2$,...,$A_n$ are countably infinite sets, is $A_1\times A_2\times...\times A_n$ countable? it seems that an infinite Cartesian product of countable sets may still be uncountable for every x∈[0,1) in a countable set.

I want to prove that infinite (yet countable) cartesian product of countable sets is countable. Here's what I tried: Step 1: I proved that for 2 countable sets $ A_1,A_2 $ , the product $ A_{1}\times A_{2} $ is countable. Step 2: I proved by induction that for any $n\in \mathbb{N} $  if $ A_{1},...,A_{n} $ are countable sets, then $ A_{1}\times A_{2}\times,...,\times A_{n} $  is countable. Now, I want to show that any countable infinite cartesian product would be countable. How do i show that  $ A_{1}\times,....\times A_{\aleph_{0}} $  is countable? Thanks in advance.


I want to create another partition in my pc, I shrink the primary partition :E and created a new logical dive :D , But when try same for the :C , I get error that I already have maximum number of partitions.  Here are screenshots to explain this    You can see the logical drive I created earlier, If you look at it it shows another unnamed partition too, I DO NOT KNOW WHERE IT IS , Then I tried to shrink :C and create another logical drive but I get this error.    Now my question is HOW CAN I CREATE ANOTHER PARTITION OR IF IT IS NOT POSSIBLE IS THERE ANY WAY I CAN ADD THIS SHRINKED SPACE TO :D or :E ?  I tried my self but there is no such option . I am using win7, core i5 laptop, toshiba .

I was installing Windows 7 using the CD. I have 3 partitions already, and when creating a new partition using the DVD, it says "You cannot create a new volume in this unallocated space because the disk already contains maximum number of partitions." How can I create more partitions?


So I have the following double integral          $$\int_{-2}^{0} \int_{-\sqrt{4-x^2}}^{\sqrt{4-x^2}} \sqrt{x^2+y^2} dydx$$      If I integrate with respect to y first I get: $\frac{1}{2}(y\sqrt{x^2+y^2}+x^2\log(\sqrt{x^2+y^2}+y)$  I understand that in polar coordinates $x=r\cos\theta$ and $y=r\sin\theta$, but am unsure how to convert the limits to polar coordinates? Thanks

$\int_{-2}^0\int_{-\sqrt{4-x^2}}^{\sqrt{4-x^2}} \sqrt{x^2+y^2} dydx$  y describes the circle of radius 2, and is positive and negative, so doesnt limit any quadrants in our integral, however x can only be negative, which means the left half of our circle is what we are interested in.  This means, we need the integral:  $\int_{\pi/2}^{3\pi/2}\int_{0}^{2} rdrd\theta$  Giving us a value of $2\pi$.  Is this a correct assessment? I wasnt sure if making  $0$ and $2$ the limits of $r$ was entirely correct, since it describes the entire circle of radius $2$, and not just one half. Then again, a circle of radius $2$ does have an area of $4\pi$ which makes me feel I am along the right lines.   Any clarification would be fantastic. Thank you!


We're using this kind of solder sponge made of brass in our electronics course:    One kid told me that he had seen this before. I wondered a bit, because they are all new to soldering. Finally he brought that thing into the class and it turned out to be steel wool, used in the kitchen.    Is it ok to use that instead? If not, why not?

Wondering should I use steel wool for cleaning my soldering iron tip.  Is it bad?  Will it impact my tip? Will it clean the black oxidization off?


I am a citizen of Trinidad & Tobago. I am about to book a flight from Port of Spain Trinidad to Aruba connecting in Toronto for 1 hour. Do I need a Canadian visa for this connection?

I'm passing through Canada, on my way to somewhere else. I'm staying only a short time.   Is there a website, or some other way of find out out if I need a visa?


On eevee engine, has anyone experienced the same?  It looks normal on Solid Viewport. This also happened in 2.82, but it was worse. Solid is basically transparent, while render is basically the same as current version, hence why i updated my blender.  My rig if anyone needs it : Ryzen 3 3200G, 16Gig RAM, RX 480 4GB. I swear it never runs anything else with a problem. Blender was working fine a few days ago too. Cycles works on render viewport, but material preview still bugged out.

I don't know why but now, when i go in material preview or rendered (in solid mode it works fine), my object is entirely gray, or invisible idk, because it has the same color of the background. I've been working for days on this project without having this issue, it suddenly showed up. I tried opening other old projects and suddenly they all do the same so i guess it is some blender program setting that applies for all the projects, but idk how it happened cuz i didn't change anything :/, anyone got any tips?


I have problem with Windows 10 Enterprise N x64. When I press "Start" and start to type application name it never finds it.  I can't even find applications like "Calculator", "Microsoft Word" or any other. Just moving dots and I let it run for 30 minutes without any success.  PS. There is chance that this will not work for you if you did upgrade instead of clean install of Windows 10. But you can always try.  This are my indexing options.

For the past several versions (since Windows Vista, I think), if you hit the Windows key and start typing, Windows will search for applications.  Since upgrading to Windows 10 with , she is only hit or miss at finding applications. And she doesn't do partial searches, either.  Some examples:   WinKey + type "Paint" does not find "mspaint". Instead it suggests some applications from the store. WinKey + type "Excel" does not find Excel. Nor does typing "Word" find Word. However, typing OneNote finds OneNote.   What is the reason for this behavior and how I can get Cortana to find the applications installed on my machine again? Is there a setting I am missing?    If I browse to "C:\ProgramData\Microsoft\Windows\Start Menu\Programs" I can see that the shortcuts for these applications all still exist. But Cortana is not finding them. Everything from the Microsoft Office applications to  to  to hundreds of other applications I have installed.  Where can I set which folders Cortana indexes?    As you can see in the screen shot below, this Start Menu folder is, indeed, indexed:    However, none of these applications are coming back as search results from the "start" menu.  It may be related to  as well.  I did a brand new install of Skype (for desktop), and it shows up nowhere in the start menu. And typing in "Skype" to search for the application does not find it. But the shortcut to Skype is definitely in this location:  C:\Users\Patrick\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Skype     EDIT  The latest Windows 10 update (Threshold 2) has solved this issue for me. Cortana now finds all my files with no issues. Previously my only solution was to use , I've been able to uninstall that now and use the standard Windows Start menu.


It is said that XLAT is an abbr of translate. But I don't understand how come it ends up like that? There is no site on internet would explain it but they're all agree that XLAT is shorten of translate. I can get that LAT is in the end part of translate (LATe) but what about the X?

I can't think of an example, so I may be wrong about this, but I think I've seen people replace the prefix "trans" as in transport with an x. "Cross" makes sense, as in "railroad crossing", and I guess "chris" is sort of a punny extension, the extension being like "chris cross" and the example being "xmas", but why trans?


I have a clue of what serialVersionUID is for, and in as far as I don't I can look it up. But it can be a private variable that's not used inside the class. Is there some construct or so behind that? Are there other examples of private variables / methods that are not used inside the same class? Can I make them while still doing something else to make it useful? How can I access private variables myself from another class without creating getters?

Eclipse issues warnings when a serialVersionUID is missing.       The serializable class Foo does not declare a static final   serialVersionUID field of type long   What is serialVersionUID and why is it important?  Please show an example where missing serialVersionUID will cause a problem.


My client would like to have his eCommerce (custom-made) site secured from DDoS attacks. What strategies can I implement? There are multiple forms in the purchasing flow --- searching, drilling-down to the product, user information and payment and I want to avoid captchas.

This is a  about DoS and DDoS mitigation.   I found a massive traffic spike on a website that I host today; I am getting thousands of connections a second and I see I'm using all 100Mbps of my available bandwidth.  Nobody can access my site because all the requests time out, and I can't even log into the server because SSH times out too!  This has happened a couple times before, and each time it's lasted a couple hours and gone away on its own.  Occasionally, my website has another distinct but related problem: my server's load average (which is usually around .25) rockets up to 20 or more and nobody can access my site just the same as the other case.  It also goes away after a few hours.  Restarting my server doesn't help; what can I do to make my site accessible again, and what is happening?  Relatedly, I found once that for a day or two, every time I started my service, it got a connection from a particular IP address and then crashed.  As soon as I started it up again, this happened again and it crashed again.  How is that similar, and what can I do about it?


I've an extension method on DateTime:  public static DateTime? Year(this DateTime? datetime) {     return datetime; }   And antoher one which is trying to build a CallExpression to this extension method:  public static Expression<Func<TElementType, DateTime?>> SemanticYear<TElementType>(this Expression<Func<TElementType, DateTime?>> expr) {      MethodInfo method = typeof(DateTime?).GetMethods().Where(m => m.Name.Equals("Year"));     //<<<<<< returns null!!      Expression<Func<TElementType, DateTime?>> lambdaExpression = Expression.Lambda<Func<TElementType, DateTime?>>(         Expression.Call(             Expression.MakeMemberAccess(expr.Body, typeof(DateTime?).GetProperty("Value")),             method         ),         expr.Parameters     );      return lambdaExpression; }   Why do I unable to get DateTime?.Year extension method?  Both methods are implemented inside the same compilation unit:  namespace Backend.Infrastructure.Linq {     public static partial class LinqTreeExtensions     {          public static DateTime? Year(this DateTime datetime)         {         //....         }          public static Expression<Func<TElementType, DateTime?>> SemanticYear<TElementType>(this Expression<Func<TElementType, DateTime?>> expr)         {         //.......         }     } }

In C# is there a technique using reflection to determine if a method has been added to a class as an extension method?  Given an extension method such as the one shown below is it possible to determine that Reverse() has been added to the string class?  public static class StringExtensions {     public static string Reverse(this string value)     {         char[] cArray = value.ToCharArray();         Array.Reverse(cArray);         return new string(cArray);     } }   We're looking for a mechanism to determine in unit testing that the extension method was appropriately added by the developer.  One reason to attempt this is that it is possible that a similar method would be added to the actual class by the developer and, if it was, the compiler will pick that method up.


I'm not trying to spark discussion; I just want to know if there was a specific reason the actors changed. I have a high opinion of Christian Bale's acting; I figured DC wouldn't want to change timelines like that unnecessarily.

This is about the upcoming  Zack Snyder movie , where Ben Affleck is playing Batman. I just read an  that Christian Bale wanted to be Batman again. So I wanted to ask why wasn't he cast as Batman in this movie. I checked the Wikipedia entry but nothing suggests why Christian Bale was not there. Nolan is associated with the movie as an adviser and DC Entertainment is producing this one too. So sort of familiar turf, right? But how come Ben Affleck is the new Batman?  EDIT: I would like to add another interesting piece of information. Bale is aged 40 (born 1974) and Affleck is 42 (born 1970). So they have actually cast an older actor.


For say in terminal I did cd Desktop you should know it moves you to that directory, but how do I do that in python but with use Desktop with raw_input("") to pick my command?

How do you call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from within a Python script?


Is there a way to automatically change/adjust the Gmail Signature by the Emails recipient? I'm thinking of adjustable rules or a plugin for the Gmail Webclient.  For example:  I'm preparing a mail for adam@mail.com. Normally it would add my standard signature "Best, Devan", but because I created a rule for adam@mail.com Gmail sees that the Email is addressed at adam@mail.com and automatically changes the signature that is added to the Email Footer to "Sincerely, Devan Loper".  EDIT: I already know about the Gmail Lab named "canned responses" that does something similar but it doesn't automate by recipient. That's the problem.

asks something similar, but it was related to Outlook and without an applicable answer.  Is there a way to to store a signature preference on a per contact basis? Or does anyone know of an extension to do something like this?  If you write to your mother, child, co-worker, vendor, or customer they all don't all expect the same thing. A custom field can be assigned to a contact, could that or another field be used somehow?   I just want to assign a specific signature to a user. Very similar to the way a custom ringtone can be assigned to a contact on a phone.


I have a string SVchnsSoQQjr5kafygOh,,,Skyrim and I'm trying to put the first 'string' into a variable, the 'Skyrim' into another variable and remove the ',,,'  I've tried .substr()  Expected output:   str = 'SVchnsSoQQjr5kafygOh,,,Skyrim'  strOne = 'SVchnsSoQQjr5kafygOh' strTwo = 'Skyrim'

I have this string  'john smith~123 Street~Apt 4~New York~NY~12345'   Using JavaScript, what is the fastest way to parse this into  var name = "john smith"; var street= "123 Street"; //etc...


So what I am trying to accomplish is somewhat like Starbucks has, were you connect to there wifi, accept terms, then it directs them to there website. Can this be accomplished with a mobile hotspot?  Another thing is that when they try to go to another site it will be locked into my site, so while logged into my wifi they will only be allowed to access our website. Is this possible?  I am a mobile DJ that would like guest at any event to be able to access our site through there mobile and send the DJ a direct song request.

Does anyone knows which are these systems that manages paid wifi networks and some hotels and airports?  Even better, would anyone know a open/free project that would do or could be adapted to that end?  The idea is simple, I want to let the network open at physical level so anyone can connect. After connected however, the clients would have access only to a specified page where they can logging in, and doing the necessary validations the router would allow these of those ports (or even everything) for his IP.


Just like when you make a reference in windows, to open a .txt file, it may open NotePad.exe and or Word.exe, while loading the text from the file into the editor. How can I do this with my Desktop Application. I am having a custom file type for it with extension .mmi. I want it so that when the user double click this file type it will not only open my application, but load the data within it into the appropriate areas of my application. I understand how to set the custom file type for my application settings, but where I am lost is how to get the file info that trigger opening my application so I can get the data from it.  For example. If I open a .html, and choose to use notepad.exe, the html is now loaded in the newly opened text editor.  This is for a From Application, not a console application that starts off with main having args, incase that helps or changes anything.  Example below:  public partial class FormDashboard : Form {     public FormDashboard()     {         InitializeComponent();     }      private void FormDashboard_Load(object sender, EventArgs e)     {            //I want to get what file trigger the app to open here, and apply the data accordingly throurght the forms application.      }

I'd like to to associate a file extension to the current executable in C#. This way when the user clicks on the file afterwards in explorer, it'll run my executable with the given file as the first argument. Ideally it'd also set the icon for the given file extensions to the icon for my executable. Thanks all.


In  The question acts as if the title is the first sentence by continuing with "I am referring specifically to the MCU version"  Often, i open up a number of questions i want to read and then skip the title when reading them. This almost always works, but for questions like the above, i need to re-read the title.  This leads me to wonder:   Should the title be included in the question (in some form) or can the question be treated as continuing from the title. If the title is a summary, would it be better if the Title field were under the question (above tags), so the user summarized what has already ben asked rather than what he expects to ask?

Questions in titles need to be repeated, why?  To me this pattern seems ridiculous. But I frequently encounter the "not a real question" situation, when I put my question in the title, then the context for that specific question in the 'question body'.     So:  I am to take it that the title is almost completely irrelevant for establishing subsequent question body is asking? I choose my titles to expose the actual question so it need not be repeated below. If questions need to be repeated in the body, could we simply title it "A question, click here and read below" ?   Tagged bug, as I have found this "problem" to be quite reproducible.  Steps to reproduce:   Ask a question with the clear, simple question in the title, and the evidence/context/example in the question body. Await close votes.


I want to create a batch file for others to run, but don't want it to permanently delete files. Is there any way without third party software and without displaying any dialogs to delete files to the Recycle Bin from a batch file?  [Someone is saying this question is same as , but there a third party software is being requested which I don't want. So how is it a duplicate question?]

Is there a command line program that can send files to the recycle bin? This is on XP and Vista.


I apologize I have asked this question before but it died and I just got around to working it out based on the suggestions so here it is.   Let the function $f$ be defined as $f$($x$,$y$,$z$) $=$ $x$$y$$z$  find the maximum and minimum values subject to the constraint: $g$($x$,$y$,$z$) $=$ $x^2$+2$y^2$+3$z^2$   $$F=x y z +\lambda  \left(x^2+2 y^2+3 z^2-a\right)$$ Computing derivatives $$F'_x=y z+2 \lambda  x=0\tag 1$$ $$F'_y=x z+4 \lambda  y=0\tag 2$$ $$F'_z=x y+6 \lambda  z=0\tag 3$$ $$F'_\lambda=x^2+2 y^2+3 z^2-a=0\tag 4$$ Now, I should consider equations $(1,2,3)$ and solve them for $x,y,z$ in terms of $\lambda$.   Multiplying equations 1,2,3 by $x,y,z$ we obtain that $2x^2=4y^2=6z^2$. From here I found the corresponding multiples that $x^2$ and $y^2$ are in terms of $z$ and plugged into equation 4 to solve for z. I found that $x$ Was a multiple of $z$ by 3 and $y$ was a multiple of $z$ by $\frac{3}{2}$ I found this by setting $4y^2$=6$z^2$ and got $\frac{6}{4}$ = $\frac{3}{2}$ Now plugging these into equation 4 I obtained 3+$\frac{3}{2}$+$3z^2-6$=0 My algebra lead me to $z=$ $\pm\frac{1}{\sqrt{2}}$ but if done right z should equal $\pm\frac{\sqrt{2}}{\sqrt{3}}$  I got this by adding 6 over to the right then subtracted 3 leaving me:                                                                                $\frac{3}{2}$+$3z^2$=$3$ then subtracting $\frac{3}{2}$ lead me to : $3z^2$= $\frac{3}{2}$ and dividing by 3 gives $\frac{3}{2} \div \frac{3}{1}$ which is equivalent to $\frac{3}{2} \times \frac{1}{3}$ = $\frac{3}{6}$ and you can see that really leaves me with $z^2$= $\frac{1}{3}$ which is equivalent to $z=$ $\pm$ $\frac{1}{\sqrt{3}}$  What did I do incorrectly and how do I proceed from here once I have found z. Also how is it that you can write the two functions as two functions added together giving you $F$.

The global maximum and the global minimum of the function $f(x,y,z)=xyz$ with the constraint $x^2+2y^2+3z^2=6$ can be found using Lagrange multipliers.  $\nabla f = \lambda \nabla g$  $g(x,y,z)=x^2+2y^2+3z^2-6=0$  This results into:  $$yz = \lambda 2x$$ $$xz = \lambda 4y$$ $$xy=\lambda6z $$  When looking at the equation $x^2+2y^2+3z^2-6=0$, it can be seen that there are six solutions $(x,y,z)$ with two coordinates equal to zero: $(0,0,\pm \sqrt 2 ),  (0, \pm \sqrt 3, 0 ) ,  (\pm \sqrt 6, 0, 0 ) $  But I got stuck here. Could someone help me with this?


I want to make a minecraft survival world where the world boarder extends 1 block everyday. I tried using command blocks and daylight sensors but got confused.

Recent Minecraft snapshots added the possibility to set a square world border that players can't pass through. It is used on the MindCrack server to expand the available area very slowly over time. How can I get the same effect in my Minecraft world?  Video with demonstration of what I'm talking about:


I have several Ubuntu computers connected (with wires) by Linksys E1000. Currently, I edit /etc/hosts on each machine to map the hostnames of all the machines and their corresponding IP addresses so that I can access each computer by hostname. But this requires editing of each /etc/hosts files.  I'm wondering if there is a way to somehow setup the network in a way that I don't have to edit all the /etc/hosts files whenever I add a new machine to the network. Thanks.

I'm new to Linux (currently running Ubuntu 10.04) and I have just finished setting up SSH access to my Linux Machine.  Currently, I have to use ssh root@x.x.x.x to connect but would much rather be able to swap the IP for the computer name (like in Windows with \\name) or a domain name (like computername.example.com). I don't really know where to start so any help would be most appreciated.  Please go slowly, as mentioned - I am still new to this.  EDIT 1 Completely forgot to mention that I am trying to connect from Windows 7 (via PuTTY) - sorry.


So my program is a version of paint.   It creates a canvas and allows me to paint over the canvas with my mouse by getting Point's from the mouse using a HashSet and Iterator.  It also connects to another identical program via a DatagramSocket and sends the Point's it generates to the other program which displays this on it's canvas.  To do this I use a Runnable thread that listens for incoming Point's and adds them to the HashSet.  My problem is that i get java.util.ConcurrentModificationException because I add Point's to the HashSet from the connected program via the thread while painting.   I don't see how to get around this exception since I want the canvas to update live.     solved this using a CopyOnWriteArraySet with which I could simply replace my HashSet :) thx for all your support!

I am using a Collection (a HashMap used indirectly by the JPA, it so happens), but apparently randomly the code throws a ConcurrentModificationException. What is causing it and how do I fix this problem? By using some synchronization, perhaps?  Here is the full stack-trace:  Exception in thread "pool-1-thread-1" java.util.ConcurrentModificationException         at java.util.HashMap$HashIterator.nextEntry(Unknown Source)         at java.util.HashMap$ValueIterator.next(Unknown Source)         at org.hibernate.collection.AbstractPersistentCollection$IteratorProxy.next(AbstractPersistentCollection.java:555)         at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)         at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)         at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)         at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)         at org.hibernate.engine.Cascade.cascade(Cascade.java:130)