After adding the code from call.eneque I get the error from the title it says a Nullpointerexception on my clickListener, but everything is initialized or do I overlook something? I looked for hours now tried different tutorials and fixes but can not find anything.  Here is my code:  public void openDialog(){         AlertDialog.Builder formBuilder = new AlertDialog.Builder(FriendListActivity.this);         View formView = getLayoutInflater().inflate(R.layout.contact_add_form,null);         final AlertDialog dialog = formBuilder.create();         final EditText nameText = dialog.findViewById(R.id.nameInput);         formBuilder.setView(formView);          dialog.show();           // Buttons          sButton = dialog.findViewById(R.id.saveButton);         sButton.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                 PalaverService friendsAddService = PalaverApiClient.getInstance();                 final String FriendName = nameText.getText().toString();                 Call<ApiResponse> call = friendsAddService.addFriend("", "", FriendName);                 call.enqueue(new Callback<ApiResponse>() {                     @Override                     public void onResponse(Call<ApiResponse> call, Response<ApiResponse> response) {                         ApiResponse responseSuccess = response.body();                          if(responseSuccess.getMessageType().equals(1)){                             friendListAdapter.add(FriendName);                         }                         dialog.hide();                      }                      @Override                     public void onFailure(Call<ApiResponse> call, Throwable t) {                      }                 });                }         });          abbrechen = dialog.findViewById(R.id.abbrechen);         abbrechen.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                     dialog.hide();             }         });        }   This is my error:    Process: de.paluno.se.palaver, PID: 16209         java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference   The error is coming on my setOnclickListener. Hopefully someone can give me an pointer.

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


I have searched extensively and have not been able to find a working solution for my uses.  I have a SanDisk USB3.0 32Gb flash drive. I want to be able to have 2 partitions on it that are both readable and writable by Windows. So, when I insert the stick into a computer I would get 2 Autorun messages (Win 7) or 2 File Explorers (Win 10).  I know that this is possible because I have a video camera that when plugged in directly, two Explorers open. (Unable to test with just SD card instead of directly, as a drop made the slot inaccessible)  I've read that you can't do this in Windows using default software, but I have access to a Linux machine, and quite frankly prefer to use Linux.  First of all I would like to know if this is even possible using a generic USB stick, and if Yes! then how would I do it?  Thanks in advance!

In Windows, 'removable' drives cannot be partitioned, without the partitions not appearing and receiving drive letters, apart from the first partition.  Partitioned flash drives work fine in Linux.  What I want to do is partition a 8GB flash drive into two, with the first partition containing various boot disc images, which can be selected to boot from, and have various portable apps, documentation, utilities, scripts, etc, on the other partition.  I currently do this using two separate flash drives, but I want to be able to use a single flash drive for everything, which I keep on my keyring.  It is not possible to do this without having at least two partitions, as the ISO boot selector for the boot disc images will not work otherwise.  I know there is a method where you can flip a bit, using Lexar's USB Format Tool, which fools Windows into thinking that the partitions are on a fixed hard drive.  However, this apparently makes it difficult to eject the flash drive.  Flash drives with  from SanDisk had two partitions, presenting itself to the host system as a USB hub with a CD drive and standard USB mass storage device attached.  This is what I would like to emulate, if possible.


I understand that energy is conserved when a force is applied to the end of a lever and magnified closer to the pivot point. However, I would like to know how it is the force is transferred and magnified between the atoms of the lever.

This is really bothering me for a long time, because the math is easy to do, but it's still unintuitive for me.  I understand the "law of the lever" and I can do the math and use the torques, or conservation of energy. or whatever... And I can see that a lever can amplify a force you apply to it  if you apply a force on the longer side of the beam.  If I were to look at the molecular lever and see what actually happens when I push on the lever, and I give acceleration to the molecules, how does it actually happen that more force is transmitted to the other side?  Thank you all  p.s I'm looking just for an explanation in terms of forces and acceleration, it's clear to me how to do this in terms of energy or torques


A question asks, "If x is a postive real number, then find the minimum value of  $[{x + (1/x)}^6  - {x^6 + (1/x)^6} - 2]/ [{x + (1/x)}^3 + {x^3 + (1/x)^3}]$    My try:- I expanded and simplified the numerator and then applied AM - GM and got Numerator $>= 12*sqrt(10) + 18$. Then applying AM-GM on denominator, we get denominator $>= 4*sqrt(6)$.  But I do not know how to combine these two results. How can I proceed?

Problem :   The minimum value of $$\frac{(x+\frac{1}{x})^6-(x^6+\frac{1}{x^6})-2}{(x+\frac{1}{x})^3+x^3+\frac{1}{x^3}}$$  Can I use this in numerator and denominator :   The minimum value of $a +\frac{1}{a}$   Using A.M and G.M inequality :   $a +\frac{1}{a} \geq 2\sqrt{a \times \frac{1}{a}}$   $\Rightarrow a +\frac{1}{a} \geq 2$ .....(1)   By putting the minimum value of (1) in $\frac{(x+\frac{1}{x})^6-(x^6+\frac{1}{x^6})-2}{(x+\frac{1}{x})^3+x^3+\frac{1}{x^3}}$   we get ; $\frac{2^6-2-2}{2^3+2}$ but I think this is wrong especially denominator as we need to find the maximum value of denominator to get the minimum value.   Please suggest ,thanks.


I have problem with file system size mismatch from 2 different linux commands  du -h shows only 250 MB used   df -h shows  9.5 GB used    Why is the different between commands ?

When I sum up the sizes of my files, I get one figure. If I run du, I get another figure. If I run du on all the files on my partition, it doesn't match what df claims is used. Why are there so many different figures for the total size of my files? Can't computers add?  Speaking of adding: when I add the “Used” and “Available” columns of df, I don't get the total figure. And that total figure is smaller than the size of my partition. And if I add up my partition sizes I don't get my disk size! What gives?


I had a Samsung Galaxy Ace 4. Last week, it fell of and the screen broke. Still, when turned on, it seems to be everything else OK (the notificacion bar shows some pending messages, the hour keeps getting up to date, the USB symbol appears when connected to a PC), but below, all is bright white within the lines of the broken screen.  I got a new phone, as probably it'd be cheaper than waiting for the old one to be repaired, and once the SIM was inserted, I realized most contacts were stored on the device memory. I've been looking for a (cheap) way to recover the missing contacts, but almost every found solution has any of the given problems:   USB debugging should be enabled, seems it wasn't before the incident. Requires the use of some app running, which I can't achieve (say Kies or AndroidLost). Contacts coud be synced with the Google account, but it wasn't setted up.   Is there any other way to access this information to create de 'back-up' on a PC and restore it on the new device (even through console management of the phone)?  I appreciate in advance any given help.

I just broke the screen of my (unrooted) Galaxy S.  How do I get back my SMS and contacts?   PS: I tried Kies but it won't detect my phone for some reason. (Kies works fine with another Galaxy I possess but not this one)


I've been reading a chapter in a certain (programming) book and stumbled upon the following sentences (and I'm sure I've seen more examples like this in the book):   Since randomized tests are nondeterministic, it is critical that the log record sufficient information to reproduce the failure.  It’s important that code being tested not call (certain functions).    (While I would expect 'the log records' and 'code doesn't call'.) The book is well-edited so I don't think all of these can be mistakes. So what's the rule about using bare infinitive after 'that' (or probably in similar constructions)?

Why is this sentence correct?     She suggested that he go to the cinema.   I would definitely use goes instead of go.


Using Windows 7, I would like to set up a single key, ideally a key which is not commonly used for anything else like PrintScrn, to automatically save the screen to a file. File name or location is not important.  By default, the screen is saved to a clipboard, which means that if you take another screenshot, the first one is overwritten. It makes it very difficult to capture multiple screenshots quickly, or in real time.  Does anyone know if there is a way to accomplish this? I don't know if there could be an obscure configuration for this. If there needs to be a third-party application, it should be as light as possible.  Thanks for your help!

I want a screen shot to be saved automatically to a location I specify, as soon as I press the Prt Scr button on my keyboard, or the Alt+Prt Scr combo. I also want the date and time to be used as file name for each new screen shot. And I want the files to be saved as PNG images.  Is there a Windows program that would allow me to do just this? I don't want any other fancy features like editing and making notes, etc. just a plain simple program that will either automatically save the screen shots to a pre-set location or prompt me where I want to save it. I don't want to go through MS Paint to save the shots.  I guess what I'm after is a little bit of Linux behavior of Print Screen, but only for Windows. And I additionally want the files to be named by the date and time they were taken.  Update:  Meanwhile, I have found one called Greenshot. But I don't know how to get the file name pattern right.  This is the default pattern.  ${capturetime:d"yyyy-MM-dd HH_mm_ss"}-${title}   Can someone explain this? Why do they have the title capturetime and the quotation marks? It produces file names like this.  2013-01-26 15_24_28-Greenshot.png   And this is what it says about the file patterns in the program description.  ${YYYY} year, 4 digits ${MM} month, 2 digits ${DD} day, 2 digits ${hh} hour, 2 digits ${mm} minute, 2 digits ${ss} second, 2 digits ${NUM} incremental number, 6 digits ${title} Window title ${user} Windows user ${domain} Windows domain ${hostname} PC name   How do I get files that include year, month and day, separated by a dash, followed by hour, minute and second? I want to include a time for uniqueness of the file name.


So I'm trying to check a list of account names to see if the username entered by the operator is in the database or not. At the moment I have:  for(int i = 0; i < rowCount; i ++){             System.out.println("Stored in array:" + accounts[i+1]);             System.out.println("name entered:" + LoginPage.usrname);             if(accounts[i+1] == LoginPage.usrname){                 System.out.println("match");             }else{                 System.out.println("no match");             }         }   I tried messing around with things like indexOf string and can't get anything to work. I'm sure there's a simple solution, just having trouble finding one. I don't understand why I can't compare a String array index to a String variable, seems like ti should be cake.

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?


Milton slept in this room.    According to   , sleep is an intransitive verb (A1). So we shouldn't be able to rewrite the sentence in the English  passive voice.   But I want the most important part of the sentence to be the room and not Milton, so I wrote     This room was slept in by Milton.    First, is this grammatical?   Second, I thought the passive voice in English can only use transitive verbs??   I researched about the English Passive Voice on  and Purdue University's  .   This answer has been marked as a possible duplicate of . But the most upvoted answer there does not address the property of intransitive as assigned by the dictionary, which is an integral part of this question. In addition the same answer there is confusing  because it says both that transitivity is not a property of verbs and yet ends up talking about transitive verbs. In addition, the same answer does not explicitly deal with verbs other than "sense verbs". So I'm not sure if that answer applies to to sleep.

The words listen, shout, etc. are intransitive verbs, but why are they used in passive sentences with preposition to, at, etc.?  e.g:     she was never listened to.   I don’t like to be shouted at.                                                  When intransitive verbs are used with preposition, are they considered as transitive verbs?


I have a collection:  List<Car> cars = new List<Car>();   Cars are uniquely identified by their property CarCode.  I have three cars in the collection, and two with identical CarCodes.  How can I use LINQ to convert this collection to Cars with unique CarCodes?

I am playing with LINQ to learn about it, but I can't figure out how to use Distinct when I do not have a simple list (a simple list of integers is pretty easy to do, this is not the question). What I if want to use  on a list of an Object on one or more properties of the object?  Example: If an object is Person, with Property Id. How can I get all Person and use Distinct on them with the property Id of the object?  Person1: Id=1, Name="Test1" Person2: Id=1, Name="Test1" Person3: Id=2, Name="Test2"   How can I get just Person1 and Person3? Is that possible?  If it's not possible with LINQ, what would be the best way to have a list of Person depending on some of its properties in .NET 3.5?


Assuming a creature with two genders (male / female), is said gender part of its game statistics block for the purposes of Polymorph effects?  In some species also the male has different statistics than the female. Such is the case of the androsphynx and gymnosphynx. Those are moot, so don't need to be considered for this question's scope.

Can polymorph and true polymorph alter a PC's race and sex? If a PC can be altered in such a way, can the PC speak and use his or her hands?


For example the rooms created from a post are ownerless.  How does one become the owner of such a room, or any other room that has no owner?    Related but not the same:

I'm pretty much every open days in the  with some other regular folks and I just noticed that stars could need a little clean-up and that the  is pretty much absent. Even on SO, ... (not an accusation, right, everyone doesn't need to be an SO addict right? ;) ) I think that the ownership of chatroom should be given to another person if the owner is offline after xx weeks or months. As a room can have many owners, we don't have to remove the ownership from the original one. But, we need some cleanup and small moderation like in the  which is pretty well handled with 5 owners. What do you think?


I have found similar questions but the result didn't help me. I need to access - read, write, list files and dirs on computer in local network but php is not able to find or read it. I use this code  $scandir = scandir("//192.168.101.22/somedir"); //returns false  And errors I got:  scandir(): (errno 2): No such file or directory scandir(//192.168.101.22/somedir): failed to open dir: No such file or directory  I shared this folder on LAN computer with full access for Everyone. When I open this location in Total Commander, there is no problem. Also I created a shared folder on the computer where PHP is located and PHP found this folder. I tried to use backslashes or file:, nothing helped me. PHP version: 5.4.16 Wamp server 2.4 Windows 8.1 (where WAMP is located) Windos 7 pro (computer on LAN)

Suppose some Windows service uses code that wants mapped network drives and no UNC paths. How can I make the drive mapping available to the service's session when the service is started? Logging in as the service user and creating a persistent mapping will not establish the mapping in the context of the actual service.


I have that convergence requires that the following be true   $$ \forall\epsilon>0\exists N: n\ge N:|a_n-a|<\epsilon $$  for some sequence $\{a_n\}_{n\in\mathbb{N}}$ that converges to $a$ for $n\to\infty$.  I want to use the reverse of this requirement. I do not know how to express it but I am guessing  $$ \exists\epsilon>0\forall N:n\ge N:|a_n-a|\ge\epsilon $$  it is expressed like the above. Can you help me out?

My task is to write a precise mathematical statement that "the sequence $(a_n)$ does not converge to a number $\mathscr l$"  So, I have my definition of a convergent sequence: "$\forall\varepsilon>0$ $\exists N\in\Bbb R$ such that $|x_n -\mathscr l|<\varepsilon$ $\forall n \in \Bbb N$ with $n>N$"  Would the correct negation of this be "$\forall\varepsilon>0$ $\exists N\in\Bbb R$ such that $|x_n -\mathscr l|>\varepsilon$ $\forall n \in \Bbb N$ with $n>N$"?  It doesn't seem that this is the answer as the next part of my task is to prove that a sequence is divergent using my formed proof, but it'd be difficult to do since it's a general proof of divergence and not just a proof that $(a_n)$ doesn't converge a specific number $\mathscr l$  Perhaps I should find a prove that $(a_n)$ tends to $\pm\infty$? This is more simple but it does not include monotone sequences such as $x_n:=(-1)^n$.  Can someone assist me with this task? All comments and answers are appreciated.


Please have a look at the code below (excerpt from a C# book): public class MyClass  {     public int val; } public struct myStruct  {     public int val; } public class Program  {     private static void Main(string[] args)      {         MyClass objectA = new MyClass();         MyClass objectB = objectA;          objectA.val = 10;         objectB.val = 20;          myStruct structA = new myStruct();         myStruct structB = structA;          structA.val = 30;         structB.val = 40;          Console.WriteLine("objectA.val = {0}", objectA.val);         Console.WriteLine("objectB.val = {0}", objectB.val);         Console.WriteLine("structA.val = {0}", structA.val);         Console.WriteLine("structB.val = {0}", structB.val);          Console.ReadKey();     } }  I understands it produces the output below: objectA.val = 20 objectB.val = 20 structA.val = 30 structB.val = 40  The last two lines of the output I have no problem with, but the first two tell me that objectA and objectB are pointing to the same memory block (since in C#, objects are reference types). The question is how do make objectB, a copy of objectA so that it points to a different area in memory. I understand that trying to assign their members may not work since those members may be references, too. So how do I go about making objectB a completely different entity from objectA?

I want a true deep copy. In Java, this was easy, but how do you do it in C#?


I have a .py config file that sets up a set of global variables. Among them is a variable called nMin. kNeighbors is another global variable defined in the exact same way as nMin. All the other variables included in the block are local variables   for i in range(PopLength):     noveltyMetric[i] = np.average(behavior[i][0:kNeighbors])     if noveltyMetric[i] > nMin:         ...   In the loop, the program references kNeighbors with no issue, but on the next line I get the error:      local variable 'nMin' referenced before assignment"   I'm running this in PTVS 2017 and when it stops & displays the bug (while paused on that line), I call nMin in the "Immediate Window" and it calls the value correctly with no error. When I call the statement noveltyMetric[i] > nMin it returns a Boolean with no error. But for some reason it still fails to execute the line in the code and insists I'm referencing it before it's defined.

The following code works as expected in both Python 2.5 and 3.0:  a, b, c = (1, 2, 3)  print(a, b, c)  def test():     print(a)     print(b)     print(c)    # (A)     #c+=1       # (B) test()   However, when I uncomment line (B), I get an UnboundLocalError: 'c' not assigned at line (A). The values of a and b are printed correctly. This has me completely baffled for two reasons:   Why is there a runtime error thrown at line (A) because of a later statement on line (B)? Why are variables a and b printed as expected, while c raises an error?   The only explanation I can come up with is that a local variable c is created by the assignment c+=1, which takes precedent over the "global" variable c even before the local variable is created. Of course, it doesn't make sense for a variable to "steal" scope before it exists.  Could someone please explain this behavior?


In the “Recent achievements” listing, apostrophes in question titles related to badges are apparently incorrectly escaped as decimal HTML character references, i.e. as &#39;:    This appears like a mix between  (for inbox) and  (for badges). But both of these are marked as fixed for some time now, while I observed the described issue today.  The  (for &ldquo; and &rdquo;) might have the same underlying cause and is still active. Will drop a comment there, but leave this here as a separate question until someone can positively confirm that these two issues indeed have the same cause and can (and will) be fixed simultaneously.

Here’s a screenshot from my achievements inbox:    The rep gain on the Meta question has the &ldquo; and &rdquo; rendered correctly, but I see plain HTML entities on the badge notification.  I found a couple of similar questions about rendering in badges being different to rep changes, but I couldn’t find one that specifically mentioned special characters.  I can see the problem in Safari 8.0 (10600.1.25) and Chrome 38.0.2125.101, both on OS X 10.10 (14A388a), but the quotes are displayed correctly in the latest public version of the iOS app.


Please check the image, on my profile the CSS in the datepicker is gone - I'm using the latest version of Chrome.

Google Chrome: Version 32.0.1700.107 m  This happens when displaying the profile and clicking on the number of visited days/consecutive.  .


SHA-256 is a well know hash function that creates digests of 256 bits. This means that the size of the digest space is 2^256 (or at least it should be), ie, the range of the digest space is:     from 0x 00 00 00 ... 00 00 00 to 0x FF FF FF ... FF FF FF   Question However, is there any kind of limitation in the SHA-256 algorithm that would not allow a specific range of digests?    For example: 0x 00 00 00 ... 00 00 00 and 0x FF FF FF ... FF FF FF are two possible digests for SHA-256 or it is impossible to exist a message that would hash into those values?

Is every output of a hash function (e.g. SHA1, MD5, etc) guaranteed to be possible, or, conversely, are there any output values that cannot possibly be created from any input? In other words, are hash functions surjective?  If so, what guarantees this? If not, is it possible to discover such impossible outputs via an attack faster than brute force?


So this is possibly a misunderstanding of the meaning of , but all the Physics texts, sites, and wiki that I've read don't clear this up for me:  In the simplest case with the simplest statement, work is force times distance.  If you push with a force $F_{1}$ on an object that doesn't budge because of friction, you do no work.  If your friend helps push and you still apply the same force $F_{1}$ and the thing moves, all the sudden you're doing work and it's not really because of what you're doing.  Moreover, if you continue applying the same force, and your friend increases her force so that the thing moves faster, and covers a greater distance, again you're doing more work and by no fault of your own.  This just seems paradoxical, and maybe the only sensible answer to this paradox is "Well, the physical notion of work is not the same as the everyday notion of work," but I'm wondering if anyone can say anything about this to make it feel more sensible than just accepting a technical definition for a word that doesn't seem like the right word to use.

I read the definition of  as  $$W ~=~ \vec{F} \cdot \vec{d}$$  $$\text{ Work  =  (Force) $\cdot$ (Distance)}.$$ If a book is there on the table, no work is done as no distance is covered. If I hold up a book in my hand and my arm is stretched, if no work is being done, where is my energy going?


In my Bayesian class, we are always required to specify vague (or noninformative) priors for bayesian modeling. I am quite confused about that.  If I understand correctly, the main advantage of Bayesian over frequentist is that Bayesian approach provides a formal and scientific way to incorporate prior useful information into models.   My questions are:  (1) Generally, when and why are vague or non-informative priors used in Bayesian modeling?  (2) If the prior knowledge is rather rare, then what is the point of using bayesian modeling?  For example, consider a linear mixed-effects model, $$\mathbf{y} = \mathbf{X} \boldsymbol \beta + \mathbf{Z} \boldsymbol \gamma + \boldsymbol \epsilon$$ where $\boldsymbol \beta$ is fixed effect vector, $\boldsymbol \gamma \ \sim \ N(\mathbf{0}, \sigma_{\gamma}^2 \mathbf{I})$, and $\boldsymbol \epsilon \ \sim \ N(\mathbf{0}, \sigma_{\epsilon}^2 \mathbf{I})$.  Then with Bayesian approach, we'd specify some vague or noninformative priors on parameters $\boldsymbol \beta, \ \sigma_{\gamma}^2, \ \sigma_{\epsilon}^2$.  I just don't understand if the priors are non-informative, why don't we just fit the linear mixed-effects model in the frequentist way.

If the interest is merely estimating the parameters of a model (pointwise and/or interval estimation) and the prior information is not reliable, weak, (I know this is a bit vague but I am trying to establish an scenario where the choice of a prior is difficult) ... Why would someone choose to use the Bayesian approach with 'noninformative' improper priors instead of the classical approach?


Problem:  I want to prove that the infinite product $\prod_{k=1}^{\infty }(1-\frac{1}{2^{k}})$ does not converge to zero. It doesn't matter to find the value to which this product converges, but I am still curious to know if anybody is able (if possible of course) to find the value to which this infinite product converges.  I appreciate any help. I tried the following trick: $\prod_{k=1}^{n}(1+a_{k})\geq 1+\sum_{k=1}^{n}a_{k}$ which can be easily proven by inudction, where $a_{k}>-1$ and they are all positive or negative. In this case, $a_{k}=-\frac{1}{2^{k}}$, but I get : the infinite product is greater than or equal to zero.

I have the product $\prod_{k=1}^\infty \frac{2^k-1}{2^k}$. I know that every successive partial product will necessarily be smaller than the last, as we are multiplying always by a number smaller than 1. But, as the expression keeps getting bigger as k does, and it does so very fast, does this product actually converge on a constant different than $0$? I tried calculating the first partial products but just saw that the terms kept approaching $0.28$. It looks like a very random number, is this just a case of slow convergence to $0$? I have no idea of how to calulate this, any help would be appreciated.


Calculate the $n$-th order determinant: $$\Delta= \begin{vmatrix} x&a&a&\ldots&a\\ a&x&a&\ldots&a\\ a&a&x&\ldots&a\\ \cdot&\cdot&\cdot&\ldots&\cdot\\ a&a&a&\ldots&x \end{vmatrix}$$ The answer is $\Delta=[x+a(n-1)](x-a)^{n-1}$. If we add all the other columns to the first column, we get the first multiplicative factor of the answer, and are left with the following determinant: $$\begin{vmatrix} 1&a&a&\ldots&a\\ 1&x&a&\ldots&a\\ 1&a&x&\ldots&a\\ \cdot&\cdot&\cdot&\ldots&\cdot\\ 1&a&a&\ldots&x \end{vmatrix}$$ How can we calculate this determinant to obtain the answer?

This question aims to create an ""  of numerous questions that ask about determinants of specific matrices (I may have missed a few):              The general question of this type is  Let $A$ be a square matrix of rank$~1$, let $I$ the identity matrix of the same size, and $\lambda$ a scalar. What is the determinant of $A+\lambda I$?  A clearly very closely related question is  What is the characteristic polynomial of a matrix $A$ of rank$~1$?


I have 100 objects and I don't want to render them until frame 30. I want to set keyframes to the restrict rendering button in the outliner but I don't want to set it for every single object by myself.

Very basic question here, I am afraid.  I have hundreds of shattered pieces of a mesh and I am trying to animate their visibility over the scene.  How can I animate the visibility and render visibility parameter for one piece, then copy/transfer to all the others?


Attribute class and id names can have any value for the HTML syntax (), while instead for the CSS syntax they can not start for example with a number (): why?  What is the reason for this (uncomfortable) difference between two syntaxes that are daughters of the same "father" (w3c)?  I saw () that the limitation probably depends by a (regex) rule: I do not understand the reason for this rule, since the syntax the html4 managed to do without it (so I suppose that is not a insurmountable physical limit but perhaps unconventional)    $(".1abc").click(function(){   alert("OK with number too"); }); $(".abc").click(function(){   alert("OK"); }); .1abc {   border: 1px solid black; }  .abc {   border: 1px solid black; }
number

no number

What characters/symbols are allowed within the CSS class selectors? I know that the following characters are invalid, but what characters are valid?  ~ ! @ $ % ^ & * ( ) + = , . / ' ; : " ? > < [ ] \ { } | ` #


Sigh, every time I try to figure out Blender, I lose an hour because of something nutty. I'm a Lightwave user, but giving Blender a go. I tried to set up 4 views for Top/Front/Side/Perspective viewing, like in Lightwave Modeler, but after watching tutorials, I decided to reduce the windows down to one view again.  Well, I only made about 5 more tiny views, and eventually learned how to join views. Now that I've done that, I wound up with one large view with ONLY the timeline.    No matter what I try, I can only expand the console at the top, or move the boundaries between what you see. How do I get the default view back?

I can't find a way to close a view panel, in particular the horizontal at the bottom, is pretty useless to me at this moment.


I am an Australian citizen with a German residence permit (type D) valid for 12 months. My residence permit allows me to spend 90 days out of 180 days travelling within the Schengen zone (outside of Germany). My question is the following: How is this 90/180 day rule enforced? How do authorities track/trace/know when a traveller with a residence permit has spent more than 90 days travelling in other Schengen countries? Surely they have some way of enforcing this? Normally 90/180 day rule can be enforced by looking at a travellers passport, however, when the traveller has a residence permit, the dates in the passport are of no use. When it finally comes to the point of leaving the EU, do German authorities expect you to provide proof that you didn't spend more than the legal amount of time travelling in other Schengen countries? If so, what sort of documents can be used as proof?

Just curious. I am a non-Schengen (and non-EU) national with a residence permit from Finland, enabling me to travel visa-free inside the Schengen area up to 90 days in any 180-day period.  Since there is no passport control between Schengen countries, it looks like one can easily overstay without any consequences. So how is this 90/180 rule tracked for RP holders?  DISCLAIMER: I am not going to break the rules. I'm just curious about how it works, because while traveling I have never shown my passport or RP to authorities.


I recently  the article , an interesting analysis of Rowling's dark portrayal of government in the Harry Potter series. One of the first claims it makes is that the Potterverse government has no elections and no democracy.  Thinking about it, I don't recall any mention of elections in the series. Over a seven-year period in the Muggle UK, there should have been at least one general election, but the only changes of leader during this period in the magical UK are when a weak and discredited Minister resigns and when a psycho murderer takes over the government and kills the incumbent Minister.  How does a magical government take power? Are there elections which we just don't see (perhaps because the main characters are too young to vote)? Is the Ministry of Magic associated with a Muggle government like other ministries? Are there different political parties in the magical world?  Canon evidence only, please. I'll reluctantly accept evidence from the films, but no fanfic or unsourced Wikia claims.

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


I renamed my folder under Users in Computer Management from "denni" to "Dennis". I then opened an Administrator Command Prompt and used   net user Administrator /active:yes   and the command completed successfully. I opened Windows Explorer and I renamed the User folder from "denni" to "Dennis". When I tried to sign out and and sign back in, I get the message that Windows was unable to sign me in and to try to sign out and sign in again.   Every time I try I get the same message. I don't know what to do now! Please help!

I was trying to rename my User folder in Windows 10, version 1909, OS Build 18363. 418 to my correct first name. I opened an Administrator Command Prompt and used the command "net user Administrator /active:yes" and it completed successfully. I then rebooted Windows and logged in as Administrator which is not associated with Microsoft. I opened Windows Explorer and I renamed the User folder from "denni" to "Dennis". When I tried to sign out and sign back in as myself, I get the message that Windows was unable to sign me in and to try to sign out and sign in again. Every time I tried I would get the same message. I renamed the folder name back to the original name again and was able to log back in.   I asked a question about the above on Super User and Ramhound replied "You cannot rename the user profile directory using the method you describe. What you can do is disassociate your account from a Microsoft account, you will be prompted to assign profile name, select the desired name at this time. After you logout and back into the profile reassign the Microsoft account of you so desire." I am not a computer novice, but I am new to Windows 10 and this is a new install. I had no idea how to "disassociate your account from a Microsoft account", so I googled it. I disassociated my account by switching to a local account then rebooted and logged back in.   I changed the User folder name, but cannot figure out how to reassign the Microsoft account. I have searched google and it said to go to Accounts, then Email and Accounts and Sign in with a Microsoft account. There is no Sign in with a Microsoft account option available, only Add an account and Add a work or school account. These sites must be using an older version of Windows 10. Now I'm locked in this local account. One of the things I saw while googling was to Add an Outlook account. I did that after I took the photo included and a lot of the options from my Windows 10 show up, but still no way to sign in with a Microsoft account.  I sure would appreciate some help getting out of here. I don't know what to do now! Please help! Thanks in advance!


Just curious here.  According to the , you can use this markdown for images:  ![sample image](http://example.com/img.jpg)   And if we want, we can also use the "reference" format for images  ![sample image][1]   [1]: http://example.com/img.jpg   So far, so good. However, the editor interface uses another format, which I'm not sure I understand the syntax of.  [![sample image][1]][1]   [1]: http://example.com/img.jpg   with the extra brackets and the duplicated [1]. How does that work? If I remove the inner [1], I get one visible [ in front of the image.  Like I said, just curious. I can't find this format documented anywhere. And I don't understand why there are so many different ways to insert images. Do some of those formats have features the others don't have?

I have recently noticed that when using the automated feature to add links, or to add images:    That instead of getting:  ![enter image description here][2]   You get:  [![enter image description here][2]][2]   And I often find the same with links too. This appears to be a bug as there is no functionality for these extra bits and they didn't used to appear.


In Ubuntu 14.04, when you hold Alt and click a window, you can drag it around.  As I understand, you used to be able to disable it through gconf, but Unity doesn't read settings from here any more (hence not being able to change where the window buttons are any more).  There's no setting for this by default, and I can't find anything in Unity Tweak Tool either.  Is there anyway to disable Alt+click window movement in 14.04?

I have problem with this function because i work in Maya and other 3D applications that use this key combination... This option on Ubuntu 11.04 was in "window" section so i could change it to something else to avoid conflicts... where is this located in Ubuntu 11.10?


For instance, it predates everything except the first two movies. Additionally, Han Solo eventually shows up, and Luke and Leia are both there as well.  I will post followup questions regarding the made-for-tv Ewok movies should this one prove popular.

For all types of derivative works, namely:   Movies Novels Comic books Other written works (including RPG materials) Cartoons Video games Derivative movies (such as the infamous Ewok movies and even more infamous )   According to what rules does something become "canon" and who is responsible for the evaluation of a published work?


My command is  /give @p lever 1 0 {"can_place_on" : {"blocks" : ["diamond"]}}   and it keeps responding by saying     Component 'can_place_on' is not a supported component.   What did I do wrong?

This question was recently split into different questions for each workaround. See   meta posts for more information.   Can you use NBT tags in commands? I’ve tried commands that normally work in Java Edition like: give @s minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}} give @s stone_pickaxe{Unbreakable:1b} give @s item_frame{EntityTag:{Invisible:1b}} summon villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:"emerald",Count:5b},sell:{id:"diamond_sword"}}]}} summon tnt ~ ~ ~ {Fuse:20s}


How to show eigenvalues of $X^T X$ are all non-negative?

Let $A$ be an $m\times n$ matrix. Prove that all eigenvalues of $A^*A$ are non-negative.


I read that it was known to Euler that $$\sum \frac{\zeta(n) -1}{n} = 1- \gamma$$, but I cannot find a proof of this and am curious how he obtained it. I first tried messing with the definition of $\gamma$, given as the limiting difference between the partial sums of the harmonic series and the natural log, but could not connect it to the zeta function. From whichever method is used to obtain the result, could we likewise obtain $\sum \frac{\zeta(2n) -1}{2n}$ or $\sum \frac{\zeta(2n+1) -1}{2n+1}$?  Could we somehow begin with the result that $\sum (\zeta(n) -1) = 1$?

While I was looking at the values of the zeta function for the first natural numbers, I noticed that the sum of the values minus $1$, converge to $1$. Better put: $$\sum_{n=2}^{\infty} \left(\zeta(n)-1\right) = 1 $$ Furthermore, if you use only the even numbers for the zeta function, the sum will converge to $\frac{3}{4}$, or $$\sum_{n=1}^{\infty} \left(\zeta(2n)-1\right) = \frac{3}{4}$$  Leaving $$\sum_{n=2}^{\infty} \left(\zeta(2n-1)-1 \right)= \frac{1}{4}$$  This is probably common knowledge among mathematicians, but I couldn't find much about it on the internet. Is there a proof of this or perhaps even a simple explanation why this is so?


I upgraded to Maverics, and thought having iBooks on the Mac would be a good idea, so I could read epubs.  My books are gone from iTunes, although the process of adding them to a Collection in iBooks doesn't seem to be any better.  I only have selected Books on the iPad, and it seems I have to attach the iPad to iTunes, so I can select the Books in iBooks I want then sync.  On the iPad I then have to move the new books into the Category, as this doesn't seem to transfer in the sync.  This is an IMPROVEMENT?

I purchased a book and have it in ePub and PDF formats. I can easily add the PDF to iBooks from Safari. However, I can't find a method to get an ePub book into iBooks without iTunes. I'm away from my laptop with iTunes where my iPhone syncs, so that's not an option at the moment.  Is there anyway to add an ePub book to iBooks without iTunes?


In addition to a few video clips I have added a scene with a 3D model to my video sequence editor. Now the final render of the video does not appear to have rendered several settings that I have given the objects in that scene such as the materials for instance. Does anyone have an idea what might be causing this?

I have a problem with Blender and its animation process, I want to do an animation and to do that I rendered all frames of my project. Textures on all of my frames are visible but when I do the render animation, my textures won't show up. I used UV/Image editor, I applied the materials to the objects and I did the exact same thing for 3 other animation and it has worked on all of them..  Here is a rendered frame where we can see that textures show up.   On this screenshot we can see that there's no textures when I do render the animation but on the right screen we have a view in "Render Mode" which shows us textures...   If anyone can help I'd be very grateful


I am very confused with the definition  of countable sets. What I ahev come to know about a countable set is, a countable set is a set of either a finite set  or countably infinite set.ehat I understand from this is that a set having finite elements ( which we  can count like 10, 50 etc) is called a finite set and hence its countable set but iam intimidated by the countably infinite set. Honestly I don't know what it means but what I understand is that it have many elemenys which are infinite but can be counted! And that is where I get confused. Like how we can count infinite elements. I know its pretty useless to ask here but I searched wiki but I was not able to understand. So any help will be admirable. Thanks

I was reading about countably infinite sets and the definition goes as, "A set is countably infinite if its elements can be put in one-to-one correspondence with the set of natural numbers"(Source: Google). Well yes, this make sense. As the set $\mathbb{N}$ is countably infinite and set which can it can create a bijection with, would end up having the same number of elements and thus they too would be countably infinite. But this would be true iff $\mathbb{N}$ is countably infinite. How would you prove that? Or is the idea of countably infinite base on some assumption that $\mathbb{N}$ is countably infinite?


As far as I know, dead as an adjective is simply the opposite of alive, or living. Which means that there is no element of level when describing a dead person. And yet I came across this phrases very dead too often when I hear the live game commentaries on Youtube. Plus, as I'm reading a book named A history of everyone who has ever lived, I see these sentences.     In a hole in the ground, a man lay extremely dead. He was either    left in this tomb by his family or perished right there, with no idea    that he was one of the more important people in millions of years.    What are these two phrases very dead and extremely dead supposed to mean?

A common grammar lesson that was taught to me in the US and that I've had to teach abroad in EFL classrooms is that we're not to use adverbs of emphasis with absolute modifiers, just as we're not supposed to use them as comparatives or superlatives.  Classic egregious examples of this mistake include very unique and more perfect, which seem obviously flawed to me. Other instances of further modified absolute modifiers are similarly meaningless or contradictory in nature.  I wonder, though, if the rule that I learned isn't overly broad, and whether it's taught similarly in the UK and elsewhere. I find myself modifying absolute modifiers quite regularly, and in some circumstances I think it's not only logical and correct, but quite meaningful. Phrases like almost exactly or virtually all or practically infinite possess a specific meaning that can't really be replicated using nonabsolutes like very nearly or most or quite long.  In my own speech and writing, I use such phrases exactly as I see fit, so this isn't a request for permission, per se. I'm more curious about whether there's a more appropriate rule regarding absolutes that you rely on (and might be used in a classroom).


[UTC] PHP Warning:  Declaration of   description_walker::start_el(&$output, $item, $depth, $args) should be   compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0,   $args = Array, $id = 0) in   /home/inach/public_html/inach/wp-content/themes/antartica14/functions.php   on line 0   [29-Mar-2019 14:34:11 UTC] PHP Warning:  Illegal string   offset 'output_key' in   /home/inach/public_html/inach/wp-includes/nav-menu.php on line 604   the code in functions.php  //menu class description_walker extends Walker_Nav_Menu {       function start_el(&$output, $item, $depth, $args)       {            global $wp_query;            $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';             $class_names = $value = '';             $classes = empty( $item->classes ) ? array() : (array) $item->classes;             $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );            $class_names = ' class="'. esc_attr( $class_names ) . '"';             $output .= $indent . '
ID . '"' . $value . $class_names .'>';             $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';            $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';            $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';            $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';             $prepend = '';            $append = '';            $description  = ! empty( $item->description ) ? ''.esc_attr( $item->description ).'' : '';             if($depth != 0)            {                      $description = $append = $prepend = "";            }              $item_output = $args->before;             $item_output .= '';             $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;             $item_output .= $description.$args->link_after;             $item_output .= '';             $item_output .= $args->after;              $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );             } } register_nav_menus( array ( 'primary' => __( 'Navegacion Principal', 'tu_theme' ), 'secondary'=>__( 'Navegacion Secundaria', 'tu_theme' )));   The login page is in blank and I cannot access the dashboard.

I'm currently working on a WordPress site and whenever in the admin I go the Appearance > Menus page I get the following error:     ErrorException: Runtime Notice: Declaration of Walker_Nav_Menu_Edit::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl() in wp-admin/includes/nav-menu.php line 203   It seems like some sort of PHP compatibility issue. I'm running PHP 5.3.10 on my local dev machine.  What would be the best way to remedy this problem?


I am trying to learn filters. In the following circuit, the author says that negative and positive feedback are used. I couldn't understand what the circuit parts do. Actually I got the negative feedback highpass parts but the low pass part is a little different from normal filters because C2 doesn't bind with ground.

I have rigged up a notch filter from . See below: -     Its the first circuit. Now I am trying to calculate its transfer function. I have calculated two equations, but I need the third one:   (Vin-V2)/(1/SC1) = V2/R3 (Vin-V1)/R1 = (V1-Vo)/(R2+(1/SC2))   V1 and V2 are the potentials at the input of the op-Amp.


I haven't finished writing this and im confused on how to do this. i need to output the averages together and indiviually(major,minor,other)-NOT FINISHED need input on what to do. you have to ask the user to continuing entering grades until they enter a negative number.  import java.util.Scanner;  public class GradingTwo {     public static void main(String[] args)     {         Scanner keyboard = new Scanner(System.in);         double grade = 0.0;         double majAvg = 0.0;         double minAvg = 0.0;         double othAvg = 0.0;         double catMaj = 0.7;         double catMin = 0.2;         double catOth = 0.1;         int count = 0;      while(grade>=0 && grade<=100)     {         System.out.println("Input a numeric grade from 0 to 100: ");         grade = keyboard.nextDouble();          if(grade<0)             break;          System.out.println("Input a grade category: ");         String gradeCat = keyboard.next();          if(gradeCat=="major")         {             majAvg+=grade;             count = count + 1;         }     else if(gradeCat=="minor")             minAvg+=grade;     else if(gradeCat=="other")             othAvg+=grade;           System.out.println();     }     System.out.println("Major Average       " + (majAvg/count)); }   }

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?


Usually people want to speed dd up but I want to slow it down, because I think there is something fishy going on with its speed.  sudo dd if=hannah-montana-linux-amd64.iso of=/dev/sdb1 bs=512k      5988+0 records in      5988+0 records out      3139436544 bytes (3.1 GB, 2.9 GiB) copied, 8.703 s, 361 MB/s   This is a USB 2.0 stick. How is this even posible? Did something go wrong?  Edit: This is not a duplicate because my question specifically asks whether the execution was successful or something went wrong. Additionally, if something did indeed go wrong I would like to know how to prevent this and how to use the command correctly.

When running dd command to copy an ISO on Linux, I get a single progress print that stays open for a long time (many minutes). Then another at the end.  The problem seems to be that a very large cache is being used which confuses dd 's output.  sudo dd bs=4M if=my.iso of=/dev/sdc status=progress   Output (first line shows for a long time).  1535115264 bytes (1.5 GB, 1.4 GiB) copied, 1.00065 s, 1.5 GB/s 403+1 records in 403+1 records out 1692844032 bytes (1.7 GB, 1.6 GiB) copied, 561.902 s, 3.0 MB/s   Is there a way to prevent this from happening so the progress output is meaningful?


I have this regex   var reg = new RegExp('["\\>]{1}\\$([^"\\<\\> ]*)["\\<]{1}', 'g');   That I run on this string  '$name'   If I test it on sites like  it works properly but if I test it in FireFox     var reg = new RegExp('["\\>]{1}\\$([^"\\<\\> ]*)["\\<]{1}', 'g'); var match = reg.exec('$name'); console.log(match);     It only matches ">$name<". How to have it catch all like on the site?  This is not a duplicate. i'm not working with query strings, beside it works online of the site.

I am trying to parse url-encoded strings that are made up of key=value pairs separated by either & or &amp;.   The following will only match the first occurrence, breaking apart the keys and values into separate result elements:  var result = mystring.match(/(?:&|&amp;)?([^=]+)=([^&]+)/)   The results for the string '1111342=Adam%20Franco&348572=Bob%20Jones' would be:  ['1111342', 'Adam%20Franco']   Using the global flag, 'g', will match all occurrences, but only return the fully matched sub-strings, not the separated keys and values:  var result = mystring.match(/(?:&|&amp;)?([^=]+)=([^&]+)/g)   The results for the string '1111342=Adam%20Franco&348572=Bob%20Jones' would be:  ['1111342=Adam%20Franco', '&348572=Bob%20Jones']   While I could split the string on & and break apart each key/value pair individually, is there any way using JavaScript's regular expression support to match multiple occurrences of the pattern /(?:&|&amp;)?([^=]+)=([^&]+)/ similar to PHP's preg_match_all() function?  I'm aiming for some way to get results with the sub-matches separated like:  [['1111342', '348572'], ['Adam%20Franco', 'Bob%20Jones']]   or   [['1111342', 'Adam%20Franco'], ['348572', 'Bob%20Jones']]


When I compile the Python code below, I get IndentationError: unindent does not match any outer indentation level  Files = os.listdir(".") monthNum = 1 totMonths = 0 for year in range(2003, 2016):     os.chdir('./'+str(year))     for month in range(1, 13):         totMonths = totMonths +1         if (month < 10):             monthStr = str(year)+"0"+str(month)         else:             monthStr = str(year)+str(month)

When I compile the Python code below, I get      IndentationError: unindent does not match any outer indentation level     import sys  def Factorial(n): # Return factorial     result = 1     for i in range (1,n):         result = result * i     print "factorial is ",result     return result   Why?


How many functions $$f: \{1,2,\dots,n\} \to \{1,2,\dots,n\}$$ are there such that for every $i \leq j$ we have $f(i) \leq f(j)$?   The only way I could think of was removing all the "bad" cases from $n^n$, but that wouldn't be very effective. What better way could I use?

Let $A = \{1,2,3,\dots,10\}$ and $B = \{1,2,3,\dots,20\}$. Find the number of non-decreasing functions from $A$ to $B$.  What  I tried: Number of non-decreasing functions = (Total functions) - (Number of decreasing functions) Total functions are $20^{10}$. And I think there are ${20 \choose 10}$ decreasing functions. Since you choose any $10$ codomain numbers and there's just one way for them to be arranged so that the resultant is a decreasing function. However my answer doesn't match. Where am I going wrong? How can I directly compute the non-decreasing functions like without subtracting from total?


I am trying to create a "simple" regex to match any string except a specific string in middle. Lets assume that the specific string is apple, Here are results that I expect:  apple -> false foo-apple -> false foo-apple-bar -> false empty-string -> true foo -> true   I tried:  ^(?!apple)$ ^(?!apple$) ^.*(?!apple).*$ ^(.*(?!apple).*)$   but none of them worked as I expected.  looks similar but the accepted answer is not working.

I know it's possible to match a word and then reverse the matches using other tools (e.g. grep -v). However, is it possible to match lines that do not contain a specific word, e.g. hede, using a regular expression?   Input:  hoho hihi haha hede   Code:  grep "<Regex for 'doesn't contain hede'>" input   Desired output:  hoho hihi haha


I'm doing some css for my form that looks like:  <sf:form>      <table>         ...      </table> </sf:form>   (according to Spring framework form tag)  I want to select this form and can't do it in traditional way:  sf:form {       property: value;  }   because of the colon interpreted by css.  I know that I can add an identifier to my form, such as id or class to select it, but also it's interesting for me if there is a way to do it with some css trick. Maybe, taking the parent element of a table tag will take care of it? The sf:form could be taken as parent of a table by:  sf:form>table   But here we have this annoying colon again.   So, can I take a table parent tag without specifying the sf:form one? Or, maybe, there are another ways of dealing with such elements as colon that breaks the structure of a tag in the css case?

JSF is setting the ID of an input field to search_form:expression. I need to specify some styling on that element, but that colon looks like the beginning of a pseudo-element to the browser so it gets marked invalid and ignored. Is there anyway to escape the colon or something?  input#search_form:expression {   ///... }


When I execute the following code, I get ConcurrentModificationException   Collection<String> myCollection = Collections.synchronizedList(new ArrayList<String>(10));     myCollection.add("123");     myCollection.add("456");     myCollection.add("789");     for (Iterator it = myCollection.iterator(); it.hasNext();) {         String myObject = (String)it.next();         System.out.println(myObject);         myCollection.remove(myObject);          //it.remove();     }   Why am I getting the exception, even though I am using  Collections.synchronizedList?  When I change myCollection to     ConcurrentLinkedQueue<String> myCollection = new ConcurrentLinkedQueue<String>();   I don't get that exception.  How is ConcurrentLinkedQueue in java.util.concurrent different from Collections.synchronizedList ?

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


Given two lenses: a full-frame lens and a crop lens, both at focal lengths necessary to capture the same frame on their respective systems and at the same f/stop. The physical size of the aperture opening (entrance pupil) has to be larger on the full-frame lens in order to deliver light across the entire larger sensor. When mounting that full-frame lens on a crop body, does that larger aperture opening have any effect on the light captured by the crop sensor?  For example, between a 36mm f/2.8 full-frame lens and a 24mm f/2.8 aps-c lens both mounted on the same aps-c body shooting the same scene at the same f/stop and ISO, does the full-frame lens allow capturing at a faster shutter speed? Or is all the extra light wasted because it falls outside the area covered by the crop sensor and both lenses will perform exactly the same?

Lets say we have two image sensors, each one with 1MPixel resolution but differing in size. The first sensor has the size 1/3", the other one 1".  Each sensor is equipped with a suitable lens (for the image sensor format, so no vignetting or cropping takes place). Both lenses have the same characteristics: F-stop f/2.0 and Ultrawide view angle circa 100°. Both sensors are running at 100fps, so that the image shown by the 1/3"-sensor is rather dark at normal illumination in a house.   Now how much does the image shown by the 1"-sensor differ (at the same illumination) in terms of brightness? I'd guess that the 1"-image would be much brighter because of the greater entrance pupil, is that correct, and if yes, how can I calculate which f-stop the bigger lens (which sits on the 1"-sensor) need to have to resemble the image brightness of the small sensor?


I have learnt some words can use present tense to express the future.  Like:  Even if it rains, I will go outside. Can I change this one to: Even if you have jobs to do tomorrow, you are still playing!!!  If you booked a ticket, you can enjoy our best service now. Can I change this one to: Even if you booked a ticket, you still can't enjoy the service for some reason. (Here the past tense is about guessing, not the unreality.）  And about Even if he had jobs to do tomorrow, he was still playing.Obviously, he was fired. (Just change the first example to the past, now someone is talking about the reason why he got fired.)  Thanks so much!

I would like to know if there are any other tenses or grammatical structures to use for speaking about the future apart from will (perfect tense included), going to, simple and continuous present.  I mean not the obvious ones. For example, simple present (I could never have imagined it could be used for the future).     My mom arrives tomorrow.   I go to the doctor at 4 o'clock this afternoon.


Let $\mathbb{D}$ be the unit disk of complex plain. Let $f:\mathbb{D}\rightarrow\mathbb{C}$ be a holomorphic function on $\mathbb{D}$. Note the by Cauchy's formula, for $0<r<1$, $$2\pi if'(0)=\int_{|\zeta|=r}\frac{f(\zeta)}{\zeta^2}d\zeta$$ On the other hand, change $\zeta$ into $-\zeta$, we have $$2\pi if'(0)=\int_{|\zeta|=r}\frac{-f(-\zeta)}{\zeta^2}d\zeta$$ Summing up, $$2f'(0)=\frac{1}{2\pi i}\int_{|\zeta|=r}\frac{f(\zeta)-f(-\zeta)}{\zeta^2}d\zeta$$ Let $d=sup\{|f(z)-f(w)|:z, w\in\mathbb{D} \}$, then the above integral formula yields $$2|f'(0)|\le \frac{d}{r}$$ Taking $r\rightarrow 1$, we have  $$2|f'(0)|\le d$$  The main problem is to find the condition that equality holds. It says that the equality holds iff $f(z)=a_0+a_1z$ where $a_0, a_1$ are constants. I wanna show the only if direction and I tried to set $$f(z)=a_0+a_1z+a_2z^2+...,\quad h(z)=\frac{f(z)-f(-z)}{z}$$ and using maximum principle ($h(0)=2f'(0)=d$, $|h(z)|\le d/r$ on $|z|=r\quad\forall 0<r<1$) to get $h$ is a constant function so that a_3=a_5=a_7=...=0  But I cannot find similar things for a_2, a_4, a_6.. Can you help me?

Suppose $f$ is a holomorphic map on the unit disc. Let $d$ be the diameter of the image of $f$. If $ 2|f'(0)|=d $, please show that $f$ is a linear function.   I think maybe I can prove it by using Schwarz lemma, but I failed.


** I want to get text from the user and find the number of words in the text according to the word searched. BufferedReader sets the readLine method to get all rows with while, but the program gives a null pointer exception error .  The program worked fine when I used a single readline.  I think the problem is in the while loop but I do not understand the problem.**    Please Write Path : C:\Users\Soul Collector\Desktop\yazi okuma  Please Write the Name of Text : buffer  Text File :  hi hello my name is suat   hello there   Hello   Write the key word :  hi  Exception in thread "main" java.lang.NullPointerException  at project2.Count.SingleWord(Count.java:83) at project2.Project2.main(Project2.java:45)   C:\Users\Soul Collector\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1  BUILD FAILED (total time: 18 seconds)            if(press == 2 )            {          System.out.print("Please Write Path : ");         scan.nextLine();         path = scan.nextLine();          System.out.print("Please Write the Name of Text : ");         txtname = "\\"+ scan.nextLine() + ".txt";          finalpath = path + txtname;          File dosya = new File(finalpath);         FileReader fr = new FileReader(dosya);         BufferedReader br = new BufferedReader(fr);         String dizi;         while((dizi = br.readLine()) != null){             System.out.println(dizi);          }            br.close();           /* StringTokenizer st = new StringTokenizer(dizi);          while(st.hasMoreTokens()){         System.out.println(st.nextToken());        }*/           String search=null;         System.out.println("Write the key word : ");        search = scan.nextLine();          Scanner s = new Scanner(dizi.toLowerCase());         while (s.hasNext()) {        toplamkelime++;            if (s.next().equals(search))                kelime ++;                   }         System.out.println("Key Word : " + search);         System.out.println("Count of key word : " + kelime);         System.out.println("\n\n\n Total Count of Words : " + toplamkelime );        }

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 new to linux.  Recently I installed barry desktop a client for blackberry sync.And after reboot I found an error notification on the desktop panel with an error message saying   ERROR: BROKEN COUNT>0"[the error notification I get on my desktop][1]    When I use the updater to update I get the following error message:  [updater error message][2] "The package system is broken: Check if you are using third party repositories. If so disable them, since they are a common source of problems. Furthermore run the following command in a Terminal: apt-get install -f"   I am also not able to install anything from the software centre or from Appgrid either. I get the following error message on opening the software center:  [error message on opening software center][3]  "New software cannot be installed because there is a problem with the software currently installed. Do you want to repair this problem now?". When I click "repair", the operation fails with another error message as follows:[package operation failed error message][4]  "PACKAGE OPERATION FAILED The installation or removal of a software package failed detail:  installArchives() failed: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings:     LANGUAGE = (unset),     LC_ALL = (unset),     LANG = "en_IN.ISO8859-1"     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 perl: warning: Setting locale failed. perl: warning: Please check that your locale settings:     LANGUAGE = (unset),     LC_ALL = (unset),     LANG = "en_IN.ISO8859-1"     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 ...  (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 265674 files and directories currently installed.) Preparing to unpack .../barry-util_0.18.5-1_i386.deb ... Unpacking barry-util (0.18.5-1) ... dpkg: error processing archive /var/cache/apt/archives/barry-util_0.18.5-1_i386.deb (--unpack):  trying to overwrite '/etc/bash_completion.d/bjavaloader', which is also in package linberry 1.1b1a dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing:  /var/cache/apt/archives/barry-util_0.18.5-1_i386.deb Error in function:  dpkg: dependency problems prevent configuration of barrydesktop:  barrydesktop depends on barry-util; however:   Package barry-util is not installed.  dpkg: error processing package barrydesktop (--configure):  dependency problems - leaving unconfigured   SAME ERROR AS ABOVE WHEN I TRY TO INSTALL FROM APPGRID.  I believe I started having this trouble since I installed BARRY DESKTOP a client for blackberry sync. Please kindly help me with this. Thankyou.

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'm thinking about a project using arduino or raspberry pi (I don't mind working with one or another). The thing is that in my project, I have to control at least.. 50 leds/relays and there will be activated at least 10 of them at the same time.  The easy way is using gpio directly with the leds/relays, but of course, neither arduino nor raspi have so many gpio outputs.  I was thinking on using some demultiplexers, but if I use them, then I may loose the ability to activate at least 10 at the same time..  For example: My project has 50+ leds/relays, and now I want to activate [1, 7, 12, 17, 21, 26, 32, 41, 44, 48] at the same time. One second after, I want to activate [6, 12, 15, 27, 29, 31, 35, 44, 47, 50] and all others will remain disabled.  Thanks in advance!

I want to use a regular Arduino board to control LEDs - what is the most lights I can control individually from the board?  Is there a tutorial on how to hook it up?


True or false: a sequence $\{a_{n}\}$ is convergent if and only if the   subsequences $a_{2n}$ and $c_{2n + 1}$ both converge to the same   number   I think that the answer is true. I know that the converse is true because the subsequences of a convergent sequence always converge to the same number. I'm not sure about the forward direction though. I couldn't come up with a counterexample.

Given a sequence $a_{n}$, if I know that the sequence of even terms converges to the same limit as the subsequence of odd terms:    $$\lim_{n\rightarrow\infty} a_{2n}=\lim_{n\to\infty} a_{2n-1}=L$$  Is this sufficient to prove that the $\lim_{n\to\infty}a_{n}=L$?    If so, how can I make this more rigorous?  Is there a theorem I can state that covers this case?


I adjusted the bones in the rigify add on and they fit my mesh, then I generated it and it still matched up well, and when I parented it with automatic weights, it goes from a full human to what's shown in the image.

I'm doing a basic human rig for practice. All of my bones are set up and the rig generates just fine, however, when I try to parent to the rig with auto weights, a majority of my mesh disappears (See pictures)   Any ideas on what's happening?


How could one find $$\sum_{n=0}^{\infty}{\frac{\cos(nx)}{n!}}\,?$$   I tried to use Fourier series and integrals depending on a parameter to reduce the problem to a differential equation, but that didn't work.

How would I find the closed form of  $$ f(\alpha) = \sum_{n=0}^{\infty} \frac{\cos(\alpha \, n)}{n!}$$  My old pal Wolfram tells me that  $$ f(\alpha) = \mathrm{e}^{\cos(\alpha)}\cos(\sin(\alpha))$$  I've attempted writing out the first couple terms for different values of $\alpha$, but I haven't quite figured out how to arrive at the result.


My teacher explained to me that we volume is an extensive property because it is additive in nature. But he also told us that pressure is an intensive property. Now according to the gas law equation $PV=nRT$, pressure is dependent on volume. Increasing pressure should increase volume. So shouldn't pressure be extensive as well.

Most textbooks explain intensive coordinates by asking us to consider a system and divide it into two parts. The properties which remain the same will be called intensive and the properties that change are called extensive. In other words intensive variables are independent of mass (so what is written in my textbook: "The intensive coordinates of a system, such as temperature and pressure, are independent of mass and the extensive properties are proportional to mass). Now say I have a system of gas of mass m and I introduce more mass m keeping the system's volume constant. Have I not increased the pressure and maybe temperature of the system too in doing so?


The  spell says that summoned creatures will temporally vanish until the creature is out of the antimagic field, but would an elemental native to the current plane vanish?  As an example, the UA Mystic can get psionic disciplines that create elementals.

The  spell has the following effect on creatures:     A creature or object summoned or created by magic temporarily winks out of existence in the sphere. Such a creature instantly reappears once the space the creature occupied is no longer within the sphere.   Which creatures, or types of creature, fall within this category?    Obviously elementals or demons summoned by a spell will qualify. What about constructs such as golems?  What about undead animated by magic, like zombies? Stronger undead?


There will be a  for watching tags, but until that's implemented, I seem to not be able to follow tags the old way. Since that's the only way that currently sends out mails, it should still be possible. But how to do it?

There used to be subscribe button in the popup window which appears when you hover the mouse over a tag. It then sent you a confirmation e-mail and later it was sending e-mail feeds when new question tagged with the tag appeared.  The subscribe button is not there anymore. How can I subscribe to the e-mail notifications?    Old duplicate question:


Find the maximum of this expression $\frac{3}{a^3+b^3 + 3} + \frac{3}{b^3+c^3 + 3} + \frac{3}{c^3+a^3 + 3}$ , where $a,b,c $ are real numbers such that $abc = 3$. What I have done is to use Cauchy-Schwarz Inequality to obtain: $\left(\frac{1}{a^3+b^3 + 3} + \frac{1}{b^3+c^3 + 3} + \frac{1}{c^3+a^3 + 3}\right) \left((a^3+b^3+3) + (b^3+c^3+3)+ (c^3+a^3 + 3)\right) \geq (1+1+1)^2 \geq 9$ Then we would have: $\left(\frac{1}{a^3+b^3 + 3} + \frac{1}{b^3+c^3 + 3} + \frac{1}{c^3+a^3 + 3}\right)\left(2(a^3 + b^3 + c^3) + 9\right) \geq 9$ $\left(\frac{1}{a^3+b^3 + 3} + \frac{1}{b^3+c^3 + 3} + \frac{1}{c^3+a^3 + 3}\right) \geq \frac{9}{2(a^3 + b^3 + c^3) + 9}$ By AM-GM inequality we have: $ a^3 + b^3 + c^3 \geq 3\sqrt[3]{a^3b^3c^3} $ $ a^3 + b^3 + c^3 \geq 3(abc) $ $ a^3 + b^3 + c^3 \geq 9 $ . . . I have gotten $\left(\frac{1}{a^3+b^3 + 3} + \frac{1}{b^3+c^3 + 3} + \frac{1}{c^3+a^3 + 3}\right)\geq \frac{9}{2(a^3 + b^3 + c^3) + 9} \leq \frac{1}{3}$ $\left(\frac{3}{a^3+b^3 + 3} + \frac{3}{b^3+c^3 + 3} + \frac{3}{c^3+a^3 + 3}\right)\geq \frac{27}{2(a^3 + b^3 + c^3) + 9} \leq 1$ After this, I am unable to break flip the inequality sign and obtain $ \leq $ sign instead in order to obtain the maximum. Much help appreciated

if $a,b,c$ are non zero positive reals prove $$\sum_{cyc}\frac{1}{a^3+b^3+abc} \le \frac{1}{abc}$$ I have used A.M  G.M  inequality as follows:  $$a^3+b^3+c^3 \ge 3abc$$ adding $abc$ both sides we get  $$a^3+b^3+abc \ge 4abc-c^3=c(4ab-c^2)$$ so  $$\frac{1}{a^3+b^3+abc} \le \frac{1}{c(4ab-c^2)}$$ But since $a,b,c$ are positive reals  $$4abc-c^3 < 4abc$$ so  $$\frac{1}{4abc-c^3} \gt \frac{1}{4abc}$$  but i am unable to proceed here


The problem comes from §3.1.2 in the "Temporal Data Mining" book by Theophano Mitsa  I'm looking for help to calculate the value of the marginal distribution and the exact posterior distribution (the book does not give these values since they are not needed for classification)  Where would you submit this?  this is not really a computer science question

There seems to be more than a few computer science/programming Stack Exchange networks (is that the correct term?). Stack Overflow, being the first, has by far the most users, questions, and answers.  What is the reasoning for creating the others, and are there clear guidelines for which kinds of questions should be posted? I can see a large amount of potential overflow, many cases of people not getting a good answer to their question, because the person who has the answer isn't browsing that particular network at the moment.  I understand that they were probably created for organizational purposes, but wouldn't it almost make more sense to just have them as categories under Stack Overflow, keep them separated but still connected, instead of making people have to create multiple 'account's, one for each network?  I am sure there was a very good reason to break them up, but as someone that is new to SE, it can be somewhat intimidating to decide which one to post in to ensure you get a good answer. For example, if I am a computer science student, my first instinct might to be to post in the computer science network, until I see that it literally has 1% of the users as the Stack Overflow network, which still seems to be for programming/computer science related questions.  So my second instinct would then to be to post it into the Stack Overflow site on the basis that I have a significantly higher chance of my question being seen and getting a good answer. Then I notice that there is also a 'programmers' network, and I don't even begin to know where that fits in. I, and I am assuming most people, will probably just post on Stack Overflow to be safe.  My question is, other than the short little description blurb of each one, is there a clear cut set of guidelines which what each network is intended for, what kinds of questions should go to each one, and is anything being done to encourage people to post in these newer, smaller (more specialized?) networks as opposed to just posting in big daddy Stack Overflow?  Now again, this is for computer science/programming/"why isn't this code doing what I want?" related questions, I am not saying that if I had a question about Linux or WordPress or something I would have the same confusion.


Should I use the definite article before "news" in the second and third sentences? Isn't it wrong to use 'from" instead of "on" in the first sentence?  You can read news reports on a Telegram news channel. 2. All news are about contemporary art. 3.I think that's good, because almost all news lately is about the coronavirus.  Can I also use "all of the news" in 2 and 3? This is one passage but I devided it into several sentences.

I'm sorry for too many items below. I'm really confused. The question is really about whether to use "a", "the" or nothing in front of "news" and "television".        A small crowd is keenly watching the news on television.   A small crowd is keenly watching a news on television.   A small crowd is keenly watching news on television.   A small crowd is keenly watching the news on a television.   A small crowd is keenly watching a news on a television.   A small crowd is keenly watching news on a television.   A small crowd is keenly watching the news on the television.   A small crowd is keenly watching a news on the television.   A small crowd is keenly watching news on the television.


Let $P(z)$ be a complex polynomial whose zeros all have a negative real part. Show that the zeros of $P'(z)$ all have negative real part.  I've thought about factoring $P(z)$ into linear factors, or maybe induction. But I can't seem to get that to work.  It was also suggested that I try doing the "logarithmic derivative" after I factor. I.e., taking the derivative of $ln(P(z))$. But it's not clear to me how this helps, since logarithms over the complex plane don't necessarily "split" across multiplication; i.e., $Ln(zw) \neq Ln(z)+ Ln(w)$.  Any thoughts would be appreciated.  Thanks in advance.

If all the roots of a polynomial $P(z)$ have negative real parts, prove that all the roots of the derivative $P'(z)$ also have negative real parts.  Could anyone provide a proof for this please?


the first and second laws of newton are both similar, so why do we need the first law if it is the same as the second?  what is the big difference between these?

Newton's second law says $F=ma$. Now if we put $F=0$ we get $a=0$ which is Newton's first law. So why do we need Newton's first law ?   Before asking I did some searching and I got this: Newtons first law is necessary to define inertial reference frame on which the second law can be applied.  But why can't we just use Newton's second law to define an inertial frame? So if $F=0$ but $a$ is not equal to 0 (or vice versa), the frame is non-inertial.  One can say (can one?) we cannot apply the second law to define a reference frame because it is only applicable to inertial frames. Thus unless we know in advance that a frame is inertial, we can't apply the second law.  But then why this is not the problem for the first law?  We don't need to know it in advance about the frame of reference to apply the first law. Because we take the first law as definition of an inertial reference frame.  Similarly if we take the second law as the definition of an inertial frame, it should not be necessary to know whether the frame is inertial or not to apply the second law (to check that the frame is inertial).


While I was solving some binomial theorem chapter questions I encountered many questions which asked me me to find maximum value of  ${n \choose r}$ for given value of n.  Example: Find n for which   $$n!(21-n)! $$ has minimum value ?  I didn't get how to do this without substituting so I looked at the solution , it was given  "   $n!(21-n)! =21!/{21 \choose n}$   Thus, for minimum value of $n!(21-n)! $ , ${21 \choose n}$ should be maximum, which is for n=10. "    So I wanted to ask ,  Is there a general result to get the value of r for which ${n \choose r}$ is maximum for given value of n ?

How do you prove $n \choose k$ is maximum when $k$ is $\lceil n/2 \rceil$ or $\lfloor n/2 \rfloor$?  This  provides a proof of sorts but it is not satisfying. From what I understand, it focuses on product pairings present in $k! (n-k)!$ term which are of the form $i \times (i-1)$. Since these are minimized when $i=n/2$, we get the result. But what about the reasoning for the rest of the terms?


Couldn't find a clear answer to this question here or on Google. What are the actual functional, assignability, routability etc. differences between IPv6 addresses ::1 and ::ffff:127.0.0.1, if any?  When should you use one and not the other? If they are equivalent, why two of them?

I have a development environment set up where I have a separate loopback address for multiple websites.  For example, I have the following:  127.0.0.1 www.example.com 127.0.0.2 foo.example.com 127.0.0.3 bar.example.com 127.0.0.4 waffles.example.com   I'd like an equivalent solution for IPv6.  I already know that you can use ::1 as a loopback address, but ::2, ::3, etc don't seem to work.  Are there any other loopback addresses in IPv6?  Is there a way to have multiple unique loopback addresses?


Here's something that has me confused.  In the Half-blood Prince, an elaborate plan was made to sneak the Death-eaters into Hogwarts to kill Dumbledore. Draco took his time to devise the plan by using the Vanishing cabinet in the RoR. In the movies, there isn't much explanation but the book mentions that Draco found out about the vanishing cabinet from a boy who was stuck between the pair of vanishing cabinets and how he managed to apparate out of it.  According to HP wikia (here: ):     Fred and George Weasley shoved Graham Montague headfirst into the   broken cabinet on the first floor of Hogwarts when he tried to take   points away from them. Montague eventually escaped (by Apparating) and   was found in a toilet's u-bend by Draco Malfoy, who summoned Professor   Snape for help. Montague revealed the previously unknown powers of the   Cabinets to Draco.   How could someone apparate within the school when there were a bunch of enchantments to avoid the very same thing. Because when Dumbledore apparated with Harry to retrieve the horcruxes, he clearly mentions that he lifted the enchantments temporarily.   And if there weren't, why couldn't the Death-eaters (or anyone else) apparate their way into the school?

In year 5, Fred and George jam Montague into the Vanishing Cabinet. He's found weeks later in a toilet.      ‘He never managed to get all the words out,’ said Fred, ‘due to   the fact that we forced him head-first into that Vanishing Cabinet   on the first floor.’      […]      ‘They’ve found Montague, sir, he’s turned up jammed inside a toilet   on the fourth floor.’   ‘How did he get in there?’ demanded Snape.   ‘I don’t know, sir, he’s a bit confused.’   In year 6 Malfoy expands on that.      ‘I had to mend that broken Vanishing Cabinet that no one’s used for years. The one Montague got lost in last year.’      […]      ‘The other’s in Borgin and Burkes,’ said Malfoy, ‘and they make a kind of passage between them. Montague told me that when he was stuck in the Hogwarts one, he was trapped in limbo but sometimes he could hear what was going on at school, and sometimes what was going on in the shop, as if the Cabinet was travelling between them, but he couldn't make anyone hear him ... in the end he managed to Apparate out, even though he’d never passed his test. He nearly died doing it.   What happened here? Did he Apparate out into Hogwarts, Apparate into Borgin and Burkes and somehow wander back to Hogwarts and get stuck into a toilet?


int x = 0;  int y = 2;  int z = (++x, ++y);   I get that z is 3 because the value is taken from ++y, but why is ++y being chosen?

How does the comma operator work in C++?  For instance, if I do:  a = b, c;     Does a end up equaling b or c?   (Yes, I know this is easy to test - just documenting on here for someone to find the answer quickly.)  Update:  This question has exposed a nuance when using the comma operator.  Just to document this:  a = b, c;    // a is set to the value of b!  a = (b, c);  // a is set to the value of c!   This question was actually inspired by a typo in code.  What was intended to be  a = b; c = d;   Turned into  a = b,    //  <-  Note comma typo! c = d;


Let $K$ be a nonempty set and $X$ a collection of sequences which their elements are from $k$  Let $d:X\times X\to [0,\infty)$ be defined as follow:  $$ d(x,y)= \begin{cases} 0,& x=y\\ \dfrac{1}{\min\{i\in \mathbb{N}:x_i\neq y_i\}},& x\neq y\\ \end{cases} $$  Prove this is a metric.  It is easy to see that   a. it is nonnegative and equal to zero iff $x=y$   b. it is symmetric  for the triangle inequality, if we have $x,y,z$ and there are two which are equal, WLOG all will be equal.  how can I proceed in the case where $x\neq y \neq z$, if we take: $x=(0,1,x,...,y,x)$ , $y=(2,...,2,y,2)$, $z=(3,1,z,...,z,y,z)$  It seems that $d(x,z)\geq d(x,y)+d(y,z)$.  Another try:  Let assume that $d(x,z)=\frac{1}{i}$ then we have $4$ options:  $d(x,y)\leq \frac{1}{i}$ or $d(x,y)\geq \frac{1}{i}$ and $d(y,z)\leq \frac{1}{i}$ or $d(y,z)\geq \frac{1}{i}$  for all options the triangle inequality holds, as there is an element which is bigger then $\frac{1}{i}$ and for  both $d(x,y)\leq \frac{1}{i}$ and $d(y,z)\leq \frac{1}{i}$ then $d(x,z)=\frac{1}{i}\leq d(x,y)+d(y,z)\leq \frac{2}{i}$

Let $S$ be the set of all real sequences , for $(x_n) , (y_n) \in S$ , let $d \Big((x_n) , (y_n) \Big) :=0 $ if $x_n=y_n , \forall n \in \mathbb Z^+$ otherwise $d \Big((x_n) , (y_n) \Big) :=\dfrac 1{\min \{n :x_n \ne y_n\}}$ , then is $d$ a metric ?   EDIT : I have only difficulty in proving the triangle inequality


Since $\frac{1}{2}\hbar \omega$ is the  of the ground state of the harmonic oscillator, then there is no way to extract this energy.  Therefore, in what way is this value different from zero? Is not it just about where we decide to choose the reference point?

Since energy can always be shifted by a constant value without changing anything, why do books on quantum mechanics bother carrying the term $\hbar\omega/2$ around?  To be precise, why do we write $H = \hbar\omega(n + \frac{1}{2})$ instead of simply $H = \hbar\omega n$.  Is there any motivation for not immediately dropping the term?


Given that both Lightroom and (as far as I know) Photoshop use adaptive histograms, is there any way to look at my photos using a true histogram?  By true I mean showing a true distribution of greyscale values across the x axis.

Lightroom has three places in the UI where it shows information about highlight and shadow clipping:   The histogram in the Loupe mode. The histogram in the Develop mode. On the image itself, by using red for clipped highlights and blue for clipped shadows, as in the following example:     Do all three accurately show whether there's highlight or shadow clipping in the RAW file? (I shoot RAW.)  I thought so, but I was told  that that's not the case.  This on the Sony NEX-5R and LR 5, in case that matters.


When referencing global variables, one can see that functions and classes handle this differently. The first is fine and the second causes an error:  x = 10 class Foo():     x = x + 1 a = foo()   Vs:  x = 10 def faa():     x = x + 1 faa()   In the  , this is described as:     A class definition is an executable statement that may use and define   names. These references follow the normal rules for name resolution   with an exception that unbound local variables are looked up in the   global namespace.   But why?   The only other hint I have come across is :     The class’s suite is then executed in a new execution frame (see   section Naming and binding), using a newly created local namespace and   the original global namespace. (Usually, the suite contains only   function definitions.) When the class’s suite finishes execution, its   execution frame is discarded but its local namespace is saved.  A   class object is then created using the inheritance list for the base   classes and the saved local namespace for the attribute dictionary.   Which still offers no explanation why this should have the consequence that unbound locals are looked up in the global namespace.   Both links are from  which does not adress the why in more details though.

What exactly are the Python scoping rules?  If I have some code:  code1 class Foo:    code2    def spam.....       code3       for code4..:        code5        x()   Where is x found?  Some possible choices include the list below:   In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop   Also there is the context during execution, when the function spam is passed somewhere else. And maybe  pass a bit differently?  There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.


I have a list of names (i.e strings) from user input, and I would like to sort them in alphabetic order

I have a list of objects I wish to sort based on a field attr of type string. I tried using -  list.sort(function (a, b) {     return a.attr - b.attr })   but found that - doesn't appear to work with strings in JavaScript. How can I sort a list of objects based on an attribute with type string?


Do the characters in Detective Conan age according to time? I am asking how the characters age, or if the characters age at all.

Detective Conan is a notoriously long-running series -- it's been running for like fifteen years, and hundreds of cases have been solved. Conan has made friends, received upgraded technology over time (cell phones!), and has generally "kept up" with its audience.  Yet, logically, time in-universe must have passed, and Shinichi's continued absence should be more notable than it is if he's been gone for more than a year.  How much time has passed, currently, in the Meitantei Conan universe?


I'm new to LaTeX. Can anyone please help in changing the colour of stacked bars? Here is the code for the plot:  \pgfplotstableread[col sep=comma,header=false]{ All,192,37 completed,61,11 dropped,64,17 in study,47,3 changed,26,6 }\data  \pgfplotstablecreatecol[ create col/expr={     \thisrow{1} + \thisrow{2} } ]{sum}{\data}  \pgfplotsset{ percentage plot/.style={         point meta=explicit, every node near coord/.append style={     xshift=17pt,     yshift=-1.15pt,     anchor=east, %       font=\footnotesize,     color=black,             align=center,         text width=1cm,     },     nodes near coords={         \pgfmathtruncatemacro\iszero{\originalvalue==0}         \ifnum\iszero=0 %       \pgfmathprintnumber{\originalvalue}$\,\%$\\     \pgfmathprintnumber[fixed zerofill,precision=0]{\pgfplotspointmeta}         \fi},  nodes near coords align={vertical},         yticklabel=\pgfmathprintnumber{\tick}\,$\%$,         ymin=0,         ymax=100,  %        enlarge y limits={upper,value=0.1},     visualization depends on={y \as \originalvalue}  },  percentage series/.style={     table/y expr=(\thisrow{#1}/\thisrow{sum}*100),table/meta=#1  }  }   \begin{tikzpicture}  \begin{axis}[     ybar stacked,  %       axis on top,  height=8cm,  %    width=10cm,     percentage plot,  %   axis y discontinuity=crunch,  bar width=0.85cm,  symbolic x coords={All,completed,dropped,in study,changed},     xtick=data, x tick label style={rotate=45, anchor=east, xshift=-1.5mm, yshift=-2mm}, %   ylabel={\#a}, %    enlargelimits=0.15,  legend style={     at={(0.5,-0.30)},     anchor=south,     legend columns=-2  }  ]   \addplot table [percentage series=1] {\data};   \addplot table [percentage series=2] {\data};   \legend{\strut Men, \strut Women}   \end{axis}   \end{tikzpicture}   Thanks

I want to plot two bar plots next to each other. This works without a problem. However both use the first color defined in a pre or selfdefined colorseries. I tried to modify the color manually in the plot, but the color and fill definitions have no effect:  \documentclass[border=5mm]{standalone} \usepackage{pgfplots, pgfplotstable}  \begin{document}  \pgfplotstableread[header=false, col sep=comma]{  1, first item 5, second item }\datatable  \begin{tikzpicture}   \begin{axis}[             ,xbar     ,bar width=2ex, y=3ex     ,enlarge y limits={abs=0.75}     ,ytick={data} % (\empty,data,{coordinate list})     ,yticklabels from table={\datatable}{1}   ]   \addplot table [     ,red!20!black,fill=red!80!white,     y expr=-\coordindex, % Use negative coordinate index as y coordinate     x index=0 % Use first column as x coordinate   ] {\datatable};   \end{axis} \end{tikzpicture}  \end{document}   The plot is still in the default blue.


A striclty monotonic function is defined from real postive to real postive, such that $f((x^2)/ f(x)) = x$. Find all such functions. I tried substituting x by $x^2/f(x), $ such that some equation forma and i am able to use one one , but then i am not able to proceed further.

Find all strictly monotone functions $f:(0,+\infty) \to (0,+\infty)$ such that $$f\left(\frac{x^2}{f(x)}\right)=x.$$ My try: it is clear that $f$ is surjective. And because it is monotone it must also be injective. Therefore we can take $f^{-1}$ from both sides: $x^2 = f(x) \cdot f^{-1}(x)$. We can take $x = f(y)$ (because of surjectivity) and get that: $\frac{f(y)}{y} = \frac{f(f(y))}{f(y)}$. So, if we define $g(x) = \frac{f(x)}{x}$ we have that $g(y) = g\big(f(y)\big)$ and I was hoping to prove that $g$ is injective so we would have $f(x) = x$ only. But I couldn't figure that last step. There may be a better way to deal with this problem. EDIT: There is another solution on AOPS, .


I found  but ended up with an unbootable Ubuntu which loads into GNU GRUB command prompt and cannot proceed further.  Is there a reliable way to do this?

OS: Windows 7. I want install Linux Ubuntu on portable external Hard Drive USB 2.0. I read a variety of methods, but I'm confused by contradictory advices and methods. Actually, installing Ubuntu on anything other than clean PC looks much more complicated than installing Windows. I need to have Ubuntu package + Python 2.7 + C compiler installed. My external hard drive is partially filled, I need to keep all files.   Will Ubuntu run entirely on external hardrive, without writing anythinhg to Windows system folders and to registry?  Can anyone post detailed guide how install Ubuntu on external hard drive?


I'm using  and the manuals on the R site are really informative. However, I'd like to see some more examples and implementations with R which can help me develop my knowledge faster. Any suggestions?

I'm interested in learning  on the cheap. What's the best free resource/book/tutorial for learning R?