Orientation change causes selected Tags to disappear

I observed this bug in version 1.0.73 of the android app. These are the steps to follow in order to replicate it.     From the navigation drawer select any site.   Once you see the set of newest question, from the action bar list select the    tags which will show you a list of tags for those sites. From that select any one tag .     We can see a list of filtered question based on the tag, now change the orientation of the phone. At this moment the selected tag disappears and so does the filtered set of questions.


Can a question "go hot" multiple times within three seconds?

I answered  and noticed in  23 distinct entries  of Became Hot Network Question. The first 20 timestamps show 2020-06-20 01:55:14Z and the last three show 2020-06-20 01:55:17Z.   Is this a bug?


Doesn't Hogwarts seriously put the world in jeopardy?

Forty kids enter Hogwarts every year. That’s forty potentially powerful wizards from potentially broken homes, abusive families…orphanages. We all know about Voldemort, and I think that’s reason enough to at least vet potential wizards before arming them, but there’s no vetting at all. Malfoy got in no problem, for example.   The most dangerous are the muggle-borns. Those who know about nuclear weapons, tanks, muggle technology.   It would just take one, one unstable muggle-born to spend a few years in Hogwarts and that would be it. S/he could brew up some Polyjuice potion that would disguise them as an MP, Apparate into Number Ten, use an invisible ropes charm on the Prime Minister, force him to drink a bit of Truth Serum to reveal nuclear codes and…done. The world is aflame.  Wizards could not withstand someone with detailed magic and muggle knowledge. No wizarding community could withstand nuclear bombardment. Even if wizarding structures didn’t sustain a scratch, the surrounding land would be irradiated, the plants killed, the rain poisoned. No food, no infrastructure, they would be exhausted from constant spells to keep the radiation sickness away, completely powerless against a followup attack by foot-soldiers (either magical or muggle).  There is no psyche evaluation at all in Hogwarts. Well, maybe the sorting hat which does literally nothing but put the potentially evil people with other potentially evil people for seven years.   It’s insane. How did anyone think it was a good idea? You could say the same about muggle schools I suppose, but let’s be honest, someone with magic could make a killing in the muggle world. Felix Felicis and the stock market. Time turners. Time and time again we see muggle technology used as a base for forward  thinking wizards to make something with: cameras, printing presses, steam engines, motor cycles, glasses, plumbing, radio, record-players, microphones.   What about Avada Kedavra and an M16?  Muggles are a threat to wizards, hence why the wizards live in hiding, but the muggle world augmented with magic would crush the wizarding world.  By an obscene amount of luck, everyone in Hogwarts, even the properly evil ones, even the properly mischievous ones, seem to keep it all a secret.   It would just take one person to, at best, expose the wizarding world. At worst, destroy the entire world in an afternoon.


I am building a website which on the contact page will have a section to find your local sales representive. I intend to do this by having a content type of sales rep with a location field and creating a view from this content on the contact page.  As an improvement to this i would like it to automatically (if the user allows it) to take the geo location of the user and automatically filter the view by this showing the users nearest sales rep.  Are there any modules in existence which i can use to achieve this? Or am I likely to have to build a custom module?


Calculation of Score when earning a specific tag badge

Take for example the , where the description is      Earned at least 100 total score for at least 20 answers in the linq   tag   How is total score calculated? is it based on the sum of upvotes and downvotes, and not the actual points you received based on questions/answers tagged with these badges?


What regex can match sequences of the same character?

A friend asked me this and I was stumped: Is there a way to craft a regular expression that matches a sequence of the same character? E.g.,  match on 'aaa', 'bbb', but not 'abc'?  m|\w{2,3}|    Wouldn't do the trick as it would match 'abc'.  m|a{2,3}|    Wouldn't do the trick as it wouldn't match 'bbb', 'ccc', etc.


Postgres dropdb and createdb commands in sudoers as a different user

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


Determining the rank of an $n \times n$ matrix

If I have the following $n \times n$ matrix   $$\begin{bmatrix}      2 &      3 & \cdots &    n+1\\      3 &      4 & \cdots &    n+2\\ \vdots & \vdots & \ddots & \vdots\\ n+1    & n+2    & \cdots &     2n\\ \end{bmatrix}$$  how can I determine its rank?  I know that I need to check for the maximum number of linearly independent columns. However, I’m having a hard time determining the linearly independent columns. Thanks for those who’ll help.


How to calculate a var of the sum of two coefficients in linear regression

Essentially after performing regression on three variables, $$ y = a_0 + a_1 \cdot x_1 + a_2 \cdot x_2 + a_3 \cdot x_3 $$ I want to find variance for $a_1+a_2$ to get CI. Logically, I think I can do $$\text{Var}(a_1+a_2)=\text{Var}(a_1)+\text{Var}(a_2)+\text{Cov}(a_1,a_2)$$ and calculate covariance of two normals because from the model results I'd know mean and variance of $a_1$ and $a_2$, and they are asymptotically normally distributed.  I'm stuck at how to get covariance of two normal RV. Any guidance? Is there a simple code to calculate this in python or R?


How can I install and use gcc 6 on xenial?

I wish to test existing software with gcc 6, to ensure that it will work when the transition takes place.   How can I install gcc 6?  Is there a ppa available?  Can I just do a "CC=gcc-6 make" ?   Thanks


Unless I keep alt keyboard button pressed, the MacBook gets shutdown! After a few seconds of releasing the alt button, a message is popped up saying:     Are you sure you want to shut down your computer now?      Reopen windows when logging back in      Restart | Sleep | Cancel | Shut Down   This is a MacBook from 2009. Water poured on the top-right section of the keyboard. Afterwards, it gets shutdown unless the alt keyboard button is pressed continuously! Did anybody run into this issue before?    Also, when booting, the alt button needs to pressed. Otherwise, the MacBook gets shutdown while booting ...  Update  A colleague cracked open the MacBook, he did nothing, and put it together. Afterwards, surprisingly, the MacBook was working good for a couple of days! But got crazy again.  The behavior looks random. Sometimes it doesn't get shutdown for a couple of days and sometimes it shuts down frequently.


How does the peptidoglycan layer of a bacterial cell wall help prevent osmotic lysis?

I recently read that penicillin works by damaging the peptidoglycan layers of a bacterial cell wall causing osmotic lysis, which is when the bacteria cell bursts due to osmotic pressure.   I just would like to know how peptidoglycan prevents this. Thanks for any responses!


Classes to Protect from SQL/XXS attacks?

I'm building a MVC application for managing a creative portfolio (Going to put it on git hub). I need something to secure the DB connections, basically I have one class to manage ALL DB transactions.   I need to either create a class or find a class that can protect all SQL queries from XXS or SQL Attacks. What suggestions do you have for securing PHP Database connections?


How do I find upper bound for nth prime number?

I'm writing a program that finds the nth prime number, so if n was 10, the answer would be 29. I need to find an upper bound to search through though so if n was 10, the upper bound would be 30 (or any number before the next prime number which is 31).  Any ideas?


I am using SSH to another terminal with very limited disk space. upon typing ls I see a file called #korpus.txt#. I suspect this file is an emacs buffer, but upon running emacs and trying to kill it with C-x k bufname RET, it isn't found. How can I remove #korpus.txt#?


Get a array of class files inside a package in Java

I need a Class[] of all the class files contained in one of my source packages in Java.  I could n't find a standard method to do it in one shot. If someone can write a function to fetch that list would be really helpful.  Class[] myClasses = yourfunction();  // Return a list of class inside a source package in the currently working project in java


She acted as though she was subtle. She never was subtle. Or: She was never subtle

She acted as though she was subtle. Then: 1 She never was subtle 2 She was never subtle The first one sounds right to me although the second one seems to be the grammatically correct one? Or are both grammatically correct?


Why didn't Dr. Strange create a portal to cut off Thanos' hand?

There are so many "Why didn't Dr. Strange" questions related to the Thanos fight.   But I wondered, when they fought Thanos and tried to pull off the gauntlet, why didn't Strange just create and close a portal around Thanos' arm? Like in the city fight where that dude's arm was cut?  I guess it all has a reason because Strange saw many different outcomes but still, I really wonder.  PS: i am not asking why Strange didnt use the ring to port back to Earth. I mean specifically why he didnt cut Thanos' arm off.


Email sent through code going to SPAM folder

I am sending an email to User after who subscribe to my website newsletter. But sometimes the subscription email going to SPAM folder. I am sharing the link of spam mail test result --  Please check the result(analysis) of SPAM mail tester given above & tell me why my mails are going to SPAM  Here is my configuration to send mail through code-->      $config = Array(  'protocol' => 'smtp',  'smtp_host' => 'mail.holaa.in',  'smtp_port' => 25,  'smtp_user' => 'noreply@holaa.in',  'smtp_pass' => 'XXXXXXXXX',  'mailtype' => 'html',  'charset' => 'iso-8859-1'  );  $this->load->library('email', $config);  $this->email->set_newline("\r\n");  $this->email->from('noreply@holaa.in');  $this->email->to($receiver);  $this->email->subject($subject);  $this->email->message($message);  $ans = $this->email->send();   Thanks in advance


Why does this question have a blue highlight?

Whenever I scroll through 'newest questions' some of the questions highlighted in blue, for example:    Why is this?


How to get integer values from Enum in c#

I have an Enum public enum MyEnum     {         value1= 1,         value2= 2,         value3= 3,         value4= 4     }  How do I get the integer values , if I give the string as input , say input--> value2 , then , output-->2 Thanks


How do I create silhouettes in a studio environment?

The trick to creating silhouettes in the field, as far as I know, is to use spot-metering and to expose for the background. However, this is a bit more difficult in a studio environment. What is the key to creating "artificial" silhouettes?  One solution that I'm considering is placing a bright flash directly behind the subject - would that work?


What is $\lim _{ x\rightarrow 0 } \frac { f(x) -x }{ x^2 }$?

Given that  $$f(x)=8x-f(3x)-\sin^2(2x),$$   find   $$\lim _{ x\rightarrow 0 } \frac { f\left( x \right) -x }{ x^2 }$$


How to create an alias for two Git commands that use a parameter?

I regularly have to delete a local and remote  branch. Therefore, I run the following commands:  $ git branch -d feature-branch $ git push --delete origin feature-branch   Since I mostly execute these two commands in a row, I would like to create an alias for them. Here is my approach:  alias gpdo='git branch -d $1 && git push --delete origin $1   However, this fails with the following error:     fatal: branch name required


Allow moderators to see delete/undelete activity on users' profiles

We get auto flags for 'possible vandalism' related to deletes, and these can be helpful at times in finding 'rage quit' users, or other potential problems.  But often, I would like to know if there is a prior pattern with the user doing this. While we can see posts of theirs which have been flagged, and perhaps find previous auto flags this way, it would be nice to see an overall view of their self-deletions and undeletions; mostly just to identify patterns.  Such a feature would be nice if it was activity centered, rather than post-centered. That is; each delete/undelete action should be shown. So we could easily see, for example, if someone went back-and-forth on a single post.  The "activity" tab in the profile would be a logical place to show these events.  I think this would be best to be limited to instant self-deletions, not deletion votes.


I want to see if I am understanding the proof of the replacement theorem correctly.   Let $V$ be a vector space that is spanned by a set $G$ containing $n$ vectors.  Let $L \subseteq V$ be a linearly independent subset containing $m$ vectors.  Then $m\leq n$ and there exists a subset H of G containing exactly $n-m$ vectors s.t. $L \cup H$ generates $V$.   The proof in the book says to start with $m=0$. In that case $L=\varnothing$, the empty set.        Let's assume this theorem is true for some integer $m \geq 0$.   Let $L = \{v_j\}_{j=1}^{m+1}$ and define it as a linearly independent subset of $V$ consisting of $m+1$ vectors.  Since any subset of a linearly independent set is linearly independent as well ($S_1 \subseteq S_2 \subseteq V$), then $\{v_j\}_{j=1}^m$ is linearly independent also.   It then says to use the induction hypothesis to say that $m \geq n$. Well, ok, but that seems sort of pulled out of nowhere to me. The next step is to say that there is therefore another subset, $\{u_k\}_{k=1}^{n-m}$ of G such that $\{v_j\}_{j=1}^m \cup \{u_k\}_{k=1}^{n-m}$ spans $V$.   That being the case there are scalars $(a_j)_{j=1}^m$ and $(b_k)_{k=1}^{n-m}$ which you can multiply by the vectors $v_j$ and $u_k$. You can then add the two sets of vectors, yielding $$\sum_{j=1}^m a_j v_j + \sum_{k=1}^{n-m} b_k u_k = v_{m+1}$$  At this point I am not sure I understand things. Because we are assuming $n-m>0$ -- otherwise $v_{m+1}$ is linearly dependent. But then it says not only is $n>m $ but $n>m+1$, and that is where I am losing the plot to get to the next step.


Unable to add restricted profile on Xperia Z2 tablet

I would like to add a . I'm on an Xperia Z2 tablet (so not on a phone, where you can't use restricted profiles) running Android 5.0.2 and I'm the "Owner".  When I go to Settings > Users there is no option Add user or profile, only Add user. When I tap Add user no Restricted profile option is shown:    Also when I tap OK no options regarding restricted profiles are offered.  According to this , it should be possible on the Z2.  I tried adding a PIN screen lock for the Owner account. That did change the information in the alert shown when adding a new user, but that didn't show the restricted profile option.


What is a sensible prime for hashcode calculation?

Eclipse 3.5 has a very nice feature to generate Java hashCode() functions. It would generate for example (slightly shortened:)  class HashTest {     int i;     int j;             public int hashCode() {         final int prime = 31;         int result = prime + i;         result = prime * result + j;         return result;     } }   (If you have more attributes in the class, result = prime * result + attribute.hashCode(); is repeated for each additional attribute. For ints .hashCode() can be omitted.)  This seems fine but for the choice 31 for the prime. It is probably taken from the , which was used for performance reasons that are long gone after the introduction of hardware multipliers. Here you have many hashcode collisions for small values of i and j: for example (0,0) and (-1,31) have the same value. I think that is a Bad Thing(TM), since small values occur often. For String.hashCode you'll also find many short strings with the same hashcode, for instance "Ca" and "DB". If you take a large prime, this problem disappears if you choose the prime right.  So my question: what is a good prime to choose? What criteria do you apply to find it?   This is meant as a general question - so I do not want to give a range for i and j. But I suppose in most applications relatively small values occur more often than large values. (If you have large values the choice of the prime is probably unimportant.) It might not make much of a difference, but a better choice is an easy and obvious way to improve this - so why not do it? Commons lang  also suggests curiously small values.  (Clarification: this is not a duplicate of  since my question is not concerned with the history of the 31 in the JDK, but on what would be a better value in new code using the same basic template. None of the answers there try to answer that.)


I took a walk in the park and my old account fell out of my pocket. Can someone help me finding it or creating a new one? I do not want to miss my questions and answers.


Robots denied by domain is still listed in search results

So, on all of our sites that are not search facing we've applied a robots.txt file (per , or any other similar question).  However, if search terms are specific enough, the domain itself can be found via results. An example of this can be found . As you can see from the link, the domain itself can be found (content is not cached, but domain is listed). Additionally, performing a search with site:hyundaidigitalmarketing.com should 3 results. Checking backlinks provides a few as well, but I obviously cannot prevent them (linking is allowed in context) or control how these are handled (can't tell the host to add nofollow, noindex).  Now, I know this is a severe edge case, however my companies clients are doing just this. In fact, our domains are pretty good, so even seemingly arbitrary searches are turning up relevant results. Now, I have to write up a report on how/why this is happening.  So, I turn to the wonderful Stack Exchange network to help me either understand what I am missing or understand what is happening. Links to industry articles are extremely helpful but, anything you can give is obviously greatful. I do intend to offer bounties the best I can to make this an answer to turn to in the future.  Edit: I've opened a bounty on this question in hopes of getting some more responses on it. I've also provided the results of my own research below.


Let $X$ and $Y$ be independent and identically distributed.    Show that if $X$ and $Y$ are continous, then $P(X<Y) = 1/2$ Give an example of two IID RVs $X$ and $Y$ such that $P(X<Y)\neq 1/2$   I can't make sense of ncmathsadist's answer. Can somebody clarify?


How to hook up an Epson XP-430 printer to an Ubuntu 14.04 system?

My son-in-law installed an Ubuntu 14.04 system on my computer - I don't know much about it myself.  I bought an Epson XP-430 printer a few days ago and cannot install the required drivers for the printer/scanner to work.  How can I hook up the printer and scanner to the computer so that I can printer and scan to my computer?


I want to discuss my technical and coding related problems with users on stackoverflow. How can I chat with individual user to discuss my problem?


How can I get my usual interface when opening projects created by other people?

I've bougth cup models from internet.   In the ZIP I get the blend file and pressing F12 I can render the project (Do you call it project?)  But I don't see anymore the "Layout" tab, that is what I use the most.   Why and how can I go back to my usual interface?    Like in the Opening Layout:    UPDATE 1  I could open the file with the default layout, however I'm not seeing the objects in there:    UPDATE 2  How to open Collection 1? It's grayed out.


I'm making a simple timer that has the ability to terminate the countdown when given a certain input.  I tried adding getch();, and scanf(); but it would just wait for my input. I want my loop to run without me having to input to keep it running. I want that when I press the "x" key, the loop will terminate and perform another function, in this case, the abortLaunch(); function.  Here is my sample program:  void main() {     int i;     int time = 5;     char abort;     printf("Press [x] to abort operation");     for(i = -1;i < time; time--)     {     printf("Launching in %d...", time);     abort = getch();     if(abort == 'x' || abort == 'X')     {         abortLaunch();     }     Sleep(1000);     system("cls");         if(time == 0)         {             printf("BLAST OFF BABYYYY!");         }     } }  void abortLaunch() {     printf("OPERATION HAS BEEN aB0rT3d, NO MORE FUNDS BOI :(");     /*         SOME OTHER COMMANDS IN HERE                                     */ }


How skewed does a distribution have to be before we use the median as the best measure of central tendency?

The question is in the title. I'm mostly asking because I'm wondering whether this is subjective or not (this is regarding a sample like avg engineer salaries by state).  I know it's more appropriate to use the mean if the distribution is symmetric, or normal. But wouldn't all real life distributions be skewed, technically? What's a good rule of thumb here? When should I say, skewness value of $\pm \, x$ so the median is more representative of the average salary?


Is there an intuitive explanation of $n$-dimensional sphere's surface and volume being maximal in dimensions 5 and 6?

I was wondering if there is an intuitive explanation why the surface of an $n$-dimensional sphere is maximal at $n=6$ and for the volume $n=5$. I know that for the surface you have: $$A_n=\frac{2\pi^\frac{(n+1)}{2}}{\Gamma(\frac{n+1}{2})}$$  And for the volume $$V_n=\frac{A_{n-1}}{n}$$      Finally you get $$A_n(R)=A_nR^n$$ $$V_n(R)=V_nR^n$$ Where $R$ is the radius of the ball. Plugging in the dimensions it's easy to show that $V_n$ is max for $n=5$ and the surface for $n=6$ Is there an intuitive way of explaining this?


Need help in showing that if (a,b) = 1, then (n,ab) = (n,a)(n,b).

This is what I have been able to come up with so far. I know that using Bezout's identity the g.c.d can be written into the sum of the products of two numbers (with a and b included). I also know that every number has a unique prime factorization, and to find the g.c.d you take the minimum value of the exponent for each prime number. Additionally, I recognized that for the g.c.d of a and b to be 1, that means their prime factorization must include exponents raised to the zero power. However, I am lost as to how to put all of this together to complete the proof. CORRECTION For the last two lines it is supposed to be: min(v_i, r_i + s_i) = min(v_i, r_i) + min(v_i, s_i) and disregard the last line.


According to this blog article dated Sept 2011:    While we will always continue to produce Stack Exchange creative commons data dumps, we are moving to a quarterly schedule for all future dumps.  Clearbits, the recommended site to get the data dump torrents at , lists the most recent dump as December 2011. Is the plan still to provide quarterly data dumps? If so, when will they resume?


can someone explain to me how i got these weird shadows and how to get rid of them?    And another problem, when I use a normal map in the princepled shader it's not working and affecting the color, why is that?    Thanks!   i already tried to recalculate the normals it didnt change anything


When walking yesterday I stumbled upon one of these humorous1 signs "my dog runs from the gate to the door in 4 seconds, if you are slower stay where you are". This made me think about the general problem  The unfortunate guest starts running at the orange position with speed $v_\textrm{h}$, as does the dog. The dog always runs directly towards the guest with a speed $v_\textrm{d}$. The blue color shows the situation after some time. $v_\textrm{h}$ and $v_\textrm{d}$ are constant. I am curious about the shape of the dog's path. Being nowadays better with computer than with math, I will simulate this experiment2 but would like to understand whether there is hope for a formal mathematical solution - and how to get there (even pointing to the general direction would be wonderful). It would be a great test before diving into the second footnote. Now that I think about it, it should be similar to the path of a swimmer in a river who swims directly towards the bank  1 The level of humour depends on the size of the dog. 2 I will also simulate the problem where $v$ is a function of time. I started to think about some realistic functions such as $v_\textrm{h}(t) = \alpha te^{-\beta t}$ (you start fast, then get tired) or a velocity that is a function of the distance between the protagonists. I believe that this is too complicated for a formal solution.


I have a PDF file with 120 pages. How can I extract only pages 20-30 and save it as another PDF file? I am using free version of Foxit Reader. It doesn't have this facility. Any solution?


The tutorial says the intersection point for L1 and L2 regularization gives the minimum loss - But why the intersection gives the minimum loss? I cannot interpret the graph clearly.


Access personal views in a list with PowerShell

I am trying to first access and then edit Personal Views for a SharePoint List using PowerShell. However only the public views are returned. In the example below the list called List1 has two views - 1 public and 1 personal created by a regular user account (contoso\user1).  I run the script below via an admin account (contoso\spadmin) -  $url= "http://portal.contoso.com/sites/TEST" $web = Get-SPWeb $url $list = $web.Lists["List1"] Write-Output "Count = $($list.views.count)" $list.views| % {Write-Output "Title = $($_.title)"}   Result -  Count = 1 Title = All Items   I tried the following as well but that did not return the personal views.   [Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges( {      $web = Get-SPWeb $url     $list = $web.Lists["List1"]     Write-Host "Count = $($list.views.count)"     $list.views| % {Write-Host "Title = $($_.title)"} } )    How do I access the personal views for a list with PowerShell?


Unable to merge unallocated space on the same drive

I'm trying to merge to old partitions into one which will result 2.75TB. I tried using the default disk utility in Ubuntu 20.04 but can't seem to make one partition. I also tried Gparted but same result.


What was the most prestigious tournament in season 1?

Since I got into League of Legends in Season 2, I'm wondering what was the most important tournament in season 1, and who won it?


What's the maximum speed that is still considered walking?

What's the fastest speed I can move until Pokemon Go no longer considers me to be walking?


Why can't I store derived class object in an ARRAY of base class and then dynamic_cast it? C++

This is my first question in StackOverflow, I normally am able to find the answers to my questions online but this particular one I can't make work. So, I'm making a text-based game in c++ and I'm using inheritance and polymorphism in it. I want to store Equipment (derived) in an inventory of Items(base) and then use dynamic_cast to get the properties of the derived class. I made a small example that represents what I'm trying to do and what can be done. (Notice that I know that it is caused by object-slicing I just want to understand why it just doesn't work with arrays but works with the rest). #include <iostream>  using namespace std;  class Equipment {     public:     int i = 20;     string s = "nothing here";     Equipment(){};     virtual ~Equipment(){}; };  class Weapon: public Equipment {     public:     int V = 900;     Weapon(){}; };  int main2(Equipment* e) {     Weapon& weapon3 = dynamic_cast<Weapon&>(*e);     cout << weapon3.V << endl;     return 0; }  int setEquipment(Equipment* e) {     Equipment &equipment = *e;      Weapon& weapon2 = dynamic_cast<Weapon&>(*e);      Equipment* inventory;     inventory = new Equipment[3];     inventory[0] = *e;      Equipment &equipment2 = inventory[0];      Equipment inventory2[3];     inventory2[0] = equipment;      Equipment *inventory3[3];     inventory3[0] = &equipment;     inventory3[1] = e;      cout << weapon2.V << endl;     cout << "METHOD A: "; // WORKS FINE     main2(&equipment);     // cout << "METHOD B: "; // DOESN'T WORK     // main2(&equipment2);     // cout << "METHOD C: "; // DOESN'T WORK     // main2(&inventory[0]);     // cout << "METHOD D: "; // DOESN'T WORK     // main2(&inventory2[0]);     cout << "METHOD E: "; // IT ALSO WORKS!!!!!!     main2(inventory3[1]);  }  int main() {     Weapon weapon1;     setEquipment(&weapon1); }  I wanted to implement something like METHOD C in my code. I tried to implement METHOD E in my actual code but I'm getting a lot of bad_alloc errors. (All the methods that don't work on the example gives me a std::bad_cast error).


Android Studio Headset control button Click Events Error

I'm getting an error message in my Android application when I call the actionPlaying button in the onPlay method. Here is my code: @Override public void onReceive(Context context, Intent intent) {     if(event.getAction() != KeyEvent.ACTION_DOWN) return;      switch (event.getKeyCode())     {         case KeyEvent.KEYCODE_HEADSETHOOK:         case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:             actionPlaying.playandpause();             Toast.makeText(context,"Play",Toast.LENGTH_SHORT).show();             break;         case KeyEvent.KEYCODE_MEDIA_NEXT:             break;         case  KeyEvent.KEYCODE_MEDIA_PREVIOUS:             break;     } }  ...  MediaSession mediaSession = new MediaSession(context,"tag"); mediaSession.setFlags(MediaSession.FLAG_HANDLES_MEDIA_BUTTONS | MediaSession.FLAG_HANDLES_TRANSPORT_CONTROLS); mediaSession.setCallback(callback);  PlaybackState state1 = new PlaybackState.Builder()         .setActions(                 PlaybackState.ACTION_PLAY | PlaybackState.ACTION_PLAY_PAUSE |                 PlaybackState.ACTION_PLAY_FROM_MEDIA_ID | PlaybackState.ACTION_PAUSE |                 PlaybackState.ACTION_SKIP_TO_NEXT | PlaybackState.ACTION_SKIP_TO_PREVIOUS)         .setState(PlaybackState.STATE_PLAYING, 0,1)         .build();      mediaSession.setPlaybackState(state1); mediaSession.setActive(true); }  MediaSession.Callback callback = new MediaSession.Callback() {     @Override     public boolean onMediaButtonEvent(@NonNull Intent mediaButtonIntent) {         return super.onMediaButtonEvent(mediaButtonIntent);     }     @Override     public void onPlay()     {         super.onPlay();         actionPlaying.playandpause();     }     @Override     public void onPause() {         super.onPause();     }     @Override     public void onSkipToNext()     {         super.onSkipToNext();         actionPlaying.clicknext();     }     @Override     public void onSkipToPrevious() {         super.onSkipToPrevious();         actionPlaying.clickback();     } };  MainActivity class     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_home);                                                IntentFilter filter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON);         MyBroadCastRecevier r = new MyBroadCastRecevier();         registerReceiver(r, filter);     }  This error message is shown when the app is closed Logcat Error Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void com.rehoboth.myapplication.ActionPlaying.playandpause()' on a null object reference     at com.rehoboth.myapplication.MyBroadCastRecevier.onReceive(MyBroadCastRecevier.java:48)     at android.app.ActivityThread.handleReceiver(ActivityThread.java:3177)     at android.app.ActivityThread.-wrap18(ActivityThread.java)      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1653)      at android.os.Handler.dispatchMessage(Handler.java:105)      at android.os.Looper.loop(Looper.java:156)      at android.app.ActivityThread.main(ActivityThread.java:6517)  I create Code this for Headset button event but it's not working.


How to debug QGIS Server WMS "Download of capabilities failed"?

Currently I am using a QGIS server with a Linux CentOS system. I am attempting the create a WMS in QGIS and upload it to my website. I have followed the instructions in the "Quantum GIS User Guide: version 1.7.0 Wroclaw". I am trying to call the newly created WMS in QGIS by "Add Layer(s) from a server" button. I am very certain I am entering the correct address but I always get this error below    Could not understand the response. The wms provider said: Download of capabilities failed: Error downloading  http://***************/cgi-bin/projects/qgismapserv.fcgi?SERVICE=WMS&REQUEST=GetCapabilities Server replied Internal Server Error


How can a square root be defined since it has two answers?

I am aware that 1/0 is undefined for two reasons:   If you would have to give an answer to this it is infinity which is not a number but a concept; The limit of 1/x for $x \to 0$ is either positive or negative infinity and since it has two limits we cannot state what its exact value is   How can we use this for square roots? It has multiple answers so why do we pick the positive one? if $x^2 = 16 \implies x = \sqrt{16} $ or $x = -\sqrt{16}$ for respectively the positive and negative solution. This implies that the square root function has a single answer and we must negate its answer to obtain the second solution. I understand this is extremely practical but it feels like 'cheating' since we know that there are 2 solutions, but in the function we simply ignore one of them. Is this correct?


I am looking for advice for an iMessage program/app that can export threads with dates/times in conversation style, preferably to PDF.   I have researched this quite a bit, but most results seem gimmicky and I am hesitant without some actually user feedback. Hopefully I can get some feedback here with which program is worthwhile at providing what I need.


I have a template presentation and in this presentation there is a line   \author{Lal Upendra Pratap Singh \\2014AN-12}   When I ran PDFLatex command in TexMaker, I got the following warning  Tokens not allowed in the PDF string(PDFDocEncoding):(hyperref) removing '\\'   Then I removed the \ and ran PDFLatex again. The warning is not gone. Also, when I try to change code, I am not seeing the results in the generated PDF. I used to run PDFLatex and then ViewPDF command.  Do I need to install some other software also? I have only installed TexMaker. I somewhere read that Miketex and Bibtex are also required. Is it  true?


Divisibility Question, a bit difficult(for me).

Taken from An Introduction to the Theory of Numbers by Niven et al:  Prove that if $m\gt n$ then $a^{2^n}+1$ is a divisor of $a^{2^m}-1$. Show that if $a,m,n$ are positive with $m\ne n$, then:  $gcd(a^{2^m}+1,a^{2^n}+1)=1$ (if $a$ is even) or $2$ (if $a$ is odd)  I just got that since $a^{2^m}-1$ is divisible by $a^{2^n}+1$ it is equal to $x(a^{2^m}+1)$ for some integer $x$. But that's all I got.   P.S.: Sorry, but I'm extremely poor in Number Theory and related problem-solving. If you could suggest some methods to get better, I'd be highly obliged. And a final request, please make the answer simple such that I understand it.  Thanks a lot!


"I have been to France." vs. "I have been in France."

Do we use "to" or "in" when talking about being to/in another location?


What is the difference between ~ (tilde) and \, (backslash comma) for a nonbreaking space?

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


How to show that they are equal? All I can come up with is using symmetric polynomials to express them, or using some substitution to simplify this identity since it is symmetric and homogeneous but they are still too complicated for one to work out during the exam. So I think there should exist some better approaches to handle this identity without too much direct computation.  In addition, this identity is supposed to be true:  $$ \frac{x^7+y^7+z^7}{7}=\frac{x^2+y^2+z^2}{2}\times\frac{x^5+y^5+z^5}{5} .$$


Product formula for $\sum_{k=0}^n\frac{(-1)^k}{2k+1}\binom{n}{k}$

How to prove the following identity: $$\sum_{k=0}^n\frac{(-1)^k}{2k+1}\binom{n}{k}=\prod_{k=1}^n\frac{2k}{2k+1}$$


Why couldn't demigods in Percy Jackson use guns?

In Percy Jackson and the Titan’s Curse, Annabeth’s dad, Dr. Chase comes in at the end of his book and uses a machine gun on his Sopwith Camel, along with some celestial bronze bullets he created in order to pulverize the monsters that are closing in on Percy and his friends.  In addition, Luke has a sword named Backbiter that is half steel half celestial bronze, so that he can kill both humans and monsters. Also, Chiron says that Demigods are vulnerable to both weapons aimed to kill mortals and weapons aimed to kill monsters.  So, at the Battle of the Labyrinth, Percy and his friends could have decided to defend camp with a bunch of machine guns loaded with celestial bronze bullets. Also, when Percy and his friend Beckendorf decide to raid Kronos’s ship the Princess Andromeda in Book Five The Last Olympian, why couldn’t they have carried guns? It would easily do away with all the sword fighting skill needed and it would just be “pow” and Luke is dead…  Clearly, there must be something wrong with my logic. But, is there any drawback in the Percy Jackson demigods using guns? What might prevent them from doing so? I'm looking specifically for practical reasons, but any reasons are fine, too :D


How to get the name of the variable calling the current method in C# pre version 6

We need to implement custom software analytics to trace the usage of the application. We have a common Command base class so the idea if to trace there something that allows us to know which command has been executed.  Consider the following sample code on a WPF Window with 1 Button:  public partial class MainWindow : Window {     private readonly Command _commandName = new Command();      public MainWindow()     {         InitializeComponent();     }      private void Button_Click(object sender, RoutedEventArgs e)     {         _commandName.Execute();     } }  public class Command {     public void Execute()     {         MessageBox.Show(this.GetCommandName());         // ....     }      private string GetCommandName()     {         string commandName = null;          MethodBase method = new StackTrace(new StackFrame(2)).GetFrame(0).GetMethod();         Type callingType = method.DeclaringType;          if (callingType != null)         {             IList<FieldInfo> variables = callingType.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.GetField | BindingFlags.Instance).Where(f => f.FieldType == typeof(Command)).ToList();              if (variables.Count == 1)             {                 commandName = variables[0].Name;             }         }          return commandName;     } }   This code will show the variable name but only if there is one Command variable on the calling type. Is there a way of getting the calling variable name directly without going thru reflection?  The output of this code is (and should be) _commandName not Button_Click.


Calculating $\int\frac{e^{iz}}{z}\, dz$ on the semi-circle given by $re^{i\theta}$ where $\theta:\,0\to\pi$

As a part of an exercise I need to calculate      $$ \lim_{r\to0}\int_{\sigma_{r}}\frac{e^{iz}}{z}\, dz $$      Where  $$ \sigma_{r}:\,[0,\pi]\to\mathbb{C} $$      $$ \sigma_{r}(t)=re^{it} $$   I know how to calculate the integral on the full circle ($|z|=r$) using Cauchy integral formula: $$2\pi ie^{iz}|_{z=0}=2\pi i$$  I have checked if  $$ (\overline{\frac{e^{iz}}{z})}=\frac{e^{iz}}{z} $$  so that the integral I want to calculate is $$\frac{1}{2}\cdot2\pi i=\pi i$$ but I got that that the equality above does not hold.  Can someone please suggest a way of calculating this integral ?


How long is it safe to store new tires before they degrade in quality?

I bought some road tires that were made for flat resistance, but within two months, the sidewalls on both got damaged to the point where I was getting repeated blowouts. I wrote to the manufacturer, and they were kind enough to send me a replacement pair.   In the meantime, I bought some new flat resistant tires to replace the busted ones.   Now I have two new pairs of flat resistant tires, but I only have a use for one at a time. How long can I store a new pair before I have to worry about the material degrading, dry rot, etc.?  (not mentioning the brands here because I don't want to bash the manufacturer that sent me the replacement.)


Is there a package for abbreviations management?

I wonder if there is a way to efficiently manage abbreviations. When I do my Ph.D. work, I usually copy the contents from one document to the other. When rewriting contents to a journal or for a presentation, it is time-consuming to keep tracking the abbreviations and see whether they are defined or consistent. Also, adding a table of abbreviation can take a long time at the end of a large project or report. As a result, I think it is good idea to develop a package to manage abbreviations with functionalities as follows   Define abbreviations with a command like \declareabbreviation{<abbreviation tag>}{<full abbreviated name>}{<text to typeset (the abbreviation itself)>} and \abbreviaton{<abbreviation tag>}. The package then uses the command \abbreviation to typeset the abbreviation according to certain rules in the options. For instance, all abbreviations should be capitals regardless of how they were declared By default, when the abbreviation is introduced in the text for the first time, the package typesets the full name of the abbreviation followed by the abbreviation itself between brackets. It could also be specified that the full name is printed in caps or, say, bold caps for first letters regardless of how the full name is declared Highlight all abbreviations in the text or change their color. This could improve the ability of the author to (at a glance) see where the abbreviation is introduced for the first time and whether that location is good or not. It also helps see how frequently it is mentioned in the text Replace all abbreviations (i.e., all instances of \abbreviations{<abbreviation tag>}) with their full name instead Add an automatically generated table to the document showing the full name of each abbreviation and even the page where it was first mentioned in the text. This would be even better if it was compatible with hyper links For common abbreviations such as PhD, it could be nice to set an option allowing the package to automatically add dots (i.e., Ph.D.) or remove them regardless of how the abbreviation name is provided when it was declared Generate warnings when an abbreviation tag is used when it has not been defined. Also, replace the text with something like ?? for undefined abbreviation tags


I am trying to find the php.ini file on Ubuntu server with the command:   sudo vim /etc/php5   However, this tells me that the file does not exist. How can I find and edit the php.ini file?


What is the document might be as "Evidence of family members remaining in your home country whilst you travel" for Standard Visitor Visa?

Applying for Standard Visitor Visa from Russia while being Russian.  In case I have children and wife, I apply the marriage certificate and children birth certificates with the rest of documents.   Is that the evidence of family members remaining in your home country whilst you travel?  If it is not please let me know what kind of document it might be? I have not managed to find an answer to that question. Thank you in advance!


Would a Stack Exchange site devoted to military-related matters be off-topic?

On Area 51, there were at least . Both were deleted.  Proposals with insufficient activity are subject to removal. Occasionally, proposals may also be removed for reasons of moderation: spam, off topic, abuse, etc.  If I may ask, were these removals due to "insufficient activity" or due to military-related matters being considered off-topic? The reason I ask this question is that I see no point in gathering a few people and attempting to start a new SE site that will never take off due to its being considered off-topic.


Most of the abstract algebra books are full of theorems and less examples . Can you please suggest me some sources where I can get the concepts with examples ?


Algorithmic error: Missing \endcsname inserted

I have the following document:  \documentclass[10pt,aps,pre,amsmath,amsfonts,amssymb,floatfix,longbibliography,superscriptaddress,notitlepage]{revtex4-1}  \usepackage{amssymb,amsmath} \usepackage{bm} \usepackage{color} \newcommand{\angstrom}{\text{\normalfont\AA}} \usepackage{hyperref} \usepackage{setspace} \usepackage{soul} \usepackage{bm} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{listings} \lstset{basicstyle=\ttfamily\footnotesize,breaklines=true} \usepackage{graphicx} \usepackage{color} \usepackage{hyperref} \usepackage{enumitem} \usepackage{algorithm} \usepackage{algpseudocode}   \begin{document} \title{Lipsum} \author{Jane Doe} \date{\today}  \begin{abstract} Lorem ipsum dolor sit amet. \end{abstract}  \maketitle  \section{Lipsum Generator} \begin{algorithm} \caption{lipsum} \label{proc:lipsum} \begin{algorithmic}[1] \Procedure{MapGen}{} \State lorem \State ipsum \State dolor \EndProcedure \end{algorithmic} \end{algorithm}  \bibliography{ref} \bibliographystyle{unsrt}  \end{document}   I am getting the following error messages during compilation:  Missing \endcsname inserted \end{algorithm} Missing number, treated as zero \end{algorithm} Extra \endcsname \end{algorithm}   The weirdest part is, it compiles and produces a correct .pdf file. What could be the problem?


Can anyone explain how we choose one sock from each of finitely many pairs without the axiom of choice?  I mean : To choose one sock from each of infinitely many pairs of socks requires the Axiom of Choice, but for shoes the Axiom is not needed.  The idea is that the two socks in a pair are identical in appearance, and so we must make an arbitrary choice if we wish to choose one of them. For shoes, we can use an explicit algorithm -- e.g., "always choose the left shoe." Why does Russell's statement mention infinitely many pairs? Well, if we only have finitely many pairs of socks, then AC is not needed -- we can choose one member of each pair using the definition of "nonempty," and we can repeat an operation finitely many times using the rules of formal logic (not discussed here).


What exactly is the difference between a derivative and a total derivative?

I am not too grounded in differentiation but today, I was posed with a supposedly easy question $w = f(x,y) = x^2 + y^2$ where $x = r\sin\theta $ and $y = r\cos\theta$ requiring the solution to $\partial w / \partial r$ and $\partial w / \partial \theta $. I simply solved the former using the trig identity $\sin^2 \theta + \cos^2 \theta = 1$, resulting to $\partial w / \partial r = 2r$.  However I was told that this solution could not be applied to this question because I should be solving for the total derivative. I could not find any good resource online to explain clearly to me the difference between a normal derivative and a total derivative and why my solution here was wrong. Is there anyone who could explain the difference to me using a practical example? Thanks!


I learned quite a bit from the question   I watched the first 3 episodes of TOS on netflix but just couldn't get into it.  Does TOS get better or is it likely that I wouldn't enjoy the rest of the series?  I enjoyed the 2009 movie quite a bit though.  I've been thinking about giving TNG a try.  However I don't have too much time to devote to these things.  I've also heard good things about The Wrath of Khan though as well.  My main questions:   Would I be confused or be missing quite a bit if I watched The Wrath of Khan first? Does it even make sense to start with The Wrath of Khan given that I didn't enjoy the first few episodes of TOS? Would I be lost if I started watching TNG after that?


Number of possible combinations involving the digits 1-9 (inclusive)

Here's the problem (per a Sudoku puzzle). Suppose I want to know the total number of combinations (order is NOT important) using ANY of the digits from 1-9 (inclusive) and WITHOUT repetition.  Furthermore the sum total of the digits and the number of digits in the combination are a Given.  The sum of the digits  must equal the stated sum For example: Sum = 10; Number of Digits = 2; Number of combinations = 4 (must be the solved value). Listing as follows: (9,1); (8,2); (7,3); and (6,4).  Two digit combo's are easy to calculate manually, which is what I did here. Now assume: Sum = 17; Num of Digits = 3; Num of Combo's = 8 (again determined manually - and I might have missed one or two!). For example:(3,6,8); (3,5,9); (4,6,7); etc. A number cannot repeat in a grouping, but can repeat in another grouping - as does the digit 3 in the first two listed groups. So, is there a way to solve for the number of possible combinations with the two Givens and stated condition as indicated?? Someone please say: "Yes, here's how". joey


What does the term "mathematical logic" mean?

What is "mathematical logic"? Is it the logic of mathematical reasoning, or is it the claim that mathematics and logic are identical?  Also, is "quantificational logic" a particular type of "mathematical logic"?  (cf. "")


How can i access the Windows Explorer context menu from a C# application?

I have an application listing in my application and I would like to allow people to right-click on an item and show the Windows Explorer context menu.  I'm assuming I would need to use the IContextMenu interface, but I'm not really sure where to start.


It seems I am not very good at using this app, or maybe I'm getting old (had to write something since SE don't allow me to just ask one a sentence question)   Can I edit my profile in android app? If so, how?


Which of the following polynomials has the greatest real root? $\textbf{(A) }   x^{19}+2018x^{11}+1   \qquad$        $\textbf{(B) }   x^{17}+2018x^{11}+1   \qquad$    $\textbf{(C) }   x^{19}+2018x^{13}+1   \qquad$   $\textbf{(D) }  x^{17}+2018x^{13}+1 \qquad$  $\textbf{(E) }   2019x+2018$   To 'find' real roots we can set each expression $A$ to $E$ equal to $0$, which makes it pretty clear that the value $x$ must be negative (for else they'd be huge positive numbers), but also pretty small, since the terms with variable $x$ in each expression (despite their coefficients) must equal $-1$, for (A) to (D). $x=-1$ or $x=0$ will not work, however, so we need $x$ to be $-1<x<0$.   For (E) we can just solve for $x$ from $2019x + 2018=0$, but that gives an $x$ pretty close to $-1$ and I need to see if there are any greater roots (i.e. closer to $0$).   However, now I'm stuck and don't know how to move on. Any help would really be appreciated!


Let $f(z)=\frac{1}{(z-1)(z-2)}$ and $g(z)=\frac{z}{(z-1)(z-2)}$. Let $\gamma$ be the circle of radius 4 centered at the origin and traveled once in the counterclockwise direction. Let $A=\{ z \in \mathbb{C}: |z|>3 \}$  1) I need to show there is no analytic function $G: A \to \mathbb{C}$ such that $G'(z)=g(z)$ for all $z$ in $A$.   2) I also need to show that there is an analytic function $F:A \to \mathbb{C}$ such that $F'(z)=f(z)$ for all $z$ in $A$.  Do I have to integrate to find such function?


Interpreting this Riemann Intergral problem

I saw this on the message board and am very interested in this problem.  The question reads as the following.  Let $f$ be continuous on interval $[0,1]$. Prove that $$\lim_{n\rightarrow\infty}\frac{1}{n}\sum_{k=1}^nf(\frac{k}{n})= \int_0^1f(x)dx$$  The person then stated this  Again any help would be greatly appreciate. I have attempted throwing the definition of continuity at it cause it states that it is continuous. I then used a uniform partition  and stated my $M_k$, $m_k$ based on the equation. I had my partition looking like this $P=({0}\frac{1}{n},\frac{2}{n},...,\frac{n}{n})$.  Now I'm having a hard time interpreting the sum on the left. Is this a collection of rational numbers on the interval $[0,1]$? I know that the rationals are dense so there are an infinite amount of points in this interval? Am I reading this correctly?


Swapped surname and given name in both passport and US multiple-entry visa

My wife's passport and US visa have her given name and surname swapped. Since it matches in both we have been travelling without hassles for years on visitor's multiple-entry 10-year visas, valid until 2029.  Now I would like to have it rectified. Should I first get a new passport and then apply for a fresh visa, or is there a different form for correction?


How to fill a rectangular hole with an even amount of vertices on either side?

I tried crating faces but it left missing edges. In the end I was left with all the right lines but there was no vertex in the center.    Here's a follow up image in case you're wondering what I mean. Notice how there's no vertex in the center.


I have Drupal version 9.1 but the  module is not available for Drupal 9.x, so I need to downgrade to the latest version of Drupal 8.x. Is it possible to do that through Composer?


What is the expected number of boxes of cereals that he should buy?

A company puts five different types of prizes into their cereal boxes, one in each box and in equal proportions. If a customer decides to collect all five prizes, what is the expected number of boxes of cereals that he or she should buy?  TRY Let $X$ be the number of boxes customer buys. For $i=1,2,3,4,5$, write $$ X_{ij} = \begin{cases} 1, & \text{ith prize is inside jth box} \\ 0, & \text{otherwise} \end{cases} $$ As I understand the problem, the number of boxes is not given so we may write $$ X = \sum_{j=1}^{\infty} \sum_{i=1}^5 X_{ij} $$ So $$ E(X) = \sum_{j \geq 1 } \sum_{i=1}^5 E(X_{ij}) $$ We know $E(X_{ij}) = P(X_{ij}=1)$ so we need to find proobability that ith  prize is inside jth box. Here is the part where I get stuck. Am I appraoching this problem the correct way?


Is it possible to download to files while in a SSH interactive?

Here I am, poking around a remote server via SSH, and I want to find out about/read/edit/whatever a file. I don't like vi or other CMI stuff, I want to read it locally.  Is there any way I can download it without exiting my interactive SSH session? (Even better, would there be any way to run local commands without exiting it?)


How to return more than one value in java?

I wrote my code and i want return multiple values in :   public int[] getResult(){ return geneticAlgorithm(cost,profit,gens,turns,cmax);   but when i use this show me eror:  Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: knapsacproject.algorithm.geneticAlgorithm([I[IIII)[I at knapsacproject.algorithm.geneticAlgorithm(Native Method) at knapsacproject.algorithm.getResult(algorithm.java:39)   my code :   package knapsacproject; public class algorithm {   public native int [] geneticAlgorithm(int[] cost, int[] profit,int cmax, int gens, int turns);  static  { try {            System.load("C:/Users/Desktop/dp/KnapSacProject/src/knapsacproject/helo.dll");   System.out.println("loaded successfully"); } catch (Exception e){ e.printStackTrace();  }  }  protected int[] cost, profit, result;  protected int gens, turns, cmax;  public algorithm(int[] cost,int[] profit, int gens ,int turns , int cmax ) { this.cost=cost; this.profit=profit; this.gens=gens; this.turns=turns;   this.cmax=cmax;      }    public int[] getResult(){  return geneticAlgorithm(cost,profit,gens,turns,cmax);   }   public static void main (String[] args ) {      }   }   So How do I return multiple value or How do I fix this?


I am relatively new to C++, so my question may have an easy answer; however, I cannot find out why my code is not working when I thought it should. Sample code is as follows.    //a.h #ifndef A #define A  template<class T> class a{ public:     a(); private:     T str; };  #include "a.cpp" #endif     //a.cpp  //#ifdef A #include "a.h" using namespace std;  template<class T> a<T>::a(){     str = 'a'; }  //#endif     //driver.cpp #include"a.h" #include <string> using namespace std;  void main(){     a<string> object; }     I have been reading information online about how to get away from errors when including template. One of it being what I am trying to achieve here: having the #include "a.cpp" in a.h. However, the samples that I have looked at still uses #include "a.h" in a.cpp, shown in the sample code. However, I am getting the function template has already been defined error. I found that using the #ifdef A and commenting out the #include "a.h" in a.cpp will help me get rid of this redefining error. But I want to understand what is happening. Shouldn't the redefinition be already taken care of by the include guard in a.h?


How does an on hold question affect reputation?

If I asked a question and someone vote for on hold, how does this affect my reputation? I have searched for quit a while. But I still cannot find a clear answer.


I have a Centos 7 VM and I want to know what consumes the 126G on the  /dev/mapper/centos-root fs. I have 2 mount points and I unmounted them to make sure there's nothing reserving space under them and mounted them again .    I've also ran sudo lsof +aL1 but there was nothing reserving GBs  Is there more efficient way to know what consumes space ?


What can I do to make my Epson Workforce 2760 scanner function in Ubuntu 18.04?

Since upgrading from Ubuntu 16.04 to 18.04 my Epson Workforce 2760 printer will not scan documents. I have tried everything I can find related to this problem with zero success. I have tried installing backends and setting permissions. There are others who are having this problem but perhaps not enough to get to a level that attracts the attention of someone who can help. There may be a bug in the 18.04 version that causes this and hopefully either a workaround or a fix can be discovered soon.   One thing I tried was this:   sudo ln -sfr /usr/lib/sane/libsane-epkowa* /usr/lib/x86_64-linux-gnu/sane   Still no success. Possibly the upgrade to Ubuntu 18.04 broke something within the Sane setup. I don't know how to "provide some more details, like the output for lsusb to prove the scanner is actually attached and recognized."  Found this:   Here is output of "sudo sane-find-scanner" :  # sane-find-scanner will now attempt to detect your scanner. If the   # result is different from what you expected, first make sure your   # scanner is powered up and properly connected to your computer.  # No SCSI scanners found. If you expected something different, make sure that   # you have loaded a kernel SCSI driver for your SCSI adapter.  could not fetch string descriptor: Pipe error could not fetch string descriptor: Pipe error found USB scanner (vendor=0x04b8 [EPSON], product=0x111c [EPSON WF-2760 Series]) at libusb:005:002   # Your USB scanner was (probably) detected. It may or may not be supported by   # SANE. Try scanimage -L and read the backend's manpage.  # Not checking for parallel port scanners.  # Most Scanners connected to the parallel port or other proprietary ports   # can't be detected by this program.


GDAL_Translate - ERROR 6: Too many command options - Batch Processing

I am trying to batch convert a set of JPEGs into ASCII text files.  Below is the code I am running (I added the "..." for privacy, it does not actually appear in the code).   gdal_translate -b 1 -of AAIGrid "C:/Users/.../Cropped Pixel Profile Images/*.jpg" "C:/Users/.../Cropped Pixel Profile Images/ASCII Converted Files/*.txt"  The message I am getting back is ERROR 6: Too many command options 'C:/Users/.../Cropped Pixel Profile Images/-10EV.jpg'.  I would just do this whole process through the "translate batch mode" GUI in QGIS, except that I need to add -b 1 to the code, which can't be done for batch processed items (maybe that's a potential bug/ feature request for future versions of Q).    I am also looking for a way to execute this within QGIS, so that I can run the same command on both OSX and Windows. (If it is platform specific, what is the same command for terminal in OSX).  Anybody have any idea why I am running into this error?


I would like to know if my laptop can handle kubuntu. If not, what are my options ?  The informations about my laptop:   Windows XP,  Version 2002  Intel(R) Core(TM)2 Duo CPU or Mobile Intel(R) 965 Express Chipset Family T5670 @ 1.80GHz 789 MHx, 0.99Gb of RAM Physical Address Extension   Thank you in advance,  Adam


What does '?' mean in this statement of C++?

What is another way to rewrite this? This function is called when the user says their number is higher in the program virtual void higher() {    //dont go above high low = (getCurrentGuess() + 1 > high) ? high : getCurrentGuess() + 1; seed = time(NULL); }


About a month ago, I installed Ubuntu 14.10 on Lenovo T430 removing the current OS Windows 7. First two - three weeks everything was working smoothly. After then, my laptop started to overheat and battery life started to drain quicker. It fell down from 2.5 hours to approximately 1 hour. Although I have been using it for more than a month I am still new to Ubuntu. Any help is appreciated.


How do I install java, ant, and red5 on Ubuntu 14.04?

How do I install java, ant, and red5 on Ubuntu 14.04. All I see is Ubuntu 12.04, which doesn't work. Redhat tutorials do not work.   UBUNTU 12.04 TUTORIALS DO NOT WORK!!!!


I am trying to fit a table in Latex. My table is so wide so I tried to change the page into landscape. However, this does not work. I have used these packages:   \usepackage{amsmath} \usepackage{pdflscape} \usepackage{rotating} \usepackage{geometry} \usepackage{graphicx} \usepackage{lscape} \usepackage{adjustbox}   the table is :  %\begin{landscape} %\begin{sidewaystable} \begin{table}[ht] \caption{My caption} \label{my-label} \centering \begin{adjustbox}{width=1\textwidth} \small \begin{tabular}{l|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} \cline{2-16} \multicolumn{1}{c|}{} & \multicolumn{3}{c|}{{\bf prediction at baseline}} & \multicolumn{3}{c|}{{\bf prediction at 3 months}} & \multicolumn{3}{c|}{{\bf prediction at 6 months}} & \multicolumn{3}{c|}{{\bf prediction at 9 months}} & \multicolumn{3}{c|}{{\bf prediction for 44 patients}} \\ \cline{2-16}  \multicolumn{1}{c|}{} & \multicolumn{3}{c|}{{\bf N = 44, n\_0 =26 n\_1 =18}} & \multicolumn{3}{c|}{{\bf N = 22, n\_0 = 13 n\_1 =9}} & \multicolumn{3}{c|}{{\bf N = 40, n\_0 =24 n\_1 =16}} & \multicolumn{3}{c|}{{\bf N = 24, n\_0 =15 n\_1 =9}} & \multicolumn{3}{c|}{{\bf N = 44, n\_0 =26 n\_1 =18}} \\ \hline \multicolumn{1}{|l|}{Models} & {\bf Sen.\%} & {\bf Spe.\%} & {\bf ER.\%} & {\bf Sen.\%} & {\bf Spe.\%} & {\bf ER.\%} & {\bf Sen.\%} & {\bf Spe.\%} & {\bf ER.\%} & {\bf Sen.\%} & {\bf Spe.\%} & {\bf ER.\%} & {\bf Sen.\%} & {\bf Spe.\%} & {\bf ER.\%} \\ \hline \multicolumn{1}{|l|}{{\bf Linear DA}} & 6 & 88 & 45 & 22 & 85 & 41 & 25 & 88 & 38 & 22 & 80 & 42 & 22 & 81 & 43 \\ \hline \multicolumn{1}{|l|}{{\bf Quadratic DA}} & 17 & 88 & 41 & 56 & 77 & 32 & 88 & 67 & 25 & 89 & 80 & 17 & 78 & 73 & 25 \\ \hline \multicolumn{1}{|l|}{{\bf Marginal Pred.}} & 22 & 88 & 39 & 22 & 92 & 36 & 75 & 92 & 15 & 78 & 93 & 13 & 67 & 92 & 18 \\ \hline \multicolumn{1}{|l|}{{\bf Condition Pred.}} & zero & 100 & 41 & 11 & 92 & 41 & 56 & 96 & 20 & 67 & 100 & 13 & 61 & 100 & 16 \\ \hline \multicolumn{1}{|l|}{{\bf Random effects Pred.}} & 17 & 100 & 34 & 22 & 92 & 36 & 38 & 92 & 30 & 44 & 93 & 25 & 44 & 92 & 27 \\ \hline \end{tabular}} \end{{adjustbox}} \end{table} %\end{sidewaystable} %\end{landscape}   Or at least the table fits well in  a page. could you please help me?


Why does aperture change when I zoom my lens even in manual mode?

I have my Nikon D7500 set to Manual Mode.  I can change the shutter speed and it maintains the setting.  When I change the aperture, the setting is not maintained and varies depending on the zoom of the lens.  How do I stop the aperture from changing when in Manual Mode?


getting error while overrideing equals method

im trying to override the equals method but keep getting the error "the method equals(point) of type point must override or implement a supertype method". im rewriting equals to determine whether two points have the same x and y values. this makes me confused because aren't i doing what the error says i am not?  @Override   public boolean equals(Point p){     if(this.getx()==p.getx()&&this.gety()==p.gety()){       return true;     }else        return false;   }   please give me your wisdom kind internet folk


A group is simple if an only if its homomorphic images are the trivial group and $G$ itself (up to isomorphism)

I need to prove the following:     Let $G$ be a group.   Then it's simple if and only if there is only surjective homomorphism $G \to G'$ for $G' = \{ e \}$ or $G' \cong G$.   Not sure how to approach this problem. So far I only have proved that if $G$ is simple and a homomorphism is surjective, then so is $G'$, but I'm not sure this is relevant.  The question is not a duplicate, since it also asks how to prove ($G$ is simple, $\phi: G \to G'$ is a surjective homomorphism) $\Rightarrow$ ($G' = \{ e \}$ or $G' \cong G$).


Special Relativity - Reference Frames S and S′ relative velocity

Consider the standard arrangement in special relativity. Let $S'$ move in the positive $x$-axis with a velocity $V$ with respect to $S$  Question: $S$ then moves with a velocity $-V$ with respect to S'. Is this an assumption or a theorem of special relativity?  If theorem - How can it be derived? If assumption - Why is it justified - what happens if you do not make this assumption?  I have asked this question before on this forum - and the answer I have got is broadly - symmetry of $S$ and $S'$  But I would like to have a deeper / more rigorous understanding of this.  So for example - Which law of physics will break if velocity of $S$ relative to $S'$ is $(-V+1)$?


I am aware of such atrocities as the  or  but I do not count these by any stretch of the imagination to count. Are there any canon or legends mentions or references to Christmas anywhere within the galaxy?  Please label answers as canon or legends.


Can a quadratic polynomial with integer coefficients have a root of unity of order 5 or greater than 6 as a zero?

We can find such polynomials with roots of unity of order $1,2,3,4,6$ as a zero as follows: $x^2-2x+1,x^2+2x+1,x^2+x+1,x^2+1,x^2-x+1$ I suspect these are all the orders I can possibly get, but have no way of proving it. Any hint or reference will be appreciated.


What is the image defect called "moiré"? What causes it, and how can we avoid or reduce it? Is it related to "false color"?


I have a series of XY coordinates. I want to use these points to draw a line in ARCMAP using arcobject10.1 using c#. I have saved this in a table inside geodatabase.Am i supposed to create a feature class for this purpose or should i use graphics. I would appreciate a hint in this direction.  I have been working all day without any success so help is needed. Please note as i mentioned  i am looking for arcobject solution not python, :)


Already defined error for functions with multiple for loops

I have following function:  self.aFunction = function(otherAll, all){     for(var i = 0; i < all.length; i++){         ...     }     for(var i = 0; i < otherAll.length; i++){         ...     }     return someResult; };   I have two for loops and they both use the variable "i". They have nothing common and used for each loops separately.  However, i take the following error from jshint:  'i' is already defined.   What is wrong with this? Why is that important to use other variables for each loops in the same function? Is it an issue i should care about in this case?


How to create a redirect page in Google Sites?   Example: Home → Page → redirect


Winter Bash 2018 took place from December 12th through January 1st. Do all Winter Bash competitions take place at this date range? Where can I look it up?


ECC - ElGamal with Montgomery or Edwards type curves (curve25519, ed25519) - possible?

I know the usual way of using getting shared secrets for encryption with ECC is DH, however, this only works with two keypairs of exactly the same kind, for example two curve25519- or two p256-keypairs.    With ElGamal, one can get a symmetric key for a recipients public key no matter which kind of key they are using themselves. This works great if users don't have the same kinds of keys, and it doesn't use the same shared secret each time. This behaviour makes development and use of an application using ECC for encryption much easier and probably even is more secure (as the shared secret is different each time), so I'd prefer using ElGamal if possible.    However, it only seems to work for Short type curves - NIST, SECG, brainpool and so on. (My javascript implementation (1) is based on SJCL's implementation, but uses "elliptic" as a library, which supports Short, Montgomery and Edwards curves, while SJCL and JSBN only know Short.)    I don't really get this, as the logic behind ElGamal is really simple:    public_key = curve_param_G * secret_key     tag = curve_param_G * random_secret     key = public_key * random_secret = curve_param_G * secret_key * random_secret     key = tag*secret_key = curve_param_G * random_secret * secret_key       The implementation of multiplication for Montgomery and Edwards curves seems to be different from the multiplication function of Short curves. Still, shouldn't it work?    Is there any change to make ElGamal work with Montgomery curves like curve25519, or Edwards type curves like ed25519, and is it just implementations fault? Or is there any reason this actually isn't possible?    Reasearching on this topic doesn't bring much detailed information(, unless you get the exact math behind Montgomery and Edwards curves, which I don't at the moment, I'm just using the elliptic library for a simple app).    Thank you for your answers :)    (1) Some pseudocode (simplified):    Get a symmetric key for a known public key (to get a symmetric key only the recipient will be able to find out knowing a public key):    ec = curveobject(curve_the_pubkey_is_on);     secret = random_secret_key();     tag = ec.g.mul(secret); // pass along with the message     key = public_key.mul(secret); // use for symmetric encryption         Get a symmetric key for a known tag (to get the symmetric key knowing the tag and own private key):    key = tag.mul(private_key); // can decrypt message with


step by step explanation of answer for discriminant function

This is a question/answer from my first assignment (intro class on pattern recognition)  I don't understand how they used the p(x given w1) and p(x given w2) in the discriminant function. For example, how did they used the mean vector [0,0] and [d, e] in g(x)?  Can someone explain the missing steps from the original function to the simplified one?  QUESTION:    ANSWER:


Steam not working with open source drivers

I have been on quite the odyssey trying to get steam to work.   I am using Ubuntu 15.04 and the linux 4.0.5 kernel. System specs:  Intel haswell quad core CPU AMD Radeon 7870 Graphics Samsung 850 EVO SSD 16GB Memory  I was able to get steam to work in 14.04LTS, but I had other problems with that version; namely flash issues in chrome. So I updated to 15.04 and my system is more stable (except for steam, there is always something...)  I have tried removing various lib files to no effect. I have removed and installed steam a few times and it doesn't appear to be working.   I tried switching to the proprietary drivers, but that causes my system to hang when it boots. In order to fix it I completely removed and purged fglrx from my system. I attempted to reinstall the proprietary drivers via command line according the ubuntu page instructions, and ran into the same error, so I am stuck with the open source drivers.  I can only assume that my card is no longer supported by the proprietary drivers, which is frustrating.   Before I removed the proprietary drivers I got the same error as these guys:   Now that I have removed the proprietary drivers I am getting missing lib errors, which I guess is not surprising:  libGL error: unable to load driver: radeonsi_dri.so libGL error: driver pointer missing libGL error: failed to load driver: radeonsi libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast  I am about ready to give up and am seriously considering buying an Nvidia card. If anybody has any suggestions on what else I can do, I would really appreciate it.


How would I vertically center child divs?

I was trying out some stuff in CSS on Codepen (jst to get more familiar with CSS), and ran into a problem where I could not vertically center the divs. This confused me, as I was able to move all of the child divs into the center.Thanks for any help!      .bg{   display: block;   margin-left: auto;   margin-right: auto;   background-color: black;   width: 800px;   height: 800px;   left: 50%; } .red {   display: block;   margin-left: auto;   margin-right: auto;   border-radius: 20px;   width: 100px;   height: 75px;   background-image: linear-gradient(to right, #f78ca0 0%, #f9748f 19%, #fd868c 60%, #fe9a8b 100%); }  .blue{   position: relative;   display: block;   margin-left: auto;   margin-right: auto;   width: 100px;   height: 50px;   background-image: linear-gradient(to top, #fbc2eb 0%, #a6c1ee 100%);;   top: 50px; }  .green{   position: relative;   display: block;   margin-left: auto;   margin-right: auto;   width: 100px;   height: 50px;   background-image: linear-gradient(to top, #0ba360 0%, #3cba92 100%);   top: 50px;  }  .stick{   position: relative;   display: block;   margin-left: auto;   margin-right: auto;   width: 30px;   height: 80px;   background-image: linear-gradient(60deg, #29323c 0%, #485563 100%);   top: 50px; }


Generating Alphanumeric random string in Java

I am using String Builder from another answer, but I can't use anything but alpha/numeric, no whitespace, punctuation, etc.  Can you explain how to limit the character set in this code?  Also, how do I insure it is ALWAYS 30 characters long?       Random generator = new Random();     StringBuilder stringBuilder = new StringBuilder();     int Length = 30;     char tempChar ;     for (int i = 0; i < Length; i++){         tempChar = (char) (generator.nextInt(96) + 32);         stringBuilder.append(tempChar);   I have looked at most of the other answers, and can't figure out a solution to this. Thanks.  Don't yell at me if this is a duplicate.  Most of the answers don't explain which part of the code controls how long the generated number is or where to adjust the character set.  I also tried stringBuilder.Replace(' ', '1'), which might have worked, but eclipse says there is no method for Replace for StringBuilder.


Vertically centering content in an element with no height, but padding

Fiddle:   Description of Issue: I'm using Bootstrap to make some columns within a section. The section has zero height (e.g. height: 0) but 56.25% bottom padding in order to maintain the aspect ratio (16:9) of the other content on the page.  The problem I'm running into is how to vertically center the content within this zero-height, padded element. I've attempted a flexbox solution to no avail. I've tried inline-blocking the content and using vertical-align, which was also a no-go. I'm running out of tricks!  Any help appreciated.  Code:  #section-1 {     background-color: #0099cc;     color: #fff;     height: 0;     padding-bottom: 56.25%; }


Sum of binomial coefficient with both the upper and lower index being multiple of 4

There is  on MSE which shows that for $n \ge 1$, $$ \sum_{k = 0}^{n}{4n \choose 4k} = {1 \over 4}\left[\left(-1\right)^{n}\, 2^{2n + 1} + 16^{n}\right] $$  I wonder if there is a more combinatorial proof for this?


Permissions to change only directory content and not itself

We have a directory and want to protect that from remove and rename, but we need to be able to rename, remove and create contents. What we can do?


Where can I find a full list of ready-to-graduate sites that don't have their own design yet?

A number of sites have grown large enough and of high enough quality to warrant a full graduation, but due to bottleneck issues haven't gotten the shiny new coat of a fully fledged site yet. Where can I find a list of sites that fit in this category?  In particular, I'm curious whether the Music Stack Exchange site is on that list, but I would be interested in seeing a full list as well.


So I have been looking how to remove a record from an array by key, but only found when the key is numberic, the problem is, I don't have a numberic key.  I build an array like this:  var obj = [];  obj.key1 = {name: "John", room: 1234}; obj.key2 = {name: "Jim", room: 1234};   Now the result of obj is   [key1: Object, key2: Object]   Which is exactly what I expect.  Now I am wondering, how would I completely remove key1 from obj? I couldn't find anything about this when the key is alphabetic.


I want to install Ubuntu 17.10 32-bit on my ASUS laptop, but when I tried to download it I got these two screens. Note that these screenshots were taken on my Windows 10 desktop. Is there any other way to install Ubuntu 17.10 32-bit?   Edit: I'm sorry everyone I should've explained myself clearer last night. The thing was, I've read the news about no 32-bit support on omgubuntu site, but it said there that you can still download it. Then I was looking for something familiar I skimmed 64-bit variants for obvious reasons and server because it was vague to me. So I checked to netboot, I saw a tree file and I was like - that's what I need, apparently I just need to download all of those files to the usb and that's it but some of them were like blanks I mean I clicked them but they weren't downloading. So I checked the installation guide - but it lead to 404 mistake so my question was how to make that netboot? Also I'm using Windows 10 on my desktop to download 17.10 to burn USB-stick that I can use to my old laptop on which it ran Windows 7 poorly so I thought of trying Ubuntu Gnome 17.10 because it's new and I wondered if it would run smoothly or not since the change of Unity. I get it that the lightest distros like Xubuntu will be more effective but I kind of dig it to the Ubuntu design. So that's it probably.   Ubuntu 17.10 (Artful Aardvark) Netboot   404 Not Found


How to auto send email when publishing a custom post type?

I'd like to have an email automatically sent out to my website's subscribers when I publish a post for a specific custom post type. I've found a few plugins that will do this but only for regular posts (or for any post type that gets published, not allowing you to specify a particular post type). Any suggestions would be greatly appreciated! Thanks.


Is there a way to make a float that only gets finalized once placement has been determined?  This is essentially an extension to  of mine by applying it to floating environments.  In the above question, I've tried creating an environment which behaves differently depending on which column it's in. This works fine, but in floating environents, \ifoddpage or \if@firstcolumn seem to reference where the code is first called, not necessarily where the float ultimately ends up being, creating inconsistencies in the behaviour.  I'm not sure if what I'm trying to do is even possible without going into the kernel, given that most likely the floating content has to be typeset before it's placement can be determined, since the dimensions need to be known.  Clarification of my Use Case:  I have a float item, which exists in 2 variants (I'll call them left-handed and right-handed). In a two-column float* scenario, the left-handed variant should be used when the float ends up on even pages, the right-handed one on odd pages. Similarly, in a one-column float scenario, the left-handed variant should be used when the float ends up in the first column of a page, the right-handed one on the second column.


replacing and adding at the end of lines with one line sed command

I have a line as follows   // Testing this   I am trying to use a sed command to replace the // with a /* (sentence or word in between) */ on each line.  so it should look something like this  /* Testing this */   The first part is easy with calling  sed 's#//#/*#'   however, with the second part, I tried this solution    I tried with -e which gave me an error of 'unterminated s command'. Then, I tried with a semi colon to make it one so it was something along the lines of   's#//#/*#;#//#s#/$#*/#'   but all that seems to do is the first part (replacing // with /*)and not the second (putting a */ at the end of the same line).  What am I not doing correctly? Any pointers would be appreciated.


I'm running this line on my shell script  sudo npm install -g yaml-cli -y 2>&1 >/dev/null   I would expect to get no output, but I still get  npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue


How can I add applications of my choice to Ubuntu Installation image?

So, I tried searching google for this but did not really get an answer to.  What I am looking for is adding applications to a Ubuntu Installation image. I know I can create a live USB with persistence and install applications on it which will persist but I don't know if, when I use that USB to install Ubuntu on the machine, these custom installed applications will also be a part of the new system.  If not, how do I go about doing this? Is it even possible?


The solvability in field of Prime Characteristic p

Let $\mathbb{F}_p$ be a field of prime characteristic $p>0$.The question is what we can say about the solvability of the equation $x^2+y^2=-1$ in $\mathbb{F}_p$ for every prime $p$. I have found out that there are $\frac{p-1}{2}$ different squares in the field $\mathbb{F}_p$. I was thinking about the circle of radius $kp-1$ has integer point for some $k$.


Hovering over featured moves the questions down a bit

When I hover over featured tab, both on the front page and in questions, the questions move down by one pixel. Here's a small screen capture demonstrating the issue:        I see it in Chrome 34 and Opera 20, but I don't see it on IE11 or Firefox 28.


How to prove this relation $\int_0^\infty \frac{\sin(ax)}{x^b}dx\,=\,\frac{1}{2}\pi\,a^{b-1}\frac{1}{\Gamma(b)\sin(\frac{b\pi}{2})}$?

How to prove the following relation if $a>0$ $$ \int_0^\infty \frac{\sin(ax)}{x^b}dx\,=\,\frac{1}{2}\pi\,a^{b-1}\frac{1}{\Gamma(b)\sin(\frac{b\pi}{2})}, \,\,\,\, 0< \operatorname{Re} b <2 $$


Can't see object through a certain camera

I can see my object fine in rendered mode.  I can even see my object fine with a particular camera in rendered mode.  However, when I switch to a particular camera, I can no longer see the object in rendered mode.  I have tried hiding/unhiding, clipping distances in camera settings and on viewport tab, the output looks good in the node editor, and I have gone through all of the solutions I could find on here.  Here is the camera that I can't see the object with:    Here is the camera that I can see the object with:   I am not too familiar with depth of field settings yet so it might have to do with that. I thought if I adjusted the aperture settings it would account for that. Here are the settings I thought you would need to see:   What're your thoughts and thanks!  Tyler


After importing a 3D scene from SweetHome3d (in .obj format), my preview window and also the F12 rendering result suddenly has very much "noise". (Please tell me if that's the correct term, I'm a blender newbie)  I never saw this when working on small scenes that I created from scratch or any tutorial files. As I added 3 point light sources to the room to rule out noise due to a too dark room, I assume it has something to do with the size of the scene? Any idea how to improve the results?  This is a screenshot, you can see the problem in the upper left window:   And this is how the final result looks like:    A screenshot of light path and samples settings:


Customize newform save button - Save and redirect to another form

What is the best way to add redirect function into the save button on a newform in SharePoint 2013.  When the user create a list item, he/she should be redirected to another form. Is it possible to get and parse the new generated item ID?  Start - Newform URL:   End - Editform URL:   Thanks


Codomain of function complete implies function space complete

Let $(X,d_X)$ and $(Y,d_Y)$ be two metric spaces.   Let $(C_b(X,Y), d_C)$ be a function space with the metric $$d_C(f,g):=\sup\limits_{x\in X} d_Y(f(x), g(x)).$$  Prove that if $(Y,d_Y)$ is complete then $(C_b(X,Y), d_C)$ is complete.  Unfortunately, I have no idea how to approach this problem. I can think of something like this:  Let $(y_k)_k\subset Y$ be a Cauchy sequence converging to $y\in Y$. Then there exists some $f\in C_b(X,Y)$ such that $f(x_k)=y_k$ for all $k\in \mathbb N$. Since $f$ is continuous, $\lim\limits_{k\to\infty} d_Y(f(x_k), y)=0$.  But how do I go from here? As far as I understand, what needs to be proved is that any Cauchy sequence of functions in $C_b(X,Y)$ converges in $C_b(X,Y)$, that is, that the limit is bounded and continuous. But how do we devise such a sequence of functions?


Are $_{\Bbb Q}\Bbb Q$ and $_{\Bbb R}\Bbb R$ artinian left modules?

My original problem is the following: given the ring $$ R:=\left\{\begin{bmatrix}q & 0\\ r & s\end{bmatrix}\;:\;q\in\Bbb Q,\;r,s,\in\Bbb R\right\} =:\begin{bmatrix}\Bbb Q & \Bbb 0\\ \Bbb R & \Bbb R\end{bmatrix} $$ I have to show that it is a left artinian ring, i.e. seen as a left module on itself, $_RR$, is artinian, i.e. the lattice of its submodules $\mathcal{L}(_RR)$, partially ordered by inclusion $\subseteq$ is an artinian poset.  So I tried to figure out how the submodules of $_RR$ are, and after some elementary computation I deduced that $$ \mathcal{L}(_RR)=\left\{\begin{bmatrix}A & 0\\ B & C\end{bmatrix}\;:\;A\;\mbox{is a $_{\Bbb Q}\Bbb Q$-submodule},A\subseteq B,\\ \;B,C\;\mbox{are $_{\Bbb R}\Bbb R$-submodules}\right\} $$ thus a descending chain of submodules of $_RR$ is of the type $$ \begin{bmatrix}A_0 & 0\\ B_0 & C_0\end{bmatrix}\ \supseteq \begin{bmatrix}A_1 & 0\\ B_1 & C_1\end{bmatrix}\ \supseteq\cdots\;\;\;\;\;\;\;\;\;(*) $$ where $\{A_i\}_{i\ge0}$ is a descending chain of $_{\Bbb Q}\Bbb Q$-submodules and $\{B_i\}_{i\ge0},\;\{C_i\}_{i\ge0}$ are descending chains of $_{\Bbb R}\Bbb R$-submodules. Thus if $_{\Bbb Q}\Bbb Q$ and $_{\Bbb R}\Bbb R$ were artinian, then $(*)$ would be stationary, thus my ring $R$ would be left artinian. Is my argument correct? How can I prove that $_{\Bbb Q}\Bbb Q$ and $_{\Bbb R}\Bbb R$ are artinian modules?


How did friction generates heat? Why rolling friction is less?

I am told that the bonds between the molecules are like strings that are are strechy so when they are broken as any other strechy material they start vibrating and this generates heat but this can't be true since those bonds are not strings so why the heat is generated by friction? If friction doesn't depend on surface area then why rolling friction is better than static friction? More area of contact will increase adhesion then why is friction not dependent on area of contact and moreover friction is a contact force?


Why does this overriding method declaration produce a compilation error?

The following code:  class Parent {     public void method(List parameter){     } }  class Child extends Parent {      public void method(List<String> parameter) {     } }   fails to compile with the following error:   Parent.java:12: error: name clash: method(List<String>) in Child and method(List) in Parent have the same erasure, yet neither overrides the other     public void method(List<String> parameter) {                 ^ 1 error   But I'm checking that JLS8 in §8.4.8.1 says:     An instance method mC declared in or inherited by class C, overrides   from C another method mA declared in class A, iff all of the following   are true:       ...      The signature of mC is a subsignature (§8.4.2) of the   signature of mA.      ...   And in §8.4.2 it says:     The signature of a method m1 is a subsignature of the signature of a method m2 if either:      ...      the signature of m1 is the same as the erasure (§4.6) of the signature of m2.   And in this case both the original and the overriding method declarations have the same erasure, so why the compilation fails?


I'm  trying to create a FPS game in blender game engine. When I do KeyBoard[Spacebar] sensor and hook it up to a simple motion of z +1 or something like that, the guys pops up really fast as if he didn't have any motion between being on the ground and being in the air. Is there a way to make a more realistic, more slow jump in BGE?


How can I define a variable, which is calculated from different variables, something like this: \newcommand \varA {3} \newcommand \varB {2} \newcommand \varC {\varB*\varA}  So that \varC will conain 6 and not 3*2. This is important, since \varC will be used as a variable in text and in a pgfplot.


In this string:  <@edi:outOperatorVoyageNbr>V4</@edi:outOperatorVoyageNbr>   I would like to match:  <@edi:   But this gets matchedinstead :  <@edi:outOperatorVoyageNbr>V4</@edi:   This is the regex I have tried already:  <@.*(:+?)   But it isnt working :(


How to prove that a union of a countably infinite set and a finite set is countably infinite with no intersection

I can get my head around this thing...  So I can find examples of this using reals and naturals, but the intersection of reals and naturals is naturals.  Is there a way to prove that the union of a countably infinite and a finite set is countably infinite with no intersection? A working example maybe? these are some of the tricky questions I stumbled upon.


Product of closed sub-groups in topological groups

We know that if $G$ is a topological group and $C \subseteq G$ is compact and $A \subseteq G$ is closed, then $AC$ , $CA$ are closed.  Is it right to say:     The product of two closed subgroups in topological groups is  closed?


I have a question concerning multiple inheritance. In my project, I want to add support for dll plugins and need an interface for that reason. In the application, I create objects like players and visual objects and hand them to the dll interface. the dll only has the ability to interpret a character pointer as ICharacter for example. My problem occurs, within the application itself:  class IGameObject {     virtual const std::string &getName(void) const = 0;     virtual void setName(const std::string &name) = 0; };  class IVob : public virtual IGameObject {     virtual const Math::Vec3 &getPosition(void) const = 0;     virtual void setPosition(const Math::Vec3 &pos) = 0;     // more pure virtual functions };  class ICharacter : public virtual IVob {     // pure virtual functions };  class GameObject : public virtual IGameObject {     GameObject();      virtual const std::string &getName(void) const override;     virtual void setName(const std::string &name) override;     // more virtual function override };  class Vob : public virtual IVob, public GameObject {     Vob(VobType type);      virtual const Math::Vec3 &getPosition(void) const override;     virtual void setPosition(const Math::Vec3 &pos) override;     // more virtual function override };  class Character : public ICharacter, public Vob {     Character();      // virtual function override };   Suppose character is of ICharacter  Now, if I want to call character->setPosition(pos); it may crash, since it comes as ICharacter pointer. If I reinterpret_cast<Character*>(character)->setPosition(pos); it, then it may work properly. It seems, as if the vtables got mixed up, but I can't see where that happens. If I reorder the inheritance it may – in some constellation – work.  Process looks like:  Creation (Character*) -> dll interface (reinterpret_cast<ICharacter*>) -> call functions in dll interface, which are 100% part of the original character  If passed back to the application:  dll interface (ICharacter*) -> application (reinterpret_cast<Character *>)  What do I miss?  Thanks in advance  Edit: In fact did I try to dynamic_cast, but that didn't help. Now it crashes in an even earlier call.


Why I can't implicitly convert Generic<T> to GenericSetted : Generic<T> ?  This driving me insane:  Declaration:  class GenericParam<T> { }  class WithGenericParamAndGeneric<G, T>     where G : GenericParam<T> { }   Implementation:  class Generic : GenericParam<string> { }  class Inherited : WithGenericParamAndGeneric<Generic, string> { }   Trouble:  void Assign() {     WithGenericParamAndGeneric<GenericParam<string>, string> b = new Inherited(); //(!) }   Error:     Cannot implicitly convert type 'Inherited' to   'WithGenericParamAndGeneric<GenericParam<string>, string>'   I do not know the reasons in which case CLR can't process this case.


Alignment of options in \question environment

I am using \question environment to make a Objective type question paper. I am using the following code:  \question Which compound would give 5-keto-2-methyl hexanal upon ozonolysis ?  \begin{oneparchoices}     \choice \begin{minipage}[c]{8em} \vspace{0pt} \chemfig{[:18]*5(--(-[:30]CH_3)=(-[:90]CH_3)--)} \end{minipage}     \choice \begin{minipage}[c]{8em} \vspace{0pt} \chemfig{[:18]*5(-(-[:-30]CH_3)-=(-[:90]CH_3)--)} \end{minipage}     \choice \begin{minipage}[c]{8em} \vspace{0pt} \chemfig{[:18]*5((-[:210]CH_3)--=(-[:90]CH_3)--)} \end{minipage}     \choice \begin{minipage}[c]{8em} \vspace{0pt} \chemfig{[:18]*5(--=(-[:90]CH_3)-(-[:150,0.9])-)} \end{minipage} \end{oneparchoices}   Issue is how do i make the options aligned into two sections like option A and B in one line and option C and D in another line(exactly below the option A & B)  Should I use oneparchoices or should i use something else to rectify the problem?  I want options to be like :     Que...   A.)                          B.)   C.)                          D.)


Which one is good for starters in QM? Principles of Quantum mechanics by Dirac or by Shankar?

I've learnt a bit of linear algebra and both single variable and multivariable calculus.


Travel on 90 days visa free travel period in Schengen or National Visa D?

I am an Australian national who will go to Austria on a student exchange program later this year. With the Australian passport, I will be able to travel in the Schengen Area visa-free for up to 90 days.  However, for the purposes of my exchange program, I am aware that I will need to obtain the Austrian National Visa D prior to my arrival in Austria, i.e. I need to sort it out in Australia, as I was told so by the Austrian Embassy. I also understand that with the Austrian National Visa D, I am allowed to travel to other Schengen countries under the Visa D.  My question is related to entering (and staying in) a Schengen country other than Austria before actually entering Austria, given the fact that I have obtained the Austrian National Visa D prior to my arrival. Say, on the day that my Austrian Visa D is valid, I fly into Italy instead of directly flying into Austria, and stay for 2 weeks in Italy, before eventually entering Austria via Italy.  Under the aforementioned circumstances, given the fact that my Austrian Visa D is valid at the time I enter Italy, will I be traveling using my Austrian Visa D or will I use up the 90 days visa-free quota that is applicable for Australian passport holders?  Thanks


Why does the guestbook chatbox not produce any network activity?

I was trying to test if I was able to automatically send a message through curl by inspecting the network activity on chrome and getting the curl command, but I found out that in spite of messages showing up in the gestbook chat there was no any network activity. Why?


How do I force ASP.NET app to use HTTPS?

My app uses HTTPS only.  I have SSL enabled from the properties window. Everything works well except, when I run the project, it runs on HTTP.  I then have to    change the URL manually to HTTPS, and then  change the port number to the SSL one.    How can I force the app to run as HTTPS?  Is there a quick fix for that (without using logic in my pages)?  I searched for this, but I haven't found a case that matches mine.  Note: I am using ASP.NET MVC4 with web API.


I have a file where character are in the type abcd abcd abcd abcd but my client wants them in the format as                                             abcd abcd abcd abcd


The value of a variable does not get updated when I pass that to a method to do so?

package com.mkyong.test;  public class Main {      public static void main(String[] args) {         String something = "";         callSomething(something);          System.out.println(something);     }      private static String callSomething(String something) {         something = "Hello Wrold !";         return something;     } }


This should be quick and easy.  I want to compare two columns and flag any mismatches in a third column. What is the easiest way?  Sample output:  1   |      A          B       C 2   |  =========  =========  === 3   |  apple      apple        4   |  banana     bananas     1 5   |  orange     orange 6   |  melon      melon 7   |  lemon      lEmon       1


If you do not want to differentiate gender of a person being referred to, for instance in public or legal notices, why is there no single word for the following word pairs?   (he,she), (him,her), {his,her)    It appears to be a big limitation in many languages...