I'm trying to write a simple program using an ArrayList that adds values, removes values, and prints values. However, I'm having an issue with removing values that the user inputs. The user should input a designated amount of values (determined by the user) and then the program should remove those values (if there are duplicates then it should just remove the first instance of the number which is fine). It's not removing the values and in some cases removes one value. I'm a bit confused as to where my code is bugged. Here is my code for remove values:  private static void removeVals() {         System.out.println("How many values would you like to remove?");         int amountToRemove = scanner.nextInt();         scanner.nextLine();         System.out.println("Enter " + amountToRemove + " values:");         for(int i = 0; i < amountToRemove; i++) {             int vals = scanner.nextInt();             if(arrayList.get(i).equals(vals)) {                 arrayList.remove(i);             }         }         System.out.println("Values removed");     }   And here is my full code:  public class Main {      private static ArrayList<Integer> arrayList = new ArrayList<Integer>();     private static Scanner scanner = new Scanner(System.in);      public static void main(String[] args) {         printOptions();          int option = scanner.nextInt();         while (option != 0) {             switch(option) {                 case 1:                     addVals();                     printOptions();                     option = scanner.nextInt();                     break;                 case 2:                     removeVals();                     printOptions();                     option = scanner.nextInt();                     break;                 case 3:                     printVals();                     printOptions();                     option = scanner.nextInt();                     break;                 case 4:                     printOptions();                     printOptions();                     option = scanner.nextInt();                     break;                 default:                     System.out.println("Not a valid option, please enter again:");                     option = scanner.nextInt();                     break;             }         }     }      private static void addVals() {         System.out.println("How many values would you like to add?");         int amountToAdd = scanner.nextInt();         scanner.nextLine();         System.out.println("Enter " + amountToAdd + " values:");         for(int i = 0; i < amountToAdd; i++) {             int vals = scanner.nextInt();             arrayList.add(vals);         }     }      private static void removeVals() {         System.out.println("How many values would you like to remove?");         int amountToRemove = scanner.nextInt();         scanner.nextLine();         System.out.println("Enter " + amountToRemove + " values:");         for(int i = 0; i < amountToRemove; i++) {             int vals = scanner.nextInt();             if(arrayList.get(i).equals(vals)) {                 arrayList.remove(i);             }         }         System.out.println("Values removed");     }      private static void printVals() {         for(int i = 0; i < arrayList.size(); i++) {             System.out.print(arrayList.get(i) + " ");         }         System.out.println();     }      private static void printOptions() {         System.out.println();         System.out.println("Program options: ");         System.out.println("1. Add values\n2. Remove values\n3. Print values\n4. Print options\n0. Exit\n");         System.out.println("\nWhat would you like to do? (enter an option):");     } }

We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection<Integer> l = new ArrayList<>();      for (int i = 0; i < 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.


I remember this mid 80's cartoon movie, I think anime.  A human child is nurtured by two fictional animal like creatures, perhaps on a spaceship. I remember one of them having funny trumpet-like organs on his sides. Maybe a phoenix is also involved in the plot?   I think the child had white complexion. The creature with trumpets appears purple in my memories. The scene that hit me was this creature making music with these many holes on his side to cheer up the baby. One of the creatures might have resembled a dinosaur...

What is the name of an anime from 80s-90s movie/series in which there is a scene, maybe the end, where a girl (who has an armor) exchanges age with a dying man in a beach, so the man transforms into a baby and the girl grows to a woman?


I have a method that can take time to complete as it uses the internet to check something and depending on the internet speeds can take a while so I have placed it into its own thread but I'm wanting to know how I can notice when this thread is complete as I then need to update the screen from the Main thread.   New thread code looks like this: Thread newThread = new Thread(){              @Override                 public void run() {  //My thread code };     newThread.start();   This is what the thread code looks like, not going to copy and paste all the code it uses as it would be pointless but I'm wanting something like when   newThread.iscomplete { //More code }   Something along those lines  Thanks

I have an object with a method named StartDownload(), that starts three threads.  How do I get a notification when each thread has finished executing?  Is there a way to know if one (or all) of the thread is finished or is still executing?


when i click on like button then it change the class and inner html  , but when i click on a unlike button then it is not working. how do i solve this problem?  <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>jquery</title>  <!-- jquery file --> <script src="jquery.js" type="text/javascript"></script>   <!-- bootstrap files  --> <script src="bootstrap/js/bootstrap.min.js"></script> <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="bootstrap/css/bootstrap-theme.min.css" type="text/css" />  <script type="text/javascript"> $(function(){     $(".like").click(function(){         $(this).html("Unlike");         $(this).attr("class","btn btn-success unlike");      })     $(".unlike").click(function(){         $(this).html("Like");         $(this).attr("class","btn btn-primary like");     })  }) </script> </head> <body>     <button class='btn btn-primary like'>LIKE</button> </body> </html>

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I guess this has different answers in different fields of science, but I'm still interested in some good arguments as to why senior scientists would bother reviewing papers. I understand that it is prestigious and fantastic when Science or Nature approaches you with a request to referee—and since their desk rejection rate is high you can trust that it is solid research—but most don't even sign their reviews and I don't expect that they actually pay you for it so that only leaves two possible motives:   Learning about what others in the field are working on Feeling like they have to because that's just how scientific publishing works   One of the reasons I ask is that if most referees are reviewing out of obedience rather than some other strong internal motivation, that would most likely reflect negatively on the quality of their reviews. They become bored, then lazy, then angry at things in the paper that don't reveal themselves to the reader immediately and in turn more likely to think positively of work that is simplistic and lacking of tedious (but important) calculations.

I do not understand what good it does them. A professor said it gives opportunity to read papers he would not read on his own. I am sure there is more to it but I do not see what they gain by participating in peer review process. It takes time, it is not paid and not even publicly acknowledged. Why do they do it?


Is there any way to measure performance on a FUSE-based mount that is mounted via long-running executable (no device is used, nor /etc/fstab entry added)?

Ok, because of a bunch of projects I'm working on I've access to dedicated Servers on a 3 hosting providers.  As an experiment and for educational purposes I decided to see if I could benchmark how good the IO is with each.  Bit of research lead me to Bonnie++   So I installed it on the server and ran this simple command  /usr/sbin/bonnie -d /tmp/foo    The 3 machines in different hosting providers are all dedicated machines, one is a VPS, other two are on some cloud platform e.g. VMWare / Xen using some kind of clustered SAN for storage   This might be a naive thing to do but here are the results I found.      HOST A      Version 1.03c       ------Sequential Output------ --Sequential Input- --Random-                         -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--     Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP     xxxxxxxxxxxxxxxx 1G 45081  88 56244  14 19167   4 20965  40 67110   6  67.2   0                         ------Sequential Create------ --------Random Create--------                         -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--                   files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP                      16 15264  28 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++     xxxxxxxx,1G,45081,88,56244,14,19167,4,20965,40,67110,6,67.2,0,16,15264,28,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++        HOST B      Version 1.03d       ------Sequential Output------ --Sequential Input- --Random-                         -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--     Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP     xxxxxxxxxxxx     4G 43070  91 64510  15 19092   0 29276  47 39169   0 448.2   0                         ------Sequential Create------ --------Random Create--------                         -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--                   files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP                      16 24799  52 +++++ +++ +++++ +++ 25443  54 +++++ +++ +++++ +++     xxxxxxx,4G,43070,91,64510,15,19092,0,29276,47,39169,0,448.2,0,16,24799,52,+++++,+++,+++++,+++,25443,54,+++++,+++,+++++,+++        HOST C      Version 1.03c       ------Sequential Output------ --Sequential Input- --Random-                         -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--     Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP     xxxxxxxxxxxxx 1536M 15598  22 85698  13 258969  20 16194  22 723655  21 +++++ +++                         ------Sequential Create------ --------Random Create--------                         -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--                   files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP                      16 14142  22 +++++ +++ 18621  22 13544  22 +++++ +++ 17363  21     xxxxxxxx,1536M,15598,22,85698,13,258969,20,16194,22,723655,21,+++++,+++,16,14142,22,+++++,+++,18621,22,13544,22,+++++,+++,17363,21   Ok, so first off what is the best way to read the figures and are there any issues with really comparing these numbers?    Is this in any way a true representation of IO Speed?  If not is there any way for me to test that?  Note: these 3 machines are using either Ubuntu or Debian  (I presume that doesn't really matter)


For my first bash script, I want to create something that's really been annoying me: when I switch folders, I want the contents of that folder to be displated automatically. I tried adding this following code to ~/.bashrc:  alias go='cd; ls'   Simple enough I thought! Not so. While typing go /etc does indeed list the contents of /etc, my working directory hasn't actually changed, I'm still in the one I was in before. How do I remedy this?

I frequently run the ls command after running the cd command. How can I create an alias (like cs) for this operation?


What is the reason that by using sudo apt install texlive-full I only get TexLive version.2015, even though the newer versions such as 2016 and 2017 are out?  I am actually trying to install Texlive 2016.

Why are packages in the official Ubuntu repositories older than the latest (upstream) versions from Debian Sid, PPAs, the authors, etc.?


Why is default ctor of struct range required at Line 16 (mentioned in code below)?  My code :  struct range {     int begInd, endInd, fr;     range(int b, int e, int f) : begInd(b), endInd(e), fr(f) {}     //range() {}   /* COMPILE SUCCESS if this line is uncommented */ };  class Solution { public:     int findShortestSubArray(vector<int>& nums) {         unordered_map<int, range> freq;         int i, minLen = INT_MAX, maxFreq;         for (i = 0; i < nums.size(); ++i) {             if (freq.find(nums[i]) == freq.end())                 freq.insert(make_pair(nums[i], range(i, i, 1)));             else {                 freq[nums[i]].endInd = i;   // Line 16                 freq[nums[i]].fr++;             }         } // more code after this...   Compile error (leetcode is not letting me copy the error, so image) :        Last 3 lines of error : Line 16: Char 29:     required from here /usr/local/include/c++/8.2.0/tuple:1668:70: error: no matching function for call to 'range::range()' second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...)  My understanding : Since no new node is being created in unordered_map at line 16, there shouldn't be any need of ctor of any type. I also checked , but didn't find anything on such case.

See also      Not a major issue, just annoying as I don't want my class to ever be instantiated without the particular arguments.  #include <map>  struct MyClass {     MyClass(int t); };  int main() {     std::map<int, MyClass> myMap;     myMap[14] = MyClass(42); }   This gives me the following g++ error:     /usr/include/c++/4.3/bits/stl_map.h:419: error: no matching function for call to ‘MyClass()’   This compiles fine if I add a default constructor; I am certain it's not caused by incorrect syntax.


Is the Ministry of Magic elected? Is the (British) magical world a democracy? What political parties exist? How are elections organized? How frequent does one can/have to vote?  In Harry Potter and the Half Blood Prince, we learn that Albus Dumbledore was offered the post of Minister for Magic three times. This seems to imply one at least doesn't have to volunteer to get elected?

Is there an election process for the Minister for Magic? Or is the Minister appointed? If he/she is appointed, by whom is he/she chosen? Aside from being, obviously, a witch or wizard, what minimum requirements (education; career track; nationality; etc) are there for being eligible for Minister for Magic? Policy-wise, are the Ministers for Magic just successive permutations of each other, or has any Minister brought a progressive and fresh point of view to the office?


When talking about quantum mechanics, a lot of people make the (pseudo-scientific?) argument that minds are required to collapse the wave function (and therefore, minds are important, we are back on the center of the universe, etc, etc)  Then, people who do study quantum mechanics say it has nothing to do with mind (wherever that is), it has to do with observation, even if mechanical observation.  OK. What I don't understand is: what if we consider the "mechanical observation device" to be part of the experiment? Just a lot of pieces of matter that are also the object of study of the experiment. Then what is happening? What is exactly causing the collapse? Doesn't that bring minds back into the game, or I am just being naive, new-age, etc?

My question is not about (pseudo) philosophical debate; it concerns mathematical operations and experimental facts.  What is an observer? What are the conditions required to be qualified of observer, both mathematically and experimentally?


I have Xubuntu 16.04 installed. I need to install an Inkscape extension which requires   pygtk and gtk pyserial librsvg2-common   When I do apt-get install pygtK or apt-get install libgtk I get the message  unable to locate package ...   Any suggestions?

Simple enough question: is there some shell command (or GUI method) I can use that, given the path to a file on my system, tells me what package put it there? Assuming the file did in fact come from a package, that is.  Bonus question: what if it's a file that isn't installed on my system? Is there, say, a website that will let me look up a file and see what packages, if any, provide it?


I created an account on StackOverflow when I had no idea of how to ask questions or what exactly needs to be asked on StackOverflow. I had just started with Python at that time. Currently I have been banned to ask questions but now I have better idea(not good yet) on which questions are for StackOverflow and which are for a forum or chat.I recently got to know about Meta, and Code Review too and here I got my first question >=0greater than or equal to 0 votes whereas on StackOverFlow I have all questions with <=0less than or equal to 0 votes. So how do I start afresh? Well, it's written to improve previous questions but those questions are too bad to be improved or some I 'm tired of improving. I can't but just delete them. What should I do? I know deleting an account or creating multiple accounts won't help but what is the option for people who are learning to code by themselves? StackOverflow doesn't have any prerequisites but I 'm learning slowly and like I said I tried on all three sites Meta, Code Review and StackoverFlow. I got my first answer +5 on Meta , +3 on CodeReview and <=0 for all StackOverFlow. Should I take it that I 'm unfit to ask on StackOverflow ?

If you are reading this, you may have been affected by one of our post quality bans. If so, it is important that you  to understand what has happened and how to regain the permissions that you lost. While trying to ask a question, one could see:  We are no longer accepting questions from this account. See  to learn more.  Likewise, for answers:  We are no longer accepting answers from this account. See  to learn more.   Why am I getting this message? Are deleted posts taken into account too? Is a question/answer ban the same as a suspension? How do I avoid getting a question ban? How long do I have to wait before I can post again? What can I do to release the ban? How can I reactivate my account? Can I simply create a new account? I'll just ask somewhere else on the SE network, and they'll migrate my question to the correct site! Will a ban on one Stack Exchange site affect my standing on other sites in the network? Does this apply to meta sites too? My account is in good standing. Why am I still blocked?


Suppose we have two objects where the distance over time decreases. Now, as I understand it, general relativity says that we can observe the Universe from the perspective of both objects an get a equal valid view, i.e. it's squally valid to say that object $A$ is in rest while object $B$ is the one moving as to say that $B$ is at rest and $A$ is moving.  Now, GR also tells us that the relativistic mass increases by the gamma factor $\gamma = \frac{1}{\sqrt{1-(\frac{v}{c})^2}}$. As the mass increases, so must the gravitational force and thus the curvature of spacetime.  But, now GR states that the curvature of spacetime is not relative, but absolute ($G_{\mu v} = R_{\mu v} -1 \frac{1}{2} g_{\mu v} R$). How is this consistent with claiming that both $A$ and $B$:s perspectives are equally valid?

Imagine there are two observers $A$ and $B$ and a particle $P$.  $A$ and $B$ are at about the same point, $P$ is some distance away.  From $A$'s point of view, $P$ has velocity $V$ and $B$ has velocity $-V$.            P---->            A      <----B   Suppose $A$ and $B$ have the same rest mass $m$ and $P$ has rest mass $m_P$.  It seems to me that $A$ will observe a gravitational force between $P$ and $A$ of $F_a$ and between $P$ and $B$ of $F_b$ with $F_a\neq F_b$ because the relativistic masses of $A$ and $B$ are different.  However, B will observe forces $F_a'$ and $F_b'$ and it seems to me that $F_a' \neq F_a$ and $F_b' \neq F_b$ because $A$ and $B$ observe different relativistic masses for everything involved.  I've tried demonstrating $F_a=F_a'$ on paper and gotten into a tangle. Intuitively, I think this equality is false and expect the difference to be resolved elsewhere.  I have a qualitative understanding of general relativity, but can't handle tensors etc. Can this be explained with high-school maths?


I read in a book that ()  160 qubits (quantum bits) could hold $2^{160} \approx1.46\times 10^{48}$ bits while the qubits were involved in computation."  How does this calculation come about? The context of the statement is that a caffine molecule would require $10^{48}$ bits to be represented by a classical computer. However a quantum computer would require 160 qubits and is thus well suited for such representation. If I look at this question on Quora, a 512 bit computer (which I suppose are real) would give a largest 155 digit number (). Isn't that big enough to represent atoms, molecules etc.?

I recently read this , which stated:     For scientists trying to design a compound that will attach itself to,   and modify, a target disease pathway, the critical first step is to   determine the electronic structure of the molecule. But modeling the   structure of a molecule of an everyday drug such as penicillin, which   has 41 atoms at ground state, requires a classical computer with some   $10^{86}$ bits—more transistors than there are atoms in the observable   universe. Such a machine is a physical impossibility. But for quantum   computers, this type of simulation is well within the realm of   possibility, requiring a processor with 286 quantum bits, or qubits.   Along with this resource estimate for penicillin, I've also seen  of the number of qubits required to model the ground state of caffeine (160 qubits). Given that the above report offers no reference(s) (probably in the name of business intelligence) and much Internet searching and looking into the quantum chemistry literature has come up short, my question is: Where are these resource estimates coming from – is there a journal article that published these numbers? I would really like to identify the methodology and assumptions used in making these estimates.


I happen to be close to a professor at my college that has the highest citations of all professors there.  However, his website looks like its from .  I have some knowledge and motivation to help redesign his website.  However, given that he has an academic business background, and already has significant clout he will almost certainly ask about the value of an improved website.  Is there an article stating the significance of a website, or lack there of?

I can't help but notice that even in CS, professors' websites are almost always difficult to navigate, poorly-organized, and just generally hard to look at (poorly-tiled backgrounds, inconsistent fonts, etc.).  Why is this? Is it expected of academics? I'll be applying to graduate programs in the Fall and took a few hours to update my personal website, and was outright told by a professor that it was "too much". If I have a "fancy-looking" website, will this reflect negatively on me as an applicant?


I'm looking for a single word which describes something that is not pleasant but is necessary. Moreover, there are no comparable alternatives for that.   Something like a delightful pain.

I am trying to describe the nature of pesticides. Although they are mostly harmful, we need them in order to produce the amount of food the world requires. Is there a word or phrase besides "necessary evil"?


I am creating notepad application and want to update my notes but I am unable to record in sqlite database. Please check my update query I am sharing error details.       public class MainUpdateActivity extends Activity  {   SQLiteDatabase mydb1; EditText titleedit,notetextedit; Button update;       @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main2);          titleedit=(EditText)findViewById(R.id.title);         notetextedit=(EditText)findViewById(R.id.notetext);         update=(Button) findViewById(R.id.update);          Intent myintent = getIntent();          String product7 = myintent.getStringExtra("product1");         String product8 = myintent.getStringExtra("product");          titleedit.setText(product7);           notetextedit.setText(product8);  update.setOnClickListener(new View.OnClickListener()             {              public void onClick(View v)             { mydb1.execSQL("UPDATE notes SET (title,notetext) values(?,?);",new String[]{titleedit.getText().toString(),notetextedit.getText().toString()});  Toast.makeText(getApplicationContext(), "note Updated", 3000).show();                Intent myIntent1 = new Intent(MainUpdateActivity.this,menu.class);              startActivity(myIntent1);              finish();              }              });

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


I have two directories which may contain the same files as the other. I want to know which files are common to both directories so that I can delete the duplicate files and save space.

I'm looking for something that will compare directories and files like Beyond Compare does for windows.  Its mainly for use of source control, but I need to use it for deployment as well.


Well, I was supposed to visit UK on 20th-22nd July this year to participate in a competition / conference as an undergraduate student from Bangladesh. I submitted my application on 18th June but it was refused:     As Evidence of your circumstances you have submitted bank name statement in your father's name... for account number ***** shows a balance of ***BDT (around 2,500USD) after a deposit of ***BDT (around 1,600USD). There is no evidence of the source of these funds. You have provided electricity bills but no evidence of your father's employment or income. I am not satisfied that the documents you have provided evidence your circumstances and this lends me to doubt that you are seeking entry only for the purpose and duration stated. I am not satisfied that you are genuine visitor and will leave the the United Kingdom at the end of your visit.   I should've probably added another document stating my father's occupation and that he will bear my costs. However, it is general knowledge in my country that a father will very likely bear the cost of his children. Probably not so in the UK. Incidentally, I have searched the term Visa refused for source of funds from a private window and the first page of Google results are all related to UK visas.  What pains me most is that this letter was signed on 23rd July even though I submitted my application a month earlier. Which means that for the whole time they didn't process my application. They could have called/contacted me if they needed any further documents. However they didn't which, I think, means they tend to reject applications more than they accept and do not care much about the applicants.  However, I will not reapply for a visa as the event in which I was due to participate is already over.  I was wondering what the future consequences of this refusal might be. I have previously visited India for a conference and stayed for 11 days.  Now that I have this smirch in my passport will it affect my future visits to other countries?    There were six of us. We all submitted similar documents according to my knowledge. However, only one received a visa, probably because he had visited Russia and USA. Two of us were refused and the other three are still waiting for their decisions.

I have applied recently for a general visitor visa to the UK to spend 10 days during Christmas with my British unmarried partner and it has been turned down.   The Entry Clearance Officer stated on his refusal notice the following:     I note that you have never previously travelled to the UK or any country with similar immigration requirements and you therefore do not have a history of travel and compliance to consider.      You have submitted an employment letter to confirm your occupation in KSA but I am required to also assess your personal, domestic and economic circumstances in determining whether you are genuine visitor travelling to the UK for the period and purpose you state.      You claim an income of SAR ........ per month which equal ........ GBP and from the evidence submitted this appears to be your sole source of income.   I note that this monthly income is reflected on your bank statements. However, the bank statement you have presented show a recent large deposit that are in excess of your stated income and inconsistent with the account history. You haven't provided evidence toward the origin of this recent deposit and in the absence of reasonable evidence I am not satisfied that these bank statements accurately reflect your personal circumstances.      In view of the above, I am not satisfied you have demonstrated that your circumstances are as you claim and therefore I am not satisfied that you're travelling to the UK for the period and purpose you stated. 41(i)and(ii).   Its true that I have deposited that sum of money right before I apply and it was a commission I received from work earlier this month.   So, could you please give me your advice on the above as I am planning to apply again soon. and how to avoid my application being refused again?


I know I can Deep Copy by accessing one property at a time and copying it. But is there a way where I can deep copy an entire object on one go? Assume I cannot alter the class Sample.   Class Sample{   int a;   int b;   public int A {get => A; set => A = value}   public int B {get => B; set => B = value}  }   Sample sm1 = new Sample(); Sample sm2 = sm1; sm2.A = 5; sm1 = sm2 //DeepCopy

I want to do something like:  MyObject myObj = GetMyObj(); // Create and fill a new object MyObject newObj = myObj.Clone();   And then make changes to the new object that are not reflected in the original object.  I don't often need this functionality, so when it's been necessary, I've resorted to creating a new object and then copying each property individually, but it always leaves me with the feeling that there is a better or more elegant way of handling the situation.  How can I clone or deep copy an object so that the cloned object can be modified without any changes being reflected in the original object?


I have been really interested in physics for some time and also take active interest in quantum mechanics. I would like to pursue physics as my undergrad major.  What kind of prerequisites does one need to major in physics? (I am going to study physics in Japan and right now is not so good at maths cause I am learning Japanese only for the past 6 months and has been totally out of it. )

Every once in a while, we get a question asking for a book or other educational reference on a particular topic at a particular level. This is a meta-question that collects all those links together. If you're looking for book recommendations, this is probably the place to start.  All the questions linked below, as well as others which deal with more specialized books, can be found under the tag  (formerly ).  If you have a question to add, please edit it in. However, make sure of a few things first:   The question should be tagged  It should be of the form "What are good books to learn/study [subject] at [level]?" It shouldn't duplicate a topic and level that's already on the list   Related Meta:


I usually use /tmp when I download files that I need just this one time so that they're be deleted automatically. But snap chromium sees /tmp/snap.chromium/tmp as /tmp and for the worst of it, the user hasn't permission to open this directory. I know almost nothing of how snap works and am wondering if there is a way to grant /tmp access to some snap application?

I just upgraded to Ubuntu 19.10 and to my horror I discovered that the default browser Chromium can no longer access other partitions than /home.  This means that my partitions containing music and videos (/multimedia) for instance are no longer accessible e.g. to upload into Google Drive. This includes USB partitions.   I found another description of this phenomenon here:  where it says  "Also, while we acknowledge that most users will only need to access their home folders, it’s worthy to mention that you no longer can access system files & folders from inside Chromium (You can’t access anything except your home folder). This means that if you are to upload a file or an image for example into the Internet using an uploading website, then this file/image must be in your home folder, as you can not access directories such as /usr, /etc or other directories located in your root partition. In fact, you no longer can access any other partition at all, this includes USB sticks and other booted partitions:"  I wonder why this behaviour been introduced? it violates the whole idea of multiple disks, partitions and symlinks. Btw, this still works for Firefox.  My questions are   Are there any plans to fix this? I expect one reason for this behaviour is about security. If so, is it possible to explain why and how that makes for better security? The files on other partitions are legitimately accessible by the user anyway e.g. through symlinks. But with this change, I'll have to move them to /home before uploading so still accessing them although more slowly and cumbersome.  If this behaviour is now permanent, the question is how should we incorporate multiple disks in our filesystem?  Alternatively, can someone tell me how to find and install the debian package. I haven't been able to locate it?   This is not a duplicate of  because that is about a specific error during installation that I didn't get. My question is about the access chromium has in Ubuntu 19.10.  Anyway, I solved the problem via the following command by using the original debian package from Google:  sudo apt-get install google-chrome-stable   After that I can now access my other partitions again. I know this is hacky in the sense that the package isn't native to Ubuntu so I would really like to get some advice on how to incorporate multiple disks and partitions with this new restricted behaviour of Chromium.  Thank you very much


I am trying to prove the following inequality Let $s > \frac{n}{2}$ and $f,g \in H^s(\mathbb{R}^n)$ then $$ \Vert f \cdot g \Vert_{H^s}\le C\cdot\Vert f \Vert_{H^s} \Vert g \Vert_{H^s} $$ where $C$ is just some positive constant. I am trying to solve this  using only the definition of the norm $ \Vert \cdots \Vert_{H^s}^2=\int_{\mathbb{R}^n}{(1+\vert y \vert)^s (\hat f(y))^2dy}$ and youngs inequality for convolutions which states that for $\frac{1}{p}+\frac{1}{q}=1+\frac{1}{r}$ $$ \Vert f \ast g \Vert_{L^r}\le \Vert f \Vert_{L^p}\Vert  g \Vert_{L^q} $$ I have checked that $s > \frac{n}{2}$ implies that $f,g$ are continous and vanish at inifinity. Would appreciate any help/hints how to approach this problem

How do you prove that the Sobolev space $H^s(\mathbb{R}^n)$ is an algebra if $s>\frac{n}{2}$, i.e. if $u,v$ are in $H^s(\mathbb{R}^n)$, then so is $uv$? Actually I think we should also have $\lVert uv\rVert_s \leq C \lVert u\rVert_s \lVert v\rVert_s$. Recall that $\lVert f\rVert_s=\lVert(1+|\eta|^2)^{s/2}\,\hat{f}(\eta)\rVert$, the norm on $H^s(\mathbb{R}^n)$. This is an exercise from Taylor's book, Partial differential equations I.


I've asked a question on Stack Overflow with a bounty. Assume I have received three answers, but all of them are incorrect and not what I asked. I clearly mentioned what my problem was and what I'm trying to achieve, yet I didn't received any correct answers.  What are my choices if I don't get any answers with in next three days? I have spent almost half of my points on that question around 300. I just don't want to waste my points to incorrect answers and not useful answers.  Can we ask moderators for help? Explain my situation. As a small user with just around 500 points I don't want to waste it for an incorrect answer.

I have an  which had about 6 views. So I'm considering a bounty but I wonder if that will provide any answers. There's a risk someone will just answer with a non-reply just to get the bounty after a few days. (Because it's automatically awarded to the person with the highest votes.) Of course, I could downvote the answer but if it's the only one, it would still be the highest one in votes. I could flag it, hoping a moderator will remove it, thus saving the bounty for a real answer. But if that doesn't happen, then I've wasted reputation to a non-answer.  So, when assigning a bounty to a Q, is it possible to exclude certain answers from automatically receiving it, even if there's no other answer after the time's up? I just don't want to reward someone who adds nonsense to my Q.


Once in a while, I run the task manager and see several processes with the same name (e.g. comskip) running at the same time in the background while looping or using most of computation power (because it is dealing with a corrupt file). I know the exact folder from which that process is using files from, but there are just too many files in that folder that It would take me days to go through each file and determine the process that locks them (which I know how to do). My concern: I would like to reverse this way of establishing that relationship. From a known running process in the task manager, I would like to determine the file that that process has locked and not the other way arround.

I'm trying to delete some folder but this error is preventing from doing it:     Cannot delete [FileName]: It is being used by another person or program.      Close any programs that might be using the file and try again.   How can I identify what application is using the file?   I want to end the application using a Task Manager, but I didn't know what application is using it.  The folder is not shared and my user account is an administrator.


Since i don't have root user password, is there anyway to install google chrome with it's dependencies ? (64 Bit)

I have no root access on this machine.  I would like to know if there is a way I can download Ubuntu packages and install them as non-root?  Probably in my ~/bin or ~/usr/share or something like that? Would that work?


I couldn't find a question that specifically targets the issue I'm having hence this question is being asked.  I have an array that holds 5 numbers:  var numbers = [0,1,2,3,4];   Once a number is clicked on the frontend (website), the number is removed from the array using the below code:  delete numbers[1];   This removes the correct number but leaves a space where the number was (the space is undefined). I believe this is causing an issue. After a number is removed from the array, I use another function to randomly pick any of the remaining numbers in the array however it sometimes fails. After much thought, I've realized it may be because there are empty spaces in the array after a number is removed and as a result, the code fails to work due to the undefined element.  Is my analogy correct or am I mistaken?  (I have also attempted to use the splice method to remove the number however that then causes an issue with the length of my array because if I later want to remove another number, it removes the wrong one due to the numbers moving around etc).

What is the difference between using  on the array element as opposed to using ?   For example:  myArray = ['a', 'b', 'c', 'd'];  delete myArray[1]; //  or myArray.splice (1, 1);   Why even have the splice method if I can delete array elements like I can with objects?


I am trying to find a way adjust the column widths/wrap text in the Quick Edit/Datasheet view in SharePoint 2013.  So far, I have only seen ways to adjust the widths in the standard view (using CSS), but these seem to not get applied to the Quick Edit or Datasheet view.

Is there a way to adjust the column widths or enable text wrapping in the Quick Edit or Datasheet view in SharePoint 2013?  I have seen ways to set widths in the standard list view (using CSS), but these do not seem to be able to change the width in Quick Edit mode.


I was wondering if my corrections are right. I think I can use both "which" and "that", I  removed "person" I think it can be used but it's not necessary.  "I don't have any secret information which my sister doesn't know about me, as she is the first person with whom I share any information."  "I don't have any secret information which/that my sister doesn't know about me, as she is the first I share any information with."

What is the difference between the words which and that?  For example I have the following sentences:   “I have a car which is blue.” “I have a car that is blue.”   Are there any rules specifying usage of which and that?


Let $p(x) = x^3 + x + 1 \in \mathbb{Z}_2[x]$ and $E = \mathbb{Z}_2[x]/p(x)$. Factor $p(x)$ into linear factors in $E[x]$.  Note that $p(t) = 0$, where $t = x + ⟨p(x)⟩$. You might also wish to show that $p(t^2) = 0$.  So far, I have that $E = \{a+bt+ct^2 : a,b,c \in \mathbb{Z}_2, t^3 = 1+t\}$ and I have shown that $p(t^2) = 0$. But I really do not know how to proceed from here.   I have in my notes that the solution is $p = [x + t][x + t^2][x + (t + t^2)] \in E[x]$ but I do not have any details on how this solution was obtained.   Any help would be appreciated.

Let $f(x)=x^3+x+1$ and set $E=z_2[x]/(x^3+x+1)$ prove that $f(x)$ splits in E that is find 3 distinct roots of $f(x)$ in $E$    Questions found $[x^2+1]$ $[x^2+x+1]$ on my sloppy work. There are more than 3 roots if my notes are correct. If that is the case do we just use the irreducibles??  Another question I have is that what is [x]?? Is it a variable, some sort of constant. I know the book uses idertimenatn and has special properties.


Is using trim() and strip_tags() for preventing sql injection is as okay as PDO or Prepaid Statement? thre is another question on how to prevent sql injection. trim() and strip_tags() was not even discussed there. I dont know from where people saying duplicate finding about trim() and strip_tags() in the former question answer!? Go read the answers and my question again       $username = strip_tags(trim($_POST["username"]));      $password = strip_tags(trim($_POST["password"]));

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


I am from a biology background. Using t, χ2, F tests day-to-day, following like a recipe. However, I feel I must understand the background of this. I took an online lecture on p-value and hypothesis testing.  if your p-value is less than 0.01, then you have a very strong case against null hypothesis very strong case. The meaning of this is only in 1 % of the cases your null hypothesis will hold true in 99 % of the cases your null hypothesis will be false  Without many mathematical notations, could someone help me to understand; 1. why having a low probability is strong? 2. What p-value really tells in hypothesis testing? because some say it'd not about probability. 3. Is setting a null hypothesis a mathematical requirement? 4. Is normal distribution a hypothetical thing? because why we have to use different t, χ2, F distributions for different data types to calculate p-value. I am not sure why I fail every time to understand this; is it mathematics or is it the language (wording) use to explain these concepts.

After taking a statistics course and then trying to help fellow students, I noticed one subject that inspires much head-desk banging is interpreting the results of statistical hypothesis tests.  It seems that students easily learn how to perform the calculations required by a given test but get hung up on interpreting the results.  Many computerized tools report test results in terms of "p values" or "t values".  How would you explain the following points to college students taking their first course in statistics:   What does a "p-value" mean in relation to the hypothesis being tested?  Are there cases when one should be looking for a high p-value or a low p-value? What is the relationship between a p-value and a t-value?


When I use the graphical EMACS and I want for, for example, execute  M-x  . as soon as I press the Meta key the unity dash opens and I lose focus from emacs, this is really annoying. how do I avoid unity capturing it?

I'm a big fan of Meta key , but in Unity interface , by pressing that key , unity's interface will show up , hindered further action with that key , e.g Meta + Tab.  Without hacking its source code , anyway to remove that shortcut key ?


I have recently installed Ubuntu 19.04 in my Lenovo ideapad along with windows 10 .   I could not find how to turn on WiFi.I could not even get anything like " No WiFi adapter found" or something like that.  I do not have any experience of using Linux.   Help me.   Edit  Output of lspci -knn | grep Net -A3; rfkill list:  Network controller [ 0280 ] : Realtek semiconductor co ., ltd RTL8821CE 802.11ac PCIe wireless network Adapter [ 10ec : c821 ] 0: ideapad_WLAN: wireless soft blocked : none , hard blocked : none

We just bought a Lenovo  (which is supposed to have the Intel 8265 for wireless). This laptop was bought in part because it is certified to run Ubuntu and as such to me at least it would make sense for things to work out of the box... but no such luck.  First, I installed Ubuntu 17.10 and after installation realised Wi-Fi was not working. I also tried Ubuntu 16.04 from a USB drive since that is the version of Ubuntu it is certified for, but no luck there either.  The wireless chip is not detected by lshw (or even lspci by the looks of it), ip link does not show a wireless interface, and the iwlwifi kernel module is not loaded at boot (I can load this myself using modprobe iwlwifi but this does not make Wi-Fi work). I think it is a combined Wi-Fi/Bluetooth chip, and Bluetooth does appear to work (or at least Bluetooth shows up in Gnome and rfkill list).  modinfo iwlwifi | grep 8265 shows me a file ending in -34 is supposedly loaded but only a file ending in -33 (and some other lower numbers) is present in /lib/firmware, if that helps).  I have also installed the Linux 4.14.9 kernel in an attempt to get things to work, but this did not resolve the issue either.  Further information  root@ThinkPad-E570:~# modinfo iwlwifi | grep 8265 firmware:       iwlwifi-8265-34.ucode root@ThinkPad-E570:~# rfkill list all 0: tpacpi_bluetooth_sw: Bluetooth     Soft blocked: no     Hard blocked: no 1: hci0: Bluetooth     Soft blocked: no     Hard blocked: no root@ThinkPad-E570:~# dmesg | grep iwl root@ThinkPad-E570:~# lspci -nnk | grep 0280 -A3 05:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:c821]     Subsystem: Lenovo Device [17aa:c024]   Update  I just noticed that the laptop does not have an Intel wireless chip at all, but in fact has a Realtek one... which means that the  of the shop I bought this laptop at were not accurate... Sigh. Same problem stands, however, just with a crappier wireless chip.


I am trying to create a shell script, below is a part of which where i am trying to extract some value from a record in a file:  tgt_val=`cat $file_name | grep "$string_name" | cut -d"|" -f$column_no`   This work perfectly when the specified column has some numeric or string value however it fails when th column has value as " * "  eg:  102|Sam|*|USA   This command would work correctly for column 1,2 & 4  However in case of column 3 it gives me output as all the files in present directory.  Someone please help over this.

Or, an introductory guide to robust filename handling and other string passing in shell scripts.  I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names).  I encountered a problem such as the following:   I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators).   What is going on and how do I fix it?


Can you tell me what the differences are between those? Also, Can you tell me how to know which one is parallel or series connection if any exercise doesn't give any picture of them?

I need to find the Equivalent Resistance across A and B. The problem is, I don't know which one's are in series and which ones are in parallel. How do I identify which ones are parallel or series?


As a high school calculus student, I stumbled across the possibilities for: $$\int x^x\,dx$$  My friends and I are currently stumped. My first idea was: $$ \left(\frac{1}{x+1}\right) x^{x+1} $$ But I doubt it is this simple. I've read through multiple forums, and cannot find any solution or explanation! Please help shed some light on this mysterious intregral.

I'm trying to find $\int x^x \, dx$, but the only thing I know how to do is this:  Let $u=x^x$.  $$\begin{align} \int x^x \, dx&=\int u \, du\\[6pt] &=\frac{u^2}{2}\\[6pt] &=\dfrac{\left(x^x\right)^2}{2}\\[6pt] &=\frac{x^{2x}}{2} \end{align}$$  But it's certain that this isn't the correct way to evaluate that, and the answer must be wrong.


I cannot seem to get rid of this error after numerous updates, anyone got any ideas/advice how to fix it as my Admin Modules doesn't want to load at all. I'm running D7.26 on this project. Thanks.  Reports as:     PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column   'has_children' in 'field list': UPDATE {menu_links} SET   menu_name=:db_update_placeholder_0, plid=:db_update_placeholder_1,   link_path=:db_update_placeholder_2,   router_path=:db_update_placeholder_3, hidden=:db_update_placeholder_4,   external=:db_update_placeholder_5,   has_children=:db_update_placeholder_6,   expanded=:db_update_placeholder_7, weight=:db_update_placeholder_8,   depth=:db_update_placeholder_9, p1=:db_update_placeholder_10,   p2=:db_update_placeholder_11, p3=:db_update_placeholder_12,   p4=:db_update_placeholder_13, p5=:db_update_placeholder_14,   p6=:db_update_placeholder_15, p7=:db_update_placeholder_16,   p8=:db_update_placeholder_17, p9=:db_update_placeholder_18,   module=:db_update_placeholder_19,   link_title=:db_update_placeholder_20,   options=:db_update_placeholder_21,   customized=:db_update_placeholder_22 WHERE (mlid =   :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] =>   navigation [:db_update_placeholder_1] => 0 [:db_update_placeholder_2]   => catalog [:db_update_placeholder_3] => catalog [:db_update_placeholder_4] => 1 [:db_update_placeholder_5] => 0   [:db_update_placeholder_6] => [:db_update_placeholder_7] => 0   [:db_update_placeholder_8] => 0 [:db_update_placeholder_9] => 1   [:db_update_placeholder_10] => 420 [:db_update_placeholder_11] => 0   [:db_update_placeholder_12] => 0 [:db_update_placeholder_13] => 0   [:db_update_placeholder_14] => 0 [:db_update_placeholder_15] => 0   [:db_update_placeholder_16] => 0 [:db_update_placeholder_17] => 0   [:db_update_placeholder_18] => 0 [:db_update_placeholder_19] => system   [:db_update_placeholder_20] => Catalog [:db_update_placeholder_21] =>   a:0:{} [:db_update_placeholder_22] => 0 [:db_condition_placeholder_0]   => 420 ) in menu_link_save() (line 3208 of /var/www/sitename/includes/menu.inc).

I have Drupal running on MariaDB 5.5.33. When I run update.php (after upgrade to Drupal 7.28 from Drupal 6) I get an error:     Failed: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'webdb.location_country' doesn't exist: CREATE TABLE {location_country} ( code CHAR(2) NOT NULL COMMENT 'Primary Key: Two letter ISO Country Code', name VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Full Country Name ', PRIMARY KEY (code) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Country data managed by location.module.'; Array ( ) indb_create_table() (line 2720 of /home/web/public_html/includes/database/database.inc).   When I try to run command     CREATE TABLE {location_country} ( code CHAR(2) NOT NULL COMMENT 'Primary Key: Two letter ISO Country Code', name VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Full Country Name ', PRIMARY KEY (code) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Country data managed by location.module.';   in phpMyAdmin I get an error     #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '{location_country} ( code CHAR(2) NOT NULL COMMENT 'Primary Key: Two letter IS' at line 1   But I wasn't able to find out where is the problem.


I have a regex that grabs the valid name of measurement units.  I've tried with negative lookbehind. But it's not fully supported yet:  var re = /(?<!\+.*)(mg|ml|g|kg|dose)$/g   There is a  to make it a little bit clear.  The question is: How can I do the same with a negative lookahead?  I tried this way but it grabs the last part of the string joined with + sign:   UPD: I solved this issue by capturing the string inside the anchors . After it, I use subpattern (mg|ml|g|kg|dose)$ to cut off numeric part and space.

Is there a way to achieve the equivalent of a  in javascript regular expressions?  I need to match a string that does not start with a specific set of characters.  It seems I am unable to find a regex that does this without failing if the matched part is found at the beginning of the string.  Negative lookbehinds seem to be the only answer, but javascript doesn't have one.  EDIT: This is the regex that I would like to work, but it doesn't:  (?<!([abcdefg]))m  So it would match the 'm' in 'jim' or 'm', but not 'jam'


I am collected data about parents and students.  I need there to be a separate row for each student without entering the family data each time.  I have always used the "pre-filled link" option to do this but need a less tedious way and want to use a formula to do this on my response sheet.  I have found some resources online but I can not get any of the examples to work for me.  Here is a copy of the response.  I would like each row to include data from A-L (header data?) and make a new row for each student M-T, U-AB, AC-AJ, AK-AR.  This is an example but the actual sheet will have more columns. This has 2 tabs, how I my responses are coming out and the second tab is how I want it to look. Any help is greatly appreciated.

I'm doing a spreadsheet for an event and I need to split a row into multiple rows. It's getting data from a form.  I need a script that can arrange the data like in the blue rectangle.


This is something of a clarification question off of   Suppose we have the following situation:  A sorcerer is stalking an unaware foe, and wishes to blast them with a spell with some metamagic tacked on.  He has Improved Invisibility up, is surprisingly good at stealth, and is using a spell with no verbal component.  In this particular case, the target has no real chance of becoming aware of his presence until the spell actually flies... but the spell itself is a full-round action because of metamagic.  Assume that the Sorcerer is willing to take his time as necessary in order to get this right and optimize on any additional action advantage that he might be able to squeeze in before the opponent figures out what's going on and starts to respond, including holding actions/delaying/etc if pertinent.  Don't worry about the effects of any other spells, magic items, or other abilities not available by default to all adventurers.  What does the resulting fight look like in terms of who goes when?  This is distinct from the originating question first in that the target remains unaware until the sorcerer has finished casting, whenever it is that that should occur, and second in that I am interested in the shape of the combat going forward from that point as well.  In particular, is there any way that the casting sorcerer might get another turn after the original cast but before the target can act?  If not, is there any way they could at least extract a few extra actions?  If so, how hard could they push that?  As clarification, this is intended primarily as a theoretical question to better understand this part of the rules.  It's not in support of any particular game.

Is it true that not even the person/creature/thing doing the initial action that starts a combat is able to use a full-round action?  According to all sources I can find, the initial attack already is part of the surprise round, so you're only entitled to a move action or standard action; but that leads to an (in my opinion) absurd scenario, so I just wanted to be sure whether there is something I'm missing:  Let's say sorcerer A is hiding in the bushes, 1HP left, waiting to finish sorcerer B (1HP left) off with magic missiles before B does the same to A. Then he suddenly spots sorcerer B - but sadly, he's some feet out of range. Now sorcerer A wants to use metamagic to double his magic missiles range and fire that on sorcerer B ... but now his magic missile takes a full-round action to cast, so sorcerer A cannot surprise sorcerer B with it anymore.  Is this interpretation right RAW-wise or am I missing something?


I made a rough calculation (probably having made a miscalculation though) following  and  to find out the number of air molecules in 1 cubic centimetre of air.   The first website says there are about $0.02504\times10^{27}$ air molecules in 1 cubic metre. The the second one says the diameter of an air molecule is about $4\times 10^{-10}$m. Then the area of the molecule is about $4\pi\times 10^{-20} \approx 12\times 10^{-20}$.  Then we get the number of air molecules in one cubic metre to be about $12\times0.025\times10^7$, and in one cubic centimetre to be about $12\times0.025\times10^5 = 30000$.  So if there are 30000 air molecules in 1 cubic centimetre, it's almost impossible for light to miss hitting all of them. Following this logic, I can't comprehend how light propagates in air (I would expect it to be scattered, absorbed etc). How does physics explain this?   Furthermore, since the speed of light in a vacuum is constant, but light is "slower" in higher refractive index materials, can I assume light travels a longer path when it travels through a medium with a refractive index higher than empty space? If not, what decreases its speed?   (I thought two questions are related as they both question how light travel in air.)

One of the great 'coincidences' in physics is that the Sun happens to shine most brightly at exactly the wavelengths our eyes can see; it's an easy explanation that our eyes evolved to make the most out of what was available.  However, this spectral window is also , with Rayleigh scattering and the ozone layer protecting us from the UV and strong water vapour absorption in the IR until way into the radio range.  My question is: is this a coincidence? Were there geological factors that made it so? Or is it just lucky chance? (I also notice other planets in our neighbourhood weren't quite so lucky.) Or had atmospheric absorption been different our eyes would have tuned to whatever spectral window were brighter as a whole?


I have an exercise that says:  (a) Prove that $\cos(z)$ and $\sin(z)$ are surjective functions from $\mathbb C \to \mathbb C$.  (b) Find the solutions of the equation $\cos(z)=\dfrac{5}{4}$.  As far as part (a) goes, I have no idea how to show surjectivity. I know by definition that $\cos(z)=\dfrac{e^{iz}+e^{-iz}}{2}$ and $\sin(z)=\dfrac{e^{iz}-e^{-iz}}{2i}$. I want to show that given $w \in \mathbb C$, there are $z_1, z_2 \in \mathbb C$ such that $\cos(z_1)=w$ and $\sin(z_2)=w$. I've tried to play with the expressions from above but I couldn't get to anything. I need help on this.  For part (b), once I've proved (a), then I know (b) makes sense, i.e., there exist solutions for that equation.  $\cos(z)=\dfrac{5}{4}$ iff $\dfrac{e^{iz}+e^{-iz}}{2}=\dfrac{5}{4}$ Again, I have no idea what can I get out from this equation.

I am trying to solve the following two problems:  1) Prove that the functions $\cos(z)$, $\sin(z)$ are surjective over the complex numbers.  2) Find all $z \in \mathbb C$: $cos(z) \in \mathbb R$ and find all $z \in \mathbb C$: $\sin(z) \in \mathbb R$.  For 1),I've tried to prove it for the function $\cos(z)$ (I suppose the other one is analogue)  so I've used the fact that $\cos(z)=\dfrac{e^{iz}+e^{-iz}}{2}$.  Let $w \in \mathbb C$, I want to show there exists $z \in \mathbb C : f(z)=w$, i.e., $\dfrac{e^{iz}+e^{-iz}}{2}=w$, multiplying by $2$ and then by $e^{iz}$ yields $e^{2iz}+1=2we^{iz}$ iff $e^{2iz}-2we^{iz}+1=0$.   I don't know if this approach is the correct one but here I've replaced $e^{iz}$ by $x$, so the solutions of the equation would be the roots of the polynomial $p(x)=x^2-2wx+1$, by the quadratic formula, I get that $x \in \{\dfrac{2w+w_0}{2},\dfrac{2w-w_0}{2}\}$, where $w_0^2=4w^2-4$.  Then, $e^{iz} \in \{\dfrac{2w+w_0}{2},\dfrac{2w-w_0}{2}\}$. At this point I got lost, I would like to explicitly show that $z$ exists and I can't see existence directly from the fact that $e^{iz}=\dfrac{2w+w_0}{2}$ or $e^{iz}=\dfrac{2w-w_0}{2}$.  First I thought of taking logarithm of both sides of the equation ir order to solve for $z$, but this is not a legitimate operation unless $e^{iz} \in \mathbb R$.   I couldn't go any farther.  For point 2) I have no idea what to do, should I use the identity $\cos(z)=\dfrac{e^{iz}+e^{-iz}}{2}$?  I would appreciate some help with the two points (specially with point 2), at least in 1) I could do something).   Btw, Happy new year!


I want to have access to the OS name and Version from inside my Python code. Is there any environmental variable I can use for that purpose?  Note that I want to get the OS name and version that appears on the About this mac on my Mac. With platform.uname() I get different OS name and version!

What do I need to look at to see whether I'm on Windows or Unix, etc?


to keep things simple i downloaded the 64b version of Ubuntu to try out on a spare computer but it turns out i have a 32b version? i even made sure to double check with the website and sure enough i downloaded the 64b version: "ubuntu-12.04.3-desktop-amd64.iso" and i also confirmed that my machine is actually 64b. so does anyone have any ideas as to why i have the wrong version? and is there a way i can get the 64b version without completely starting over?   "uname -i" displays "i386". and when i go into the system settings and details it says i have "OS Type: 32-bit"

As per title, I wish to know if I can, after a successful 32bit setup and consequent software installations, update to a 64bit version.  I know how to partition (actually one of the solutions is to set /, /etc, /home, /var/www, and /opt as separate partitions) and I know that a clean install is way better than a dirty one, yet I would like to know if/how it's possible to do that.


I'm using an MS Access database (I know...), so to capture the auto-generated primary key, I'm extending the table adapter class. I took me a while to figure this part out, so if that's your problem, future reader, right-click on your dataset file (*.xsd) and select View Code. This will create a partial class. The GetLastID() method is just a query with SELECT @@IDENTITY. The trick is that it has to be done when the row is updated, without closing and opening a new connection, so the RowUpdated event needs to be handled. Here's the code for that: namespace TimeTrack.TimeTrackDataSetTableAdapters {     public partial class TimeSlipsTableAdapter     {         public void CustomSetup()         {             Adapter.RowUpdated += Adapter_RowUpdated;         }          private void Adapter_RowUpdated(object sender, OleDbRowUpdatedEventArgs e)         {             if (e.StatementType == StatementType.Insert && e.Errors == null)             {                 int lastID = (int)GetLastID();                 e.Row["ID"] = lastID;                 e.Status = UpdateStatus.SkipCurrentRow;             }         }     } }  My question is: Is there are way to avoid having to call the CustomSetup() method? I would like for somehow to include the event handler assignment in the construction of the table adapter without having to make an additional call. Is there a way?

I don't think this is possible, but if is then I need it :)  I have a auto-generated proxy file from the wsdl.exe command line tool by Visual Studio 2008.  The proxy output is partial classes. I want to override the default constructor that is generated. I would rather not modify the code since it is auto-generated.  I tried making another partial class and redefining the default constructor, but that doesn't work. I then tried using the override and new keywords, but that doesn't work.  I know I could inherit from the partial class, but that would mean I'd have to change all of our source code to point to the new parent class. I would rather not have to do this.  Any ideas, work arounds, or hacks?   //Auto-generated class namespace MyNamespace {    public partial class MyWebService : System.Web.Services.Protocols.SoapHttpClientProtocol {       public MyWebService() {          string myString = "auto-generated constructor";          //other code...       }    } }  //Manually created class in order to override the default constructor namespace MyNamespace {    public partial class MyWebService : System.Web.Services.Protocols.SoapHttpClientProtocol {       public override MyWebService() { //this doesn't work          string myString = "overridden constructor";          //other code...       }    } }


Windows has a feature called . Is there any way to make it use other keys?  For example rather than use the numberpad I'd rather use QWE/ASD/ZXC instead of the 789/456/123 that it comes with.  I'm interested particularly in modern versions of windows (7/8/10)  This is slightly different from  as that solution isn't easy to toggle; with the built in mouse keys you can toggle the keys on/off with NumLock but for that answer you have to logout/reboot for it to take effect.

One of my laptop's keys has fallen off. Is there any way I can remap another key to serve as that key?  I'll 'sacrifice' the other key because I never use it.


It is easy to go from a duplicate question to its original: there is a link in the body of the question. But how do I go in the reverse direction (from a single original question to a list of duplicates)?  I don't see anything in   I saw  question that is marked (incorrectly) as a duplicate of  question that has no answer to this particular question.  For example, how do I find all duplicate questions where  is marked as the original?

Can I see how many duplicates there are of a post? I.e. how many posts have been labelled as duplicate because of this post? If so, how? And can I also get a list of these duplicated posts?


I have been searching around online trying to figure out why my references appear to be numbered in a seemingly random order. I have read probably 20 different webpages in total, including many questions on this site and I cannot fix the problem.  However so far I have learned that biblatex and bibtex are not the same thing? My guess is there are loads of different "bibliography executables/programs/compilers" (?) [I have no idea what you actually call something like biblatex] and I think this has been one source of confusion.  The most simple thing to do is give you my main tex file:  \documentclass[11pt, twoside]{report} \usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}  \usepackage{fancyhdr} \pagestyle{fancy} \fancyhead{} \fancyhead[LO,RE]{\rightmark} \fancyfoot{} \fancyfoot[LE,RO]{\myname} \fancyfoot[CE,CO]{\thepage}  \usepackage{amsmath} \usepackage{physics} \usepackage{graphicx} \usepackage{siunitx} \sisetup{range-phrase=-,range-units=single} \usepackage[font=small,labelfont=bf]{caption}   \usepackage{longtable}   \usepackage{mymacros}  \extrafloats{100}  \pagenumbering{roman}  \usepackage[backend=bibtex,style=numeric]{biblatex} \addbibresource{references.bib}  \begin{document}      \input{title.tex}      \tableofcontents     \listoffigures     \listoftables      \clearpage     \pagenumbering{arabic}      \chapter{Chapter 1...}     \input{chapters/chapter1.tex}      \input{chapters/theory.tex}      \clearpage     \section{Conclusion}      \chapter{Appendix}     \input{chapters/appendix.tex}      \printbibliography  \end{document}   I compile this with texstudio, and the first reference number is [8]. The next is [12]. I want the order to be [1], [2], etc.  I can provide the references.bib file, but essentially it looks like this (here are a few examples)  % normal/inverted heirachy image @article{Artusa:2014wnl,     author         = "Artusa, D. R. and others",     title          = "{Exploring the Neutrinoless Double Beta Decay in the     Inverted Neutrino Hierarchy with Bolometric Detectors}",     collaboration  = "CUORE",     journal        = "Eur. Phys. J.",     volume         = "C74",     year           = "2014",     pages          = "3096",     doi            = "10.1140/epjc/s10052-014-3096-8",     eprint         = "1404.4469",     archivePrefix  = "arXiv",     primaryClass   = "nucl-ex",     SLACcitation   = "%%CITATION = ARXIV:1404.4469;%%" }  % KATRIN paper @article{1703.05272,     Author = {J. Behrens and P. C. -O. Ranitzsch and M. Beck and A. Beglarian and M. Erhard and S. Groh and V. Hannen and M. Kraus and H. -W. Ortjohann and O. Rest and K. Schlösser and T. Thümmler and K. Valerius and K. Wierman and J. F. Wilkerson and D. Winzen and M. Zacher and C. Weinheimer},     Title = {A pulsed, mono-energetic and angular-selective UV photo-electron source for the commissioning of the KATRIN experiment},     Year = {2017},     Eprint = {1703.05272},     Eprinttype = {arXiv},     Doi = {10.1140/epjc/s10052-017-4972-9}, }   I can't think of anything else which would be useful. I hope it is a simple mistake that I have made because this has been confusing me all morning and I have not been able to resolve the issue.  Here is a screenshot to demonstrate the issue...

I'm facing a problem with biblatex citation order.  Using this configuration:  \documentclass {article} \usepackage[brazil]{babel} \usepackage[utf8]{inputenc} \hyphenation{es-ta-bi-li-da-de} \usepackage{setspace} \singlespacing \usepackage[natbib=true,style=numeric]{biblatex} \addbibresource{frameworks.bib}   Being frameworks.bib this:  @Article{JONHSON88, author = {Ralph Johnson, Brian Foote}, title = {Designin Reusable Classes}, journal = {Journal of Object-Oriented Programming SIGS}, year = {1988}, key = {Johnson:88}, volume = {1}, number = {5}, pages = {22-35}, month = jun }  @book{UML-F:00, author = {Fontoura M., Pree W., Rumpe B.}, editor = {Addison-Wesley}, title = {The UML Profile for Framework Architectures}, year = {2000}, }   The PDF is generated with a text like:  Something about something[4], and moo foo other children[1].   This citation [4] is the first in all text. How can I order this correctly to [1]...[2] ...?


We use "a" before words that start with a consonant sound and "an" before words that start with a vowel sound. "EULA" seems to start with a  sound.     An  (EULA, /ˈjuːlə/) is a legal contract entered into between a software developer or vendor and the user of the software, often where the software has been purchased by the user from an intermediary such as a retailer. A EULA specifies in detail the rights and restrictions which apply to the use of the software.   Do we right "a" or "an" before "EULA"?

I am getting confused while using an article an. Because an is used while referring to vowels (a,e,i,o,u).  But today I read an article where for user they used a user.  My question is, why was an not used?  Could someone explain this with an example?


Let $R$ be a commutative ring. Show that there is a bijection between   the set $L$ of ringhomomorphisms $\mathbb Z[i]\to R$ and the set $X$   of $x\in R$ with $x^2+1=0$.   I can show that $\phi\colon L\to X\colon f\mapsto f(i)$ is a well-defined ring homomorphism. Now I would either like to show directly that it is bijective, or I should show that its inverse exists; $$\phi^{-1}\colon X\to L\colon x\mapsto f:f(i)=x. $$ Now here I am a bit stuck, because I can't really make any progress either way. I also haven't used that $R$ is commutative, it seems. Could anyone give a hint on how to continue from this point?  Btw: My course has just started dealing with rings and fields, so I barely know any theorem, except the isomorphism theorems. So I am looking for an elementary proof, if possible, at this point in my course.

I am studying basic ring theory and I am stuck on the following (possibly easy) question.     Let $R$ be a commutative ring. Prove that there is a bijection between the set of ring homomorphisms $\mathbb{Z}[i]\to R$ and the set of $x\in R$ for which $x^2+1=0$.   Some  things I remember and can prove:   If $f$ is a ring homomorphism then $f(1)=1, f(a+b)=f(a)+f(b)$ and $f(ab)=f(a)f(b)$. Also $\mathbb{Z}[i]^* =\{1,i,-1,-i\}$ and I can prove $\mathbb{Z}[i] \cong \mathbb{Z}[X]/(X^2+1)$. My idea would be to construct a map from the set of ring homomorphisms to the set of $x \in R$ for which $x^2+1=0$ and show that it's bijective. The problem is that I don't know how to construct such a map (what does the set of ring homomorphisms look like?) and where to use that $R$ is commutative.  Any answer/big hint would be appreciated. Thank you.


I am trying to import the pymodis library within python and I keep getting error that   "GDAL installation has no support for HDF4, please update GDAL"  I am running the latest version of GDAL [Version: 1.11.2+dfsg-1~exp2] and tried runnign the update command too. But still the same error persists.   I am running Ubuntu 15.04 and using the terminal to run  python.

I'm running code that works with MODIS HDF4 datasets on a Debian Linux distribution.  I am also running this code on a Windows machine.  On both the Windows and the Linux machines, I have the most recent GDAL version (gdal 1.11.1, np19py27_1), however on the Linux machine, GDAL doesn't seem to recognize HDF4 Drivers... it won't load or process any of the HDF4 datasets that are easily processed on the Windows machine (unfortunately this machine doesn't have enough space to run the full code).  Has anyone else encountered this problem?  Do I need to install an additional module on the Linux system?


How to construct and call a function from a string? For example, consider three different functions and a list of strings, I want to be able to use the items in list of strings to construct and call the appropriate function  def do_function1():     return 'done function1'  def do_function2():     return 'done function2'  def do_function3():     return 'done function3'  listOfstr = ['function1','function2','function3']    for item in listOfstr:     result = 'do_'+item()     print(result)  result = 'do_'+item() TypeError: 'str' object is not callable

What is the best way to go about calling a function given a string with the function's name in a Python program.  For example, let's say that I have a module foo, and I have a string whose content is "bar". What is the best way to call foo.bar()?  I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this.


Inductor and capacitor are  to each other in Physics. One comes from Electric Field Theory while the other one comes from Magnetic Theory; the both theories expose strong duality with each other. Sometimes we can replace an inductor with a capacitor, or a capacitor with an inductor in a circuit in the appropriate manner.  After considering all these similarities between inductor and capacitor, the idea of "mutually coupled capacitors (MCC)" comes into my mind. How does a practical MCC system look like; what kind of Physical structure would it have? Why don't we use MCCs in practice?    After giving it a though for a while, I came up with an idea of a typical MCC structure.    I'm not an expert in Electromagnetics, but here is my explanation:  If \$A_1=A_2\$, then the voltage ratio between \$V_s\$ and \$V_p\$ will be as simple as \$\dfrac{V_p}{V_s}=\dfrac{2 \ell_1 + \ell_2}{\ell_2}\$ (similar to the one in the ideal transformer case). I can't explain why but I feel that this will only work when \$V_p\$ is AC (maybe someone can clarify this).

Capacitors and inductors are .    A transformer is made of two inductors, and transfers power through , through the magnetic  (right?)  Also, you can vary the ratio of voltages or currents by changing the ratio of turns on the core.  You could think of this as coupling a single primary loop with many secondary loops, and then stacking the secondary loops so their output voltages are summed.  Is there an electric dual of the transformer?  Something that uses capacitance and transfers power through the electric near-field over an isolation barrier?  Some way to couple a single primary capacitor with multiple secondary capacitors and then stack them to do power conversion by summing their outputs?  I know that an isolated supply can be built using two capacitors, but I'm not sure if that's exactly a dual, or if there's an equivalent to adjusting the ratio of turns:     Or maybe something related to this?      For example, there are capacitive voltage dividers, but these only reduce voltage, they can't increase it like an autotransformer.  There are charge pumps, but those require active elements like switches or diodes, which aren't present in a transformer.  More succinctly: Is there a way to transform power (1 V, 5 A on primary to 5 V, 1 A on secondary) using electric fields instead of magnetic fields, and passive components only?  If not, why not?  (Electric field screening?)


$\newcommand{\stab}{\operatorname{stab}}$Group $G$ acts on set $X$. Let $a, b \in X$ be at the same orbit. Prove $\stab(a) \cong \stab(b)$  Any hints?

Let $G$ be a group and $X$ set. $a,b \in X$ are in the same orbit, so show that $\mathrm{stab}(a) \cong \mathrm{stab}(b)$.  What I tried so far:   $a,b$ are in the same orbit. So that means $b \in \mathrm{orb}(a)$. That means there is $g'\in G$ so that $g'\cdot a=b$.   $\mathrm{stab}(a)=\{g \in G| g\cdot a=a \}$  $\mathrm{stab}(b)=\{g \in G|g\cdot b = b \}=\{g \in G|g\cdot g'\cdot a=b\}=\{g \in G|gg'\cdot a=b\}=\{g \in G|g.a=b\}$  So the second step $\{g \in G|gg'\cdot a=b\}$ is because of the properties of group action. The third step $\{g \in G|gg'.a=b\}=\{g \in G|g.a=b\}$ is because of the properties of group (so you can "get" to any element, with $g'$ being fixed element and $g$ is arbitrary). Are my steps so far correct? How should I continue?   Any hints and assistance would be much appriciated!


We've got a db that has been pretty much deadlock free for over 6 months, but a day or two ago we had over 60, all on the same two or three pages of the same table (~12,000,000 rows, ~250 bytes per row.)  From the deadlock graph I can see what pages are common in all the deadlocks, and part of the query that was running (always an INSERT vs a SELECT) but I have no idea what rows or data this involves. Is there any way to find out?

SQL Servers has Traces and XEvents. These are used to capture and analyze what is going on with our SQL Server Instances. Events are stored in the stack for later analysis. For example,  If I decide to monitor any dead lock in the database, I just query the trace file to see the history of deadlock for a period of time. Here is my question:  While events occur, in our example deadlock event, is there a way to get an email notification using msdb.dbo.xp_send_dbmail?


In every tutorial i've seen, there is a Name field under the "UV Maps" section of the Data for an object.  The latest tutorial i've seen said simply it was version 2.7.  I am using Cycles renderer.  However I have no Name field, nothing in right click, and nothing I could see in the UVs menu seems to have anything to do with naming it.    How can I rename my multiple UV maps?  Edit:  I didn't think to ask about renaming vertex groups because it wasn't obvious to me that they would have anything in common.

For some reason the name text field doesn't appear for vertex groups in blender 2.70. I tried in 2.69 and it's there and works fine. Was this feature removed in 2.70 or am I missing something?


The negative binomial distribution NB($m,r$) is defined as $$\Pr(X = k) = \left(\frac{r}{r+m}\right)^r \frac{\Gamma(r+k)}{k! \, \Gamma(r)} \left(\frac{m}{r+m}\right)^k \quad\text{for }k = 0, 1, 2, \dots.$$ I'm interested in finding the Jeffreys prior for $m$ and $r$. I could not find this anywhere, most of the results assume $m$ fixed. I tried to derive the expression but got stuck, not sure how to proceed or simplify the expression.  $$\frac{\partial^2 ln P}{\partial m^2} = \frac{k+r}{(m+r)^2} - \frac{k}{m^2}$$ and  $$\frac{\partial^2 ln P}{\partial r^2} = ...$$

I'm trying to obtain the Jeffreys' prior for a negative binomial distribution. I can't see where I go wrong, so if someone could help point that out that would be appreciated.  Okay, so the situation is this: I am to compare the prior distributions obtained using a binomial and a negative binomial, where (in both cases) there are $n$ trials and $m$ successes. I get the right answer for the binomial case, but not for the negative binomial.   Let's call the Jeffreys' prior $\pi_J(\theta)$. Then,  $$ \pi_J(\theta)\propto [I(\theta)]^{1/2}. $$  Under the regularity conditions (fulfilled as we are dealing with the exponential family),  $$ I(\theta)=-E\left(\frac{\partial^2 \log L(\theta|x)}{\partial \theta^2}\right) $$ where for the negative binomial $n$ is $x$ in the above expression (the total number of successes $m$ is fixed, $n$ is not). The distribution --I think-- is  $$ p(m|\theta)\propto\theta^m(1-\theta)^{n-m} $$ since $\theta$ is defined as the probability of success and $m$ is the number of successes. This is also the likelihood, since $m$ is a scalar and not a vector. Hence,  $$ L(\theta|n)\propto\theta^m(1-\theta)^{n-m}\\ \log L(\theta|n)=m\log\theta +(n-m)\log (1-\theta)\\ \frac{\partial\log L(\theta|n)}{\partial \theta}=\frac{m}{\theta}-\frac{n-m}{1-\theta}\\ \frac{\partial^2\log L(\theta|n)}{\partial \theta^2}=-\frac{m}{\theta^2}-\frac{n-m}{(1-\theta)^2} $$ so the Fisher information is  $$ I(\theta)=-E\left(\frac{\partial^2\log L(\theta|n)}{\partial \theta^2}\right)=\frac{m}{\theta^2}+\frac{E(n)-m}{(1-\theta)^2}=\frac{m}{\theta^2}+\frac{\frac{m\theta}{1-\theta}-m}{(1-\theta)^2}\\ =\frac{m(1-\theta)^2+\frac{m\theta^3}{(1-\theta)}-m\theta^2}{\theta^2(1-\theta)^2}=\frac{m(1-2\theta)+\frac{m\theta^3}{(1-\theta)}}{\theta^2(1-\theta)^2}\\ =\frac{m(1-2\theta)(1-\theta)+m\theta^3}{\theta^2(1-\theta)^3}=\frac{m(1-3\theta+2\theta^2+\theta^3)}{\theta^2(1-\theta)^3}\\ \propto\frac{1-3\theta+2\theta^2+\theta^3}{\theta^2(1-\theta)^3} $$  This, however, does not give me the correct answer. The correct answer is  $$ \pi_J(\theta)\propto \frac{1}{\theta(1-\theta)^{1/2}} $$ which means that the Information I get should be   $$ I(\theta)=\frac{1}{\theta^2(1-\theta)} $$ since the prior should be proportional to the square root of the information.   Can anyone find any mistakes? I wouldn't be surprised if I screwed something up with the set up of the distribution (successes vs failures with their respective probabilities, etc).   I used the expected value from  and I know the correct answer from .


I have an Excel workbook with 2 worksheets.  One worksheet is for the input of stock transactions, the other has an overview of the portfolio.  So on the portfolio worksheet I would like to have a column with the total number of each stock.  Now to get this I would need a formula to check the name of the stock on the portfolio worksheet, say this is in B column, and then find the last input of this stock on the transactions worksheet (C column), and finally get the total number of stocks I have calculated on that row, say on J column.  Example:  Portfolio Worksheet    B    |      C       |         F             | Stock  | Last Price   | Cumulative Units      | IBM    |     ###      | (formula needed here) |   Transactions Worksheet    A   |   C    |         J        | Date  | Stock  | Cumulative Units |  ###  |  IBM   |   10000          |  ###  |  IBM   |     20000        |  ###  |  IBM   |       30000      |   I need a formula in cell F of the portfolio worksheet to check the value of B column (name of stock), and then search in the Transactions worksheet my last input of that stock and output the cumulative Unit figures on that row, e.g., 30,000.  I'm trying to make an Excel version of an online Google sheet portfolio tracker and the formula on the Google sheet is      =iferror(INDEX(arrayformula(filter(Transactions!J:J,Transactions!C:C<>"",row(Transactions!C:C)=max(if(Transactions!C:C=B2,row(Transactions!C:C),0)))),1),0)

Basically, I could do this manually, but as the data is huge, it would take a lot of time. I am sure there must be a formulaic way of doing it.  I have two worksheets in Excel.  Worksheet 1.  Column-A        Column-B Device Names    Total numbers Device A           19  Device B           81 Device C           12  Device D           21  etc.               etc.   Worksheet 2.  Column-A         Column-B Device Names   Total numbers Device D Device S Device Z Device S etc.   I need the formula which will look-up the Device names in Column-A/Worksheet 2 in ColumnA/Worksheet 1. If the device names in worksheet 2 and worksheet 1 match, the data in Column-B of worksheet-1 should be transferred to Column-B in worksheet-2.


By Arzela-Ascoli, if I show that A is bounded and equicontinuous. Then, it is totally bounded. I have no problem showing that it is bounded. But I do not know how to determine it is equicontinuous or not. Can you help me? Thanks for any help.

Suppose $f_n(x)=\sin(nx)$ on $[0.2\pi]$. Is the sequence of functions $\{f_n\}_{n \geq 1}$  equicontinuous on $[0.2\pi]$?  I try to compute derivative, which is $$f^{\prime}_n(x)=n\cos(nx)$$ which gives us $\sup_{x\in [0,2\pi]}|f^{\prime}_n(x)|=|n \cos(nx)|$, which is unbounded. So can we conclude that the sequence of functions is not equicontinous?  Remark: I don't know whether we can use derivative to show equicontinuity of a sequence of functions or not. I saw this somewhere else but I don't know why it works and why it doesn't.  EDIT: Is it always true that $|f_n(x) - f_n(y)| \leq \int_x^y{|f_n^{\prime}(t)|dt}$? So if $|f_n^{\prime}(t)|$ is bounded for all $n$, then the sequence of functions is equicontinuous?


Is the sequence  $\left(\dfrac 1{n^2 \sin n }\right)$ convergent ? If it does, with what limit?

Are there any infinite series about which we don't know whether it converges or not? Or are the convergence tests exhaustive, so that in the hands of a competent mathematician any series will eventually be shown to converge or diverge? EDIT: People were kind enough to point out that without imposing restrictions on the terms it's trivial to find such "open problem" sequences. So, to clarify, what I had in mind were sequences whose terms are composed of "simple" functions, the kind you would find in an introductory calculus text: exponential, factorial, etc.


I posted an item I was selling on Craigslist. This is two different buyers who want to buy my item. One was $150 and the other was $100. And these two separate buyer had sent me a check that was over $1000. I checked my email to inform them then they had said the EXACT same thing. They both wanted me to run by the money gram and send the rest of the money to some person’s address (two different person’s address). I already know that this is a scam; what should I do?

This is actually about my sister-in-law who lives in Georgia. She just received a "cashiers check" for $2395 from a company in Indiana. It looks like this:    She said that she has been doing "mystery shopper" work for a company and thought that this would be payment for that, but that usually the payments she received for that work were just a couple of hundreds of dollars.  She said she had not done that much of that "mystery shopper" work that she would have expected to receive anything close to the amount on this check.  She was asking me about it but I thought that if she does not know the sender, perhaps this could be some kind of new scam and she should check with the local police (which she said she was going to do).  Anyway I wanted to ask here if anyone knows of a scam like this? Considering that the check here seems to be a "cashiers check", how would a scam like this even work?  Update: I just found out that there was indeed a letter included with the check (and it seems to have instructions similar to those mentioned in the answer by "BrenBarn"). This is indeed related to that "mystery shopper" work. Turns out the reason she was not sure was because the sender of that check has a different company name than the company she normally dealt with. Here is a part of the letter:


I'm having trouble in running C code from Geany. The code compiles successfully, but when I try to execute it, it shows on Terminal:   /tmp/geany_run_script_I007A0.sh: 7: /tmp/geany_run_script_I007A0.sh: ./test: not found   I saved the program as test.c.

I wrote a simple program to print "hello world". The compiler shows a message "Compilation finished successfully". But the out put of the program, I can't see anywhere.    As using codeblocks a new terminal comes out with the program output. How can I see the program output using geany compiler.


Left my precooked vacuum sealed ham out in 45 degree garage over night is it still good to make

If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more?


I use  on Windows as my terminal to work with WSL. I want to use GUI instead of terminal. Is there any walkthrough of how to install a desktop GUI on WSL and be able to start it either upon connection or using a command? Thanks

I searched around, and currently there are two methods suggested; installing an enhancement for Windows Subsystem for Linux and installing an XServer.  I want to know which method is the most hassle-free (easy to install AND to use), and which one is less memory-heavy.  I just want Synaptic and CMake. Why couldn't that be a builtin feature?


Prove that a strictly increasing function $f:[a,b]\rightarrow\mathbb{R}$ which has the intermediate value property is continuous on $[a,b]$.     Let $x_0\in[a,b]$. As $f$ is strictly increasing, $$\sup_{a\leq x<x_0}f(x)=f(x_0^+)\leq f(x)\leq\inf_{x_0<x\leq b}f(x)=f(x_0^-)$$ To yield a contradiction, suppose that $f(x)<f(x_0^+)$. Let $\{x_n\}$ be a sequence of $(x_0,b]$ that converges to $x_0^+$such that $\lim\limits_{n\rightarrow\infty}f(x_n)=f(x_0^+)$. Since $f$ is strictly increasing, $$f(x_n)>f(x_0^+)>f(x_0)$$ Apply the intermediate value theorem, there exists a point $x'\in(x_0,x_n]$ such that $f(x')=f(x_0^+)$, then $$\inf_{x_0\leq x<x'}f(x)\geq\inf_{x_0<x\leq b}f(x)=f(x')$$ However, by strictly monotonicity of $f$,  $\inf_{x_0\leq x<x'} f(x)<f(x')$ which is a contradiction.   Hence, $f(x)=f(x_0^+)$. Similarly, $f(x)=f(x_0^-)$,$f(a)=f(a^+)$, and $f(b)=f(b^-)$.    Can someone give a hint or suggestion to write a direct proof? Thanks

How to prove that a strictly increasing function $f:[a, b]\rightarrow \mathbb{R}$ which has the intermediate value property is continuous on $[a, b]$.


I want to write a custom application which can dim my screen. I like the default effect of dimming the screen in Ubuntu when system it's not in use for 10 minutes (default setting). Which program or code in kernel is responsible for this effect?

I am using Ubuntu Natty on my laptop. While unplugged screen fades out, gets a little bit darker. It is great for the battery.   The question is how I can adjust the time before the fades out. Now it is something like 5 seconds.  When I read I must hold my finger on the touchpad in order to be not annoying of the brightness shifts every time.   1 or 5 minutes should be better.  I looked for it in Compiz configuration with no success....  Thank you in advance.


I want to show others what keys I currently press onscreen. Unfortunately, neither xvkbd nor florence nor onboard visualize the keys I press. What else can I use?

I'm going to be giving a short "talk" about efficient note taking with LyX. As such it'll be important to focus on keyboard shortcuts. Since people can't see me type, however, I want a tool that displays keyboard combinations as I press them, like this:    I'm sure I've read about something like this on OMG Ubuntu!, but my google-fu is weak.  Ideas?


Hi I'm creating a 2D array of objects in java and want to access one of the functions that simply returns the boolean value of the variable but for some reason, its throwing an error. The code looks so simple but I can't figure out what I am doing wrong. My guess is something to do with my implementation of the array, but I think I did it right. My goal is to create individual instances of the class for each value in the 100x100 grid. Here is the code and error I am getting public class Main {      public static void main(String[] args) {         ParkingLot parkingLot = new ParkingLot("Rushi's Parking lot", 100, 100);          Vehicle car1 = new Car("License");         parkingLot.registerVehicle();      } }  public class ParkingLot {     String name;     ParkingSpot[][] parkingGrid;      public ParkingLot(String name, int xSize, int ySize){         this.name = name;         this.parkingGrid = new ParkingSpot[xSize][ySize];     }      public void registerVehicle() {         System.out.println(parkingGrid[0][0].isAvailable());     }      public void getNextSpot(Vehicle vehicle){      } }  public class ParkingSpot {     private boolean available = true;     private String license;     private int time;      public boolean isAvailable() {         return available;     }      public void reserveSpot(String license){         this.license = license;         this.available = false;     } }  Error: Exception in thread "main" java.lang.NullPointerException     at ParkingLot.registerVehicle(ParkingLot.java:14)     at Main.main(Main.java:7)

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


Especially the outer edges will have an extremely high relative velocity from the perspective of an external observer. In the , two objects age differently due to different reference frames. Do different parts of the disk age differently due to rotation? What about the center of the disk?

With today's ultracentrifuge technology, they can spin so fast that the sample can be subjected to  accelerations of up to 2 millions Gs. That is equivalent to two solar masses. Has someone tried to measure the time dilation in a radioactive sample? How calculate that time dilation respect to the time outside the ultracentrifuge, for example one week. I think that that time dilation will be significant enough to be measured.


I was wondering if there is a word that describes when someone emotionally agrees with someones argument regardless of whether the argument actually is a valid argument or not.  For example a fan of sports team X might get excited and agree with someone's argument that "Sports team Y is terrible" regardless of any evidence they give to support that claim.  The online Cambridge definition of 'jingoism' is close, but describes only nationalistic arguments.  It's not a potshot, or straw man because those describe the argument and also because the word I'm looking for could allow for a rigorous, and true argument, but the reason the person agrees with it is not based on the argument but their allegiances.

I'm looking for a word that is similar to patriotic but does not relate to one's country (or state).  For what it's worth, I'm specifically referring to "overly patriotic" in a negative sense, to describe someone who has a overly sentimental/cultural or otherwise less-than-rational attachment or devotion to something and makes it part of their very identity. A common example might be an extremely zealous football fan.


I want to extract the total page range of a pdf using using bash commands. Is it possible to do.

Do you have any idea how to extract a part of a PDF document and save it as PDF? On OS X it is absolutely trivial by using Preview. I tried PDF editor and other programs but to no avail. I would like a program where I select the part that I want and then save it as a PDF file with a simple command like CMD+N on OS X. I want the extracted part to be saved as PDF and not as JPEG, etc.