The Community user deleted a question I had an accepted answer on. If it was a low quality post, I would have expected a close reason and then the delete votes. That didn't happen here, though.  Why was this question deleted?

The  was deleted last night by the Community user.    Normally, I wouldn't see an issue with this, but for this particular deletion, I can see three issues:   We try not to delete good content There are multiple upvoted answers We often use previous answers on Meta (as well as badly asked questions) to form the precedent (and to use as duplicates) when users ask questions like this in the future   On a personal note, I find it easier to link to one of my previous answers whenever possible.  This seems like a bug with the deletion algorithm, , the deletion algorithm should never delete questions with upvoted answers.  I'm going to go ahead and undelete it, but I'm bringing this up in case there was either:    A policy change A bug   So is it either of the above or something else?


I want to make a translation of a grib file to tif with gdal, I use the python script, and I have always error "the specified file not found '  import subprocess  src ="donnee1.grib2" dst ="donnee2.tif" subprocess.call(["gdal_Translate -of Gtiff -b 1",src,dst])

Is it possible to use some gdal API to call gdal_translate from Python code? I do not mean simply executing the gdal_translate.exe from the file system, but rather call it somehow in code so I do not need to know the exact directory the gdal_translate executable is in?


I am trying to execute some binaries manually installed in a bin directory in my $HOME (normal user).   Files are present in /home/user/bin and have exec permission:  $ ls -la ~/bin/ total 120 drwxr-xr-x  2 my_user my_user  4096 déc.   8 12:04 . drwxr-xr-x 94 my_user my_user  4096 déc.   8 12:23 .. -rwxr-xr-x  1 my_user my_user  4843 déc.   8 12:04 dplx -rwxr-xr-x  1 my_user my_user  6515 déc.   8 12:04 dprint -rwxr-xr-x  1 my_user my_user  2123 déc.   8 12:04 dprintm -rwxr-xr-x  1 my_user my_user 15494 déc.   8 12:04 duplex -rwxr-xr-x  1 my_user my_user  6501 déc.   8 12:04 kmprb -rwxr-xr-x  1 my_user my_user 11069 déc.   8 12:04 kmprb_one -rwxr-xr-x  1 my_user my_user  5543 déc.   8 12:04 krmpq -rwxr-xr-x  1 my_user my_user  8267 déc.   8 12:04 mpr -rwxr-xr-x  1 my_user my_user 25452 déc.   8 12:04 mprb -rwxr-xr-x  1 my_user my_user  2953 déc.   8 12:04 pqnext -rwxr-xr-x  1 my_user my_user   896 déc.   8 12:04 rmpq   And ~/.profile contains the call for ~/bin (it's the default on debian).  # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then     PATH="$HOME/bin:$PATH" fi   However, binaries are not recognized after a reboot:  $ duplex bash: duplex : commande introuvable   I also tried source .bashrc and source .profile. The second one works but just for the terminal (if I close it and reopen a new one, the command isn't recognize anymore).  How could I permanently install these binaries?

In my ~/.bashrc and ~/.profile I have some variables set to some filepaths:  export MY_VAR1="/path/to/somewhere"   In my ~/bin/ (which is added to my PATH) I have a few scripts that rely on those variables being set.  If I run those commands from the terminal, they work as expected.  However, if I try to double click on a script in Nautilus and run it, it runs as if those variables were not set.  Same thing happens if I add one of the scripts to Gnome's "Startup Applications" using the GUI utility or if I add them to the Gnome menu using the "Main Menu" GUI utility.  I would've thought that since I included these variables in my ~/.profile, which is run at login that gnome and nautilus and processes spawned by them would have access to those variables.  Both Gnome and Nautilus are run under my login user. All my scripts in ~/bin have the bash shebang at the top.  I am new to bash scripting, sorry if I am missing something obvious. I am using Debian Wheezy and Gnome3.


On the moderator  there were a diamond alongside sites they are moderating.        It's hidden if the site name is too long. Is it a bug?

Normally we see the sites where the user has a diamond in the Communities section of their profile:        However, when the site name is lengthy and causes text overflow, the diamond is hidden:        (The  is a moderator on Personal Finance & Money Stack Exchange)  Can this please be fixed so that we'll see the diamond regardless of the site name length?


I have two SSD images from two different modern Dell laptops that use the new BIOS that allows you to set your boot mode to "legacy" and then set your SATA mode to AHCI or "Raid mode" (Intel Rapid Storage Technology). These laptops were set to legacy boot and RAID mode to allow Windows 7 to run on them.  Now, these SSD images cannot run when restored to computers that only have AHCI mode. Windows 7 appears to boot correctly and it spends a few seconds on the logo-loading screen and then it goes straight to a blue screen with a STOP 0x0000007b error. The same thing happens in the original laptops if the SATA mode is changed from RAID to AHCI.  I need to run these images in VirtualBox but I get the same BSOD. My question is: Is there something I can change on either VirtualBox or the restored image itself that may allow Windows to succesfully complete the startup process?  I've tried setting VirtualBox to use all different controller options (IDE with its different chipsets, SATA, SCSI and SaS) with no success.  Thanks in advance for any suggestions or comments.

I had a RAID0 array that for all intents and purposes went to hell. I put a new SSD (same on-board Intel controller) and installed a new copy of Windows on it and all the drivers (Intel Rapid Storage, etc.). I failed to change the SATA type from RAID to AHCI when I did this though.  I have removed the old SSDs that were in RAID0 and if I change the SATA type to AHCI in the BIOS, Windows will not boot. It tries and fails. It then goes into the whole 'let me fix your woes' routine, only to tell me it cannot fix my woes.  The only help I could find was the following:     Locate and then click one of the following registry subkeys:   HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci   HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\IastorV   In the right pane, right-click Start in the Name column, and then click Modify.   In the Value data box, type 0, and then click OK.   That is going from SATA to AHCI I think, but either way my values are already 0.  It seems to work okay, except for the fact that I'm running a 256K Samsung 830 and my read speeds are 226MB/s which is about half of what I should be getting...  Any help would be great. I would REALLY love to not have to reinstall Windows and all apps again...


I am working on edits for a training manual that was sent to me.  The author consistently uses the word "the" before the company name, whose first word is "The."  Is this proper to use, or should "the" be deleted throughout?  Example:  "The Company abides by the [The Company Name] Code of Conduct established by [The Company Name], which is a manual of good company practices and behaviors. The [The Company Name] Code of Conduct is mandatory and violations can be punishable, up to and including termination."  Is it proper to use "the The..." together in this instance?  It just doesn't look right.  Thank you.

If a proper noun includes the word "the" and we want to refer to it using the definite article, should "the" appear twice in succession? For example:  "Can you pass me The Who CD?" vs. "can you pass me the The Who CD?"  "The US Government passed The Hague Act" vs. "The US Government passed the The Hague Act?". (this example inspired by a comment to ).  To me the first versions seem incorrect, but the second versions sound very awkward.


I haven't used java in a long while and i'm trying to teach someone the basics and get some practice in for myself. I decided to make a change machine that will give you the amount of Dollars Quaters NIckles etc one of those beginner codes.  This isn't the final code but I just have periodic print statements scattered about to test whether the code is working or not.  THE CODE OUTPUT  2 dollars and the change is 0.69  2 quaters and the change is 0.18999999999999995 1 dime and the change is 0.08999999999999994 1 nickel and the change is 0.03999999999999994 3 pennies and the change is 0.009999999999999938   THE QUESTION  It should be 4 pennies instead of 3, I thought of using an if statement like if change > 0.0 then + 1 penny but I feel like that's a brutish way of doing that could cause problems in the future but i'm also trying to keep it as simple as possible.   Is there any other suggestions on how to properly get 4 pennies, I believe there's a way to limit the decimal though I don't remember how complex it was.   If there are any suggestions to my code please feel free whether it be an easier way to do it or etc.  import java.util.Scanner;  public class changeMachine {   public static void main (String[] args) {      Scanner scan = new Scanner(System.in);      System.out.println("Price");     double price = scan.nextDouble();      System.out.println("Price " + price + "\n");      System.out.println("Cash");     double cash = scan.nextDouble();      System.out.println("Cash " + cash + "\n");      double change = (cash - price);      System.out.println("Change " + change + "\n");      double dollar = 1.00;     double quater = 0.25;     double dime = 0.10;     double nickel = 0.05;     double penny = 0.01;      int dollarAmount = (int)(change / dollar);     change = change % dollar;     System.out.println(dollarAmount + " dollars and the change is " + change);      int quaterAmount = (int)(change / quater);     change = (change % quater);     System.out.println(quaterAmount + " quaters and the change is " + change);      int dimeAmount = (int)(change / dime);     change = (change % dime);     System.out.println(dimeAmount + " dime and the change is " + change);      int nickelAmount = (int)(change / nickel);     change = (change % nickel);     System.out.println(nickelAmount + " nickel and the change is " + change);      int pennyAmount = (int)(change / penny);     change = (change % penny);     System.out.println(pennyAmount + " penny and the change is " + change);   } }

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


I have to list all dependencies of 71 packages. I planned to write a bash using  with a for loop but I got this message:  pactree : command not found   I have updated pacman but pactree still doesn't work. I searched in the arch repo and aur but both don't have pactree. What should I do to use pactree or at least list all dependencies?

I updated Arch Linux and now pacsearch is gone.  I know you can pacman -Ss, but I really liked how cool pacsearch was.  How can I get pacsearch back?


Recently I've noticed a pattern of users answering questions by way of comments. Generally this is followed by downvoting the question itself and eventually the question gets closed. Is that considered "good form"? I fail to see how that provides an actual answer and it ends up in questions without answers, but with comments. Commenting is fine, don't get me wrong. But I feel it produces poor answers... usually one-liners, and things can become fragmented when a user deletes their comment, which was at one point referenced in another user's comment on that comment. If it is bad form, how do we combat/flag these cases? UPDATED: Based on the comment by @jenayah new information came to light, which I feel is very relevant to my question, in highlighting the primary issues with using comments as answers. In a related , the following anti-patterns come to light.  Most often I do this when I have some input to give that I think is helpful, but I don't have the time/care to write a detailed answer that meets my personal quality standards. Rather than an incomplete answer or not helping at all, I'll leave a comment to point them in the right direction.   If I vote to close a question, I refuse to answer it as well. But sometimes I will give some input in the form of a comment. Occasionally such a comment from me will be a real answer.   Sometimes I'll put in a half-answer in the comments when I'm really not sure if I'm right or not, hoping that somebody can confirm what I'm saying. Then I'll go off and research the answer, and by the time I get back somebody else has confirmed what I said in a real answer, so I'll vote them up, or if nobody has, I'll answer myself.   There are probably as many answers to this question as there are people answering in comments...   Other times, like when my answer is really a joke and the question isn't CW, I'll choose to answer with a comment so that it isn't confused with a real answer to the question.   I'm really just trying to spur a quick correct answer, and not put down something as an answer if I'm not sure it's right.   Also someone may be afraid of losing rep from an answer that may not be what people want to hear if the truth is unpopular or politically incorrect.  Those are some of the answers to the question  which perfectly demonstrate the flaws in using comments to answer questions. Ironically, those where the top upvoted answers, and the reputation generated essentially rewarded such behaviors By , comments are intended to be employed as:  You should submit a comment if you want to:  Request clarification from the author; Leave constructive criticism that guides the author in improving the post; Add relevant but minor or transient information to a post (e.g. a link to a related question, or an alert to the author that the question has been updated).  When shouldn't I comment? Comments are not recommended for any of the following:  Suggesting corrections that don't fundamentally change the meaning of the post; instead, make or suggest an edit;  Answering a question or providing an alternate solution to an existing answer; instead, post an actual answer (or edit to expand an existing one);  Compliments which do not add new information ("+1, great answer!"); instead, upvote it and pay it forward;  Criticisms which do not add anything constructive ("-1, see previous comments you scallywag!"); instead, downvote (and provide or upvote a better answer if appropriate);  Secondary discussion or debating a controversial point; please use chat instead;  Discussion of community behavior or site policies; please use meta instead.     Side Note: My question is about how I as a member of the community can help combat the anti-pattern of  "comment-as-answer" behavior, not why or when comments should be used, as such, I don't think it is [duplicate], it's a different question.

Often, I will go to answer a question, and I will notice that someone commented on the question, which basically the answer. Why not just answer instead of commenting? If the answer to the question is in the comments but provided as an answer, should I still provide an answer just for the sake of clarity?


I came across an unusual question on Meta today:   I went to vote up some of the comments but couldn't:    I found some other questions on the matter:    - Anna says it's because the question is locked (in a comment)  - the accepted answer says it's because the question is deleted - not the case here, another answer says the comment has been deleted - also not the case here, and a third says the comment is from the old site and can't be voted, no mention of locking  again mentions locking   I believe the real reason is because of the migration: comments left before migration can't be voted on (or flagged, which I think is likely a problem) on the new site. Is this in fact the reason? And if so, could the little red box say so?        This comment is from another site and not eligible for voting or flagging   Would save a moment of confusion, right?

When trying to upvote a comment made on a locked post (ordinary lock, not historical lock which remove the vote arrows and flag altoghether) we are greeted with such error message:        Or in words:     This comment is not eligible for voting or flagging   Being the curious type, I went straight away and tried to flag, fully expecting the same message... just to see the flag dialog open up just fine:        I was able to flag as well.  Can the error message please be changed to just "This comment is not eligible for voting"? Or of course, if it's not the intended behavior really disable the option to flag?  The original post on which I experimented is now deleted, but  you can play with.


I graduated 2 years ago from a (frankly shitty) US state school with a 2.9 GPA and a Bachelor's of Arts in Computer science and no research experience.   I am well aware that this is a very poor undergraduate record. My mental health has has improved markedly since I left undergraduate and I have continued educating myself (self study/undergraduate courses).  I have the opportunity to move to a group within my company that does machine learning and statistics. Provided I take this position, will this experience be a positive mark on an application to a Master's program in a related field (comp. sci, statistics)? If so, how can I maximize the utility of this work experience in terms of admission?   More generally, what can I do to prevent myself from being permanently locked out of acceptance into graduate studies?

When applying to a PhD program in the US, how does the admissions process work? If an applicant is weak in a particular area, is it possible to offset that by being strong in a different area?  Note that this question originated from this . Please feel free to edit the question to improve it.


I am using Ubuntu 16.04.1 LTS on my seedbox dedi setup which has full root access, as I ssh into my system I now see a message with over 100 package updates can be updated none of them are security.  As I have moved from windows when the system needed to update it just done it, do I have to enter this command I read about to upgrade every time I want to? plus is sudo command only used for root systems?  sudo apt-get update && sudo apt-get upgrade

I want to be sure if automatic updates are enabled on Ubuntu 12.04 server.   How exactly can I check this?   And how can I disable automatic updates if it's enabled?


Show that $(0,1]$ ~ $(0,1)$ by constructing a one-to-one correspondence between the two sets. I have seen the other example on here, but I am not sure how exactly to prove it. Do I need to come up with a function that is one-to-one and onto and show that I can map a point from one set to the other set?

How to define a bijection between $(0,1)$ and $(0,1]$?   Or any other open and closed intervals?   If the intervals are both open like $(-1,2)\text{ and }(-5,4)$ I do a cheap trick (don't know if that's how you're supposed to do it): I make a function $f : (-1, 2)\rightarrow (-5, 4)$ of the form $f(x)=mx+b$ by \begin{align*} -5 = f(-1) &= m(-1)+b \\ 4 = f(2) &= m(2) + b \end{align*} Solving for $m$ and $b$ I find $m=3\text{ and }b=-2$ so then $f(x)=3x-2.$  Then I show that $f$ is a bijection by showing that it is injective and surjective.


How does one access data from an Esri file geodatabase in Quantum GIS?  I've seen snippets of conversation that indicate it's possible with qgis 1.7+ and gdal 1.9+ but no clear recipe.   I recognize that in a few months or a year this will likely be a non question ("just click [add data] button"), but today, I'm stumped. ;-)

I have spent around 2 days to find the way to open GDB (Esri geodatabase) in QGIS (or any other open source software) but still without success.  I have downloaded the newest OSGeo4W installer and tried the setup - express desktop install - all packages, as well as advanced install incl gdal-filegdb.  Can you describe a more detailed procedure, including installation and how to open .gdb in QGIS (OSGeo4W installation)?


How to calculate the isometry group of $\mathbb{R}^n$? And show that $G$ is generated by rotations, reflections and translations? Can someone help me?

The isometry group of $\mathbb{R}^n$, $\def\Isom{\operatorname{Isom}}$ \begin{eqnarray*} \Isom_n(\mathbb{R})=\{f\colon \mathbb{R}^n \to \mathbb{R}^n: f ~  \text{is an isometry}\}. \end{eqnarray*}  How to prove that \begin{eqnarray*}\Isom_n(\mathbb{R}) \cong \left\{\begin{bmatrix} A & \mathbf{t}  \\ \mathbf{0} &  1\end{bmatrix}: A\in O(n), \mathbf{t}\in \mathbb{R}^n \right\}? \end{eqnarray*}  Here $O(n)$ is the $n\times n$ orthogonal group.


For $\alpha > 0$, we want to prove that $$ \left| \sum_{k=1}^n a_k b_k \right| \leq \dfrac{1}{\alpha}  \sum_{k=1}^n a_k^2 + \dfrac{\alpha}{4} \sum_{k=1}^n b_k^2 $$  attempt We may rewrite our inequality as $$ \sum \alpha a_k b_k \leq \sum a_k^2 + \sum \left( \frac{b_k \alpha }{2} \right)^2 $$ Now, we may apply $a^2 + b^2 \geq 2ab $ as follows: $$ \alpha a_k b_k = 2 a_k \dfrac{ b_k \alpha}{2} \leq a_k^2 + \left( \dfrac{b_k \alpha }{2} \right)^2$$ Now, adding up from $k=1$ to $n$ proves our result. Is my approach correct?

Let $X_1,X_2,\ldots,X_n$ and $A_1,A_2,\ldots,A_n$ be real numbers taken at random, and $\alpha\gt0$. Show that: $$\sum_{k=1}^n |X_kA_k| \le \frac{1}{\alpha}\sum_{i=1}^n X_k^2 + \frac{\alpha}{4}\sum_{k=1}^n A_k^2$$


I have a blog regarding Placement papers from December 2010. My monthly impressions are around 4000. For the last 2 days, my blog has disappeared from Google search engine result pages.  Impressions have reduced drastically.  Please check Stat reports:    My blog is still on the search engine because when I search site: mydomain.com on Google, I can see my all pages indexed over there…  But my pages which used to appear on the first or second pages of Google do not appear any more.  Example: If I search with query GE round 2 code writing test on bing.com or Yahoo search, the first link on the result page is my blog.  But if you do same on Google, my URLs do not appear even on the 1st 3 result pages. I used to get lots of visitors by these search query earlier.

There has been a significant drop (90%) in traffic from Google to one of my well-established sites (6+ years) in the last week. Searches show that the top 3 wide keywords all dropped 4 spots. Searches for other keywords do not show ANY results in the first 10 to 25 pages of results, while previously one 1st or 2nd page at most.  Since there are , the question really is:  What steps are necessary to figure out what caused such a drop?  There have been no major changes during this period or the last month on the site and certainly not in the homepage which has dropped in rank. Over all the years of running this site and plenty of others, I have never experienced this. There are is duplicate content on my site and I have rigorously used canonical links for the last few years to ensure it is not misinterpreted as such.


I am a 3rd year phd student. I have a good human relation with my advisor, who generally leaves me a lot of freedom in deciding my work and my next steps.  However he recently started a personal business that is capturing all his time and interest. The consequences are:   He started skipping the scheduled meeting, being available more or less once each three weeks. He rarely reads what I send him, and if he does, he does it in the minutes just before we meet.   In general I feel that he has lost any interest in my supervision, to which he dedicates just the time of our meetings.  This in generally reduces the quality of what I produce and of the directions that my research can take.  At this point, I am considering the possibility of propose him to add a co-advisor to my PhD. In fact we are having a good collaboration with another professor from a different department (biology, I am in Cs) who seems very interested to my research; but I have no idea if he might be interested in co-advising me.  Might this be a good solution? And how to propose this to him without even hurt the good relation that we have?

I'm finishing up the first year of my master's program, heading into the second starting September. I had proposed a topic to my (then potential, since confirmed) supervisor in October and we agreed to work together. I changed this topic a month ago for various reasons (mostly lack of available data).  My supervisor was supportive of my topic change and throughout this process has been really helpful, responsive, and critical. But he is not really knowledgeable about the topic or the theoretical framework I am using - his helpfulness has come more from his knowledge of the discipline I'm working in (to which I am new) and his commentary on how I present and support my ideas. I feel that a co-supervisor would help focus my ideas and point out possible gaps, flaws, or inconsistencies in my analysis of the data based on their knowledge of the topic.  Is it too late to ask for a co-supervisor at the end of first year? I have a professor in mind who I'd like to ask, and he is someone I already know, but since it's quite late in the year I am wondering if it is appropriate to even ask. (And I'd definitely consult my current supervisor first. He'd probably be ok with it).


Going over the impressive list of topics discussed on the Stack Exchange network, it got me thinking - has there ever been a site that was in public beta, but then closed? Is there a list of these somewhere?  I assume sites in public beta are still being developed/grown - for example .

When I know the name of the site that was closed during public beta, I can search for that site in Area51 search.  However, is there any place where I can find the list of all closed public betas? I'm just curious to find out, what were the reasons for particular sites to fail.


I am currently switching from Windows 7 to Ubuntu 13.04. When i download the .iso file from Ubuntu.com I notice that it said AMD64 and i have a intel cpu. Is there a certain version i need for intel chips.

What is the difference between standard i386 download and the amd64 download of Ubuntu 11.04? I am currently running the i386 on an amd machine, would my system work better with the amd64 download instead? (my machine was running Windows 7 64bit, but I neglected to look at that prior to installing Ubuntu).


In WPF I'm trying find the distance from my control to the bottom of the screen. I can get the position of the control using .PointToScreen() but I'm having trouble finding the distance from that point to the bottom of the screen.  I've tried using SystemParameters.WorkArea.Height, SystemParameters.VirtualScreenHeight, and SystemParameters.PrimaryScreenHeight. All of these receive a value less than the Y postion of my control probably because the scaling is at 175%. I also have a second screen that is scaled at 100%.   I would prefer a solution that uses the screen references by the PointToScreen. I also looked at System.Windows.Forms.Screen, but would prefer a WPF solution if possible.

What I am looking for is the equivalent of System.Windows.SystemParameters.WorkArea for the monitor that the window is currently on.  Clarification:  The window in question is WPF, not WinForm.


How to resolve it? How to find that sum?

Apparently $1+2+3+4+\ldots+n = \dfrac{n\times(n+1)}2$.  How? What's the proof? Or maybe it is self apparent just looking at the above?   PS: This problem is known as "The sum of the first $n$ positive integers".


I am studying probability theory by reading Sidney Resnick's "A Probability Path". On page 12 and 13, algebra and $\sigma$-algebra are defined. The only difference between the two is the third requirement.   For algebra, it is required that $A, B\in \mathcal A \Rightarrow A\cup B\in \mathcal A.$ That is, algebra is closed under finite union; For $\sigma$-algebra, it is required that $B_i\in \mathcal B, i\geq 1 \Rightarrow \bigcup_{i=1}^\infty B_i\in\mathcal B$. That is, $\sigma$-algebra is closed under countable union.   I find the definition for algebra confusing. If the union of $A$ and $B$ is in $\mathcal A$, then for any $C\in\mathcal A$ one has $(A\cup B)\cup C\in \mathcal A$ and so on. Then by induction, this extends to countable union. Why does induction NOT work in this case, please? Thank you!

I am trying to understand why induction is valid. For instance why would this 'proof' not be valid under the principle of proof by induction ? :    $$ \sum_{k=1}^{\infty} \frac{1}{k} \lt \infty$$ because using induction on the statement  $$S(n) =  \sum_{1}^{n} \frac{1}{k} \lt \infty$$ - "$S(1) < \infty$ is true and "$S(n) < \infty$" implies "$S(n+1) < \infty$" since $S(n+1)  \lt S(n) + \frac{1}{n}$


How can I get increased coverage for this code? I get only 75% so far.  Not able to cover the delete statement in the main class.  Any help is greatly appreciated.  Main Class:  public void execute(SchedulableContext schedulevariable)     {          //Variable Declaration         List<Case> CaseList = new List<Case>();          try{             CaseList = [SELECT Id,Privacy_Issue__c,Status,SystemModstamp FROM Case                          WHERE Status ='Closed' AND Privacy_Issue__c = True AND                          SystemModstamp < :system.now().addDays(-63)];              if(CaseList.size()>0){                 Database.delete(CaseList ,false);             }         }         Catch(Exception ex){             system.debug('Exception Message::'+ex.getMessage());         }     }   }   Test Class:   @isTest(seealldata=false) public class DeleteCasesBatch_Test {      static testmethod void executeTest()     {         List<case> caseList = new List<Case>();         //Runas System Admin         TestUtility.getRunAsUser();          System.runAs(TestUtility.runAsUser){              //Case record Insertion             Case c1 = TestUtility.createCase();              c1.Status='Assigned';             c1.Privacy_Issue__c= true;             Database.insert(c1);              c1.Status = 'Closed';             Database.update(c1);              DeleteCasesBatch ads = new DeleteCasesBatch();             ads.execute(null);              Test.stopTest();              system.assertNotEquals(c1, null ,'Case Record is Null');              Database.delete(c1);          }     } }

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 want to pass list of key-values pairs into my function.  I can do this by following:  HashMap<String, String> params = new HashMap<>(); params.put("param1", value1); params.put("param2", value2); foo(params);   But there are 4 lines of code. And my foo function will be called in many times in my code, so it becomes hard to read.  Can we decrease number of lines in this call?   Is there a way to write foo([("param1", value1), ("param2", value2)])? Maybe Java standard classes have constructors to pass there several elements? Or can we write some factory class, that will create HashMap in less lines of code?

How would you initialise a static Map in Java?  Method one: static initialiser  Method two: instance initialiser (anonymous subclass) or some other method?  What are the pros and cons of each?  Here is an example illustrating the two methods:  import java.util.HashMap; import java.util.Map;  public class Test {     private static final Map<Integer, String> myMap = new HashMap<>();     static {         myMap.put(1, "one");         myMap.put(2, "two");     }      private static final Map<Integer, String> myMap2 = new HashMap<>(){         {             put(1, "one");             put(2, "two");         }     }; }


Are both the following sentences correct?  1- Hi everyone, ask me any question. I will answer it to the best of my ability.  2- Hi everyone, ask me any questions. I will answer them to the best of my ability.  I think the second one using plural noun is correct. I am not sure.

While I was answering a question on ELL, I got confused with a  from a fellow user. After I indicated that:     "Do you have any idea to prove it?'   is grammatically correct, the OP commented that "ideas" should be used in place of "idea".  The comment befuddled me. I thought until now that "any" should be followed by singular noun and not plural. So I searched Google and saw it's a huge debate going on and there is no end to it. I got no perfect and trustworthy source. So I thought to post the question here.  So what is the right rule? Should singular or plural be used after "any"?


I created a rating chart to be used as a reference in my reviews. In the chart's description, I want to say "This rating chart is for the readers to know where I stand ____ the video game." I know the "on" preposition can be used when telling my opinion on an issue, debate, or these sorts of things. Does the same apply to this case or what other preposition should write down?

I know that "as to", "on", and "of" are synonymous with "about", but I also know these words are not always interchangeable.  I was wondering if there are rules for picking between these prepositions.    There is still no news as to whether he will leave the company. (all four can be used with no change in meaning)  I don't know what you are talking about.  (only about and of can be used)  I heard of that from Jim. (only of and about) The speaker spoke on the issue of liquidity markets. (all four?)   Thanks for the help.


I always learnt in school that diffraction and interference happens if the slit width is of the order of wavelength. But what if the slit width is less than that of wavelength. Does diffraction happens in such conditions? If so then is there a mathematical representation for that?

I was wondering this for quite a long time now. Let's say you have a water wave (like ripples, not the ones you see during tsunamis) with wavelength 10 m. Imagine you put a boundary with an opening of 1 m. Will diffraction be observed? According to my research, no. But, then, what would be seen?


I'd like to reference an algorithm from algorithm2e using hyperref and cleveref. The goal is that "Algorithm" is capitalised in the reference. Neither using the capitalise option nor including manual reference names using \crefname{algocf}{alg.}{algs.} \Crefname{algocf}{Algorithm}{Algorithms}  works, unfortunately. A minimum example is: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[ruled,vlined]{algorithm2e} \usepackage{hyperref} \usepackage[capitalise]{cleveref}   \begin{document}   \begin{algorithm}[t] \SetAlgoLined test \caption{test algorithm} \label{algo:test} \end{algorithm}   Reference is \autoref{algo:test}.   \end{document}

\usepackage{algorithm,algpseudocode} \usepackage{hyperref}   So when I   \begin{algorithm} \caption{Baseline}\label{ALG_baseline} \begin{algorithmic}[1] ... \end{algorithmic} \end{algorithm}   the output will look somewhat like this:  -------------------------------------- Algorithm 1: Baseline -------------------------------------- ... --------------------------------------   So obviously, there IS a counter, already.  But   \autoref{ALG_baseline} is simply linked to with a number.   will result int   [1] is simply linked to with a number.   How can I make autoref output  [Algorithm 1] is ...   instead?


I can't seem to determine whether or not the second half of the sentence below is restrictive or non-restrictive and thus, whether or not a comma is needed? While it doesn't seem necessary, it does seem to be rather important.  However, a previous history of drug use was found to be strong predictor of program success, which suggests that interventions should be put in place sooner rather than later.  I've spent the last little bit going over restrictive and non-restrictive clauses, as well as dependent and independent clauses separated by coordinating conjunctions and am a tad confused at this point. Is this a case where it is a case of personal preference?  Any help is appreciated.  Many thanks!

There are many answered questions that address the usage of "which" and "what" on this site—many of them marked as duplicates—and there is even a specific tag for this topic. But I could not find any answer for the following question:  Should I use "which" or "what" or something else if I want to express     A does B which/what causes C.   Therein, "which/what" (the "which" or the "what") should not refer to B but to the act of A doing B (i.e. the predicate of the main clause).  For example see these alternatives:     Bob writes on the blackboard which causes a screeching noise.   Bob writes on the blackboard what causes a screeching noise.   Please note: The noise is caused by the writing not by the blackboard.  Side question: Would the use of a comma be appropriate here?  There is a closely related question, "", that aims on "which" versus "that" as the alternatives and is answered in favor of "which". But maybe "what" would be the better choice here.


log5(2) ∈ I. Hint: Consider using the Fundamental Theorem of Arithmetic.

Show that   $\log_7 n$ is either an integer or an irrational number where n is a positive number.   I assumed that it is rational and tried to get a contradiction for $\log_7 n = a/b$, where b does not divide a, but how can I show that $7^{a/b}$ is not an integer to achieve a contradiction since n is an integer ? If I can exclude rational numbers from the range of log function then it is either integer or irrational.  Or do you suggest other methods ?


New to trading, trying to understand how wash sales apply to short term trades that occur in the middle of the tax year. Consider the following scenario:  Day 1: Buy 100 ABC for $10  Day 2: Sell 100 ABC for $5  Day 3: Buy 100 ABC for $4  Day 4: Sell 100 ABC for $10  At the end of the tax year, will my broker make the cost basis adjustment to the buy on Day 3 for me? Or will they simply tell me the $ amount of my wash sales, at which point I need to manually find and adjust every instance of this on my own?

First let's make sure I understand a Wash Sale:  Let's say I invest in 100 shares of ABC stock for $100 and after a week sell the 100 shares of ABC for $70, I've lost $30 which I can deduct from my taxable income come tax time. However, if I reinvest into ABC for ANY amount within 30 days of exiting ABC for a loss there is a wash sale which means I can no longer claim the original $30 loss as a loss.  Considering that is all correct, here is my theoretical scenario:  Let's say I buy 100 shares of ABC at $1 a share and at the end of the day I sell all 100 shares of ABC at $0.70 (30% loss). On the following day I buy 100 shares of ABC at $0.70 a share and sell at the end of the day when ABC is at $1 a share (30% gain). Let's theorize that this loss / gain cycle repeats consecutively for 8 additional days so at the end I have the following:   Lost $30 dollars every other day starting with day 1 and felt -$150 over the 10 day span. Gained $30 dollars every other day starting with day 2 and felt +$150 over the 10 day span.   Per wash sale rules I cannot claim ANY wash sale loss because on the last day I invested in ABC and made a profit.  Knowing I cannot claim any losses, my question is: Do I have to pay taxes on all of the gains? That is, will I still have to pay taxes on $150 dollars even though I only ended up gaining a net total of $0 from the time I started?  Here is a visual example of my scenario:  Day:      | 1    2    3    4    5    6    7    8    9    10 Loss:     | -$30      -$30      -$30      -$30      -$30    Gain:     |      +$30      +$30      +$30      +$30      +$30  Felt Loss | -$30      -$60      -$90      -$120     -$150 Felt Gain |      +$30      +$60      +$90      +$120     +$150 Net Gain  | -$30 $0   -$30 $0   -$30 $0   -$30 $0   -$30 $0


Bounty faq says that if owner of bounty does not give bounty to any answer in 7 days half of bounty amount will be given to highest voted answer. But what if two answers have same number of vote and that are the highest votes among answers. Who will get the half amount of bounty?

It's possible to offer and award bounties of reputation on questions.   What is a bounty? How can I find questions that have a bounty attached? How do I start a bounty? When can I start a bounty? Why is the system requiring me to choose a bounty amount that's higher than the minimum? Can I use Markdown formatting in the bounty remarks? Can I edit the remark? How long is the bounty period? How do I award a bounty? Can I award a bounty to my own answer? Can I award a bounty to an old answer? If I offer a bounty on someone else's question, can I award the bounty to their answer? After awarding the bounty, can I remove it or move it to another answer at a later time? What happens if there's no answer after the bounty period? What happens if I feel my question is still unanswered? What is automatic awarding? Are bounty awards exempt from the 200 points/day reputation limit? How does Community Wiki mode affect bounties? How does user deletion or post dissociation affect bounties? Can I award a bounty to an answer from a deleted user or one where the author was dissociated? Can I offer a second bounty after the first one has expired? Can I raise my bounty? What happens if a bounty question is closed or deleted? Why can't I vote to close or migrate a bounty question? What happens if I delete my account while I have an active bounty? Do I keep an awarded bounty when I delete my answer? What happens if a question where I awarded a bounty later gets deleted or migrated? Can I cancel my bounty? Can I affect / divide / share part of my bounty to two (or more) users? How many outstanding bounties can a single user have?      See also:  in the Help Center


I have posted a few times and answered my own questions. Normally it was because I was overlooking something or just plain doing something stupid.  So I deleted the post thinking it would not benefit anybody else.  What is the MO for keeping your posts?  At the same time I am afraid if I answer my own posts (because I truly found an answer) then people may vote my answer down, when in fact I was keeping it up in case it helped someone else.  Can an answer to your own post even be voted up by another person?

According to , the only restriction on self-deleting an answer is that you can't delete an answer that's been accepted.  But I've also heard of users getting in trouble for deleting (non-accepted) answers, and there's the CC-SA license to consider, so -- quite aside from what is technically possible -- my question is when it's permitted to delete your own answer.  Some cases to consider:   You now believe the answer is incorrect. Your answer is correct, but another answer covers the same territory better. You aren't satisfied with the quality/rigor of your answer, e.g. it's speculative and you didn't back it up (on a site that expects that). Something in the answer embarrasses you and you'd rather just make it go away. Your answer wasn't well-received by the community (whether that's "meh" or "make the rep bleeding stop please"). (I'm sure there are others; this isn't meant to be an exhaustive list.)   Does voting matter, either in absolute terms or in comparison to other answers?  For example, maybe it's ok to delete a lower-voted one but not the top-voted answer, or one with score > N??  There is a badge, Disciplined, for deleting your own post of score 3 or higher.  This tells me that it's sometimes ok to delete upvoted answers.  But I'm not sure how much policy we can infer from badges.  Could we have some clarification please?


I have a table and figure that I need them to appear side-by-side. The figure appears in a higher position than the table. I need to align them so that their sizes are equivalent. This is the script and the output compared to what I need.  \documentclass[11pt,a4paper,english]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{babel} \usepackage[font=small,labelfont=bf]{caption} \usepackage{graphicx} \begin{document} \begin{minipage}{\textwidth} \begin{minipage}[b]{0.49\textwidth} \centering  \captionof{table}{Table} \begin{tabular}{ll} \hline\noalign{\smallskip} Item1 & Item2 \\ \noalign{\smallskip} \hline \noalign{\smallskip} C & 100  \\ B & 200  \\ C & 300 \\ \hline \end{tabular} \end{minipage} \hfill \begin{minipage}[b]{0.49\textwidth} \centering \includegraphics[width=0.5\textwidth]{venndiagram2} \captionof{figure}{Diagram.} \end{minipage} \end{minipage} \end{document}

Looking to put a table and a figure side by side so that the table and figure have their own captions. A crude sketch    ------------              -----------------     TABLE    | a |  b |                     FIGURE   | c |  d |  ------------              Table 2: Caption           -----------------                            Figure 7: Caption   The closest I've gotten is:  \begin{table}% \centering \parbox{0.4\textwidth}{ \begin{footnotesize} \begin{tabular}{| l | r |} \hline some & table\\ \end{tabular} \end{footnotesize} \caption{Table} \label{tab:table} } \qquad \begin{minipage}[c]{0.53\textwidth}% \centering     \includegraphics[width=1\textwidth]{awesome} \caption{Figure} \label{fig:figure} \end{minipage} \end{table}   But that gives two Table X: Caption captions. I didn't find anything in subfig.  Help?


I have the following code:  def TEST(): vals = [[0]*len(K_values)]*len(u_values) for p in range(len(u_values)):     u = u_values[p]     for i in range(len(K_values)):         K = K_values[i]         vals[p][i] = u * K return vals   u_values and K_values are 11-element long 1-D arrays. vals is a 2-D array of zeros that (should have) has its [p][i] element updated with u * K upon every loop.  The problem is that instead of changing the index p upon each (outer) loop, python always uses p=0 - this means that upon every loop, only u_values[0] is ever used. At first I thought this was because the outer for loop was only executing once; however, when viewing the code output (vals), it is clear that the outer loop IS looping len(u_values) times; it's just always with p=0 (otherwise, I would expect that only the zeroth column of the vals array would be nonzero).

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


Suppose $f(z)$ is holomorphic in the whole plane, and that $f(z)$ does not have an essential singularity at $\infty$. Prove that $f(z)$ is a polynomial.   Since $f(z)$ does not have an essential singularity at $\infty$, it has either a removable singularity or a pole. If it has a removable singularity, we can define $f(\infty)$ in such a way that $f$ is holomorphic in the extended plane. Having a pole at point $a$ usually means that we can write $f(z)=\dfrac{g(z)}{(z-a)^k}$ where $g(z)$ is holomorphic. I'm not entirely sure what a pole at infinity means in this case.

This is an exercise from Alhfors Complex Analysis book- to show that an analytic function with a nonessential singularity at infinity must be a polynomial. It seems like it should probably be pretty straight forward, but I must be missing something. If it has a removable singularity at infinity than it extends to an analytic function on the Riemann sphere, and so must be constant by Liouville's theorem. What if there is a pole at infinity though? This was homework some time ago, and  I never finished it :/ but have been thinking about it again recently. Thanks :)


I bought a house recently. Some of the wiring, particularly in the basement, while not obviously unsafe, is... inspired. On the side of a junction box in the basement, there's a device with two thin wires coming off of it, going up into a hole. I believe, but don't know for sure, that above the hole is an exterior wall, but there's nothing on that wall that would use such thin wires - just switches and outlets, which I'd hope are fed from the thicker cables also going through that hole. So what is this thing?

This thing is on my junction box but i don't know what it is or what it's for.


If I have a nilpotent Lie Algebra $\mathfrak{g}$ and a representation $\rho(X)$ in a vector space $V$ such that $det \rho(X) = 0 $ for all $X \in \mathfrak{g}$, then how do I show that there is a vector $v \in V$ such that $\rho(X)v = 0$ for all $X \in \mathfrak{g}$? I know it involves Engel's theorem but I'm not sure how.

Could you help me with this question?  Let $\mathcal{g}$ be a nilpotent Lie algebra over $k$ and $\rho$ a representation of $\mathcal{g}$ in a finite-dimensional nonzero vector space $V$ over $k$. Suppose that det $\rho (X) = 0$ for all $X \in \mathcal{g}$. Show that there is a nonzero vector $v \in V$ such that $\rho(X)v = 0$ for all $X \in \mathcal{g}$.


I'm very curious about how light is created.    I'm trying to get back to some type of real understanding about why everything on the sub-atomic level vibrates and the implications for the preservation of both the conservation of energy and conservation of momentum.  How is light created at the atomic level?

To be clear here, My question arises from studying Electromagnetic induction and polarisation and photoelectric effect. From here I've gained the knowledge that creation of a photon involves:  Electromagnetic Induction - The fact that a time varying spatial magnetic field which creates a closed loop electric field [Super Confusing as to why universe does that] Polarisation - In the books, they show that light is oscillating electric field vectors and magnetic field vectors Photoelectric Effect - Creation of light has something to do with an electron returning to a lower energy state, not saying that it's the only way.  So how does light get produced? I'm seeking in-depth explanation.  Some Context The question arose when I was talking to my friend about a hypothesis of mine where I was saying that If I released a photon from , say a torch. I could, under some known error margin, say at what instant the photon was created but according to what I've heard multiple times, time stops at light speed. So, any photon at 'c' would basically never had experienced any time. So, from the perspective of the photon, its birth can't be defined. We seem to reach a paradox here, if I observe a time at which the photon was created but the photon has no notion of time, it has no notion of a beginning or an end. Then, I tried to expand the concept of the hypothesis to say that maybe in a similar sense, the universe doesn't hold a concept of beginning or an end. As we experience it's perspective, we can't determine its birth time using our maths which has been cultivate throughout this universe, and we also know that maths do break down when we try to solve equations for the t=0 time of Big Bang. NOTE: This talk was just to have fun, I just like physics and like to talk about the universe, however, I understand that I might have just annoyed someone by ignoring a dozen of laws and theorems that I'm yet to find out about. APOLOGIZES!  I'm expecting a somewhat dumbed down explaination, now don't get too carried away by that. I'm a high school student but I do love a bit of technical mumbo jumbo but I'm just asking to keep in mind that I'm in high school. Example: Say we have an equation: x3+x2-x+44=0 Instead of saying the degree of equation is 3 maybe say the highest power in the equation is 3.


after installing Ubuntu 16.04, when I choose in grub startup menu to boot in Windows 10 it restart PC but loop again in grub start up menu. I tried - boot repair (to correct it - "recomended change") - sudo update-grub also. So as I wrote after installing Ubuntu 16.04, when I select Win10 in grub, it restart computer, but again shows grub bootup menu... Basic information - older desktop (no UEFI), - 1. installed Win Xp, 2. Windows 10, both load without problem, - Win10 shut down, but fast boot was not disabled (in ubuntu I can see other drives, but ubuntu cannot mount them) - 3. installed Ubuntu 16.04  As first on HDD I had 2 NTFS partitions (50 and 70GB), on the first was Win XP, I split it ( 50GB to 20GB Win XP and new 30GB) and on new part I install win 10. After this I split the second partition (70GB in 30GB and 40GB) and on the 30GB I install Ubuntu 16.04 (the partition during installation was split into 20GB - system and rest /shows 8,6GB/ as "HOME"), after few restart I try to choose Win 10 during booting, but as I wrote earlier, I cannot access Windows.   When you can help me, thank you for your answer/help  PS.: When I correct installation (using Win 10 installation disk) - fix MBR, I can run Win10 (including Win XP) - but of course not Ubuntu. So then I again reinstall Ubuntu 16.04, but problem occurs again, and I cannot access my Window installations...!

I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install.  What can I do to fix this?


Let $P$ is given permutation. How can I calculate $F$ such that $F*F=P$.

Observe that  $$\begin{pmatrix} 1 & 2 & 3 & 4 & 5 \\  2 & 4 & 1 & 5 & 3 \end{pmatrix} \begin{pmatrix} 1 & 2 & 3 & 4 & 5 \\  2 & 4 & 1 & 5 & 3 \end{pmatrix} =  \begin{pmatrix} 1 & 2 & 3 & 4 & 5 \\  4 & 5 & 2 & 3 & 1 \end{pmatrix},$$  so $\begin{pmatrix} 1 & 2 & 3 & 4 & 5 \\  4 & 5 & 2 & 3 & 1 \end{pmatrix}$ is the square of a permutation. More generally, how do I check if a permutation is square and how can I find its root?


I am trying to get right answer to question: Can you make bijection between set ℝ\{-3} and set ℝ?  I know those two sets are not same size but I think I can still make bijection, but I need mathematical proof.  Can someone tell me what is right answer + proof? +Is there way how to for example ask Wolfram for those questions?

About a bijection between $\mathbb R$ and $\mathbb R \cup \{\infty\}$  If we'll take a line $f(x)=\begin{cases} ax &, x\in\mathbb R\\ 0 &, x=\infty  \end{cases}$ then we'll have a bijection.   But about this function: $g(x)=\begin{cases} x &, x\in\mathbb R\setminus \{0\}\\ 0 &, x=\infty  \end{cases}$ ? it appears to be a bijection and it's even simpler.


I want to get pointer to the rectangle from list. But Rectangle is struct and when I try to get pointer I get copy.  Class MyClass {     Rectangle MovingRectangle;     List<Rectangle> RectangleList;     Point StartLocation;      ***some code here***      void PicBoxMouseDown(object sender, MouseEventArgs e)     {         foreach (rectangle in RectangleList)         {             if (condition)              {                 MovingRectangle = rectangle;                 StartLocation = e.Location;                 break;             }         }     }      void PicBoxMouseMove(object sender, MouseEventArgs e)     {         MovingRectangle.Location =                 new Point(movingRectangle.Location.X + (e.X - StartLocation.X),                           movingRectangle.Location.Y + (e.Y - StartLocation.Y));     }  }   I want to change rectangle position in List, but i change position of copy.

I have a list of structs and I want to change one element. For example :  MyList.Add(new MyStruct("john"); MyList.Add(new MyStruct("peter");   Now I want to change one element:  MyList[1].Name = "bob"   However, whenever I try and do this I get the following error:     Cannot modify the return value of   System.Collections.Generic.List.this[int]‘ because it is not   a variable   If I use a list of classes, the problem doesn't occur.  I guess the answer has to do with structs being a value type.  So, if I have a list of structs should I treat them as read-only? If I need to change elements in a list then I should use classes and not structs?


I encountered the following linker errors and I can't seem to find out why Observable<T> doesn't get defined:  CMakeFiles/Sapling.dir/Core/Window/SdlWindow.cpp.o: In function `se::SdlWindow::SdlWindow(se::Window::State const&)': /home/glados/ClionProjects/Sapling/Core/Window/SdlWindow.cpp:9: undefined reference to `se::Observable<se::WindowEvent>::addObserver(se::Observer<se::WindowEvent>*)' CMakeFiles/Sapling.dir/IO/SdlInput.cpp.o: In function `se::SdlInput::processEvent(SDL_Event const&)': /home/glados/ClionProjects/Sapling/IO/SdlInput.cpp:83: undefined reference to `se::Observable<se::WindowEvent>::notify(se::WindowEvent const&)' collect2: error: ld returned 1 exit status   The problem seems to be about these two classes:   Observer.h  #ifndef OBSERVER_H #define OBSERVER_H  #include "../Util/UID.h"  namespace se {      template <typename T>     class Observer {      public:          Observer();         virtual ~Observer() { }          virtual void onNotify(const T& subject) = 0;          const UID& getId() {             return m_id;         }      private:         UID m_id;         static UIDPool m_uidPool;     };  } // namespace se #endif   Observer.cpp  #include "Observer.h"  namespace se {      template <typename T>     UIDPool Observer<T>::m_uidPool = UIDPool();      template <typename T>     Observer<T>::Observer() : m_id(&m_uidPool) { }  } // namespace se   Observable.h  #ifndef OBSERVABLE_H #define OBSERVABLE_H  #include "Observer.h" #include <vector>  namespace se {      template <typename T>     class Observable {     public:          void addObserver(Observer<T>* observer);         void removeObserver(Observer<T>* observer);      protected:          void notify(const T& topic);      private:         std::vector<Observer<T>*> m_observers;     }; } // namespace se #endif // Include guard   Observable.cpp  #include <cstdlib> #include <cassert> #include "Observable.h"  namespace se {      template <typename T>     void Observable<T>::addObserver(Observer<T>* observer) {         m_observers.push_back(observer);     }      template <typename T>     void Observable<T>::removeObserver(Observer<T>* observer) {         assert(observer->getId().get() < m_observers.size());          for (size_t i = 0; i < m_observers.size(); ++i) {             if (observer->getId() == m_observers.at(i)->getId()) {                 m_observers.erase(m_observers.begin() + i);             }         }     }      template <typename T>     void Observable<T>::notify(const T& topic) {         for (size_t i = 0; i < m_observers.size(); ++i) {             m_observers.at(i)->onNotify(topic);         }     } } // namespace se   The problem isn't a circular dependency one as Obervable<T> is not circularly dependent (UID.h only includes STL headers). I'm using cmake to make and gcc to compile/link.  I hope you can help me out as I have spent over 7 hours trying to resolve this...

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


What is the purpose of having both?  Aren't they both used for mounting drives?

In FHS-2.3, we have /media that holds mount points for removable media such as CD-ROMs and we have /mnt that holds temporarily mounted filesystems.  On the other hand, we have /run/media and /run/mount. For me, the CDs and USBs are mounted on /run/media.  I don't see any clear distinction between them(/media, /mnt, /run/mount) . What are their differences?     I have seen similar trend (mount on /run/media) in fedora 20 - GNOME 3.10.4 and ubuntu 14.04.1 (installed on virtual box) with GNOME 3.10.4. But when I plugged in a USB flash (with auto-mounter script) on a system with Centos 6 and GNOME 2.28.2 it was mounted on /media


I used replace keyword to replace string or char, and i can replace successfully here is my code   string keywoord = "Emerika"; var result = keywoord.Replace(keywoord[0], 'A');   the result : Amerika  but i get strange behaviour when replace thing and the next thing is same    string keywoord = "xxxxx";     var result = keywoord.Replace(keywoord[0], 'A');   I will get result : AAAAA  It should return Axxxx  string keywoord = "aaakaaa";       var result = keywoord.Replace(keywoord[0], 'z');   I will get result : zzzkzzz  It should return zaakaaa  so what happened with this,  i just need to replace one thing not multiple thing, any error or do u have another solution?

I want to replace the first occurrence in a given string.   How can I accomplish this in .NET?


Suppose that $A$ and $B$ are invertible, $p \times p$ matrices. If $A^n = B$ and I know all of the entries in $B$, can I find an $A$ for some or all integers $n \ge 0$? How many solutions for $A$ exist? If I'm thinking correctly, then $A = B * (A^{-1})^{n-1},$ but this is sort of self referential. Thanks!

Is there a general method (which can be implemented by hand) to finding the $n$-th roots of $2 \times 2$ matrices? Is there a similar method for a general $m \times m$ matrix? (for $n > 1$ and $n\in\mathbb{Z}$)


i  need the edges of the plane to stop dissappearing when i rotate/scale can anyone help, the plane is very large kms

I'm having an odd issue - When I try to zoom in on a detail using my MMB, the "camera" in the 3D view seems to be cutting off the exterior surface of my object and showing me the inside instead. I'd expect this behavior, but only when I was much more zoomed in.  If I zoom out a bit (one click on the scroll wheel) then I can see the exterior as I intend.  Is there any way to adjust this behavior?  Thanks!


I have completed my first custom PC build. I installed Windows 8 Pro and I have a few questions pertaining to the OS and the way I should configure my hard discs.  I have a 128 GB SSD that I installed the OS on and I have a 3 TB HDD. I want to reserve as much space as possible on the SSD and limit the use because I know they have a limited life.   Q: How would I optimize the life span of my SSD? I wanted to put everything else on the HDD other than the OS of course. Is this the right choice? If so how do I change the settings for Program Files and folders such as My Documents, Downloads, Pictures etc. to default to my HDD (E:/ Drive)?

I have recently upgraded my desktop PC and installed a SSD as system drive.   I read somewhere that these drives "don't like" being written on too much and that one needs to enable/disable certain OS features for such drives.  I checked the properties for the drive C: in Windows 8 and here's what I got.      Q1: As you see Allow files on this drive to have contents indexed in addition to file properties is checked. Does it need to be checked for that drive?  Q2: Is there anything else that I need to change in the settings to accommodate for the SSD?


M: Amy doesn't speak Korean, right? W: No,* she does speak Korean. She has lived in Korea for three years! M: Amy doesn't speak Korean, right? W: Yes, she does speak Korean. She has lived in Korea for three years!

I faced a problem to answer a negative question, for example, when someone asks you:      Don't you have any money?   It's a yes/no question but how should one answer the question without ambiguity?  When you answer "yes", does it mean "yes, I don't have any money"? or the other way "Yes, I do have money"? the questioner may think you are agreeing to the negative, that yes, you do not have any money.  I know it's better to answer with "on the contrary" but is it possible to answer yes or no?


We know that there are multiplicity of different works/sources in Harry Potter Universe:   HP books 1-7 Associated JKR books (Beedle the Bard, QTTA, HP Prequel story, Magical Beasts) HP Movies 1-7 JKR interviews jkrowling.com information Pottermore Harry Potter amusement parks Possibly, other non-JKR franchise works, though to the best of my knowledge none exist as of now and none are planned. assorted fan fiction :)   Given that the universe is pretty big/complex, with many sources, it's not surprising that there already are discrepancies between different sources (the obvious ones between books and movies; ones ; and ).  To manage such discrepancies, other universes frequently employ official or unofficial canon rules (as an example, Star Wars , whereas Dr Who ).  Is there an official position of JKR/Harry Potter franchise on HP Universe canon structure?  NOTE: "No canon" and "No current official position" are two different answers.

There are many different Harry Potter works including:   books short stories movies card games video games toys amusement parks web content   Which ones are considered to be canon?


I'm new to Gnome, and I don't really like it. So that's exactly why I installed Unity 7. So far so good, Unity works like a charm, much better than Gnome, at least this is my opinion. However, now I have 2 settings app,  2 calculators, 2 networks managers, 2 of everything. Is there any way to remove gnome 3 without messing up at all Unity? I don't really like to search an app and instead of showing up only 1 it shows at least 3 different apps with the same icon. Is there any way? Thank you!

I need to get rid of the GNOME Desktop Environment which has been installed by default when I updated my pc from 15.10 to 16.04.  After a while, I found myself not only with GNOME DE, but also with Cinnamon alongside (in the login screen, I could choose at least five or six DE!)  Now I am using Unity, and I'm happy with that, and I successfully uninstalled Cinnamon, but now I'm afraid that after uninstalling GNOME I will mess up the Unity DE, since I see many packages running in unity with the packagename starting with gnome-... Would someone mind to help me? Thx in advance


So I imported data from two txt files.  However, I would like to plot the mean of the data and then the standard deviation bars.  How can this be done?  \documentclass[tikz, convert = false]{standalone} \usepackage{pgfplots}%                                                             \pgfplotsset{compat = 1.8}%                                                        \begin{document} \pgfplotstableread{FRETData.txt} \datatable%                                                                        \pgfplotstableread{FRETData2.txt} \datatabletwo%                                                                     \begin{tikzpicture}   \begin{axis}[ymin = 0.16,     ymax = 0.22,     minor y tick num = 5,     xmin = -6.7,     xmax = -6.2     ]     \addplot table[y = 1] from \datatable;     \addplot table[y = 1] from \datatabletwo;   \end{axis} \end{tikzpicture} \end{document}     From the picture, we see that pgfplots has connected two separate experiments.  How can I remove the line?  Can pgfplots calculate the mean for each experiment and put standard deviation bars?  Edit 1:  So to remove the lines, I added only marks option.

My current plotting tool for my papers is  for nice consistent plots. Now I would like to add a boxplot. Is this possible with help of pgfplots, or any helper package?


Problem  Let $M_{n}(\mathbb{R})$ is a vector space of square matrix with size $n \times n$. Assume $V$ is a subspace of $M_{n}(\mathbb{R})$ such, that all its elements have zero determinant. What is the maximum dimension of space $V$?  Question  Can somebody give me a hint on how to tackle the problem above? Thanks.

I am sure the answer to this is (kind of) well known. I've searched the web and the site for a proof and found nothing, and if this is a duplicate, I'm sorry.  The following question was given in a contest I took part. I had an approach but it didn't solve the problem.     Consider $V$ a linear subspace of the real vector space $\mathcal{M}_n(\Bbb{R})$ ($n\times n$ real entries matrices) such that $V$ contains only singular matrices (i.e matrices with determinant equal to $0$). What is the maximal dimension of $V$?   A quick guess would be $n^2-n$ since if we consider $W$ the set of $n\times n$ real matrices with last line equal to $0$ then this space has dimension $n^2-n$ and it is a linear space of singular matrices.  Now the only thing there is to prove is that if $V$ is a subspace of $\mathcal{M}_n(\Bbb{R})$ of dimension $k > n^2-n$ then $V$ contains a non-singular matrix. The official proof was unsatisfactory for me, because it was a combinatorial one, and seemed to have few things in common with linear algebra. I was hoping for a pure linear algebra proof.  My approach was to search for a permutation matrix in $V$, but I used some 'false theorem' in between, which I am ashamed to post here.


I want to use blender to draw a cycloid animation. I know the function, but is it possible to render the motion path of a vertex of a circle like the following video?

Once you have an animated object using typical key-framing (other methods such as physics, driver or NLA apply too).  It could be useful to apply the motion to a path:   to adjust the evaluation time edit curve points points may be easier have many objects move along the same path. ability to follow the path.   Is there a way to do this?    Note that rotation and scale won't be taken into account.


I have a theorem A and another one whose numbering is the numbering of A followed by a prime. However, I don't want the red box of the numbering for the second theorem, and this is the single place where I want to remove the box, that is, I want to keep the boxes for all other references. The example I have is as follows:  \documentclass[11 pt, a4paper]{article} \usepackage{amsmath,amssymb,amsthm,mathrsfs,amsfonts,dsfont} \usepackage{hyperref}  \newtheorem{thm}{Theorem}[section]  \newenvironment{thmprime}[1] {\renewcommand{\thethm}{\ref{#1}$'$}% \addtocounter{thm}{-1}% \begin{thm}} {\end{thm}}  \begin{document}  \begin{thm}\label{test} Test \begin{align}\label{eqn}  a^2  \end{align} \end{thm}  Equation \ref{eqn}  \begin{thmprime}{test} Test \end{thmprime}  \end{document}   Many thanks in advance!

When using the hyperref package, is it possible to tell LaTeX not to create a link for some references?  In my case the page number is displayed in the footer in  \fancyhf[FC]{\thepage\ of \pageref{pg:end}}   which is what I want. Unfortunately every single page in the document then has a link to the final page, which is a bit silly.  Any ideas on how to fix that?


When our children are admitted to a special or private school, it is likely that our family members, friends etc will come to know about it. Why is this not true with Muggleborn wizards? When Muggleborns go off to an unknown school, and live a secretive life (for example, marrying another wizard), why don't the people around them know about this?   I suppose data on every individual is collected by the authorities of each country. Some of the Muggles know about witches and wizards, and wizards cannot be everywhere all the time to make sure that the Muggles aren't continuously sharing what they know about wizards with the other Muggles.   How do wizards make sure information about the Wizarding World is not revealed by Muggles?

Obviously, in the Harry Potter universe, some Muggles know all about wizards.  The Dursleys, for example, and the British government, as well as Hermione's family.  But at the same time, the Wizarding World has a vested interest in keeping themselves hidden, often going to extreme lengths to preserve the Muggles' ignorance about what's really going on.  Some things (like ) seem to take care of themselves, but word-of-mouth still seems like it would be an issue.  Are there any details provided about how they navigated this issue?  Did Hermione ever mention (before the events of the final book where she straight-up mind-wiped them) an inability to tell her parents about anything she was doing?  Was there a legal reason why the Dursleys could know about Hogwarts but Marge Dursley couldn't (aside from the Dursley's self-imposed shame)?  Did we ever hear about family members' memories being altered after graduation, or any loose-lipped gossips needing to be told to hush up?


I have a big problem my render F12 is all white, while my preview render is working.  Please help me guys, thanks.

For some reason, when I render out the image, it is plain white. I've checked the sky settings, and I tried applying textures, but nothing seems to change.  How can I fix this?


A friend of mine encountered a problem while studying GR. I'm going to answer it myself if I get some time, but here it is.  The (symmetrized) energy-momentum tensor for the electromagnetic field is $$T^{\mu \nu} = F^{\mu \lambda} F^{\nu}_{\,\, \lambda} - \frac{1}{4} \eta^{\mu \nu} F^{\lambda \sigma} F_{\lambda \sigma} \, .$$  In this calculation, she had to assume conservation of energy-momentum in the form $\partial_\mu T^{\mu \nu} = 0$ to figure how it works out in the presence of field sources. In other words: $$T^{\mu \nu} = T^{\mu \nu}_\mathrm{matter} + T^{\mu \nu}_\mathrm{field}$$ The step that confused her was showing that  $$ \partial_\mu T^{\mu \nu}_\mathrm{matter} = F^{\nu}_{\, \, \mu} j^{\mu} $$  I tried to write it out using the Maxwell field equation $$\partial_\mu F^{\mu \nu} = j^\nu$$ and the Bianchi identity $$\partial_{[ \lambda} F_{\mu \nu ]} = 0$$ but something smelled fishy in my calculations and I didn't manage to get back to it.

In a theoretical physics homework problem, I have to show the following: $$\partial_\nu T^{\mu\nu} = - j_\nu F^{\mu\nu}$$  Where $T$ is the Energy-Momentum-Tensor, $j$ the generalized current and $F$ the Field-Tensor. We use the $g$ for the metric tensor, I think in English the $\eta$ is more common.  I know the following relationships:   Current and magnetic potential with Lorenz gauge condition: $$\mathop\Box A^\mu = \mu_0 j^\mu$$ Energy-Momentum-Tensor: $$T^{\mu\nu} = \frac1{\mu_0} g^{\mu\alpha} F_{\alpha\beta} F^{\beta\nu} + \frac1{4\mu_0} g^{\mu\nu} F_{\kappa\lambda} F^{\kappa\lambda}$$ Field-Tensor: $$F^{\mu\nu} = 2 \partial^{[\mu} A^{\nu]} = \partial^{\mu} A^{\nu} - \partial^{\nu} A^{\mu}$$ d'Alembert operator: $$\mathop\Box = \partial_\mu \partial^\mu$$ Bianchi identity: $$\partial^{[\mu} F^{\nu\alpha]} = 0$$   So far I have set all the definitions into the formula I have to show, but I only end up a lot of terms from antisymmetrisation and product rule. I also drew all what I have in , but I still cannot see how to tackle this problem.  Could somebody please give me a hint into the right direction?


for example:     has a few responses which involve the bash ${#x} construct.  It incorrectly treats the hash like a comment.  Questions:  1) What engine is used for syntax highlighting?  2) If SE an external engine, is there a way that we lowly users can make upstream changes that could be pushed?

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


For my Website, I have a set background-color of the body, for example  body { background-color: #FFFFFF; }   I also have a button defined in the .html-File (Let's say it has the ID "button1"), and I want the Background-Color of the body to change (to for example #000000;) when the button is beeing hovered over with a mouse and change back when the mouse isnt on the button anymore. Is there a way to do this?  I am a new webdeveloper and am still looking at/learning JavaScript.

Is there a way to select a parent element based on the class of a child element in the class?  The example that is relevant to me relating to HTML output by a nice menu plugin for .  The output renders like this:

           Active Page

             Some Other Page

     My question is whether or not it is possible to apply a style to the list item that contains the anchor with the active class on it.  Obviously, I'd prefer that the list item be marked as active, but I don't have control of the code that gets produced.  I could perform this sort of thing using javascript (JQuery springs to mind), but I was wondering if there is a way to do this using CSS selectors.  Just to be clear, I want to apply a style to the list item, not the anchor.


I would like to write files that when opened open a terminal window and perform a series of commands, the reason for this is I want to eventually schedule them to run hourly, daily etc, and some of which I want to eventually run as background processes (data mining) continually.  I'm really sorry in advance if I am difficult to understand here, I am very amateur as far as computer science and programming is concerned, so I am just describing my objectives as best as I can without knowing the formal terminology.

I was curious how I would go about running multiple commands via shell script.  For example, just to try it out, I'd like to be able to connect a .desktop to a .sh that will run all the update codes so I don't have to type it out. I know how to execute a single command via a .sh, not multiple.  Any way?


Ferromagnetism depends on the arrangement of orbitals and spin in the valence electrons of an atom (below its Curie point). But what is so special about the orbitals of iron, nickel and cobalt, to make them the main ferromagnetic materials, and everything else more or less pale in comparison?  Please note that I am not asking "how do magnets work?". I know about domains, EM and the like, but on a strictly atomic/QM level, I would like to understand what sets these materials so greatly apart from dozens of others with seemingly similar orbital arrangements.

Manganese has five unpaired electrons, but Iron has four, then why is Iron ferromagnetic and Manganese paramagnetic? What's that property I'm missing?


I can login to minecraft fine through the launcher and play singleplayer just fine. But when I go into multiplayer it won't let me join any server. It just keeps saying "Bad Login".   I do have a paid account and this has never happened to me before. What could cause this?  I have no mods installed and the server is up to date

When I try to log into Minecraft it connects online and my skin is there in single player but when I try to go onto a server it says bad login (If I try to login on Minecraft.net it lets me)


Lets assume an ordered finite sequence of integers A = {0,1,2, ... k}. Im looking for a (seeded) function f: A -> A where the image of f seems to be ramdom, but every element is hit exactly once (bijective).  It's importatant that someone who has access to some results of f should neither be able to estimate if he's looking at direkt neighbours f(n), f(n+1) nor should he be able to guess the next result.  One idea would be to map a range(1, k) on a shuffle(range(1, k)). But this seems very low in performance (for large k) and does miss the basic idea of a generator. The first element in the sequece should be as expensive to calculate as the n-th element.  Difference to 'normal' randomgenerators  Read carefully before marking as dublicated. I'm not looking for randomly picking from a range where collisions are possible. Also I want to calculate the n-th element without calculating all n-1elements before, like I would have to using the MT or Xorshift.

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?


How do I switch between windows of the same application in GNOME in Ubuntu 18.04? For example, if you have two Nautilus windows open, Alt+Tab will go to the next application (say, browser), but not to the second window of Nautilus.

Currently if I hold ALT + TAB and then while still holding down ALT I press TAB I am able to go between applications in a little view and then when I release all the keys that application and all its windows come to the front.  And this is very useful, but I would like to know if there is a way of switching between individual windows with this keyboard shortcut in the same way rather than grouping windows with an application to switch to?  I am running Ubuntu GNOME 15.10 with GNOME 3.18.


Suppose we have a partition  $$\lambda =(\lambda_1,...,\lambda_n)=(\alpha_1,...,\alpha_r|\beta_1,...,\beta_r)$$ written in the Frobenius notation.  I am trying to prove the following relation $$\sum\limits_{i=1}^n t^i(1-t^{-\lambda_i})=\sum\limits_{j=1}^r(t^{\beta_j+1}-t^{-\alpha_j}).$$   My idea was to use similar relations for hook-length, but it seems like this is a wrong way. Any hint how to start it?

Let $\lambda$ be a partition of length $n$ and suppose its largest diagonal block, the Durfee square of $\lambda$, has size $r$. By this I mean that $\lambda = (\lambda_1,\ldots,\lambda_n)$ is a non-increasing sequence of numbers, which I depict by the following diagram  \begin{align*} &\square \cdots \square \square \quad (\lambda_1 \text{ squares })\\ &\square  \cdots \square \quad (\lambda_2 \text{ squares }) \\ &\quad\vdots \\ &\square \quad(\lambda_n \text{ squares }) \end{align*}  and the largest $i\times i$ block one can fit to the topmost left is of size $r\times r$. The conjugate partition $\lambda'$ is given by reflecting the drawing above along the diagonal. If $\alpha_i$ and $\beta_i$ denote the sequence of numbers of blocks to the right of the diagonal in the $i$th row, and below the diagonal in the $i$th column, we write $\lambda = (\alpha_1,\ldots,\alpha_r\mid \beta_1,\ldots,\beta_r)$.   For example, for the partition $(5,4,2,1,1)$ has diagram $$ \begin{align} &\blacksquare\square\square\square\square\\ &\square\blacksquare\square\square\\ &\square\square\\ &\square\\ &\square \end{align} $$  and its conjugate is $(5,3,2,2,1)$. Its diagonal has length $2$, and in Frobenius notation we have $\lambda = (4,2\mid 4,1)$.  How can one show that the numbers $\lambda_1',\lambda_2'-1,\ldots,\lambda_r'-r+1,r+1-\lambda_{r+1},\ldots,n-\lambda_n$ form a permutation of $1,\ldots,n$? If $\lambda = (\alpha\mid \beta)$ in Frobenius notation, this is equivalent to the identity $$\sum_{i=1}^n t^i (1-t^{-\lambda_i}) = \sum_{j=1}^r (t^{\beta_j+1}-t^{-\alpha_j})$$ which is Example 4 in page 11 of MacDonald's Symmetric Functions and Hall Polynomials, which he states without proof, so presumably this is easy.   Continuing with the example, we compute that the sequence for $\lambda = (5,4,2,1,1)$ is $$5,3-1,3-2,4-1,5-1=5,2,1,3,4$$ a permutation of $1,2,3,4,5$.  In $(1.7)$ MacDonald proves that if we take $m\geqslant \lambda_1$ and $n\geqslant\lambda_1'$ then the numbers $$\lambda_i+n-i,1\leqslant i\leqslant n,\quad n-1+j-\lambda_j',1\leqslant j\leqslant m$$  are a permutation of $0,\ldots,m+n-1$ by labelling the vertical and horizontal edge-lines on the diagram of $\lambda$ fitted inside the diagram of $(m^n)$, but I haven't been able to come up with a proof similar to this.


I had a chosen answer with a significant amount of upvotes and bounty awarded. Months after answering, the question disappeared and I lost the 400 rep.  I am not in this for the points, but when you get close to a certain rep threshold you get excited for that certain privilege and it pushes you to participate more. To lose 1/4 of my rep instantly has made me a little bitter to the whole experience.  Why are people able to delete questions months afterwards when there are numerous answers with many votes? Also, why should I lose the reputation for an answer that many found helpful. It was no less helpful during that period of time, and would have remained helpful had the question not been deleted.  Edit:  Thanks to Bill the Lizard's answer I see that the question was migrated to Programmer's SE.   While it's nice to know that it wasn't deleted it still leaves me with the same problem in the end. I was 100 rep from being able to edit and then it was ripped away due to (imo) over-organization. The question was on SO for months. Would be nice to just have a central rep repository rather than splitting it between a dozen similarly themed sites.

I posted a question which was closed as off-topic and it seems like it could fit on another site in the network. How can I go about moving it there?   What is migration? When can a question be migrated, and who can migrate it? When should I consider migration, and when is it inappropriate? What causes a migration to be blocked and what happens after? What causes a migration to be rejected and what happens after? Anything else I should know about migration?


I'm new to Ubuntu , while working with permissions I messed up with ~/usr directory and now I can't run sudo and pkexec both commands. Is there any other way to make ~/usr directory permission to default. I'm the root user and I tried several commands but none of them worked.   I entered into recovery mode and into root but it is saying read-only file system, can anyone give me step-by-step process to make it right. Thank you   Ubuntu was installed on server

I accidently ran  sudo chmod 755 -R /   instead of  sudo chmod 755 -R ./   I stopped it after few seconds, but now there is some problems such as  sudo: must be setuid root   How can I revert permissions back?


I've been dealing with the following series for a while now, without real progress.  $$\sum_{n=1}^ \infty n^2 \cdot \left(\frac{2}{3}\right)^n$$  After using , I know it converges to $30$, but I can't see how to calculate it by myself.  Any leads would be greatly appreciated!

I'd like to find out why  \begin{align} \sum_{n=0}^{\infty} \frac{n^2}{2^n} = 6 \end{align}  I tried to rewrite it into a geometric series  \begin{align} \sum_{n=0}^{\infty} \frac{n^2}{2^n} = \sum_{n=0}^{\infty} \Big(\frac{1}{2}\Big)^nn^2 \end{align}  But I don't know what to do with the $n^2$.


While installing Ubuntu 13.04 I selected Replace Windows 7 with Ubuntu.   Apparently by doing so I have lost all my data that is stored in local disk:D. Is there any way that I can recover my lost data?

I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions  (C:) Vista  (D:) Entertainment  (E:) Work  (F:) Sources   and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB.  I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost  I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse?   I need these data badly as I don't have a backup for them.


I am trying to center a DIV vertically and horizontally in a page:   * {   box-sizing: border-box; }  div.wrapper {       border: 1px solid red;   position: relative; }  div.window {   border: 1px solid blue;   max-width: 300px;   position: absolute;   top: 50%;   left: 50%;   transform: translate(-50%, -50%); }

     Sed blandit augue quis diam tristique fringilla. Morbi tortor leo, efficitur sit amet ultrices non, lacinia ut nunc. Donec ut odio a diam semper consequat quis in leo.

    Somehow this is not vertically centered. What am I doing wrong?

How can I horizontally center a
 within another
 using CSS?

Foo foo


As a StackExchange user on the Badges Tab I would like to see statistics on how far away a certain badge is compared to the goal. In this way it would be easyier to see how the effort progresses.     Edit:      This question is a duplicate of the question

It would be nice if for each badge to have some indication as to how close you are to earning that badge.  Any chance of this being introduced?


I ran something like:  sudo chmod -R 777 /.     In my Ubuntu 16.04 LTS it shows many errors on display, but anyway, the damage was done. Now I can't use sudo  sudo: error en /etc/sudo.conf, línea 0 mientras carga plugin 'sudoers_policy' sudo: /usr/lib/sudo/sudoers.so sólo tener permisos de escritura por el propietario sudo: error fatal, no se puede cargar los plugins   And besides of that I'm nervous about what else I have broken.  Is there a way to reestablish the right permissions of the system files?  I apologise for the English, that is not my native language.


Many modern big budget films such as ,  and even some TV shows such as  are still shot on film.  Directors such as Christopher Nolan and Quentin Tarantino have stated that they oppose digital cinematography due to the inferior image quality. Tarantino even saying that he thinks digital cinema is the  of the film industry.  What are the benefits of shooting on film? Pre-2010 it seems film may have had a technical edge, but with the advancing technology I cannot see any way in which film is still superior:  Modern digital cameras are smaller, lighter, cheaper, more flexible and offer a much higher dynamic range, frame rate and a similar or better resolution than their film counterparts. In addition, most films are edited and projected digitally at 2K or 4K which would remove any additional resolution you may gain from film. Even if a "film look" is desired it can be created in post production from digital footage and can look indistinguishable from real film.  Why do many directors and cinematographers still prefer film? I cannot find anything other than vague mentions of "better resolution" or "it just looks better".

I happen, time and again, to read and hear people – among which people working in cinema – regretting the fact that film (in the sense of actual reels of plastic strip) is nowadays very rarely used when shooting movies. Is there some ground to such nostalgia?  Of course I am not looking for opinions for or against film vs. digital media, but sourced, objective reasons. Is there anything that could be done with film but not with digital supports? Are there measurable differences in effects on viewers?


I need help to answer the folowing problem:     Let $F$ be a field, $n\ge 1$ and $G=F^n\bigoplus F^n\bigoplus Mat(n,F).$ That is an element of $G$ has the form $(v,w,X)$ where $v$ and $w$ are n-by-1 vectors and $X$ is $n$-by$-n$ matrix, all with entires in $F$.      Define an operator on $G$ by:      $$(v_1,w_1,X_1)(v_2,w_2,X_2)=(v_1+v_2,w_1+w_2,X_1+X_2+v_1w_2^t)$$      Show that $G'=\left\{(0,0,X), X\in Mat(n,F)\right\}$. Where $G'$ is the derived group of $G$ i.e $G′=\left\{[a,b],a,b∈G\right\}$   I poved the following inclusion:  we need to compute the commutator $[(v_1, w_1, X_1), (v_2, w_2, X_2)]$. Before jumping into the computation it's clearer to first write out the inverses.  We have:  $(v_1, w_1, X_1)^{-1}      = (-v_1, -w_1, -X_1 + v_1 w_1^t)$   and  $(v_2, w_2, X_2)^{-1}      = (-v_2, -w_2, - X_2 + v_2 w_2^t)$  Then  $[(v_1, w_1, X_1), (v_2, w_2, X_2)]$   $= (v_1, w_1, X_1)(v_2, w_2, X_2) (v_1, w_1, X_1)^{-1} (v_2, w_2, X_2)^{-1}$  $= (v_1, w_1, X_1)(v_2, w_2, X_2)(-v_1, -w_1,  - X_1 + v_1 w_1^t) (-v_2, -w_2, - X_2 + v_2 w_2^t)$  The $v$'s and $w$'s all cancel out nicely in the first two coordinates. The third coordinate is some $n \times n$ matrix.  We have just proved that the set of commutators is a subset of the set of all elements of the form $(0, 0, X)$.   So we have shown that   $G'\subset \{(0,0,X)\}$. Please help me to prove the other inclusion. Thanks in advance.


I have a 4k screen notebook, a Lenovo Yoga 900 to be precise.     We have a Java application that doesn't scale itself to high resolution and seems very very small to on screen.    I changed the Windows DPI settings and as a result, the text in the application are all mixed up.   You can see it in the picture below:    What else can I try to see enlarged the application?

I recently purchased a Lenovo Yoga 2 Pro, which sports a high-dpi 13" screen with a resolution of 3200x1800, running under Win8.1.  The issue I sometimes face is that some applications will not scale properly and will look tiny on screen, making them almost unusable.  I'm aware of the scaling options for Win8 and of the magnifier tool (that you can call using the  and + or - keys), but it will magnify parts of the screen only and its use is cumbersome since it is indiscriminate.  Ideally, what I would need is a utility that can automatically resize the windows of a given application or at least a selected window.  I'm sure this is an issue that will become more common as high-dpi screens become more mainstream for Windows machines.


I have a computer with Ubuntu 14.04 installed and I have a Radeon HD 4870 (RV770) video card and I want to install Ati drivers but when I download it says this:  Distro Version entered incorrectly or not supported, use --listpkg to identify valid distro versions   The latest drivers in AMD web doesn't mention my graphic card so I don't know if it works...

After upgrading to 12.10 quantal, the packaged version of fglrx no longer works. I discovered that this is because there is a separate 'legacy' fglrx driver for the HD 2k-4k series cards, but it is incompatible with the xorg server on 12.10.  This is the most current version of the driver for HD 2000 through HD 4000 series cards. You can't use the non-legacy fglrx driver, but you can use the open-source radeon driver if you prefer your WM compositing to be laggy and your YouTube videos to play like they would on a Pentium MMX series:    Usually this driver can be installed in the following way, necessary because apt-get install fglrx would pull in the non-legacy driver:  wget http://www2.ati.com/drivers/legacy/amd-driver-installer-12.6-legacy-x86.x86_64.zip unzip amd-driver-installer-* sudo sh ./amd-driver-installer-*.run --buildpkg Ubuntu/quantal sudo dpkg -i fglrx*.deb sudo aticonfig --initial -f   If you use a different version of fglrx (for example, a newer 12.9 that doesn't support those cards) then the final command will give you an error no supported hardware detected or something similar. However, everything works at this point and you will get a reasonable xorg.conf:  ... other stuff  Section "Device"         Identifier  "aticonfig-Device[0]-0"         Driver      "fglrx"         BusID       "PCI:1:5:0" EndSection  ... other stuff   At this point you're supposed to reboot and everything will be working with the fglrx driver. However, upon rebooting, you'll be treated to the following errors in Xorg.0.log when fglrx attempts to load:  (EE) Failed to load /usr/lib/xorg/modules/drivers/fglrx_drv.so: /usr/lib/xorg/modules/drivers/fglrx_drv.so: undefined symbol: noXFree86DRIExtension   Some searching around will show that this is a problem with the legacy ATI drivers not supporting xserver 1.13 or newer. () ATI has released a fixed driver for its most recent (HD 5000 series or later) cards, but not for the 'legacy' cards yet. The non-legacy ATI drivers can't be used with the old cards.  What should an Ubuntu user, using one of these HD 2000-4000 series cards, do?    Wait for an updated 'legacy' ATI driver that properly works with xserver 1.13?   Downgrade back to 12.04 Precise, which uses xserver 1.11? Try to downgrade xserver on 12.10 Quantal to 1.12, which could possibly break Unity and GNOME? Forced upgrade to HD 5000 series or later card? (Not possible with integrated graphics...) Some other 1337 action that fixes this problem painlessly?


/give @p chest 1 0 {BlockEntityTag:{Items:[{display:{Name:"SHADOW_GUARD_SWORD",Lore:["SHADOWS_JUDGMENT!"]},AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:100,Operation:0,UUIDMost:15145,UUIDLeast:331544}],ench:[{id:0,lvl:1000},{id:1,lvl:1000},{id:2,lvl:1000},{id:3,lvl:1000},{id:4,lvl:1000},{id:5,lvl:1000},{id:6,lvl:1000},{id:7,lvl:1000},{id:8,lvl:1000},{id:16,lvl:1000},{id:17,lvl:1000},{id:18,lvl:1000},{id:19,lvl:1000},{id:20,lvl:1000},{id:21,lvl:10},{id:32,lvl:1000},{id:33,lvl:1000},{id:34,lvl:10000},{id:35,lvl:100},{id:48,lvl:1000},{id:49,lvl:1000},{id:50,lvl:1000},{id:51,lvl:1000},{id:61,lvl:100},{id:62,lvl:100}],HideFlags:5,id:diamond_sword,Slot:0,Count:64},{display:{Name:"SHADOW_GUARD_SWORD",Lore:["SHADOWS_JUDGMENT!"]}   This is a smaller version of the code my goal is to have it give me a shulker box with these enchanted items.

I am making a Minecraft Mini Game adventure map, and one of the levels has a /setblock command, I am using the command in a way to spawn an item in a chest (Wooden Button) I need the wooden button to have CanPlaceOn tag so it can be placed on a log. I have tried this command: setblock 294 5 -1251 minecraft:chest 0 replace {Items:[{Count:1,Slot:0,id:minecraft:wooden_button,CanPlaceOn:[log]}]}`


Well known Kepler laws state that earth revolve around sun in an elliptical path with sun at one of the focii.  My question is rather simple. Why so?   I mean for an equilibrium of earth that is it is not accelerated towards or away from sun its gravitational force must be balanced by centrifugal force (pseudo force as frame corresponding to earth)   But following an elliptical path it distance from sun won't be same and hence the gravitational force and hence how is this?   I suspect may be it is due to presence of other celestial bodies but that seems too vague and escaping from the truth   Also maximum of derivations in gravitation are done by assuming circular path of earth around sun. (atleast at my level)   Please give me the real physics behind it?

I know that planets speed up when getting closer to the sun, but they speed up because they have an elliptical orbit, and they have an elliptical orbit because they speed up. Why did they have an elliptical orbit in the first place?