I do have a simple Object which can be identified by a String. These identifiers are unique.  public class SomeObject  {      private String identifier;      public String getIdentifier() {         return this.identifier;     } }   I now have another class which holds a List of these simple Objects and has a method to return the object that matches the identifier provided if it exists in the list.   public class SomeBiggerClass {      LinkedList<SomeObject> allObjects;      public SomeObject getObject(String identifier)     {         if (this.allObjects.stream().anyMatch(object -> object.getIdentifier() == identifier)) {             return this.allObjects.stream().filter(object -> object.getIdentifier() == identifier).findAny().get();         }         else {             return null;         }     } }   However even if the Strings exactly match it will return false for the anyMatch() part and will throw an exception for the second lambda. I would be alble to do this in c# and linq, however I'm kinda lost with these java lambdas. Any ideas on how to do this would be apreciated.

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


I have this, in my onPostExecute :      String test = currentActivity.getClass().getSimpleName();     if(test == "SplashScreen"){         Log.e("OK",test);      } else {         Log.e("OK",test);      }   The problem is, the value of test is "SplashScreen" (that we can see with the log), but the code never goes in the if, only in the else.  Why does this happen?


To most, this question might feel subjective... but there's really more than just opinion involved here.  If you hover your hand over something in real life, most times a subtle shadow will appear above the object. Mimicking that same idea in the form of user-interface / experience could be more intuitive or natural... or not if the user perceives technology as something totally separate from real life.  An example of the two:   So again, what is more intuitive to the user, a button that is illuminated upon hover, or darkened upon hover? And why?

We're having a discussion in the office about whether a button should become lighter or darker when a user hovers over it.   Here are some examples from the field:  Apple "Buy Now" button (Second is hover, third is depressed) -     Twitter Bootstrap -    (Unselected)   (Hover)  Github homepage - github.com      The button on FogBugz homepage goes from yellow to slightly lighter yellow. The buttons on Optimizely and Visual Website Optimizer hardly change.  Amazon's "Buy Now" button doesn't do anything when you hover over it (besides change to a pointer cursor). The colored buttons in Google's new interface (see Gmail or Calendar) go slightly darker when you hover over them.  Finally here is our button:    Should your button become lighter or darker when you hover over it? What else should you consider? Does anyone have data on whether the hover effect matters for conversions?


tl;dr ... found a script that uses ${1+"$@"} to forward command line arguments to another script. What exactly does this do? When do you use it instead of $@ and "$@"?  There's a simple shell script called runhaskell that is distributed with ghc on Ubuntu 15.10 (and perhaps others). I am trying to figure out how to replace it with something that's aware of cabal sandboxes. The shell script looks like this. It appears to have some variables that aren't used and an unnecessary shebang-like comment (from an earlier version of the script?)  #!/bin/bash exedir="/usr/lib/ghc/bin" exeprog="runghc" executablename="$exedir/$exeprog" datadir="/usr/share" bindir="/usr/bin" topdir="/usr/lib/ghc" #!/bin/sh  exec "$executablename" -f "$bindir/ghc" ${1+"$@"}   I'm having trouble understanding the last line. /usr/lib/ghc/bin/runghc is a native executable that runhaskell evidently delegates to, and one of the arguments it passes in is the location of the compiler. Okay, no problem.  What does ${1+"$@"} do and when should you use it? My best guess is that 1 is just a test that always succeeds and that this construction is just being used just to pass in the arguments verbatim. I remember POSIX requires that $@ and "$@" behave somewhat differently from what you'd expect, but I don't remember the exact details.

In the Perl documentation,  suggests launching Perl scripts using a bilingual shell/Perl header:  #!/bin/sh #! -*-perl-*- eval 'exec perl -x -wS $0 ${1+"$@"}'     if 0;   What does ${1+"$@"} mean?  I tried using "$@" instead (using Bash as /bin/sh), and it seems to work just as well.    Edit  Two answers below say that it's supposed to be ${1:+"$@"}.  I am aware of the ${parameter:+word} ("Use Alternate Value") syntax documented in bash(1).  However, I am unconvinced, because   Both ${1+"$@"} and "$@" work just fine, even when there are no parameters.  If I create simple.sh as  #!/bin/sh eval 'exec /usr/bin/perl -x -S -- $0 "$@"'     if 0; #!perl use Data::Dumper; print Dumper(\@ARGV);   and question.sh as  #!/bin/sh eval 'exec /usr/bin/perl -x -S -- $0 ${1+"$@"}'     if 0; #!perl use Data::Dumper; print Dumper(\@ARGV);   I can get both to work identically:  $ ./question.sh  $VAR1 = []; $ ./question.sh a $VAR1 = [           'a'         ]; $ ./question.sh a 'b c' $VAR1 = [           'a',           'b c'         ]; $ ./question.sh "" $VAR1 = [           ''         ]; $ ./simple.sh  $VAR1 = []; $ ./simple.sh a $VAR1 = [           'a'         ]; $ ./simple.sh a 'b c' $VAR1 = [           'a',           'b c'         ]; $ ./simple.sh "" $VAR1 = [           ''         ];  Other sources on the Internet also use ${1+"$@"}, including  who seems to know what he's doing.   Perhaps ${parameter+word} is an undocumented alternate (or deprecated) syntax for ${parameter:+word}?  Could someone confirm that hypothesis?


Had a quick look around on here and around the web but I haven't been able to fix my problem yet.  I recently bought a new laptop with windows 8 pre installed on it but I want to be able to dual boot with ubuntu. I turned secure boot off in UEFI and I changed my load order so it would boot cd, USB then HDD. When I boot from my USB I get to a GRUB menu where I can choose to install or try ubuntu, no matter which one I select the screen goes black and stays that way. Left it for over half an hour the first time and nothing happened.  Trying to install ubuntu 12.10  Laptop is MSI GE60 288au with Intel Core i7-3630QM  *definately an issue with UEFI, when I boot in legacy mode it works fine, except it doesn't detect my already installed windows 8!

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


I have an object Application and Application Address.  Type field on Application address which has values Addr1,Addr2,Addr3  Trigger on application :- When new application is created, Create 3 application address of different type.  On my vf page. I want to show all 3 application address in different page block section.  I tried this and its working. But want to know how is this possible using map In constructor  this.bizapplicationaddress =[SELECT Type__c, Name, Id, Contact_Person__c, Contact_Person_Title__c, Application__c, Address__c, Additional_Instructions__c                                      From Application_Address__c                                     WHERE Application__c = : this.application.id                                     AND Type__c = 'Address1' LIMIT 1];                        this.corapplicationaddress =[SELECT Type__c, Name, Id, Contact_Person__c, Contact_Person_Title__c, Application__c, Address__c, Additional_Instructions__c                                      From Application_Address__c                                     WHERE Application__c = : this.application.id                                     AND Type__c = 'Address2'LIMIT 1];                    this.regapplicationaddress =[SELECT Type__c, Name, Id, Contact_Person__c, Contact_Person_Title__c, Application__c, Address__c, Additional_Instructions__c                                      From Application_Address__c                                     WHERE Application__c = : this.application.id                                     AND Type__c = 'Address3' LIMIT 1];        public void copyAddresDetailstoBiz() {     this.bizapplicationaddress.Contact_Person__c            =   this.regapplicationaddress.Contact_Person__c;     this.bizapplicationaddress.Contact_Person_Title__c      =   this.regapplicationaddress.Contact_Person_Title__c;     this.bizapplicationaddress.Address__c                   =   this.regapplicationaddress.Address__c; } public void copyAddresDetailstoCor() {     this.corapplicationaddress.Contact_Person__c            =   this.regapplicationaddress.Contact_Person__c;     this.corapplicationaddress.Contact_Person_Title__c      =   this.regapplicationaddress.Contact_Person_Title__c;     this.corapplicationaddress.Address__c                   =   this.regapplicationaddress.Address__c; }   In page block  <apex:pageBlockSection columns="1" id="pbRegisteredAddr" title="Address1">     <apex:inputField value="{!regapplicationaddress.Contact_Person__c}"/>     <apex:inputField value="{!regapplicationaddress.Contact_Person_Title__c}"/>     <apex:inputField value="{!regapplicationaddress.Address__c}"/>  </apex:pageBlockSection> <apex:pageBlockSection columns="1" id="pbBusinessAddr" title="Address2"><apex:commandLink action="{!copyAddresDetailstoBiz}" value="Same As Above" reRender="pbBusinessAddr"/> <apex:inputField value="{!bizapplicationaddress.Contact_Person__c}"/>     <apex:inputField value="{!bizapplicationaddress.Contact_Person_Title__c}"/>     <apex:inputField value="{!bizapplicationaddress.Address__c}"/>  </apex:pageBlockSection>  <apex:pageBlockSection columns="1" id="pbCorrespondenceAddr" title="Address3"> <apex:commandLink action="{!copyAddresDetailstoCor}" value="Same As Above" reRender="pbCorrespondenceAddr"/>     <apex:inputField value="{!corapplicationaddress.Contact_Person__c}"/>     <apex:inputField value="{!corapplicationaddress.Contact_Person_Title__c}"/>     <apex:inputField value="{!corapplicationaddress.Address__c}"/>     <apex:inputField value="{!corapplicationaddress.Additional_Instructions__c}"/> </apex:pageBlockSection>

Can anyone please help me to understand the below code. I am not able to understand how we are  extracting value from map on visualforce page.  Actually i am trying to get the size of value list which is associated with respective key in map.              <apex:outputPanel >                 <apex:repeat value="{!attributeWrapper.mapAllAttributesLabel}" var="M">                     <div>                         <div>{!attributeWrapper.mapLabels[M].Name} </div>                         <div>                             <ul>                                 <apex:repeat value="{!attributeWrapper.mapAllAttributesLabel[M]}" var="attribute">                                     <li>                                     <p>                                         <apex:outputLink onclick="selectAttribute('{!attribute.attributeLabel.Label__c}','{!attribute.attributeLabel.Attribute__c}');return false;">                                            <apex:outputLabel value="{!attribute.attributeLabel.Attribute__r.Name}"/>                                         </apex:outputLink>                                     </p>                                     </li>                                 </apex:repeat>                             </ul>                         </div>                     </div>                 </apex:repeat>             </apex:outputPanel>    public with sharing class AttributeWrapper {      public Map<String, List<AttributesLabelWrapper>> mapAllAttributesLabel{       // some code to populate this map     } }   If i do:  {!attributeWrapper.mapAllAttributesLabel[M].size}   I get an error so how do i get the size of value list on VF page?


I have a form that I'm using to collect responses on in Google Forms. One of the question includes a response that usually starts with a leading zero (like an account number).  When the response is collected in the spreadsheet, the leading zero is removed.  I've changed the format of that particular column to "Plain text", but it doesn't fix the issue for previous responses. Also, when I do this, new responses don't follow the formatting rule - it changes all new responses to "Automatic" formatting.  How can I resolve this?

I have Google Forms where users enter information, some of which contains leading zeros (e.g. zip codes, ID numbers).   However, when this data is saved to the Google Sheet, it doesn't treat it as plain text and strips the zero. The form fields are text fields with no validation.   I have tried to format the range of cells containing these values as plain text, but it seems Sheets does not set the formatting as plain text unless there is already text in a cell. So I can format a column as plain text, submit the form, and the leading zero will still be stripped.   I tried writing an apps script to deal with this but there's no good way for me to deploy it to the users who would need it.   How can I get around this without having to instruct users to prepend a single quote to their form entry? This is such a small thing, but I can't find a good simple solution to what it seems must be a common problem. If I can't get this to work I may have to drop Google Forms/Sheets altogether.


Suppose that the equation $x^4+y^4=z^2$ has solutions $(x,y,z)\in\mathbb{Z}^{3+}$, let $c$ be the smaller $z$ for which $(x,y,c)$ is a solution. (1) If $x$ is even, prove $x^2=m^2-n^2, y^2=2mn, c=m^2+n^2$, $m,n$ relatively prime. (2) Prove $x=r^2 - s^2, n=2rs, m=r^2+s^2$, $r,s$ relatively prime.   (1) I have the following theorem: if $x^2+y^2=z^2$ then $x^2=2ab, y^2=b^2-a^2, c=b^2+a^2$.  Taking the $x^2$ to be $y$ in the latter, $y^2$ to be $x$ and $c$ to be $z$, then there is $m,n$ such that $x^2=m^2-n^2, y^2=2mn, c=m^2+n^2$.  (2) $x^2+y^2=m^2-n^2+2mn=(m-n)^2$. By means of the same theorem, there is $r,s$ such that $x=r^2-s^2, y=2rs, m+n=r^2+s^2$. This gives the equation for $x$, but the other two don't seem two follow, because it needs too be $n=y$ and if $m+n=r^2+s^2$ then $m=(r-s)^2$ instead of $m=r^2+s^2$.

$x, y, z \in \mathbb{N}$,    $\gcd(x, y) = 1$  prove that $x^4 + y^4 = z^2$ has no solutions.  It is true even without $\gcd(x, y) = 1$, but it is easy to see that  $\gcd(x, y)$ must be $1$


Each Stack Exchange site has its own, dedicated meta site. I just asked by myself, why not one meta site for all Stack Exchange sites?  I suppose that many questions have cross site duplicates and for specific questions it would be possible to introduce site specific tags. Are there technical constraints or is it more likely design decision?

Historically this site, , has been the place to ask questions about not just Stack Overflow, but the functioning of the entire Stack Exchange (2.0) network, including Area 51 and stackexchange.com and careers.  (Yes, there was a , but that dealt with the old legacy Stack Exchange 1.0 sites. It was deprecated a while ago, and currently redirects here.)  Now that we've gotten many, many months under our belt from the SE 1.0 days, I think it's time that we gave Stack Overflow its own, true per-site meta, and moved the higher level network meta discussions to meta.stackexchange.com.  Over time, it's begun to bug me more and more that requests for Stack Overflow, the site, kind of get buried here on meta.stackoverflow under the avalanche of network issues. Retag requests, synonym requests, things truly specific to Stack Overflow, the site, not the network. This is unfair to our vastly largest and flagship Q&A site, and it's unfair to the Stack Overflow users to mix their requests in with network level concerns.  It's also odd that Stack Overflow is the only network site without a proper, dedicated per-site meta, where its meta has its own reputation system not tied to the parent site in any way.  This is mostly a quirk of history more than anything else, and I believe it is now an appropriate time to split into two sites:   , a proper per-site meta for Stack Overflow with integrated rep , a global network meta with its own reputation system   Yes, this will be painful. But I believe it is a good, necessary, and healthy step both for the future of the network and the future of Stack Overflow.  Some things to discuss:   which questions should be migrated from here to meta.so? Obviously site-specific things like the retag-requests, and perhaps questions with the  tag. Anything that is 100% wholly specific to Stack Overflow and not generalizable to the rest of the network should be moved over. This may be a pretty small, narrow list of questions, and that's OK. Should we do some meta spring cleaning in our transition? Which questions / tags should be blown away as no longer relevant, referring to ancient versions of Stack Overflow or issues that have long since ceased to exist and aren't instructive for any future visitors? Your meta reps will generally be unaffected, except insofar as we delete for spring cleaning, or move site-specific things to meta.so. We still plan to have a distinct reputation system for the new meta.se site, just like here.   I do not have a timeline for this change, that is up to Jarrod and David to decide. It may be months away. However, we feel pretty strongly that this is something that we need to do to clean things up and pave the way for the future -- so I expect it will happen in the next few months, giving us lots of time to decide how we want to do it, per the above.  Update  .


Find the lowest value n such that $\frac {n^2-38}{n+1}$ is an integer  So, it's not really hard to notice that n can't be an integer different to 0, and 0 could be the lowest value, but maybe there's a non-integer n that satisfies such equation.I've tried to factorize, and acomplish $$\frac {(n-6)(n+6)-2}{n+1} $$ But i still find nothing.  So i'm looking for a hint or answer,thanks

How can I find all integers $x≠3$ such that $x−3|x^3−3$?  I tried expand $x^3−3$ as a sum but I couldn't find a way after that.


I wanted to give my submit button a value. I have watched this video,    but I am using CodeIgniter so it gave me an error.  I have already done this:  <?php    echo form_open('Mycontroller/thisfunction/'.$this->uri->segment(3));   ?>         <button class="btn btn-info fa fa-save" type="submit" name ="1">&nbsp Save</button>         <button class="btn btn-primary fa fa-save" type="submit" name ="2">&nbsp Save1</button>      <?php        echo form_close();     ?>   and my controller:  public function thisfunction(){      if($_POST['1']){         echo "1";     }else if($_POST['2']){         echo "2";     } }   but I got the error Message: Undefined offset: 1 and Message: Undefined offset: 2..   I need this code because I will be using it like this:      if(THIS BUTTON IS USED){         redirect it to this page     }else if(THIS BUTTON IS USED){         redirect it to other page     }

I have two submit buttons in a form. How do I determine which one was hit serverside?


There are a few sites I have visited by mistake. These are not bookmarked, but despite repeated clearing of browser history, both from within Firefox, and using CCleaner, Firefox keeps suggesting these sites via autocomplete in the location bar. This happens on both OSX and Windows.  For example, one time, about 23 versions ago, I typed vim and then accidentally pressed ⌘-Enter instead of ⌘-Shift-Enter. The latter would have browsed to www.vim.org whereas I ended up on www.vim.com.  To this day, when I type vim in the location bar, I am offered vim.com, and not vim.org as the first choice even though I have cleared history many times, and vim.org is bookmarked:    How can I get Firefox to offer vim.org (which is bookmarked) instead of vim.com (which is not bookmarked) when I type vim in the location bar?  PS: Search suggestions in both the search bar and the location bar are disabled.  PPS: On my MacBook Pro, if I press Delete, or ⌘-Delete, or Shift-Delete, it clears vim.com from the location bar, but the same thing happens again the next time I type vim into the location bar.  PPPS: The magic of asking on SuperUser strikes. Doing the same thing I have done before, delete from auto-complete, clear history, and then clean using CCleaner, I now have what I want.

I love the way the browser remember the text I entered into a form field - especially when I'm a developer. It saves lots of my typing time.  Though, sometimes there are unwanted remembered items and need to be removed. I don't know how to do that in Firefox and Chrome. Please help!


I'm confused, why do I get Undefined index: file_upload_name when using ajax to submit the form?  I've just made a test and this is the php server.  <?php    echo count($_FILES['file_upload_name']['name']); ?>   this is the form, I want to have an anchor button to submit the form instead of the regular button.  <form method="post" id="the-form" action="upload.php" enctype="multipart/form-data">     <input type="file" name="file_upload_name[]" multiple>     Submit </form>   this is the jquery, where I used ajax to manually submit the form on anchor click.  $( document ).ready( function () {     $( '#btn-submit' ).on( 'click', function ( e ) {         e.preventDefault();         $.ajax( {             url: 'upload.php',              dataType: 'text',              cache: false,             contentType: false,             processData: false,             data: $( '#the-form' ).serialize(),             type: 'post',             error: function ( jqXHR, textStatus, errorThrown ) {                 console.log( "OOPS!: " + errorThrown );             },             success: function ( data ) {                 console.log( 'Submit success, server says: ' + data );             }         } );     } ); });   here is the error thrown by the server     Successfully upload the file:    Notice:  Undefined index: file_upload_name in D:\xampp\htdocs\sampleupload\upload.php on line 2      Warning:  count(): Parameter must be an array or an object that implements Countable in D:\xampp\htdocs\sampleupload\upload.php on line 2   0   This only happen when using ajax and not when I have a regular button to submit the form. I've missed something but I couldn't figure what it is. I'm totally confused right now.   UPDATE Just to make it clear, I'm not asking on how to do this or how to do it right now . I'm confused on why the server returns undefined index of variable and I want to understand it. Clearly, this wont happened if I used FormData(), but since I used serialize() I'm expecting the server will not say undefined index of variable.

I would like to upload a file asynchronously with jQuery.     $(document).ready(function () {     $("#uploadbutton").click(function () {         var filename = $("#file").val();          $.ajax({             type: "POST",             url: "addFile.do",             enctype: 'multipart/form-data',             data: {                 file: filename             },             success: function () {                 alert("Data Uploaded: ");             }         });     }); });  File <input type="file" id="file" name="file" size="10"/> <input id="uploadbutton" type="button" value="Upload"/>     Instead of the file being uploaded, I am only getting the filename. What can I do to fix this problem?


do I need to put a comma after 2009 in the following sentence:  In 2009, established an institute in India and served as chief executive of the Institute for three years

Is a comma required after the date (year only or day of week only) that is in a prepositional phrase before the subject of the sentence?  For example:      In 1966 I began college.


Is there a word to define a period of four months?

Is "tri-quarterly" a real English word meaning 3 times a year? Are there any other words that mean 3 times a year?


How long will beet stock be good in the fridge and is it obvious (odor or otherwise) if it's bad.  I've had this beet stock for a while and I want to drink it but I'm a little nervous. It smells fine and looks fine.

How do I know if a given food or ingredient I have is still good, or if I should discard it?  How can I best preserve a food or ingredient?     This broad question is intended as a "general reference" question to quickly answer many how long will food keep for? questions. Please feel free to edit this question to expand and clarify as needed.


Trying various versions of ActiveState and Strawberry Perl, I'm still not having any luck overcoming:  pg96/lib/postgresql/plperl.dll:  The specified module could not be found   Suggestions that may have worked for prior versions of postgres don't work for 9.6

When I create language plperl , I get error: ERROR:  could not load library "C:/Program Files/PostgreSQL/9.1/lib/plperl.dll": The specified module could not be found.  But in my computer,  "plperl.dll" file is exist in "C:/Program Files/PostgreSQL/9.1/lib/..." folder   ( I can not post illustrative image, this forum require >= 10 reputations)  And if I select * pg_pltemplate, I get:  -[ RECORD 4 ]-+------------------------- tmplname      | plperl tmpltrusted   | t tmpldbacreate | t tmplhandler   | plperl_call_handler tmplinline    | plperl_inline_handler tmplvalidator | plperl_validator tmpllibrary   | $libdir/plperl


I'm wondering what the math would be to getting a grenade arc (like you're throwing it). In my game you would know the point in 3D that you'd be aiming at so the idea would be to arc it from it's starting point to exactly that point, but I'm not sure of the math on getting all the points between so I can smoothly move it without physics. Any advice or pointing in a direction would be great. Thank you!

If I have a point which I want to hit at the end or during a parabolic arc, how would I calculate the needed x and y velocity?


print '*' * 80   This python snippet prints 80 asterisks, which I use often as delimiters in log files.  How can I do it in bash script using operator overloading?

I found the following command to repeat a character in Linux:  printf 'H%.0s' {1..5000} > H.txt   I want, for example, H to repeat 5000 times. What does %.0s mean here?


Someone is throwing a party with $n$ people in attendance( $n \ge 2$ including the host). Why are there at least two people at the party that have exactly same number of acquaintances present?

Show that in a party of $n$ people, there are two people having identical number of friends.  I am a beginner at Pigeonhole Principle problems and have produced a solution to this intermediate level question. I am excited about it and I want my solution to be cross-checked and if anything is going wrong, please point it out.  So here it goes:  Let us consider an $n$ by $n$ symmetric matrix $A$ such that $a_{ij}=1$ if $i$-th and $j$-th persons are friends, otherwise $0$.  Please understand that I have assumed that friendship is mutual in the ordinary sense and also, $a_{ii}=1$ for all $i$. The matrix visualization is not necessary, but it just helped me in my thinking process.  So all we need to do is count the number of $1$'s in a particular row as this will give the number of friends of that particular person to whom that row corresponds. For example, the total number of $1$'s in row $3$ will give the total number of friends the third person has, after we have arbitrarily chosen a first person and begun counting.  So it boils down to showing that there will be two rows with same number of $1$'s. First consider that no person is friend only with himself, and no person has everyone a friend i.e. no row in the matrix has only one $1$ and no row has all $n$ entries $1$. Then the sum of $1$'s in a row can be maximum $n-1$ and minimum $2$, giving a total of $n-2$ possible sums, but there are $n$ rows. So, two rows must have the same sum of $1$'s, and those two persons have the same number of friends.  Now consider the case where one person, say person $1$ is friend with no one except himself. That means $a_{11}=1$ and $a_{1j}=0$ for $j=2,3,...,n$. We claim that in this case, the sum of $1$'s in any row other than the first row, has a minimum value of $2$ and a maximum of $n-1$, which is easy to check. The minimum is not a problem, but in case questions arise regarding the maximum, it is clear that the maximum is not $n$ because that would imply there exists a person with $n$ friends, contradicting the fact that the first person is friend only with himself. So there are $n-1$ rows and $n-2$ possible sums, for which two rows have the same sum.  The case where one person is friends with all others is similar.  We have exhausted all the three cases and thus we are done.


In a documentary written in collaboration with Stephen Hawking, the narrator (supposedly Stephen Hawkings) says that by the time the cosmos was 10 minutes old, it had already expanded thousands of light years in diameter. How is it possible that matter was traveling faster than light?

just after the Big Bang and before inflation the currently observable universe was the size of a coin. One millionth of a second later the universe was the size of the Solar System, which is an expansion much much faster than speed of light. Can space expand with unlimited speed?


I am new to htaccess. so when i want to do a url redirect using htacces, i always get a redirect loop, and don't know how to fix it. I have been searching on the web but coundn't find a solution for me. please help on this   what i want to do is to redirect all the subpages under root(/*) to index.html under root (/index.html)  i need to redirect  www.mydomain.com.au/* to  www.mydomain.com.au/index.html  here is my code   RewriteEngine On RewriteBase /  RewriteRule ^(.*)$ http://www.mydomain.com.au/index.html [R=301,L]   please help on how to fix this thanks very much !!

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


For natural numbers $n>2$ prove that at least one of $2^n-1$ and $2^n+1$ must be composite. How would one conduct this proof? I had the idea of trying to prove by contradiction since for this to be true these would have to be twin primes however this did not seem to go anywhere.  Thanks

Not sure what approach to take with this:  Prove that at least $2^n-1 $ or $ 2^n+1$ is composite $\forall$ $n>2$


I bought Laptop Dell Inspiron 15-3552 4113/SDPP/2015 5100  12439497278 Service tag (s/n) 5PQ5LJ2 MFG YR 2017 with Ubuntu 16.04.6 LTS already installed and after one update  on screen apair login user name and password which I don't know it. I check with shift/esc/space to reach at Grub menu to change the user name and password but nothing works. Please help me!

I'm working on a Ubuntu system, and my client has completely forgotten his administrative password. He doesn't even remember entering one; however it is there.  I've tried the suggestions on the website, and I have been unsuccessful in deleting the password so that I can download applets required for running some files. Is there a solution?


I have checked out some files from subversion repository.  After building, there are a number of new files created.  How can I get the list of files that are handled which are not registered with this subversion repository?  I work on linux, and with subversion console version.

Sometimes you're developing and you decide to commit, forgetting you created a few files on your project. Then a few days down the line your buddy gets your build out of Subversion and complains that some files appear to be missing. You realize, ah crap, I forgot to add those files!  How can I get a list of the files that are not under version control from Subversion so I'm sure I've added everything to the repository?


I know this has been asked many times before but I've gone through all the previous questions and not been able to apply the answers to my particular problem. I have a SwitchPreference in my settings that switches on or off a particular set of activities. That set of activities in included in the menu, so I want to be able to hide the item when it's not valid. In my menu, the item is defined by <item     android:id="@+id/action_most_recent_summary"     android:orderInCategory="20"     android:visible="true"     android:title="@string/action_most_recent_summary"     app:showAsAction="never" />  Then in the MainActivity I create the menu with     @Override public boolean onCreateOptionsMenu(Menu menu) {     SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());     boolean do_inc_summary = sharedPreferences.getBoolean("summary", false);     if (do_inc_summary) {         menu.findItem(R.id.action_most_recent_summary).setVisible(true);     }     // Inflate the menu; this adds items to the action bar if it is present.     getMenuInflater().inflate(R.menu.menu_main, menu);     return true; }  Sometimes it doesn't work! Sometimes the app crashes and I get the following error in the logcat     java.lang.NullPointerException: Attempt to invoke interface method 'android.view.MenuItem android.view.MenuItem.setVisible(boolean)' on a null object reference     at com.example.cgpagerv2.MainActivity.onCreateOptionsMenu(MainActivity.java:52)  Line 52 is the menu.findItem line. So I think it's telling me either "menu" or "do_inc_summary" is null, but I don't understand why.

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 am researching some concepts of practical 2 party computation and was curious if anyone could point me to a research paper that is focused on private set intersection where one party has a very large set and the other has a comparatively small set.  Specifically, a user has a small set and the server has a large set.  Since the server will handle thousands or millions of requests, I am more concerned about the performance for the server.  The specific use case that I had in mind is contact discovery.  Meaning, a user wants to know who else is using a service but does not want to disclose their contacts to the server in plain text.  Ideally the server does not learn the outcome of the intersection.  At a minimum the server should only learn the size of the users contact list and the results of the intersection.  I found this  that appears to be a breakthrough in performance but it's benchmarks are based on two sets of equal size.  Is there existing research on a PSI that is optimized for non-equal set size?

Are there dedicated protocols to achieve a private set intersection where one of the set is of small constant size $c$ and the other one of size $n$?  What are the resource complexities of this kind of protocol, in terms of communication and computation?


While I update my device using software updater, I am getting following screen and then the updater paused in following screen:    Here is my locale lists, i.e. list which will display after execute locale command:    Here is a output of locale -a    Do anyone have idea how to fix it?  I have already tried the answers given over  stackoverflow question, but it didn't worked for me! :(  Edit:  After applying changes suggested in answer I am getting following error with my update-manager:    Any help would be appreciated! Thanks in advance.

I am getting this message every time I do something like starting or stopping a service.  perl: warning: Setting locale failed.    perl: warning: Please check that your locale settings:            LANGUAGE = "en_US:en",            LC_ALL = (unset),            LC_MESSAGES = "en_US.UTF-8",            LANG = "en_US.UTF-8"        are supported and installed on your system.    perl: warning: Falling back to the standard locale ("C").    locale: Cannot set LC_CTYPE to default locale: No such file or directory    locale: Cannot set LC_MESSAGES to default locale: No such file or directory    locale: Cannot set LC_ALL to default locale: No such file or directory    (Reading database ... 21173 files and directories currently installed.)   Removing bind9 ...    * Stopping domain name service... bind9                                        [ OK ] Processing triggers for man-db ...    locale: Cannot set LC_CTYPE to default locale: No such file or directory    locale: Cannot set LC_MESSAGES to default locale: No such file or directory    locale: Cannot set LC_ALL to default locale: No such file or directory      How do I fix this error ?


I have a lot of figures to put side by side in a document, and they are all slightly different in size (i.e. not all 4:3 format or so).   What I'm doing at the moment is tweak the width=0.XX\textwidth of both until they look more or less the same height.   Here I provide an example code: what I would like to be able to do is have a macro or something, where I can simply provide the two figures and they automatically scale to have the same height and fit on one line. Is that possible? And if yes, how?  Edit: since people are asking why I'm not providing specific sizes for the images: The code should work with any 2 images with any aspect ratio. Give it two images and the code scales them to fit side by side and have the same height, filling the horizontal space available.  \documentclass{scrreprt} \usepackage{subfig} \usepackage{graphicx} \begin{document}     \chapter{Figures}     \begin{figure}[h!]         \centering         \subfloat[Figure one]{%             \centering\includegraphics[width=0.45\textwidth]{example-image-a}}         \qquad         \subfloat[Figure two with different side proportions]{%             \centering\includegraphics[width=0.45\textwidth]{example-image-16x9}}         \caption{How to get the two figures to same height (respecting proportions)?}     \end{figure} \end{document}   What I get:    What I wish to happen automatically:

I want to make a figure composed of two images that have different sizes. I want to put them side by side so that they have the same height and that they overall take, say, 90% of the line width.  It is easy to make them have the same fixed height (say in cm), but how to let this common height be automatically adjusted to fulfill the desired overall width? Manual trial-and-error is time-consuming, approximate and non robust.  A solution with or without subfigure or another LaTeX package is OK.


I have two existing directories :   foo: directory with dotfiles in it foo2: empty directory   I would like to have a solution to copy all dotfiles in foo to foo2. I would like a solution that is not shell-dependent (bash, zsh, etc.). I would prefer not having to install rsync to do it (tar is ok).  Weeks ago, I asked , but I feel both questions should be separated as they answer different needs. All answers were shell-dependent or using rsync.

How do I move all files in a directory (including the hidden ones) to another directory?  For example, if I have a folder "Foo" with the files ".hidden" and "notHidden" inside, how do I move both files to a directory named "Bar"?  The following does not work, as the ".hidden" file stays in "Foo".  mv Foo/* Bar/   Try it yourself.  mkdir Foo mkdir Bar touch Foo/.hidden touch Foo/notHidden mv Foo/* Bar/


Here's how it is.  So I was studying some notes on Discrete Structures then I discovered this. Prove that $2^N = \binom{N}{0} + \binom{N}{1} + \binom{N}{2} + \dots + \binom{N}{N}$ Since I was new to this, I didn't quite understand it.  I tried using the binomial expansion but it confused me a little.  Can someone please help me solve this.  That would be great.

I'm well aware of the combinatorial variant of the proof, i.e. noting that each formula is a different representation for the number of subsets of a set of $n$ elements. I'm curious if there's a series of algebraic manipulations that can lead from $\sum\limits_{i=0}^n \binom{n}{i}$ to $2^n$.


The verb , as defined by English Oxford Living Dictionaries, means to grind (one's teeth) together as a sign of anger (often used hyperbolically).  We [humans] gnash our teeth whenever we are in an anger mood, but cattle often gnash their teeth, and I don't think that cattle grind their teeth angrily; in fact I often find them grinding their teeth without being angry. Hence, we can't use the verb gnash whenever any cow or goat grinds their teeth. Is there any verb to be added here for this need?     A cow was______her teeth.

How do you describe the the way cattle buffalo chew ("re-chewing", specifically) their food? There is a specific aspect of their food eating habit which is often related to how people work.


I am not sure whether forward or forwards is to be used in this sentence.

As an adverb, what is the difference between forward and forwards?


I have a class like   public class KeyNamePair {  public string Key {get;set;}   public string Name{get;set;} }   My code  List<KeyNamePair> list =new List<KeyNamePair>();      list.Add("1", "Day 1");     list.Add("2", "Day 11");     list.Add("4", "Day 5");     list.Add("6", "Day 13");   How can i sort the list to display  >  "Day1", "Day5", "Day 11", "Day 13"   in order?  i tried   var SortedList = source.OrderBy(x => x.Name).ToList();             return SortedList;   this does not do any sort

Anyone have a good resource or provide a sample of a natural order sort in C# for an FileInfo array?  I am implementing the IComparer interface in my sorts.


To answer this question, I tried using the combinations formula in the following manner: I first obtained the number of elements in the sample space ( the number of 5 card hands that could be drawn from a deck of 52 cards) by calculating C(52,5)=2,598,000 and then calculated the number of 5 card hands that had cards all from the same suit by calculating C=(4,1) and C=(13,5) and multiplying those values together to obtain a total of 5148 different hands containing five cards of the same suit. I then divided this value by 2,598,000 to obtain the probability of a 5 card hand being drawn from a deck of 52 cards having all of its cards be of the same suit. This gave me a value of ~0.001981524 (which is the probability rounded to seven decimal places).

The following is the problem put to me:  A 5-card poker hand is dealt from a well shuffled regular 52-card playing card deck. Find the probability that the hand is a Flush (5 nonconsecutive cards each of the same suit).   I am completely unfamiliar with poker, and just learning the principles of probability. I would appreciate some help understanding the problem, and figuring out how to proceed from there.  For example: when it says "5 nonconsecutive cards," does it mean no single card can be consecutive to any other, or does it only mean that they cannot all 5 be consecutive to one another? (Same goes for other combinations- are 4 in a row disallowed? 3 in a row? 2? Are 2 and Ace considered consecutive?)  For the sake of beginning the problem, I'm going to assume none of them can be consecutive to any other, and that the 2 and the Ace are not considered to be consecutive. If I'm wrong I would appreciate someone correcting me.  Here's how I think I might begin $\ldots$  First, we're choosing cards of the same suit, so we have 13 of any one suit.  None of these can be next to each other, so we'd have to consider the different ways they could be alternating.  They could either be in the alternating slots: 2,4,6,8,10,Q,A , of which there are 7 possibilities.  Or in the alternating slots: 3,5,7,9,J,K , of which there are 6 possibilities.  So I figure, the answer to this would be:  $(7C5 * 6C5) / 52C5$  Can anyone either verify or correct my assumptions about the nature of the question, and point me in the right direction if my logic/solution is incorrect? Thank you very much.  P.S. I assume this question is asking ONLY about the probability of getting a flush, rather than a straight flush or a royal flush (which I believe is a "thing"), since it's asking about nonconsecutive cards specifically.


I would like the result of this to return correct to 2 decimal places. ie price = 4.35 ie weightGrams = 233  public double pricePerHundredGrams() {    return (price * 100) / weightGrams;  }    I would like the calculation to return as 1.86 not 1.86695279....

What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations.  I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes.  I know one method of doing this is to use the String.format method:  String.format("%.5g%n", 0.912385);   returns:  0.91239   which is great, however it always displays numbers with 5 decimal places even if they are not significant:   String.format("%.5g%n", 0.912300);   returns:  0.91230   Another method is to use the DecimalFormatter:  DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385);   returns:  0.91238   However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this:  0.912385 -> 0.91239 0.912300 -> 0.9123   What is the best way to achieve this in Java?


Can you please explain how to take md5 of a file using php

I need to keep a session alive for 30 minutes and then destroy it.


Tried to install Inkscape but I'm getting this error.  GPG error:  stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D615560BA5C7FF72  I hope someone can help.

I added some extra repositories with the Software Sources program. But when I reload the package database, I get an error like the following:     W: GPG error:  trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8BAF9A6F   I know I can fix it using apt-key in a terminal, according to the official Ubuntu documentation. But I would have liked to do it graphically. Is there a way to do this without using a terminal?


Given a set $X$, can you always find a disjoint set $Y$ such that there is a bijection between them? This is easy with AC. you can well order X and replace each $x\in X$ with the least ordinal not already in $X$. I am unsure how to proceed without AC though.

How would one use the Axiom of Foundation (that every non-empty set has an $\in$-minimal element) to prove that for any two sets $x,y$ we can find a set $x'$ so that $x'$ and $y$ are disjoint and $x'$ and $x$ are in bijection?  I myself tried to construct $x$ recursively by doing the following: if $x$ and $y$ are disjoint, we are done; if not, take $z$ in $x \cap y$ and let $x_{1} = (x - \left\{z_{1}\right\} ) \cup \left\{y\right\}$. Now, the new intersection $x_{1} \cap y$ has size with $1$ less than the size of $x \cap y$ because $y \not \in y$ (by Axiom of Foundation) and so on (i.e. if $x_{1}$ and $y$ are not disjoint take $z_{2}$ in the intersection and let $x_{3} = (x_{1} - \left\{z_{2}\right\}) \cup \left\{\left\{y\right\}\right\}$. However, I don't think this works since we might have $y \in x$ and this messes up our bijection.  A detailed answer would be appreciated... (for me to get confortable with the basics) thanks


If take question 'Do you want to eat?' as example, I don't understand meaning of 'do' because:   to do something in my understanding is to take some actions, to want something is not an action, it is not something, that you 'do'.   And in form of simple statement this question will be 'I want to eat', not 'I do want to eat' (right?).   What meaning of 'do' in this question?

A former lecturer of mine once explained why, from a syntactic point of view, the English rule that negation and questions are formed with the auxiliary do follows from other syntactic facts about English.  More precisely, if you gave a good syntactician not familiar with English a corpus of English sentences containing everything but questions and negated phrases, then s/he could infer grammatical rules from it (such as headed-ness of phrases, what kind of arguments what word takes, etc.) From some of these rules, then, s/he could see that something specific would be wrong with the sentences "Gave you the present to Mary?" and "He went not to the cinema."  Can someone explain what exactly this something is and how it follows from other sentences?  FYI, my lecturer did this in Government & Binding with X-Bar theory. This may be more suitable a question for the proposed  but as it's not online yet I'm trying it here first.   Edit: the beta is online now at .


Given an Annulus with $A(0,r,R)$ show by considering Cauchy's Theorem for primitives that there is no holomorphic function with $f'(z)=1/z$  I am struggling to picture this since but it seems like there are issues because $f(z)=log(z)$ isn't well defined in the same range as $1/z$.  Is it worth considering $f(z)$ as anything other than just a function? e.g setting $f(z)=log(z)$ and proving it this way?

Given an Annulus with $A(0,r,R)$ show by considering Cauchy's Theorem for primitives that there is no holomorphic function with $f'(z)=\dfrac{1}{z}$.   I am struggling to picture this since but it seems like there are issues because $f(z)=\log z$ isn't well defined in the same range as $\dfrac{1}{z}$.  Am I looking to show that $\int_Ag(z)dz = 0$ where $g(z) = \dfrac{1}{z}$?


Let $f$ be twice continuously differentiable on $[0,2]$, and $|f(x)|\leq 1$, $|f''(x)|\leq 1$.   Prove that $|f'(x)|\leq 2$.  If I use Lagrange intermediate value theorem, then  $$|f'(\xi)|=\frac{|f(2)-f(0)|}{|2-0|}\leq 1$$ for some $\xi$. Using  $$|f'(x)|=|f'(\xi)+f''(\eta)(x-\xi)|\leq 2$$ if and only if $|x-\xi|\leq 1$. But this does not cover all of $[0,2]$....

Let $f:\mathbb{R} \to \mathbb{R}$ be a twice differentiable function. And let  $$\eqalign{   & M_0  = \sup \left|f(x)\right|  \cr                & M_1  = \sup \left|\frac{d}{dx} f(x) \right|  \cr                & M_2  = \sup \left|\frac{d^2}{dx^2} f(x) \right| \cr }$$ Prove that  $$M_1 ^2  \leqslant 4M_0 M_2$$ I can not think how I can relate these values in some inequality )=


Suppose $A \in \mathbb{R}^{nxn}$. Let $\lVert A \rVert_1 = \max \{\lVert Ax\rVert_1: \lVert x \rVert_1 \leq 1\}$ and $\lVert A \rVert_{\infty}= \max \{\lVert Ax\rVert_{\infty}: \lVert x \rVert_{\infty} \leq 1\}$. How do I show that these two norms are dual of one another?  I tried to show this by showing $$\lVert A \rVert_{\infty} = \max\{Tr(Z^TA): \lVert Z\rVert_1 \leq 1\}$$  and vice versa.   I found out that $Tr(Z^TA) = \sum_{i=1}^n z_i^Ta_i$ where $z_i, a_i$ are the columns of $Z, A$ respectively. So we have that   $$\sum_{i=1}^n z_i^Ta_i \leq \sum_{i=1}^n \lVert z_i \rVert_1 \lVert a_i \rVert_{\infty} \leq \sum_{i = 1}^n \lVert a_i \rVert_{\infty}$$  since $$1 \geq \lVert Z \rVert_1 = \max_{1 \leq j \leq n} \sum_{i = 1}^n |z_{ij}|$$  From there on, I am stuck. Also, I have no idea how to show the other direction.   Ideally, I should show this using linear-algebraic techniques. I'm not dealing with dual-spaces or anything of the like.

Suppose that $l_1 = \{ (x_n)_{n \in \mathbb{N}} | \sum|x_n| < \infty \}$ and $l_{\infty} = \{ (x_n)_{n \in \mathbb{N}}| \sup|x_n| < \infty \}$.  Show that $(l_1)^* \cong l_{\infty}$, where $(l_1)^*$ is a dual space of $l_1$.  My attempt: Define a map $L: l_{\infty} \rightarrow (l_1)^*$ given by  $$L(x)(y) = \sum_{n \in \mathbb{N}}{x_ny_n}$$  where $y = (y_n)_{n \in \mathbb{N}} \in l_1$.   My aim is to show that $L$ is an isometric isomorphism.   Clearly $L$ is linear and and injective (choose $y = e_n$ for all $n \in \mathbb{N})$.  How to show that $L$ is a surjection and isometry?


what about the result for $GL_{3}(F_{q})$ and $GL_{4}(F_{q})$. I tried some small number cases but for arbitrary p and large power, examples are not found. There is a related problem for a specific small number case:

What is the number of Sylow 2-subgroups of the group $\mathrm{PSL}(2,q)$?


When driving on a wet highway at night, any surface emitting or reflecting light will have a reflection right under it that is blurry and seems to stretch to infinity.  This is not exactly what I am picturing in my mind, but I couldn't find better images. Anyway, I think it'll do.    Does anybody know why it is such a long reflection? I never figured it out myself.

Have you ever notice the sunset's image in the sea? It's like long light path to the end of the horizon! I've attached a sample of this:     How can we explain this? I know that it can happen even in wave less sea or lake! Why is this path so continuous? I expected that sea should act like a mirror!


My whole google drive, with files, consist of only 2.5 GB.  I have no idea what else I should throw away.  Yet google insist I am using 30GB of space.  I wonder if I can see detail where do I use those space  Google claim I uses 30GB more  But the screenshot clearly shows that I am using a mere 3.5 GB. I wonder what I actually used. The google photos is moved somewhere else too and that's at most a few gigabytes. Trash is empty      The duplicated question have no answer.  In fact, I upgraded my storage to 100GB. Guess what? Google still complain that I don't have enough room.

I have a paid 100GB Google Drive plan. It is reporting that I am at 99% capacity.  According to the the storage both within the desktop and web application, I have used 90.53GB within Drive.    My Drive is mapped to my OS X filesystem, and when fully synched it reports only 61.28GB used.    So what is going on here? I need to do a cleanup but cannot account for the 30GB difference.


A Rocket in a constant gravitational field, what are the conditions required for the rocket to take off immediately? (in terms of $m_0,μ,g,v_r$), where  $m_0$ = mass of the rocket at $t=0$  $μ$ = mass per unit time of expelled gas;  $v_r$ = velocity of the expelled gas relative to the rocket  Show that, in this case, the velocity of the rocket always grows (until the fuel is used up).   If this condition is not fulfilled, then there are two possibilities: Either the velocity is always descending, or there is a moment in time when the velocity, after descending, starts to grow again. Find the condition separating these two cases (will involve the mass $m_1$ of the rocket without fuel).  Thanks :)

For the rocket in a constant gravitational field, how to find a condition that ensures that the rocket immediately takes off?  Update: I apologize. Let's try again. So my question:  For the rocket in a constant gravitational field, find a condition (involving the constants $m_0,μ,g,v_r$) that ensures that the rocket immediately takes off.  $m_0$ is the mass of the rocket at $t=0$;  $μ$ is the mass per unit time of expelled gas;  $v_r$ is the velocity of the expelled gas relative to the rocket.  After I want to show that, in this case, the velocity of the rocket always grows (until the fuel is used up).


I need some help to write a regex that matches a string in parentheses with nested parentheses and starts with pattern.  (NOTE: the text in the 'parent' parentheses could be without nested parentheses)  Examples:  Some text (pattern: SOME TEXT THAT (I WANT TO EXTRACT)) a bit more text (another pattern: ignore that text) and may be a little more text  Result should be: SOME TEXT THAT (I WANT TO EXTRACT)  Some text (pattern: SOME TEXT THAT (I WANT TO EXTRACT)) a bit more text (another pattern: ignore that text) and may be a little more text  Result should be SOME TEXT THAT (I WANT TO EXTRACT)   Some text (pattern: SOME TEXT THAT I WANT TO EXTRACT) a bit more text (another pattern: ignore that text) and may be a little more text  Result should be SOME TEXT THAT I WANT TO EXTRACT  The RegEx I've tried like /\((pattern:?\s?([^\)]+))\)/gi misses a nested )

I need a regular expression to select all the text between two outer brackets.  Example: some text(text here(possible text)text(possible text(more text)))end text  Result: (text here(possible text)text(possible text(more text)))


Sometimes, LaTeX breaks the word ".NET", leaving the dot on the previous line and putting "NET" on the next line. Can I force it to put all four characters either at the first line or at the second line?

How can I make a pair of words stick together in line breaks? For example, "MS Access". I don't want a line break in the middle. But, I'd like to set this up once, not at  every occurrence of that word pair.  edit: Check out Sveinung's answer for two possible problems - overfull line, and hyphenation. For sure, I don't want that.


Can my surname under which I publish differ from the one on my passport?  I was thinking of publishing under "Miller-Hendrix" instead of just "Miller".

I have one official first name which appears on my ID card. I have another first name which friends call me by. Is it possible to use my unofficial first name and official family name to publish scientific papers? How can I prove to someone that I am one of the authors?


Always, I am using vim as my text editor. But, when I want to copy full file's content in clipboard to paste another place I open the file in gedit and press CtrlA and then CtrlC.  Opening the file in text editor and pressing CtrlA and then CtrlC is overhead to me. Because I have to open the file in text editor, although I don't edit the file.    So, if there is any command that can copy the file's content in clipboard it better. e.g. clip file.txt    There also a possibility to gain this feature in vim by mapping CtrlA to some command or make a clip command to copy. But, I don't know how to copy entire file in vim using command.    N.B. My vim doesn't support +clipboard.

How to copy the contents of a file in UNIX without displaying the file contents. I don't want to cat or vi to see the contents.  I want to copy them to clipboard so that I can paste it back on my windows notepad.  I can't copy the file from that server to another due to access restrictions.


In a report document with appendices, Appendix chapter's title should appear in the main table of contents without the section's, subsection's, etc., title it contains. At the beginning of the appendices, their should be a local table of contents only with the titles of sections, subsections, etc., it contains.  In practice, the following scheme:  \maintableofcontents \chapter{Some Chapter} \section{Some Section} \section{An Other section} \chapter{An Other Chapter} \section{A Section, Again} \section{An Other Section, Again} \appendix \chapter{Appendices} \localtableofcontents \section{Some Appendix} \section{An Other Appendix}   should give something like(*):  Table of contents  Some Chapter       1 Some section       2 An Other section An Other Chapter       1 A Section, Again       2 An Other Section, Again Appendices  (here the main content)  Appendices  1 Some Appendix 2 An Other Appendix  (here the appendices' content)   How to get this?  (*) Note that, in this specific case, chapters have been redefined to be unnumbered.

I am writing a large article type document with a series of complex appendices in it.  I have included a local table of contents with each appendix that lists the sections and subsections within that specific appendix (the local TOC for Appendix A lists only that appendix's subsections, etc) using tools from the etoc package.  What I would like to do is have my appendix sections contain numbered subsections/subsubsections, but have the subsections/subsubsections only appear in the appendix local TOC. However I still want the appendix sections to appear in the main TOC.  Here is a rough approximation of my setup:  \documentclass{article}  \usepackage{tocloft} % Adds tools for TOC customization \usepackage{etoc} % Local toc \usepackage[titletoc,title]{appendix}  \begin{document}    \setcounter{tocdepth}{3}   \tableofcontents    \section{First section}     \subsection{a Subsection}   \section{Second section}     \subsection{a Subsection}     \subsection{Another Subsection}    \begin{appendix}     \section{Appendix A} % <- I want this to appear in the main TOC       \etocsetnexttocdepth{2}       \localtableofcontents       \subsection{Appendix Subsection} % <- I want this to appear in the local TOC, but not the main TOC   \end{appendix}  \end{document}   And the output:


My question is linked to that post () as I have exactly the same issue but as the guy couldn't provide screenshots and the post is unachieved, I ask again the question:   I'm using QGIS 2.18, I try to merge two rasters (geotiff files) raster> miscellaneous >merge, while trying to merge I have an error message  Methodolgy:  I uncheck the choose input directory instead of files.  I select my two input files ( raster so ".tiff" files ) I define my output files ( .tiff as well ) Like showed in the video  (and the screenshot showed in the other post) but after that, in 'the summary box', the code is in "GMT" instead of "GTiff" like show in the video  (1 min30)  Picture  from the video (1 min30)    What I have     And the Error message when I click on "OK"    Even if I manually change the "GMT" to "GTiff" with the pen, it automatically comes back to the "GMT"   Could someone help me?

I am using QGIS 2.18.4 Las Palmas on Windows 10 (32 bits).  I need to clip raster (TIF) 1 km resolution imagery files downloaded from MODIS using a shapefile mask of Argentina. To do so I tried to use the Clipper tool in the GDAL plugin. All of my layers are in the same coordinate reference system and I have the "Enable on the fly CRS transformation" option disabled.  After doing Raster >> Extraction >> Clipper >> Clipping mode: mask layer, I get the following error message:     Output driver 'AAIGrid' not recognised or does not support direct   output file creation. The following format drivers are configured and   support direct output: ...   followed by a list of 45 supported outputs.  After a thorough online search of related problems and potential solutions, I feel like I have exhausted all possibilities.   Could someone point me in the right direction please?


When copying files with cp command on Mac OSX Mavericks and then looking at them ls command I sometimes see an @ sign in the listing.  What does it mean please?  For example:  # cp -v ~/Desktop/ios-newbie/oauthGoogle/oauthGoogle/Google.* . /Users/admin/Desktop/ios-newbie/oauthGoogle/oauthGoogle/Google.h -> ./Google.h /Users/admin/Desktop/ios-newbie/oauthGoogle/oauthGoogle/Google.m -> ./Google.m  # ls -al total 88 drwxr-xr-x  12 admin  staff   408 Jan 27 10:18 . drwxr-xr-x  18 admin  staff   612 Jan 27 10:17 .. -rw-r--r--   1 admin  staff   114 Jan 27 10:17 Facebook.h -rw-r--r--   1 admin  staff  2815 Jan 27 10:17 Facebook.m -rw-r--r--@  1 admin  staff   112 Jan 27 10:18 Google.h -rw-r--r--   1 admin  staff  3554 Jan 27 10:18 Google.m -rw-r--r--   1 admin  staff   112 Jan 27 10:18 Mailru.h -rw-r--r--   1 admin  staff  3364 Jan 27 10:18 Mailru.m   Here the screenshot of the same example:

Possible Duplicate:          Consider the following output from ls -l on OS X 10.5.8  drwxr-xr-x   3 user  staff    102 Aug 26 20:21 downloads drwxrwxrwx@ 10 user  staff    340 Aug 26 20:12 images   Can anybody tell me what the @ represents at the end of the permissions section, and also how to disable/enable it. I guess this this has something to do with the directory listing permissions, as when I'm running a PHP script in Apache that needs to access a folder without the @ bit set, it doesn't list the directory contents.  Thanks!


I'm using this method:  public static long GetFileSizeOnDisk(string file)         {             FileInfo info = new FileInfo(file);             uint dummy, sectorsPerCluster, bytesPerSector;             int result = GetDiskFreeSpaceW(info.Directory.Root.FullName, out sectorsPerCluster, out bytesPerSector, out dummy, out dummy);             if (result == 0) throw new Win32Exception();             uint clusterSize = sectorsPerCluster * bytesPerSector;             uint hosize;             uint losize = GetCompressedFileSizeW(file, out hosize);             long size;             size = (long)hosize << 32 | losize;             return ((size + clusterSize - 1) / clusterSize) * clusterSize;         }   And use it like this:  label10.Text = GetFileSizeOnDisk(previewFileName).ToString();   The result for example is: 5074944 But what i want it to dispaly is if it's low then mega byte then display as kb and if above then as mb or gigabyte i mean if 5074944 is megabyte then display it for example as: 5,074944 MB  Including the MB  Or how it known to display/write sizes.

How do I get a human-readable file size in bytes abbreviation using .NET?  Example: Take input 7,326,629 and display 6.98 MB


I have an Acer Chromebook c720. I would like to install Ubuntu on it but do not want to use crouton, as it is not real Ubuntu. I am aware there are other posts on the subject, but they are all different and very old. I don't know which tutorial is correct.   How should I proceed?

I have installed Ubuntu 13.04 on my desktop (runs like a charm). Then I used Crouton to install Ubuntu 12. 04 on my chromebook samsung (ARM). It also works quite well.  Here comes my question. Can we have a true Ubuntu (preferably 13.04) on my ARM chromebook?  It seems that the Crouton/Ubuntu is not 100% the real thing.  The best option would be to have the full Ubuntu 13.04 and remove the Chrome OS.


has a rather interesting community list; it seems he joined Mathematics twice. One of the links ends up at a , the  doesn't exist (maybe because it was deleted as no longer welcome).    I can't check whether the account is duplicated on the accounts tab as in  because the  is broken (which reminds me of ).

For , his accounts tab shows three entries for "Database Administrators". It's the same account listed three times:


When I run sudo apt-get update it wastes time updating PPAs that are already up to date. Is there a command that does the same with more efficiency?

When I add a PPA and I want to install some of its content, it is quite annoying to re-update all my apt list using apt-get update.  Is it instead possible to only sync the content of a given repository?


In my grammar book, in a chapter on subject-verb agreement, the author said that when two nouns, joined by and, are suggesting the same idea or person, we consider the nouns as one unit and use a singular verb, e.g. in  The novelist and poet is dead.   Among many examples he gave, I caught attention of this one:      Time and tide waits for none.    This didn't appear correct to me. I think it should have been:      Time and tide wait for none.    I went on to look on the internet and found conflicting resolutions to this. Different references said differently. What do you think is correct? And what's the reason behind your answer?   EDIT  A possible duplicate has been raised for my question: . However, in the mentioned duplicate, the OP is not interested in knowing which construct is correct. He's rather interested in knowing the nuance between tide and time. Hence, the answers provided there also talk about that nuance, rather than answering which construct is correct.

In the old proverb:      Time and tide wait for no man.   Our first record of the proverb is from St Marher in 1225:     And te tide and te time þat tu iboren were, schal beon iblescet.   When it was already considered ancient. As near as I can make out, the Middle English proverb quoted above means:     “And the tide and the time that you were born shall be blessed.”   Thanks to  for pointing out the correct translation, and also for pointing out that this is just the oldest tide and time reference, not an actual translation of the whole proverb.   Even though that does not have the “wait for no man” aspect to it, nonetheless the modern proverb is always traced back to the St Marher quote in any source I consulted.  But what is the difference between tide and time?  To me, time and tide seem to mean the same thing: see yule-tide and Christmas-tide.  (Then again, “good tidings” and “good times” now mean different things.)  But why are they repeated in the proverb then if they are not different?  What aspect or nuance does one of time and tide possess that the other does not?  Or was this somehow done for poetic effect?    Apparently, Barrie’s idea of this originally being a rhetorical duplication of the same thing that counts as the same thing has some currency.  It turns out that there are plenty of mentions of the proverb with singular concordance, as in:   Time and tide waits for no man.   That shows that the speaker thinks of them as one lexical unit, as in:   Our new President and CEO is John Smith. Peanut butter and jelly makes the tastiest snackwich. Early to bed and early to rise, / makes a man healthy, wealthy, and wise.   However, in modern times, there are more instances of the proverb with plural concordance than with singular, which I suspect helped the reänalysis of the two words meaning essentially one and the same thing into two words meaning separate things.


I'm having trouble understanding the indicated line from the solutions  Do a proof by contradiction by assuming there exists an $a > 1$ such that $a \mid \frac{n}{d}$ and $a \mid \frac{m}{d}$.  This implies (I don't understan why!) $ad\mid n$ and $ad\mid m$,   but $ad>d = \gcd(m,n)$, a contradiction.

Could someone verify this proof?  Given the following definition of divisibility $(\forall{a,b \in \mathbb{N}})[a \mid b \equiv (\exists{c \in \mathbb{N}})(ac=b)]$.  Statement: $(\forall{a,b,c \in \mathbb{N}})[(a\mid b) \rightarrow (ac\mid bc)] $ .  Proof:  Let $a,b \in \mathbb{N}$ be arbitrary.  Assuming that $a\mid b$, we can conclude that $\exists{d \in \mathbb{N}}$ such that $ad = b$.  By Algebra we can deduce the following sequence of statements.  If $(ad)=b$, then $(ad)c=bc$.  Therefore $(ac)d=bc$.  Hence by the definition of divisibility we know that $ac\mid bc$.


I have a size_t * variable of which I want to set the least significant bit to 0. Since it starts at 1, I tried the following approach.  size_t * next_chunk = stack_mem.start; int n = (int)next_chunk; n ^= 1 << 1; next_chunk = (size_t)n;   This is probably horribly wrong.

How do you set, clear, and toggle a bit?


I have the following code. And the maps structure  is 'Map<String, Long[]> Map' and it has the following values:  <com.service.a, 21221, 2121>  <com.service.b, 5454, 8787>  <com.service.c, 1227, 0>  public static void savetoFile(Map<String, Long[]> result, String filepath) throws IOException      {         FileWriter fw = new FileWriter(filepath,true);         BufferedWriter bw = new BufferedWriter(fw);         PrintWriter pw = new PrintWriter(bw);         for (String name: result.keySet())             {                 String key =name.toString();                 Long[] value = result.get(name);                   //System.out.println(key + " " + value);                  pw.println(key+","+value);                    }          pw.flush();         pw.close();     }   On running this function I get the following output:  {com.service.a=[Ljava.lang.Long;@135fbaa4, com.service.b=[Ljava.lang.Long;@4b67cf4d, com.service.c=[Ljava.lang.Long;@7ea987ac,}   How to get rid of this error? I have gone through certain link where they suggest to use toString() method but I'm not sure how to apply that within this function.  I want the above values to be stored into CSV file as :  com.service.a, 21221, 2121  com.service.b, 5454, 8787  com.service.c, 1227, 0

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


It looks as if the browser-based fix mentioned  to users being unable to delete their own answers wasn't applied to the Android app. In the app, the delete link is never there.

Currently, the only way to vote to delete (and undelete, since you can't see deleted posts) in the Android app is to open the post in a browser, and then vote to delete from there.  Can we get delete vote functionality within the app, as well as the ability to delete our own posts?  Worth to mention: users , so it's possible in the API.  Related:


I want to create a sports simulation game, something along the lines of Championship Manager (if you're not familiar, you can check out ). It's essentially a 2D game with top-down view, with the exception that the ball seems to behave as if it was 3D.  Given that the game is almost entirely 2D and only the ball is 3D, is there a good way to deal with that without making an entirely 3D game just because of the ball? Can the ball be hooked into a 3D physics engine, the rest to a 2D engine and somehow reconcile the two, then when rendering, just make the ball grow the higher it goes and show a shadow, or something along those lines?

A 2D game called Deer Hunter has projectiles like this:    Are the projectiles 2D or 3D models? How could I implement something similar?


do-release-upgrade (trying to upgrade from 13.10 to 14.04) fails with this message:  [...] Calculating the changes  Could not determine the upgrade  An unresolvable problem occurred while calculating the upgrade.  This can be caused by: * Upgrading to a pre-release version of Ubuntu * Running the current pre-release version of Ubuntu * Unofficial software packages not provided by Ubuntu  If none of this applies, then please report this bug using the command 'ubuntu-bug ubuntu-release-upgrader-core' in a terminal.   Restoring original system state [...]   What can I do to fix it? Is it because of google-chrome? If so, how do I fix that?    I ran sudo apt-get remove xserver-xorg-video-all, which seems to have fixed it.

The update from Ubuntu 13.10 to 14.04 LTS does not work it keeps showing me an error as could not calculate the upgrade, even when I want it to get updated from the terminal it says the same error. I did not use the beta its the final Ubuntu 14.04 LTS.I have restarted my laptop for like 5-10 times no change. Disabling the software sources also does not help.


I need to use the aobs-tikz package  so I install it automatically using miktex but when I compile my file I get the error  "File `aobs-tikz.sty' not found". so please help me to fix this problem?

I'm new to LaTeX, investigating using it for some work projects.  I'm using MiKTeX on Windows.  My employer's locked-down network blocks the application's automatic installation function.  I can take my laptop home and successfully install from there, but if I need a package in the middle of the day I'm stuck.  I am able to access the CTAN website and download the package files (.dtx or .ins?), but I don't know what do do with them.  How can I do a manual package installation?


Find the Equation of Ellipse that is tangent to the lines   $x-4y=10 $    and  $x+y=5$   I don't know what is the idea of this problem , how can i begin   Thank you for your help

Find the equation of the ellipse tangent to the two lines $$x-4y=10$$ and $$x+y=5$$  I know that the equation of ellipse in general is  $$ \frac{(x-x_0)^2}{a^2} + \frac{(y-y_0)^2}{b^2}=1$$  but how can continue? I substituted for   $x $ from the equations of the two lines in the equation of ellipse but it still difficult to continue!  is it true to take $(x_0,y_0)=(0,0)$ ??


I think I can use tech-illiterate. However, this word seems to have a negative aura. Is there any word choice with a more positive feel?

Just as there is "computerate" to describe those who show familiarity with, and ability to use computers, is there a word to describe the opposite, those who are computer illiterate? The word I'm looking for includes both those who have access to computers but, for some reason, choose to keep away from them, and those who can read and write but have never seen a computer in their entire lives. I'm not looking for insulting or pejorative terms.


I realise this isn't a 'yes or no' question, and I apologise for asking something that could be seen as a discussion thread, but I had to ask.  I'm currently doing an EPQ in CS (specifically how QC will change Cryptography). I'm trying to gather up topics to cover, and so far I've scribbled down -  Effects -   National security, classical cryptographic methods (RSA, DSA, AES-256). Including Shor's algorithm. Communications Online services, e.g. BitCoin.   How would we counter this (not sure how better to phrase this) -   Lattice-based Multivariate Hash-based signatures Code-based cryptography   Is there anything else you'd recommend me including (as well as the above), or anything in the above you don't think I should include?   Honestly, the list above is a rough, first draft the main bulk of it... so don't it as gospel.  Best regards,  Cameron.

With the advancement of technology in quantum computing, it's becoming more evident that we need to start thinking about protecting the future integrity of our cryptographic standards.  What can we do on binary computers to prevent attacks on cryptographic related items such as password hashes, private keys, and asymmetric key exchange?


This command: sudo add-apt-repository ppa:upubuntu-com/network -y  returns: Cannot add PPA: ''This PPA does not support focal''.  Then I'll jump straight to the point by skipping the elementary part of "add-apt-repository" answered and over-answered. This command: sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv A5D712AEE06E6293 sudo gpg -a --export A5D712AEE06E6293 | sudo apt-key add - sudo bash -c "echo -e 'deb http://ppa.launchpad.net/upubuntu-com/network/ubuntu wily main\ndeb-src http://ppa.launchpad.net/upubuntu-com/network/ubuntu wily main' > /etc/apt/sources.list.d/upubuntu-com-ubuntu-network-wily.list"  returns the right output but then when I go to run: sudo apt-get update  returns equally the error: W: GPG error: http://ppa.launchpad.net/upubuntu-com/network/ubuntu wily Release: The following signatures were invalid: DED04C8CBB517AE45B073F12A5D712AEE06E6293 E: The repository 'http://ppa.launchpad.net/upubuntu-com/network/ubuntu wily Release' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.  ---------------------------------------- Update ---------------------------------------- The repositories: deb [ trusted=yes allow-insecure=yes allow-weak=yes allow-downgrade-to-insecure=yes check-valid-until=no ] http://ppa.launchpad.net/upubuntu-com/network/ubuntu wily main deb-src [ trusted=yes allow-insecure=yes allow-weak=yes allow-downgrade-to-insecure=yes check-valid-until=no ] http://ppa.launchpad.net/upubuntu-com/network/ubuntu wily main  With the command: sudo apt-get update --allow-unauthenticated --allow-insecure-repositories  doesn't have effect but the error message becomes shorter: W: GPG error: http://ppa.launchpad.net/upubuntu-com/network/ubuntu wily Release: The following signatures were invalid: DED04C8CBB517AE45B073F12A5D712AEE06E6293

I'm using an unsigned repo in Ubuntu 16.04 from Debian multimedia:  deb http://www.deb-multimedia.org jessie main   To install deb-multimedia-keyring, I'm running:  apt-get update && apt-get install deb-multimedia-keyring -y   This gives an error:  W: GPG error: http://www.deb-multimedia.org jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5C808C2B65558117 E: The repository 'http://www.deb-multimedia.org jessie InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.


I am writing technical documents (user requirements, user guides etc) often and MS Word and Grammarly often give me an error message "Passive voice misuse".  For example:   Function X is shown in this video. It can be done by clicking this button. This button can be used. If more details are needed, they can be found in Annex A.   for all examples above Grammarly gives "Passive Voice Misuse". The same for MS Word. My question is   Are these examples completely fine or they can be rewritten in a better way from the native language speaker point of view?  As I understand Grammarly and etc is not a good reference here. I am asking just about my specific examples.  Please do not mark it as duplicated with . There are some similarities, but my question is more generic, but the other is very specific and related to only one example. and that question is not answered.  UPDATE 1 after some reading, I can rewrite my examples like this   This video shows Function X. To do it click this button. Use this button. Annex A contains more details if needed.   Is it really better from native English speakers?

Whenever I create a document in Microsoft Word, it complains about a lot of my sentences being in passive voice. But, when I read that sentence aloud, it sounds fine to me. I am not sure if it is just me and will a statement in passive voice sound strange to a native speaker?  So, my question is, is it considered bad form to use passive voice generally? Or in some specific cases like written communications only?  Edit: If it is ok to use passive voice, then why does MS-Word complain?


Currently I use this way to get context:  SharedPreferences sharedPref;      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);         Context context = MyApplication.getAppContext();         sharedPref = context.getSharedPreferences("MyPref", Context.MODE_PRIVATE);     }   MyApplication class:  public class MyApplication extends Application {      private static Context context;      public void onCreate() {         super.onCreate();         MyApplication.context = getApplicationContext();     }      public static Context getAppContext() {         return MyApplication.context;     } }   I'm trying to call a method in MainActivity from MovieUpdatesService class   MainActivity method:  public void checkNow() {         new Thread(() -> {             String site = null;             if (sharedPref.contains("site")) //line 153                 site = sharedPref.getString("site", "Not available");              //codes...          }).run(); }   MovieUpdatesService class:  public class MovieUpdatesService extends JobService {      //codes...      public void doBackgroundWork(final JobParameters params) {         if (jobCancelled)             return;          new MainActivity().checkNow();          Log.d(TAG, "Job finished");         jobFinished(params, false);     }      //codes... }   I get NullPointerException when running and I think it has something to do with context  Error:  java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.content.SharedPreferences.contains(java.lang.String)' on a null object reference         at com.tashila.movieupdates.MainActivity.lambda$checkNow$0(MainActivity.java:153)   How do I fix this? I'm new to Android so I'm hoping for a simplified answer (:

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 came upon this question recently while studying about buoyancy. It goes like this:     If an iron block is covered with ice and floats in a tub of water, what will be the change to the water level when the ice melts and the iron submerges completely?   According to me the the water level should go up because the iron block will displace more water when it submerges. But, the answer is that the level will remain the same. I did not get the  reasoning nor the logic behind it. Please explain why the level will remain the same. This question is driving me crazy.

This is a strange question I would like to have some explanation accompanied with:  We have an ice block, with in it a lead block. This entire block is put into a glass of water, resulting in a rise of water level until the edge of the glass. The block stays floating on the surface. What will happen with the water level when the ice melts?  The answer is that it will drop, but how is this even true?? My thoughts are: - block floats on water, so rho(block) < rho(water) - Archimedes law, the Fg of block = Fg of water pushed away. - Since a smaller volume of water has equal mass (and so Fg) to block, and ice is less dense than water, when it melts, no mass is lost, so it will take in less space??? Please help me with this point of thinking.


I am new to this so would appreciate some guidance!  I have caught both a cp15 pidgeotto and a cp61 pidgey, will I loose the 61cp when I evolve the pidgey to pidgeotto?  is the cp reset to minimum when a Pokemon evolves? Or should I just evolve the pidgey twice and keep the higher cp?   Many thanks, Tom

When activating the evolution for a caught Pokemon, it seems to amplify the Combat Power (CP). Thus it seems most beneficial to evolve your Pokemon with the highest CP, if you have multiple of the same kind.   But what I am not sure about is whether it makes an efficiency difference if you spend candies and dust to boost CP before evolving, to gain more from the amplification? Or is it more efficient to just evolve without spending, and then using the leftover candies afterwards, since they now give a bigger CP boost per candy?   I only tested with a Rattata so far, which gained +8 CP per candy before evolving, and +15 CP afterwards. I collected no numbers on the amplification efficiency though, and now ran out of materials for further testing.  Or maybe it is a balanced calculation and makes no difference at all? I would love to have some insight on that.    Some data I collected thus far: (GPC = CP gain per candy)  79 CP Weedle (GPC 6) evolved to: 84 CP Kakuna (GPC 6), evolved at 90 CP to: 297 CP Beedrill    Note: The max-CP "half circle" in the profile stayed filled roughly at the same relative position throughout the evolutions.


Farmer; AC 7; Level 0; hp 6; #AT 1; D 2-8; XP 16  i am a new player and cannot understand what these mean. Can someone explain to me? I am trying to play The Temple of Elemental evil

In many early D&D and AD&D modules, NPCs, monsters, and other creatures are often listed with an attribute of #AT followed by a number.  What does that mean?  For example, from the AD&D 2nd edition T1-4 module compilation, Temple of Elemental Evil, page 7:     Farmer; AC 7; Level 0; hp 6; #AT 1; D 2-8; XP 16


This is a question of curiosity, and not for any academic purposes.  Suppose I push a box along a surface that allows it to slide. When I initially start pushing it on one side, how long does it take for the other side of the box to start moving?  Obviously, it's going to be observed as instantaneous, but in the extreme case of a 1 lightyear-long box, I find it hard to believe that all of it would start moving at the exact same time.

So, in typing the title of this question I was recommended , which confirmed my guess that this effect "propagates" at the speed of sound (though I just had a feeling, I don't really understand why).  I also only have high-school level physics experience.  I feel like I don't know physics well enough to really know what to ask correctly, but I'll try to explain.  So, I rotate my arm, and, even though tendons are just pulling it at a certain location, the rest of it follows suit.  Why is that?  What is happening at an atomic/molecular scale that ends up "conveying forces" over a distance?  And, something else I don't understand- what is so special about the speed of sound that makes it this "fundamental unit of translation", or something?  Maybe the better question is "what processes at an atomic/molecular scale lead to the speed of sound being associated with all of these behaviors", which ties both questions together.


Specifically, for $a \in (0,1)$, I am interested in the sum $$\sum_{p\leq n} \frac{1}{p^a} $$ as $n$ grows.

Note the $ p < x $ in the sum stands for all primes less than $ x $. I know that for $ s=1 $, $$ \sum_{p<x} \frac{1}{p} \sim \ln \ln x , $$ and for $ \mathrm{Re}(s) > 1 $, the partial sums actually converge to a finite limit called the , which has an analytic continuation to the whole right-half plane but the actual series diverges in the critical strip. So anyway, I'm wondering what the asymptotic behavior of the partial sums are in the limit as $ x \to \infty $ for a given value of $ s $ with $ \mathrm{Re}(s) < 1 $. At first I intuitively conjectured it might be something vaguely like the following  $$ \sum_{p<x} \frac1{p^s} \sim f(s) \pi(x)^{1-s} , \quad f(s) = \lim_{n\to\infty} \int_0^1 g_n(u) u^{-s} du $$ but after some thought I'm not sure if this kind of formula will work after all. Any ideas?  Note again: I'm asking about asymptotics when $ \mathrm{Re}(s) < 1 $.


Let $A$ be a $2\times 2$ matrix with complex entries.How to find the number of $2\times 2$ matrices $A$ satisfying the equation $A^3=A$ ?

Let $\mathrm A \in \mathbb C^{2 \times 2}$. How many $2 \times 2$ matrices $\mathrm A$ satisfy $\mathrm A^{3} = \mathrm A$. Infinitely many?   If it is $3 \times 3$ matrix then by applying Cayley-Hamilton theorem I could have said that given matrix is diagonalizable. Also zero is eigenvalue of $\mathrm A$. So it would be collection of all singular diagonalizable matrices. But how to count them?  Here I have $2 \times 2$ matrices i feel I can't apply the Cayley-Hamilton Theorem here? I am stuck with these thoughts?


I'm trying to use my iPhones mobile hotspot as a router between two laptops. Right now the laptops can't ping each other. Is there some firewall or settings on the iPhone that block communication between the two?

When I turn on the Apple hotspot feature, is it an isolated network, or can I see other devices on it?  Can I use it to connect a third device to a Chromecast?  As in tablet -> iPhone with hotspot (and cellular data off) -> Chromecast?  I want to use a Chromecast while on holiday!


I'm having a hard time proving this theorem from a textbook.  Theorem  For any integer $n \ge 0$, we have $$\sum_{k=0}^{n} {n \choose k} = 2^n$$  Proof  Take $x = y = 1$ in Newton's Binomial Theorem  My work so far  $$ x = y = 1 \\ \sum_{k=0}^n{n \choose k} 1^{n-k}1^k \\ = \sum_{k=0}^n{n \choose k} 1^n $$  Then I tried using concrete examples $$ k=0,\ \binom{n}{0}1^n \qquad \qquad \binom{n}{0} = \frac{n!}{0!(n-0)} = \frac{n!}{n!}=1\\ k=1,\ \binom{n}{1}1^n \qquad \qquad \binom{n}{1} = \frac{n!}{1!(n-1)} = \frac{n!}{(n-1)!}\\ k=2,\ \binom{n}{2}1^n \qquad \qquad \binom{n}{2} = \frac{n!}{2!(n-2)} \\ \vdots \\ k=n,\ \binom{n}{n}1^n \qquad \qquad \binom{n}{n} = \frac{n!}{n!(n-n)} =1\\ =1^n+\cdots+1^n $$  How to prove this?

I'm well aware of the combinatorial variant of the proof, i.e. noting that each formula is a different representation for the number of subsets of a set of $n$ elements. I'm curious if there's a series of algebraic manipulations that can lead from $\sum\limits_{i=0}^n \binom{n}{i}$ to $2^n$.


I'm attempting to install QGIS version 2.18.6 (64-bit).  The installation gets close to completion, but before it finishes I get a message saying "Extract error writing to file..." I've tried installing several times, and a different file name comes up in the error message almost everytime (including qtgui4.dll, gdal200.dll, and others).  Per another user's suggestion, I opened a command window and looked at the tasklist, but nothing comes up.  I'm running as an admin and installing to the default program files (C:/Program Files).  Any suggestions?

I want to uninstall and completely remove QGIS installation from my computer(windows vista). I have uninstalled it and when i try to reinstall it says it is already installed on the system.


And plz don't say wankism. That's similar thing, but not so popular. So what's a better way to express?

Is there an English word meaning "the use of uncommon words" or similar?


Everytime after I restart the machine, "source ~/.bash_profile" has to be executed first in order to use "python" as an alias for "python3". Is there a solution for this problem?  I have the following lines in my ~/.bash_profile:  # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH=/opt/python35/bin/:$PATH alias python="python3" export PATH   Thanks in advance!

I've used a number of different *nix-based systems of the years, and it seems like every flavor of Bash I use has a different algorithm for deciding which startup scripts to run.  For the purposes of tasks like setting up environment variables and aliases and printing startup messages (e.g. MOTDs), which startup script is the appropriate place to do these?  What's the difference between putting things in .bashrc, .bash_profile, and .environment?  I've also seen other files such as .login, .bash_login, and .profile; are these ever relevant?  What are the differences in which ones get run when logging in physically, logging in remotely via ssh, and opening a new terminal window?  Are there any significant differences across platforms (including Mac OS X (and its Terminal.app) and Cygwin Bash)?


I have one array like below  Array     (         [AllocationPool] => TEST do not USE         [Quarter] => 2016-Q4         [Segment] => Storage         [Region] =>          [SubRegion] =>          [Country] =>          [typeofrec] => 0         [TotalAllocations] => 100         [TotalTransfersOut] => 75         [TotalTransfersIn] => 0         [StartOfAllocation] => 25         [ApprovedActivities] => 0         [AvailableBalance] => 25         [TotalApprovedClaims] => 0         [Balance] => 25         [TotalUnApprovedClaims] => 0         [Exposure] => 25     )   I need to remove some elements from this array and formatted to new structure.  I need to change below structure after format my array   Array     (         [AllocationPool] => TEST do not USE         [Quarter] => 2016-Q4         [Segment] => Storage         [Region] =>          [SubRegion] =>          [Country] =>      )   Is any method available in php for remove some elements in an array using php?

Is there an easy way to delete an element from an array using PHP, such that foreach ($array) no longer includes that element?  I thought that setting it to null would do it, but apparently it does not work.


I recently bought a Canon Pixma ip2700 printer. I tried to install it, and the computer wouldn't let me, saying it was not compatible with the current operating system. I think I don't know enough about wine and would like to learn more. I was able to successfully install MIDIsport, but that's it. What am I doing wrong?

I tried to install the MP190 drivers, but appeared a message show me that requires to have libcupsys2. I understand that libcup2 is an update of libcupsys2.   How do I solve this? Are there proprietary drivers for my Canon printer or scanner?


I am having a dispute with a co-worker regarding a Big O question. For example, consider the following Python for-loop that prints every 100th element: n = 10000 for i, x in range(0, n, 100):     print(i)  I think the complexity is O(log n) as opposed to O(n), because it grows not quite linearly. O(n) is not wrong, I think, but isn't O(log n) more precise? Thanks!

Most people with a degree in CS will certainly know what . It helps us to measure how well an algorithm scales.   But I'm curious, how do you calculate or approximate the complexity of your algorithms?


Consider the function $$f(x)= \begin{cases}0&\text{if }x\in\Bbb{R}\setminus\Bbb{Q}~\text{or}~x=0\\\frac{1}{q}&\text{if }x=\frac{p}{q}, p\in\Bbb{Z},q\in\Bbb{N},(p,q)=1\end{cases}$$  Of course this function is discontinuous at rational numbers. To show it is continuous at irrational numbers I need: If $x_n\to x$, with $x_n=\frac{p_n}{q_n}$, and $x_n\ne x,n\in\Bbb{N}$, then $\lim_{n\to\infty} q_n=\infty$.  How to do that?

In :  $$ \begin{align} t(x) = \begin{cases} 0 & \text{if $x$ is irrational}\\ \frac{1}{n} & \text{if $x = \frac{m}{n}$ where $\gcd(m,n) = 1$} \end{cases} \end{align} $$  I can prove the discontinuity at rational $b$ by taking a sequence of irrationals $x_n$ which converge to $b$.   But while going through an argument for continuity at irrationals.  I found this in a book.      On the other hand if $b$ is an irrational number and $\epsilon > 0$   then there is a     natural number $n_0$ such that $1/n_0 < \epsilon$.   There are only finite number of rationals with denominator less than   $n_0$ in the interval $(b-1,b+1)$. Hence we can find a $\delta > 0$   such that $\delta$ neighbourhood of $b$ contains no rational with   denominator less than $n_0$.   I understand the rest of the proof. But I am unable to prove the emphasized text. Although I find it intuitive.