Redirect to SSL only if browser supports SNI

I have Apache 2.2 with mod_ssl and a bunch of sites in HTTPS on the same IP/port with VirtualHosting, so client must support SNI to connect to those virtual hosts.  I would like to configure my server the following way:  When a user types www.dummysite.com and his browser supports SNI (Server Name Indication), any HTTP request is redirected to https:// where an HSTS header is sent. But if the browser doesn't support SNI then the request is served by HTTP.  The above rule, stated as is, is actually a fallback rule for those people that still run old browsers, as Mozilla and Chrome don't have this problem, just to avoid leaving these users out of the site.  I would like to do this redirecting at the Apache config level, perhaps with a filter on the user agent. I wouldn't like to touch running applications except making sure that no direct http:// references are present (otherwise they imply a security warning)  [Edit] (while editing the question I forgot the question): what is the list of SNI-enabled user agents to redirect?


I have project in PHP5 and when trying to install PHP 5 in Ubuntu 18.04 using following command  sudo add-apt-repository -y ppa:ondrej/php5-5.6 Cannot add PPA: 'ppa:~ondrej/ubuntu/php5-5.6'. ERROR: '~ondrej' user or team does not exist.   I tried to install php5 following various content but not succeed Please give me any solution or suggestion is appreciated. Thank you


How to static import a class from default package?

I have 2 classes: class A and class B, both classes are packageless (in default package). I want to import and use A's static variable into B. How do I do that so that it compiles?  The following is not compiling:  A.java  public class A {     public static int x = 10; }   B.java  import static A.x;  public class B {     public static void main(String[] args) {         System.out.println(x);     } }   Compiler output: B.java:1: error: static import only from classes and interfaces


"Couple was" or "couple were" getting married?

I have recently read both:  couple is getting married couple are getting married  So which is actual usage?


I need some help with the following sentence in order to know whether it should be WAS or WERE:     a recent study revealed that the ninety percent of people who had   decided to change their first job WAS/WERE more satisfied now than in   the past, since their job conditions had improved significantly.


Can daily viewcounts be added to the data dump?

An interesting addition to the data dump would be the daily/hourly/whatever view counts for the websites. This could be used to see what happened to SO when proposal X came out, what time of day is the most active (if it was hourly), what day of the week is the most active, activity to question ratio, and many other things.   Before you say "What about Users.Views and Posts.ViewCount?", they aren't usable since they only list the total, not the breakdown of when it happened. The only statistics you could draw are monthly, which is useless.  If your worried about size, then your exaggerating what I'm asking. Daily is tiny, only 7 rows for an entire week. Hourly is a bit bigger, 168 rows per week. Considering other tables are millions of rows long, this won't affect size at all considering the growth.


How to query multiple post types and multiple post states

This following produces an empty array:  $args2 = array(     'posts_per_page' => -1,     'paged'          => 0,     'orderby'        => 'post_date',     'order'          => 'DESC',     'post_type'      => array( 'carellcars', 'ccf', 'attachment' ),     'post_status'    => array( 'publish', 'inherit' ) );  $posts_array2 = get_posts($args2);    Changing the post_type and post_status to a single string (only one post_type, one post_status) produces results. Is my syntax wrong? Or how can I query multiple post types and post states at once?


Does Google treat websites with different port as different website?

I've seen similar question on stackexchange,  However, the answer does not provide whether how Google treats different port website as different website (such as subdomain) so to summarize, does Google treat below sites as different as subdomain? or identical as subdirectory? https://example.com vs. https://example.com:####


Reset equation numbering after each section

I would like to reset equation numbering after each section or subsection. Right now I use  \setcounter{equation}{0}   I saw in another page you could also reset it by adding the following line to the preamble.  \numberwithin{equation}{subsection} \renewcommand\theequation{\arabic{equation}}   But this doesn't seem to work. The equation counters just increment across subsections. It's the same across sections if we changed the preamble to   \numberwithin{equation}{section}


How to scrape more slowly using delay python code

I am making a web scraper that has a loop that goes from page to page. The only problem is that it is running too fast and I got temporarily banned from the website. (The website allows robots to access their content). Is there any library/command that I can add to my code to make it run slower?


Python performance with Blender operators

In my script, I have for loop over many cube objects (~1000) and the treatment is very slow. Looking more in details, I notice that in the same amount of loops:   if I use python operation or simple blender operation like  obj = bpy.data.objects[obj_name]   or   obj.select = True   it takes less than 0.08s (for all 1000 objects) but as soon as I start using blender operators like:  bpy.ops.object.select_pattern() # or bpy.ops.object.duplicate() # or bpy.ops.object.location_clear() # or bpy.ops.object.transform_apply() # etc.   then, the performance drops down deeply with more than 6s for the same amount of objects.   And, a last information, if I reduce the amount of objects from 1000 to 50, the same set of operations with bpy.ops is 0.03s - so extrapolating, it would be 0.6s for the 1000 objects and not 6s. It is as is with 1000 objects, we loose a factor 10 in speed in comparison than with 50 objects.  I tried reducing the complexity of my mesh changing the cubes in planes but it had no effect at whole on performance.  Is there something particular to know to improve these performance or a way to use the bpy.ops methods with better performances? Obviously, I am missing something important probably.


When do our hats slowly walk off into the sunset?

The  page indicates "the hats get put back in their boxes on January 4th". Aside from the pure terror that sentence seems to invoke, I was curious of exactly when this is going to be.  I know that the hats have caused a bit of a time warp at times (for example the starred chat hats). Will this be true of the removal process as well?  Do we get our hats until 23:39 UTC Jan 4th, are they removed at the end of UTC Jan 3rd?


Problem to create a bibtex file to be used in LATEX

Here is the content of the Bibtex that I want to use as bibliography for LATEX file (paper):  @article{kargupta2004fourier,       title={A fourier spectrum-based approach to represent decision trees for mining data streams in mobile environments},       author={Kargupta, Hillol and Park, Byung-Hoon},       journal={Knowledge and Data Engineering, IEEE Transactions on},       volume={16},       number={2},       pages={216--229},       year={2004},       publisher={IEEE}     }  @article{mukherjee2006privacy,   title={A privacy-preserving technique for Euclidean distance-based mining algorithms using Fourier-related transforms},   author={Mukherjee, Shibnath and Chen, Zhiyuan and Gangopadhyay, Aryya},   journal={The VLDB Journal—The International Journal on Very Large Data Bases},   volume={15},   number={4},   pages={293--315},   year={2006},   publisher={Springer-Verlag New York, Inc.} }    I would to save the file with name BIB1. However, I have option to save it in TexStudio as txt file or as a TEXfile (list of extensions includes *.tex, *.bib).  How to save it? and afterwards should I compile it or use the command Bibtex?


I would like to make a request to Stack Overflow's gatekeepers.   I am not very good at asking questions and most of the time I do not know the right questions to ask.  I find it helpful to read lots of different opinions, and to listen to lots of past experiences before making a decision based on various trade-offs.  To that extent I'd really like to see opinions about a particular library, server, API usage.   I find myself using and reading a lot of posts closed as "not constructive". While these posts might be subjective, they are extremely useful to me.   Can another version of Stack Overflow be created which allows opinions about particular technology i.e. Server Fault, Super User?  On a lighter note, it would be ironic if this post is marked as not constructive. :)


What are the pros and cons of standardizing variable in presence of an interaction?

I put this question because while reading the benefits of  standardizing explanatory variables or not, I read good but contrasting opinions about standardizing when there are interaction in the model.   Some talk about how problems of collinearity are removed when standardizing (e.g. ), which is basically the case of my GLMM. However, others claim that standard errors and p-values of interactions of standardized models are not reliable... (e.g. or )  So, any ideas on what is the right thing to do?


how to solve $\int_{-\infty}^\infty e^{-x^2-x{\tau}} \cdot x\ dx$?

I took ${-x^2-x{\tau}} = k $ on differentiating it $dk=(-2x-\tau)dx$ but this substitution doesn't work how can i proceed further .


Object and Parent move separate from each other

before I begin I would like to say that I am new to blender so please be patient with my lack of knowledge.  I want to make a donut to learn the basics of Blender,so far is good,but when it comes to parenting I don't know if either my model is so badly made or maybe there are some values that are not the right.  One object moves faster then the other and.I would apreciate any advice. Thank you for your time


I have a indian passport and have a French permanent residence card valid for 10 years. Can I go to the UK for a few days to visit without a visa?

I have a French permanent residence card valid for 10 years.  Can I go to the UK for a few days to visit without a visa?


highest power of prime $p$ dividing $\binom{m+n}{n}$

How to prove the theorem stated .     Theorem. (Kummer, 1854) Let $p$ be a prime. The highest power of $p$ that divides the binomial coefficient $\binom{m+n}{n}$ is equal to the number of "carries" when adding $m$ and $n$ in base $p$.   So far, I know if $m+n$ can be expanded in base power as  $$m+n= a_0 + a_1 p + \dots +a_k p^k$$ and $m$ have to coefficients $\{ b_0 , b_1 , \dots b_i\}$ and $n$ can be expanded with coefficients $\{c_0, c_1 ,\dots , c_j\}$ in base $p$ then the highest power of prime that divides $\binom{m+n}{n}$ can be expressed as  $$e = \frac{(b_0  + b_1 + \dots b_i )+ (c_0  + c_1 + \dots c_j )-(a_0  + a_1 + \dots a_k )}{p-1}$$ It follows from  page number $4$. But how does it relate to the number of carries? I am not being able to connect. Perhaps I am not understanding something very fundamental about addition.


Exercise $2.1.1$ - Differential Topology by Guillemin and Pollack

If $U \subset \mathbb{R}^k$ and $V \subset H^k$ are neighborhoods of $0$, prove that there exists no diffeomorphism of V with U.   Here, $H^k$ is simply the upper half-space.  I tried to solve this problem with the continuity, but it is a dead-end. I have difficulty to solve this problem. Anyone could give me a hint to complete this problem?


How to hide from Google indexing part of HTML document, RODO pop up window?

I noticed, that Google is displaying my RODO pop up text in the search results for my page. Is there any way to hide certain <div> in the document for robots?


Help on proof of $\binom{n}{0}^2 + \binom{n}{1}^2 + ... + \binom{n}{n}^2 = \binom{2n}{n}$

The proof is required to be made through the binomial theorem. I will expose the demonstration I was tought, and forward my questions after exposing it. You'll see question marks like this one (?-n) on points I don't quite understand, where $n$ is the numeration of the mark. This are the doubts I have about the demonstration, the which I hope someone can clarify.  Prove that $\binom{n}{0}^2 + \binom{n}{1}^2 + ... + \binom{n}{n}^2 = \binom{2n}{n}$.  We will use the following equality, and call it $P$:   $(1+x)^n(1+x)^n=(1+x)^{2n}$    (?-1)  The result will be proved finding the $x^n$ coefficient of both terms of this equality (?-2).  According to the binomial theorem, the left-hand side of this equation is the product of two factors, both equal to  $\binom{n}{0}1+\binom{n}{1}x+...+\binom{n}{r}x^r+...+\binom{n}{n}x^n$  When both factors multiply, a term on $x^n$ is obtained when a term of the first factor has some $x^i$ and the term of the second factor has some $x^{n-i}$. Therefor the coefficients of $x^n$ are  $\binom{n}{0}\binom{n}{n}+\binom{n}{1}\binom{n}{n-1}+\binom{n}{2}\binom{n}{n-2}+...\binom{n}{n}\binom{n}{0}$ .  Since $\binom{n}{n-r}=\binom{n}{r}$, the previous summation is equal to $\binom{n}{0}^2 + \binom{n}{1}^2 + ... + \binom{n}{n}^2$. So the left hand side of the equation we are asked to proove is a coefficient of $x^n$. When we expand the right-hand side of the equation $P$, we find that $\binom{2n}{n}$ is a coefficient of $x^n$. Therefore (?-3) the left-hand side of the equation we were asked to prove is in deed equal to $\binom{2n}{n}$. In conclussion,  $\binom{n}{0}^2 + \binom{n}{1}^2 + ... + \binom{n}{n}^2 = \binom{2n}{n}$.  This was all the demonstration. My doubt one (?-1) goes about where the heck does this equation come from? How would I know what equation to come up with if requested to prove a different equality?  Doubt two (?-2) goes about why would the solution of the first equation would have anything to do with finding the $x^n$ coefficients of the one I just made up (see doubt one).  Doubt three (?-3) goes about why demonstrating that $a$ is a coefficient of $x^n$ on the left hand side of the equation I made up, and that $b$ is a coefficient of $x^n$ on the right-hand side of this equation as well, would prove my original equation, the one I was supposed to prove on the first place?  I know there are many doubts here, I hope you guys can help me. Sorry for the long post, it's a long demonstration.


I have this error message:  ! No room for a new \dimen . \ch@ck ...\else \errmessage {No room for a new #3}                                                 \fi   which I can not find a cure for.


Prove the map sending a matrix to it's inverse is continuous.

Let $GL(n,\mathbb{R})$ be the space of invertible $n \times n$ matrices over $\mathbb{R}$. I have already proved that $GL(n,\mathbb{R})$ is open in $\mathbb{R}^{n^2}$ and that it is not connected with the relative topology from $\mathbb{R}^{n^2}$. How do I prove that the map $f:GL(n,\mathbb{R})\rightarrow GL(n,\mathbb{R})$ given by $f(x):=x^{-1}$ is continuous?  Any help would be greatly apprecaited.   Additionally how do I prove that $g:GL(n,\mathbb{R})\times GL(n,\mathbb{R}) \rightarrow GL(n,\mathbb{R})$ given by $g(x,y):=xy$ (matrix multiplication) is continuous, where we take the relative topology from $\mathbb{R}^{n^2} \times \mathbb{R}^{n^2} \cong \mathbb{R}^{2n^2}$?


How to use two different languages in the same bibliography with biblatex?

Is it possible to mix two different languages in the same bibliography made with Biblalex?  I would like to get this output:   Instead of this:   I have tried using langid field, but it localizes only hyphenation.  paper.tex:  \documentclass{article} \usepackage{polyglossia} \setdefaultlanguage{english} \usepackage[backend=biber, style=alphabetic]{biblatex} \bibliography{biblio}  \begin{document}  \cite{paperES, paperEN} \printbibliography \end{document}   biblio.bib:  @article{paperES,     author={Adan Cruz and Brisa Carmelo},     title={Titulo},     journal={Título de la revista},     year={2011},     volume={IV},     pages={8-17},     langid={spanish}, }   @article{paperEN,     author={John Smith and James Brown},     title={Title},     journal={Journal title},     year={2012},     volume={V},     pages={3-15},     langid={english}, }   Any hints would be appreciated.


a problem about Lp space and Holder inequality

If for any $g$ in $L^q$, $fg$ is in $L^1$, prove that $f$ is in $L^p$. $p>1$, $p$ and $q$ are conjugate. It is sort of an inverse version of Holder inequality. We are considering Lebesgue measure in $\mathbb{R}^n$.


Programmatically adding .shp file to .mxd file

I have spent hours attempting to find the solution to the following problem online, but all answers I have found are quite old, and none work. Here is the situation: I have a variety of .shp files. I have a blank mxd file. I want to add the .shp files into the .mxd file.  Various stackoverflow and stackexchange answers would have me believe that the answer to my problem lies in either: arcpy.MakeFeatureLayer_management(,) or arcpy.mapping.Layer()  Unfortunately, I get a similar error no matter what approach I take.  The exact code from my most recent attempt (I'm really not sure how this could possibly be simpler):  import arcpy arcpy.env.workspace = "C:/test" arcpy.Exists("shapefile.shp") #returns True arcpy.mapping.Layer("shapefile.shp")   It is at this point that I receive the following error: Traceback (most recent call last):   ...   File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\arcobjects\mixins.py", line 289 in init   super(LayerMixin, self).init(lyrfile)   File "C:\Program Files\ArcGIS\Server\arcpy\arcpy\arcobjects_base.py", line 47, in init    for arg in args ValueError: Object: CreateObject Layer invalid data source  Edit: exact code from my attempt using the other function  import arcpy arcpy.env.workspace = "C:/test" arcpy.Exists("shapefile.shp") #returns True arcpy.MakeFeatureLayer_management("shapefile.shp","myshapelayer")   In this case, I receive the following error: Traceback (most recent call last):   ...   arcgisscripting.ExecuteError: ERROR 000229: Cannot open shapefile.shp Failed to execute .  Can anyone advise me as to how to proceed? I have found almost five different solutions suggesting that this is the procedure which I should follow, but it definitely isn't working for me. I am using Python 2.7.  Additional Notes: -I have manually loaded the shapefile in ArcMap, it loads and displays correctly.


How to use google rest console with salesforce rest API

Hi I wanted to  test my rest webservice from Google Rest API Console earlied I did this by copy pasting session from VF page in same browser.  I feel this should be directly possible can anybody suggest a better approach ?


Why does tar list multiple entries for some files?

In a folder with a single file (image.jpg) I run the following commands  $ ls -a .         ..        image.jpg $ tar cf target.tar image.jpg   Listing contents of the archive  $ tar tvf target.tar -rwxrwxrwx  0 Oskar  staff     190  8 Feb 12:14 ./._image.jpg -rwxrwxrwx  0 Oskar  staff  404968  8 Feb 12:14 image.jpg   Extracting archive  $ tar xzf target.tar $ ls -a .         ..        image.jpg  target.tar   Why does the list of files in the archive show two files?  I'm running this in OSX 10.11.5.  $ tar --version bsdtar 2.8.3 - libarchive 2.8.3   Extracting the same archive in Python using  also extracts the ./._image.jpg file.  I've only seen this happen with .jpg files, .txt and .xml files works as expected.


I'm downloading some images from a service that doesn't always include a content-type and doesn't provide an extension for the file I'm downloading (ugh, don't ask).  What's the best way to determine the image format in .NET?  The application that is reading these downloaded images needs to have a proper file extension or all hell breaks loose.


According to Wiktionary there is a noun . Does this suggest nuisance can be an adjective? Is it?


No function that is continuous at all rational points and discontinuous at irrational points.

Possible Duplicate:          I think I saw somewhere(but I'm not sure) that there is no function $g$ on $[0,1]$ that is continuous at all rational points and discontinuous at all irrational points. Please, is this true? If yes how can I show it?  Thanks.


Word for a person who is challenged to a bet

When I want to challenge my friend to do something (like a bet), what would you call such a person? Challenged person? Challengee?   For example:      I challenge my friend to kiss a girl and he'll receive 4 pints. I'm   the challenger, he's the [...]


Is the CEO's job now to prepare Stack Exchange for acquisition?

It's normal for a company to have a spate of firings 2-3 months after a new CEO is installed as they determine what cultural changes they want to make to an organization they must lead.  Bringing the company into alignment with the leader's goals is critical to the success of that leader's (and by proxy, the investor's) vision.  Probably the recent notable firing are merely the tip of the iceberg as this process proceeds.  Recent activity suggests this is happening as normal, but there are a few things missing - for instance announcing replacements for those positions.  While a few posts suggest they are after "growth" the actions seem to be out of step with long term growth, but appear intended to immediately increase the value of Stack Exchange.  Are the investors asking the company to position itself for acquisition? Do we have access to board meeting notes?


Trying to understand the very basics of category theory... While trying to solve a simple exercise on the subject I suddenly realized that I don't even know what morphism equality is! (The exercise asked to prove that such-and-such morphism composition in such-and-such category is well-defined - but to prove this I had to prove that it is associative, which requires me to prove equality of the sort $f;(g;h)=(f;g);h$ - which gave raise to this question)  On the one hand, many proofs in category theory consist of diagrams of some sort where it is shown that $f;g=h;j$ because a square whose edges are morphisms $f:A\rightarrow B$, $g:B\rightarrow D$, $h:A\rightarrow C$ and $j:C\rightarrow D$ 'commutes':    So it would seem that two morphisms are equal iff they lead from the same source to the same destination?  On the other hand, this would mean that there may be at most one morphism in one direction between two given objects - but this seems not the case.  I looked at Wikipedia article but could not find morphism equality defined.  Sorry if this is an extremely basic question - but when are two morphisms equal?


Simple question: how do you unzip or extract .zip archives/files in Ubuntu 12.04 Unity?


I have this batch file I wrote to open putty and want to make it a universal script for others. The script is as follows  @echo off ::Written by Mark Gulick:: ::Today's Date 20150316::  set /p U="Enter Username: " set /p P="Enter Password: " set /p DC="Enter DC Number: " start /d "C:\Program Files (x86)\putty\" PUTTY.EXE %U%@b0%DC%db -pw %P% pause   I would like to make the password not show up and have tried some areas on here and haven't found one that will work. I might be doing it wrong too. I'm a little rusty on my scripting. Am I missing something or should I use something else other then the set command?


How did Toru and Koji pass the entrance exam in My Hero Academia?

I have seen some comments and speculations about the robot having an off switch or whatever. But I want to know if there is any source material or comment from the author on how they managed to pass the exam.  I have only seen the actual author's comment on Mineta:     But I was wondering if there are author notes for the other characters.


I've done the following process:   take a set of points, each one representing a hotel with a field that says the "neighborhood" that the hotel is in (field is called "full_hierarchy") Performed SNN clustering on these points Created Voronoi Polygons using the clusters Dissolved the Voronoi polygons on the field "full hierarchy")   And I get this:    My problem is that there are bits of each polygon inside of other polygons, as you can see in my image where I have highlighted one of my neighborhoods.  Any ideas how I can get rid of these bits so that each of my polygons is complete with no "islands" in them?  I am going to be doing this on a mass scale, so I need a process that I can do on QGIS   Would also be interested in smoothing the polygons, if possible.  EDIT: Using the options recommended to be below when using the eliminate sliver polygons:    But the output layer looks exactly the same - nothing changes?


Any class of a nonempty $X$ generates a base for a topology on $X$.

Theorem Any class $\mathcal{A}$ of subsets of a nonempty set $X$ is the subbase for a unique topology $\tau$ on $X$. That is to say, the finite intersections of members of $\mathcal{A}$ form a base for the topology $\tau$ on $X$. Example Consider $X=\{a,b,c,d\}$ Let $\mathcal{A}=\{\{a,b\},\{b,c\},\{d\}\}$ The finite intersection of members of $\mathcal{A}$ give us: $$\mathcal{B}=\{\{a,b\},\{b,c\},\{d\},\{b\},\varnothing,X\}$$  How is it true that $X \in \mathcal{B}$ ? By definition of subbase, the finite intersection of members of $\mathcal{A}$ are the members of some base $\mathcal{B}$. But for $a_i \in \mathcal{A}, \displaystyle\bigcap a_i \neq X$ for any finite intersection of $a_i$'s. Look: $\{a,b\}\cap\{b,c\}\cap \{d\} \neq \{a,b,c,d\}$ nor do any other intersection of elements of $\mathcal{B}$ result in $X$. Anybody know what's going on here? Why is $X \in \mathcal{B}$?


I am a bit confused because everyone says to reduce the swappiness to about 10; but if I have only 4GB RAM than how much swappiness would be the best? and also If I had 8 and 16GB ram?  and also I am not talking about swap partition/file size I am talking about swappiness.  [Edit]: I don't want to know that what swappiness does, instead I want how much I need. According to a suggestion below I am listing some common tasks and apps I use. I am a programmer so apps like: VScode, Pycharm are neccesary for me and also some heavy tasks like virtualization (most of the times of android or windows) are in my usual work. And I also do video editing and graphics design, but, for those I use light programs (I think they are because they feels so fast) like: Shotcut, Inkscape.  So, I think this info would help in answering the question Will appreciate an answer!:))


I a have a small problem with Git commit. So I am working on some project and using Git. I did a Git commit and I accidentally wrote a wrong commit message. So my question is:     Is there anyway I can change the commit message in Git?   NOTE: I have tried to do this way:  git commit -a --amend -m "New Commit Message"   But it doesn't work. Why?  Thanks.


Need help in my code (Error: NullPointerException when accessing map's key)

This is my take on the question "Longest Palindrome Substring"(Leetcode problem  ). So, I tried iterating through each substring to see whether they are palindrome or not and stored the palindromic substring with its length in a map.  But, when accessing the key (string:- "aba") using the value (int:- 3), I'm getting the error " Line 27: java.lang.NullPointerException".   I tried giving test cases of ignoring strings with length less than 3, but i'm still encountering the issue, where longer strings works fine.   class Solution {     public String longestPalindrome(String s) {         ArrayList<String> arr = new ArrayList<>();         arr = allSubStr(s);         if(s == null || s.length() <= 2)             return s;         //System.out.println("before" + arr);         for(int i = 0; i < arr.size(); i++){             if(!isPali(arr.get(i))){                 arr.remove(i);             }         }         //System.out.println("after" + arr);         Map<String, Integer> map = new HashMap<>();         for(int i =0; i < arr.size(); i++){             map.put(arr.get(i), arr.get(i).length());         }         Map.Entry<String, Integer> maxEntry = null;         String maxVal = "";         for (Map.Entry<String, Integer> entry : map.entrySet()){             //System.out.println(maxEntry.getValue());             if (maxEntry == null || entry.getValue().compareTo(maxEntry.getValue()) > 0){                 maxEntry = entry;                 maxVal = entry.getKey();             }         }         return maxEntry.getKey();      }     public static boolean isPali(String str){         int i =0;         int j = str.length() -1;         char[] word = str.toCharArray();         while(j > i){             if(word[i] != word[j])                 return false;             i++;             --j;         }         return true;     }      public static ArrayList<String> allSubStr(String str){         ArrayList<String> temp = new ArrayList<>();         for(int i =0; i < str.length(); i++){             for(int j =i+1; j < str.length(); j++){                 temp.add(str.substring(i,j));             }         }         for(int i =0; i < temp.size(); i++){             if(temp.get(i).length() < 2){                 temp.remove(i);             }         }         return temp;     } }   So, can anyone point out, where I am making the mistake? The output should be "aba" when given a string "babad" or any of its alternative.  Thanks in advance!


The mass of a photon is said to be 0, But light (photons) get attracted due to gravity of a black hole, that means photons have a mass which is very very very small. And we know that any object with mass cannot reach speed of light. Then how does a photon which have a very little mass can travel with speed of light?


When a square of given dimensions is cut to make it a rectangle, does the area of rectangle becomes greater? why? how?

In the attached image i have shown a square whose area comes out as 64. Now that square is cutted to make a rectangle and the area of rectangle comes out as 65. How is it possible when same material is their and no more material is added ? Thanks for your time .


I was able to review the same post twice, in two review queues

I'm mostly reviewing stuff over at the gamedev SE. A late answer can also show up in the first posts section. If I review it in either of those two, it does not show up in the other one. If, however, I open each section in a separate tab, and the same answer shows up in both tabs, I can review it twice (no error whatsoever, it just works).  For example:  and , both on  the same answer.  Is this a known issue? Or is it an issue at all? Since a normal review under a section makes the answer disappear from the other, I'm guessing this is kind of an exploit.


I have a webapp hosted in Amazon S3, the webapp is build with jQuery Mobile and I use changePage lo navigate between pages, I'm not using the hash operator(#) when I change the page.  I'm having problems when the user copy the url and paste it in a new tab  For example:    loads the page page1.html that is in amazon s3 with only the jquery page structure...  The behavior that I want is that load index.html and with js read the url, detect the page and load the correct page.  With Apache I solve this with URL Rewriting... but for Amazon S3 I didn't find any similar...  NOTE: I know that if I activate the hash operator (#) in my urls the problem is solved but I need clean urls without #.


How do I summon specific villagers in Minecraft 1.14?

I've tried using codes from Minecraft 1.13 to summon specific villagers, but it doesn't seem to work as I always get the same villager. Is there such a command that works in Minecraft 1.14?


What do I mean by Convention? First of all, allow me to clear myself about the word 'conventions. As most of you already know, coding conventions are a set of guidelines for a specific programming language that recommend programming style, practices and methods for each aspect of a piece program written in this language []. These conventions usually cover 'file organization', 'indentation', 'comments', 'declarations', 'statements', 'white space', 'naming conventions', 'programming practices', 'programming principles', 'programming rules of thumb', etc. An Example! As an example, consider Java (and other C-like programming languages). In Java Naming Conventions, class names should be in UpperCamelCase, methods and variables should follow lowerCamelCase and constants should be ALLCAPS. A Personal Experience: There are some of these conventions that I have realised while writing smaller reports. For example, the second time I wrote a report with LaTeX, I realized it's better to put each chapter in a separate file. Also, I learned about them reading other peoples code like  one that I learned about it recently: One-Sentence-per-Line. This looks very important for sake of readability of the latex source but I never thought about it until I read that answer. Here comes the Question! I'm about to write my master thesis and I want to know these conventions for LaTeX. My goal is to achieve a readable, reusable, easy to modify and standard source code. If you know any conventions, or if you have your own personal ones, regarding any aspect of LaTeX, please share with me and I would be delighted if you support your answers/conventions with reasons or examples.


to  migrated from Stats.stackexchange.com to StackOverflow.   The answer was given on stats site, and migrated with the post. It is in locked and deleted state. What puzzles me, it is locked after receiving additional vote up (answer has +1 on stats and +2 on SO). And more, how it comes up being locked by ?   Surfing meta, it seems that I get what locked post is, and how and why some posts ends up being locked. But Community account seems to serve for automated maintenance tasks on stackexchange, so the quesition is, what triggered the mentioned answer locking?


Random Forest- change in model performance due to same values in one of the independent

What will happen in random forest if one of the independent variable has no change in value (have same answer) for all the samples?


There is a hotkey mentioned by Gleb in the Blender Guru podcast that allows the camera view to be flipped on the x/y axis, I can't remember it for the world, nor find it anywhere in google.  The episode is like 3hs long so I'd prefer not to go through it again trying to find the moment he mentions it.  What is this hotkey?


Why is Raghav Sood's accounts count showing zero in his profile-page?

See his .  Why is it showing like that?  All his profiles are showing like this. See his .


GoP - The Game of Points: Critical Sneak Attacks (Grant downvotes are commented soon)

Lets see how a downvote without a comment explaining the reason, is like a critical sneak attack:   We don't know who did it. We don't know why they did it. The target can't defend him/herself. The target can't adapt and learn from it. The target can't improve what he/she was doing. The one who attacks isn't challenged in absolutely any way.    :P  "Forcing a comment will end in even worse results." at  why? how? ppl doing the harm will complain more? how can that be bad??? less worse than not knowing why we got downvoted, that's for sure.    So I request this alternative message and feature: "If someone, that downvotes, comment in the next 2 hours, all downvotes will be kept, otherwise all downvotes will be cancelled." (this refreshes every 2h after a new downvote) Now that is a great incentive to let someone take an honorable action!    Dup-friend of this +-10 year old question:  Related to , and possibly to also all the ones heavily down-voted and linked from it :P    hot tip:  If you readed til here, make it sure to further read  BEFORE creating your equivalent/duplicate question about this same subject (I wont edit above to keep it as raw as I used to think :))    (Suggestion) Btw, from the comments I came to this:    I think the "taking the downvote personal" instead of being "about the question/answer itself" problem arises from the fact of the personal penalizations we receive (or we see others receiving) when we have little points on that account, like we cant do many things when we have little points.    If we could, for ex. vote something up/down but that vote be "ignored" by the system until we reach a minimum score to validate these votes we cast (so it would keep the votes we cast and our effort on reading and understanding and voting wouldnt be discarded), it would lower the side effect of personalizing the downvote, helping on keeping the feeling about the downvote limited to the question it-self, instead of a personal practical/usage kind of punishment.   In short, let newcomers do all basic things, but only make these actions available to everyone after we have enough points to grant what we did has enough quality to be made public. What would be a further incentive on contributing for sure :)  Obs.: I just found an answer deserving a downvote. The user had just a few points above 100. If I downvoted him, he would be prevented from several actions in the network. I saw other of his answers, they were ok, had effort on it, but I couldnt upvote any of them yet. If I had downvoted I would help the network itself what is good, but I would mess his usability of the network what is bad. So, we that care not only for the network but also for the ppl using it (what is the network w/o ppl? nothing) are thrown in a dilemma. If I downvote he will be forced to put more effort on his answers, what is good, but can he? does he have such time/energy/knowledge? how long his actions will be limited on the network? will he simply giveup? So, I wont downvote his answer right now, and that is bad for the network, but I know (I feel) I am doing the overall right thing, and that is what matters to me. Also, that subject had more than 11K visualizations, and NOBODY downvoted it! someone should begin trying to really understand why as apparently my argumentation is not enough.    (Suggestion) about possible anonymous comments:  I think, if comments could be made anonymously (may be only for ppl with enough score to do so), then they would be more willing to provide help about their downvotes w/o fear of retaliation.


Help! Bone Heat Weighting: failed to find solution for one or more bones

im trying to rig the character of Lol Ahri in Blender 2.9, i want her to walk and wave. I downloaded the object(ahri), and used the basic human armature.  But when i try to parent the model with the rig, it shows me the error "Bone Heat Weighting: failed to find solution for one or more bones". I tried to use automatic weigths   So i started looking for solutions, this is what i tried: MERGE BY DISTANCE (or remove doubles), scaled up, decimate geometry, delete loose, remove all modifiers, any of the bones are showing off, just using a single bone, changed the merge distance to 0.002, and placed the root bone at the center of the model.   the link to the project is:  if you could help me i would be very grateful :)


I have a question about the following exercise:     Evaluate   $$\left(\left(-2\right)^2\right)^{\frac{1}{2}}.$$   When I solve it I get $2$. I first raise $-2$ to the second power, which is $4$. After that I raise four to the $1/2$ power, which is the same as taking the square root of it. So I get $2$.  But when I put this question in Symbolab, I get $-2$. They are using a formula of exponents. I think their answer is wrong, especially because many other sites, for instance Wolfram Alpha, are saying the answer is $2$.  Link Symbolab exercise:   Is it correct that when you want to use the formula underneath, $a$ has to be a positive number? Or is there another reason why this rule doesn't seem to work in my example? $$(a^m)^n = {a}^{mn}$$.


How to write vertical lines in algorithm

Hello please help me with this one, cant put vertical lines even with algorithm2e, i have to make it till Saturday.  Thank you very much


Find the value of : $\cos x \cos 2x...\cos 999x$ given that $x=\frac {2\pi}{1999}$

Given $x=\frac {2\pi}{1999}$  Find the value of $$\cos x \cos 2x \cos 3x ...\cos 999x$$  So I tried expanding $\sin {2000x}=2\sin 1000x \cos 1000x$  Then rewriting  $\cos 1000x= \cos {(999x+x)}$   No luck so far.


I'm currently working on a project on Blender and I'm still trying to familiarise myself with the interface so I'm quite a beginner at the moment. I was working on a figure and then I'm not quite sure what I clicked on it took me to a different interface other than the initial one where you edit the figures and stuff.  This is what I'm getting when I open my saved project    Thank you!


Vban installation -bash: $: command not found

I'm trying to install Vban on a Raspberry Pi Zero.  I've installed the required packages libasound, libpulse, libjack and autoconf + automake I think I successfully did the steps with $ ./autogen.sh and $ ./configure (I had to use sh./autogen.sh and sh -/configure) When I try $ make or sh make the command line only returns -bash: $: command not found Can you give me some hints or assist on installing Vban? Thank you


It is about installation. I bought a new laptop. Dos was already there but no other os.i tried to installing Ubuntu. It was installed and asked to restart now. It restarted and the dvd tray ejected. now when i start it  is showing the system is running on low graphic mode.  What to do now?!


StackOverflow user leagues reputation doesn't match

While I was perusing  today, I noticed that it stated my all-time rep was 412 when it actually is 453 (as of now). Does this reputation take time to update itself? (I had gotten a few upvotes just before I checked). I'm just curious.


Word for person who always judges their actions positively

What do we call a person who always tries to judge their own actions in a positive way, or convince themselves that what they do is always right?


Why do we have wrinkly fingers after swimming?

I found an explanation for my question here , which suggests that water washes out sebum (special oil, which covers our skin) and water gets into outer layer of now unprotected skin by osmosis. This article also suggests that fingers are not really shriveled - they are water-logged. But is this right? I think I observed many times my wrinkly fingers after swimming, but I never felt that they are water-logged. Any thought on this matter would be highly appreciated.


Run an AppleScript by using a keyboard shortcut

I need to run an AppleScript using a keyboard shortcut. How can I do that?   I think about    Save AppleScript in textual format. Use Keyboard Maestro to launch 'osascript' to run the script when the matching keyboard shortcut is called.   What do you think? Is there better way to go?


Can someone with poor coursework record but decent research profile fit in academia?

I want to try to enter academia by doing 2 postdocs after my PhD. However, I am bothered by the fact that I have been consistently poor/average in my grades during my undergrad, master's and PhD degree. I had 3.2/4 GPA in undergrad. I had to retake 3 courses in my second year as I had flunked them. They were related to my current field of research. My master's and PhD GPA were 3.75/4 each. I had a bit of TA experience during master's and PhD. I took tutorials for a laboratory course for first and third year undergraduates. Will my performance hinder my shortlisting for interviews in academia when I do apply for tenure track positions?


Views - How to suppress ajax errors without leaving a log entry in browser

I have a views page that is continually updated using views_autorefresh.  My setup works fine except for the occasional error message:  AJAX Request terminated abnormally  This only happens if the user tries to navigate away from the page during an update.  Is there a way to suppress this message?  Because I know that this message will happen (repeatedly) I do not want for there to be a log entry of it.


I was wondering if the mass of an object can be measured by the effect it has on a body of water if it was dropped from a certain height?

The question:    asks about the height of the splash when an object is dropped into water, but there are other parameters that can depend on the mass and velocity of the object e.g. the shape of the splash, the horizontal distance reached, the amplitude of waves radiating outwards and so on.  So the question is: Is it possible to measure the mass of an object based only on the effect it has on the body of water (i.e: a swimming pool) it is dropped in (such as the behavior of the wave oscillations, etc)?


Suppose I have a sphere of radius $r$ with all the charge residing on the surface, distributed  uniformly i.e. charge density $\sigma$ is constant. I want to find the electric field created by this sphere.  All problems of this sort I have solved by enclosing the sphere in a larger imaginary sphere with radius $R$, and then using the assumption that the electric field lines are in a radial direction, in combination with the divergence theorem.   If I use that method for this question, I find that the Electric field inside the sphere is zero. I can't understand this intuitively. I would have thought that if you are in the proximity of charge, there will be an electric field. Why would the electric field lines extend outwards radially from the sphere, and not inwards too?


If a body A is revolving about an axis with moment of inertia (MOI) $I_1$ with angular velocity $\omega_1$, and rotating about its centre of mass with MOI as $I_c$ with angular velocity $\omega_2$, how would we calculate the kinetic energy of the body?  E.g., a disc with radius R is revolving about an axis $3R$ from its centre, and is simultaneously rotating about a parallel axis through its centre of mass (let's say perpendicular to the plane of the disc for simplicity) with angular velocities $\omega_1$ and $\omega_2$ respectively.


Could not initialize the package information       An unresolvable problem occurred while initializing the package information.       Please report this bug against the 'update-manager' package and include the following error message:  E:Encountered a section with no Package: header,  E:Problem with MergeList /var/lib/apt/lists/ca.archive.ubuntu.com_ubuntu_dists_precise_multiverse_i18n_Translation-en, E:The package lists or status file could not be parsed or opened.'    This is the message I receive when i click the top left corner of my screen and click the Software Updater.   What should I do?


Finding a path to a circular zone in continuous space

I need to find the shortest path for an agent that wants to use a ranged attack against the specified target. This means that the path's ending point should be inside the range of the attack and have line-of-sight on the target, which may be blocked by various static obstacles. This part of the game is turn-based, so I only have to worry about finding a path for one agent at a time, and can allow myself to take a small performance hit. Anything under 100ms is probably acceptable. I'm operating in a continuous space, but even if I constrain it with an overlaid grid, the problem doesn't get much easier. The only solution I can think of is to use A* to find a path to every grid cell inside the range that has LOS on the target, and compare their length to find the shortest one - which is prohibitively expensive at longer ranges. Calculation of path to target 3000 cells takes up to 600ms. What's worse, LOS check is also somewhat expensive, so even determining a complete set of cells which have LOS is out of question. Before we even consider LOS, I can't find a good way to find the shortest path to the target circle. Of course, I can sample a number of points on the circumference and find a path to each one, but this sounds too unreliable and too costly at long ranges. This approach also completely breaks down if we take LOS into account, because it is possible that no point on a circumference has LOS, but some point inside the circle does. I was unable to find any algorithms or even research papers on the topic of finding a path to a circular zone in continuous space, so maybe I'm using the wrong keywords or missing something. Are there any known algorithms for this problem? Alternatively, is finding the path to every sampled point inside circle my best bet, and I should work on optimizing this approach?


Prove $f$ is uniformly continuous iff $ \lim_{x\to \infty}f(x)=0$

Let $f:[0,\infty)\to (0,\infty)$ be a continuous function and $\displaystyle\int^{\infty}_{0}f<\infty$. Show that $f$ is uniform continuous iff $\displaystyle\lim_{x\to \infty}f(x)=0$   So I could only see that continuity is not sufficient condition for the limit to exists since $\displaystyle\int^{\infty}_{0} \cos x^2$ exists but $\displaystyle\lim_{x\to \infty}\cos x^2$ does not exist , so we need something more stronger than continuity.


Entire function bounded by a polynomial is a polynomial with a less or equal degree- complex function

There is an entire function $f$, that is bounded by polynomial $p(z)$ with degree $n$, meaning that  $|f(z)|≤|p(z)|$ for every $z\in\mathbb C$.  Show that $f$ is a polynomial of degree at most $n$ (less or equal to $n$).


Find all the triangles satisfying $\cos(A)\cos(B)+\sin(A)\sin(B)\sin(C)=1$

I am trying to solve the problem of finding all triangles with angles $A$, $B$ and $C$ (in $[0,\pi]$) such that $\cos A\cos B+\sin A\sin B\sin C=1$.   In the case where the triangle has a right angle, it can be proved that $C=\frac{\pi}{2}$ (thus $C$ is the right angle and $A=B=\frac{\pi}{4}$. If we assume that the triangle is isosceles, then the triangle is flat or has a right angle (hence is the above solution).  My intuition says that these are the only solutions but I struggle to prove it. Any idea?


Is buying a lens with image stabilization (IS) worth the money?

I have been saving up to buy a Canon 70-200 mm f/2.8 IS lens and was wondering if the IS is worth the extra $ or can I buy a lens without it, and spend the extra $ on a extra lens like the 17-40mm?


Can a warlock choose a lower-level spell upcast at a higher level for their Mystic Arcanum class feature?

A player asked me if they could use their 17th-level Mystic Arcanum (Warlock class feature) to select the 6th-level spell "Mass Suggestion" cast at 9th level (to always make the suggestion last a year and a day).   I am unsure how to answer this (final verdict), as Mystic Arcanum specifically states:     At 11th level [...]. Choose one 6th level spell from the warlock spell list as this arcanum. [...] At higher levels, you gain more warlock spells of your choice that can be cast this way: [...] and one 9th-level spell at 17th level. (PHB p.108)   So my take on this is that they are very specific about which spells you are able to choose (spells that are on the warlock spell list, and there, they have to be n-th level).   Am I wrong? Is there any rules citations which support what the player asks?


server machine: sudo apt-get update error

When I try running the update through the terminal in my server machine, I get the following error.  $ sudo apt-get update Err:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease                     Temporary failure resolving 'in.archive.ubuntu.com' Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease              Temporary failure resolving 'security.ubuntu.com' 0% [Working]^C                    I checked the network too.  $ ping us.archive.ubuntu.com -c 4    ping: us.archive.ubuntu.com: Temporary failure in name resolution   sudo  apt-get update Err:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease Temporary failure resolving 'in.archive.ubuntu.com' Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease Temporary failure resolving 'security.ubuntu.com' Err:3 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease Temporary failure resolving 'in.archive.ubuntu.com' Err:4 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease Temporary failure resolving 'in.archive.ubuntu.com' Reading package lists... Done W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic    /InRelease  Temporary failure resolving 'in.archive.ubuntu.com' W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Temporary failure resolving 'in.archive.ubuntu.com' W: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Temporary failure resolving 'in.archive.ubuntu.com' W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Temporary failure resolving 'security.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead.   I have edited the apt-get update command's output  ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. ping: sendmsg: Operation not permitted ping: sendmsg: Operation not permitted


How to see what will be updated from repository before issuing "svn update" command?

I've committed changes in numerous files to a SVN repository from Eclipse.  I then go to website directory on the linux box where I want to update these changes from the repository to the directory there.  I want to say "svn update project100" which will update the directories under "project100" with all my added and changed files, etc.  HOWEVER, I don't want to necessarily update changes that I didn't make. So I thought I could say "svn status project100" but when I do this I get a totally different list of changes that will be made, none of mine are in the list, which is odd.  Hence to be sure that only my changes are updated to the web directory, I am forced to navigate to every directory where I know there is a change that I made and explicitly update only those files, e.g. "svn update newfile1.php" etc. which is tedious.  Can anyone shed any light on the standard working procedure here, namely how do I get an accurate list of all the changes that are about to be made before I execute the "svn update" command? I thought it was the "status" command.


Since we have borel measurable function, why do we have to introduce lebesgue measurable function?

I am wondering the reason of the introduction of Lebesgue measurable function after Borel measurable function.


Python equivalent of Ruby's each_with_index?

In Ruby, if I have an array and I want to use both the indexes and the values in a loop, I use each_with_index.  a=['a','b','c'] a.each_with_index{|v,i| puts("#{i} : #{v}") }    prints    0 : a  1 : b 2 : c   What is the Pythonic way to do the same thing?


How to use a different mirror of macports rather than the offical mirrors?

How to use a different mirror rather than the mirrors in the ?  Well, I mean not only download port.tar from other mirror, like the question , but also download packages from a different mirror.  I have noticed that when downloading packages, the port just download packages from . But I don't know how to change the mirror it get packages from.  Many thanks!  I will appreciate every answer or comment.


Were there two Death Stars in construction at the same time?

The first Death Star was in construction at the end of Episode III (presumably 19 BBY). The ending shot is this picture, with only small portions of the superstructure completed:    19 years later, the Death Star has only been recently completed (the novel Death Star places the completion about 1 BBY). So we assume it took about 18 years to build, and that's with tons of Wookiees working on it. Fast-forward to Return of the Jedi in 4 ABY, and the second Death Star is significantly built, and is "fully operational":    They had learned from their mistake on the first Death Star, and had covered up the thermal ports. Presumably they did not just make a patchwork fix, but re-engineered that portion. Anyway, it seems unlikely the progress made on the second Death Star occurred in only 4 years. Both Death Stars cost huge amounts of money and resources, and having two in construction would have been much more difficult to hide. So were both in construction at the same time?


"Find the net force the southern hemisphere of a uniformly charged sphere exerts on the northern hemisphere"

This is Griffiths, Introduction to Electrodynamics, 2.43, if you have the book.      The problem states Find the net force that the southern hemisphere of a uniformly charged sphere exerts on the northern hemisphere. Express your answer in terms of the radius $R$ and the total charge $Q$. Note: I will say its uniform charge is $\rho$.   My attempt at a solution:   My idea is to find the field generated by the southern hemisphere in the northern hemisphere, and use the field to calculate the force, since the field is force per unit charge.   To do this I start by introducing a Gaussian shell with radius $r < R$ centered at the same spot as our sphere. Then in this sphere,   $$\int E\cdot\mathrm{d}a = \frac{1}{\epsilon_0}Q_{enc}$$  Now what is $Q_{enc}$? I feel like $Q_{enc} = \frac{2}{3}\pi r^3\rho$ , since we're just counting the charge from the lower half of the sphere (the part thats in the southern hemisphere of our original sphere). (Perhaps here is my error, should I count the charge from the entire sphere?, if so why?)   Using this we get $$\left|E\right|4\pi r^2 = \frac{2\pi r^3\rho}{3},$$ so $$E = \frac{r\rho}{6\epsilon_0}.$$ Using these I calculate the force per unit volume as $\rho E$ or $$\frac{\rho^2 r}{6\epsilon_0}$$  Then by symmetry, we know that any net force exerted on the top shell by the bottom must be in the $\hat{z}$ direction, so we get $$ F = \frac{\rho^2}{6\epsilon_0} \int^{2\pi}_0\int^{\frac{\pi}{2}}_0\int^R_0 r^3\sin(\theta)\cos(\theta) \mathrm{d}r\mathrm{d}\theta\mathrm{d}\phi$$  integrating we get $F = \frac{1}{4}\frac{R^4\rho^2\pi}{6\epsilon_0}$.   Now Griffiths requests us to put this in terms of the total charge, and to do so we write $\rho^2 = \frac{9Q^2}{16\pi^2R^6}$  Plugging this back into $F$ we get $$F = (\frac{1}{8\pi\epsilon_0})(\frac{3Q^2}{16R^2})$$  Now the problem is that this is off by a factor of $2$ ...   I tried looking back through and the only place I see where I could somehow gain a factor of $2$ is the spot I mentioned in the solution, where I could include the entire charge, however, I can't see why I should include the entire charge, so if that's the reason I would be very grateful if someone could explain to me why I need to include the entire charge.   If that is not the reason, and perhaps this attempt at a solution is just complete hogwash, I would appreciate if you could tell me how I should go about solving this problem instead. (but you don't need to completely solve it out for me.)


How does this Python statement "line[len('name:'):]" work

I'd like to know how the following string processing works for the text file given below. It tries to get what follows in lines starting with "name:..."  The part of the 4th line   line[len('name:'):]   does not seem very intuitive in helping me understand how it works.It seems like its getting the length of 'name:'. Also what is the extra : following ) for ?  for line in lines:     line=line.rstrip('\n')    # assuming it came from a file, remove newline     if line.startswith('name:'):         print('The name is '+line[len('name:'):])     else:         print('The content is '+line)   It parses a text file with the following content  name:english 1001Nights  A Night at the Call Center Grammar name:science Engineering Biology Physics name:maths Algebra Geometry   Thanks in Advance for all your help


I have array something like this  string[] arr = ['a', '', 'c', 'f', ''];  I want to remove null elements from the same.  How  can I remove the required elements in C#?


How do you group a list of nodes by the taxonomy term?  e.g.  Term 1  --- Node 1 --- Node 3 --- Node 7  Term 2 --- Node 6 --- Node 9 --- Node 12   I have tried creating a view with "Node" and "Taxonomy Term" as fields. I then enabled grouping, and grouped by the taxonomy term. Doing this outputs the following:  Term 1  --- Node 1 Term 1 --- Node 3 Term 1  --- Node 7    Term 2 --- Node 6 Term 2 --- Node 9 Term 2 --- Node 12   There is a Drupal 6  that explains how to fix it, but it doesn't work under Drupal 7.   It seems like such a simple task, yet after many days of trying, I can't get it to work! I've found many threads of people asking the question, but no solutions (at lease a solution which doesn't involve installing taxonews).


Deleted chat messages still show links if they refer to another message

If a user posts a message in chat that links directly to another chat message like  12345689: You smell funny!  The chat rightly highlights message 12345689 when you hover over User: You smell funny!  If the user or a moderator deletes the You smell funny! message, the text changes to (removed), which again is expected.  However, hovering over (removed) still highlights the previously referred-to message, in this case 12345689.  I have to assume this is unintentional behavior for a message that is ostensibly deleted.


A logarithmic integral question: $\int_{0}^{1} \frac{\ln^2{x}\ln^2{(1-x)}} {1+x}dx$

$$\int_{0}^{1} \frac{\ln^2{x}\ln^2{(1-x)}} {1+x}dx$$ Can the integral be calculated in terms of well known constants?


Which is the place to ask for Firefox and Chrome issues?

I am having issues in both Firefox and Chrome browser on Windows 10. When you browse to www.google.com it just render something like this (I took that img from Google Image not an actual screenshot)   But that's not the point, the point is, where can I ask this? is not code related, just installed software malfunctioning due some bad configuration, virus, etc


Can the half-life of a free neutron be calculated or is it just empirical?

Everyone keeps telling me its just 10.3 minutes and no one knows how to get that number form theory. Any idea?


Using \lstinputlisting to include a file but only certain lines or line ranges

I wanted to tidy up a TeX document and was curious if you can use \lstinputlisting or a similar function to include a certain part of a source-code file.  Example, I have a 500 or so line source file and I want to include just lines 300-400.  Is there a way to do this?


Save custom Prompt string in command prompt

I've come to like starting all my sessions with a   prompt $D$H$H$H$H$H$H$H$H$H $T$H$H$H $P $_   Is there a way to just save it so it does it itself?


Using the triangle inequalities to prove a bound in the complex plane

Let $G$ be the interior of the circle in the complex plane given by $|z-(1+i)|=1$. Prove that if $z\in G$ then $\sqrt{5}-1<|z-3|<\sqrt{5}+1$. Attempt so far: We know by the triangle inequality that $|a+b|\leq |a|+|b|$ and also $|a-b|\geq||a|-|b||$. Now, $G$ is a circle centred at $(1+i)$ with radius $1$. Using the inequality above, we have $|z-3|\leq |z|+3$, and so $|z-3|\leq 4$. For the lower bound, $|z-3|\geq ||z|-3|=|\sqrt{2}-3|$. This isn't the required inequality though. Any ideas?


On Ubuntu 16.04 I'm stuck with this command:  sudo apt-get update 0% [Connecting to archive.ubuntu.com (2001:67c:1560:8001::14)]


Full stack , Stack Exchange etc, What is stack ??

This might be silly and non technical.   This website name is "stack"overflow and there is "stack"exchange. In one of the job portals I saw a new term "Full Stack Developer". In one of the presentations of an IT giant, there were talking about the stacks like "Server", "Storage" , "Applications".  Stack is just one word and it is being used differently in different situations. All I know is that it is a LIFO data structure and plays a vital role in many system operations. Can someone throw some light on this ?? Thanks in Advance


intepreting Negative coefficients of Poisson model

i have fitted a Poisson regression to my claim frequency data. my predictor is make of vehicle.  I have obtained the following result:  Coefficients:               Estimate  Std. Error  z value Pr(>|z|)   (Intercept)  -19.99774  1138.82118  -0.018  0.98599   make2         -0.30873    0.20550  -1.502   0.13302  make3         -0.39177    0.21129  -1.854   0.06372  make4         -0.38375    0.13388  -2.866   0.00415 **   How do I interpret the negative coefficients? Thanks


Same name and copyright / fanfiction question

OK, so this is still about a game... only a web-based browser game, in this case , a political/social role-playing game that's text/image-based, interactive fiction.  It's a political/social satire, basically.  I'm creating fictional magazines for a fictional nation, and they're being hosted on a flipbook site. My question relates to titles and same names.  I obviously can't call my fictional newspaper relating to the nation The Times or my fictional car magazine Auto Trader, as they're trademarked - I checked on ipo.gov.uk,  but if I was to call them The Anytown Express The Times or The Anytown Express Auto Trader (with different logos than the original to avoid copyright infringement, as well), would that fall under copyright infringement / trademark infringement, and is adding an affix sufficient enough to differentiate themselves?  I don't actually have anything yet on the site about my fictional nation's media... so am OK for now, but when I actually do, what's the right way to go about it?  Since this game is a parody/satire/social commentary, what's the right way to do a parody successfully?  All help is gratefully appreciated.


Determine affected file given logical block number

Given the logical block number from these log lines in /var/log/messages, is there a way to determine what file was affected?  ...Buffer I/O error on device sdd1, logical block 203953715 ...lost page write due to I/O error on sdd1


Does the use of English words weaken diceware passphrases

A Diceware passphrase is constructed from a set of words chosen from a 7776-word database, using five dice throws to choose each word. The argument is that each word in the phrase adds about 12.92 bits of entropy since $\log_2(7776)≈12.92$. As Arnold Reinhold, the creator of Diceware, , the entropy comes from the size of the database, not from the way in which the elements are represented. So, in principle, it does not matter whether a 7-word passphrase is formed as 7 English words from a Diceware database, the original 7 five-dice throws (in effect 7 five-digit base six numbers with each digit increased by 1), or seven Chinese characters chosen from a database of 7776 Chinese characters. Each would have an entropy of about 90 bits.  Is it not the case, however, that using English words in place of the underlying dice-throw numbers reduces the entropy of the passphrase. The words in the standard Diceware database have an average length of 4.2 characters. This means that the average length of a 7-word passphrase would be about 30 characters. It is said that letters in English text have an entropy of about 1.3 bits each due to the redundancy of the language. This would imply that, analyzed as English text, the passphrase would only have an entropy of 38 bits. Arguably a Diceware passphrase is not typical English text, but presumably one could do a similar analysis to determine the redundancy of text drawn from the Diceware database, but, if my argument is correct, each letter in the passphrase would have to have at least 3 bits of entropy in order not to downgrade the entropy of the underlying Diceware elements.   Reinhold himself glosses over this. He :      But, you might ask, Diceware is made up mostly of English words. Doesn't that redundancy affect it at all? Well, it does. The seven word Diceware passphrase we talked about above would average about 30 letters in length (36 if you count the spaces between the words). If those letters were selected randomly, you would get 4.7 bits of strength per letter. That would work out to a lot more than the 90 bits Diceware claims for a seven word passphrase. The difference is the redundancy of English at work. However English redundancy does not affect the calculation that each Diceware word has 12.9 bits of randomness, which is based entirely how many different words there are in the Diceware list. You can rely on that number.   The redundancy of English does not affect the entropy of the Diceware passphrase, so long as you can rely on each letter having 4.7 bits of entropy, or indeed at least 3 bits. But I don't see what guarantee there is that this is the case.  Note that this question is not answered by  since this question raises a different argument not considered in that question. The underlying issue is similar, but the question asked about it is different.


I have a Centos 7 server with nginx and PHP7 and have a Problem with SELINUX if the SESTATUS is Enforcing I cannot upload images but if the Status is permissive it works. I host Magento on that Server so to add product images I need to upload the images through the Admin Panel. So what is the reason that the Enforcing mode is blocking the Uploading. Note I can select the images and 'upload it' but the images is broken and if I check the product image folder nothing is there. After uploading I should see it also in the backend but there is only a broken tmp image. So should I create a policy for the exceptions with audit2allow? Or is there any other Solutions available?


Making small edits to my posts all the time bumps them to top; I need to stop, right?

I have a habit of repeatedly editing my own posts.  I like to aim for perfection.  Partly since the site encourages answering my own questions and treating that like a blog post.  I notice this bumps my posts, and I feel guilty :(.  So I need to try easing off on editing simply for optimal word choice.  Maybe avoid trivial edits unless there was also a substantial change in the last 5 minutes.   Am I right in thinking that would be preferable?


My Indian passport is almost full, I have 4 blank pages, but not facing pages (1 blank page at the beginning of my passport, one in the middle, and the very last page recto/verso).  Do I need to renew my passport or can I apply directly? The rules are not so clear, do the blank pages need to be facing one another, just be consecutive, or it doesn't matter?


Functions whose derivative is not continuous on a dense subset

Are there differentiable functions $F:(a,b)\rightarrow \mathbb{R}$, where the set of points at which the derivative of $F$ is discontinuous, is dense in $(a,b)$?   So far I've only found functions where derivatives are discontinuous only at a finite number of points.


I am a long time baseball fan and now I am learning about soccer/football. When I am watching soccer on TV and there is a soccer player that has the ball running away from a  defender. If the player is moving forward and is the only player. Sometimes the referee would raise a flag a offside. I don't understand how this works.


Sometimes I find footnotes either annoying or distracting when trying to edit the body of a text:  particularly one  which is heavily annotated with footnotes.  One solution I've come up with is to gather my footnotes together into files organized to mirror to the file/directory structure I'm using for the overall document.   Each footnote is given its own unique(ish) macro. Here is an example of the sort of code I use to define a footnote macro:  \makeatletter %% #1 = footnote identifier      %% #2 = footnote content \long\def\setfootnote#1#2{%%   \expandafter\long\expandafter\def\csname ae@footnote@#1@ftnt@\endcsname{#2}} \def\aefootnote#1{\footnote{\csname ae@footnote@#1@ftnt@\endcsname}} \makeatother   This is a bit flattened from how I typically define my footnote commands, but my file/directory structure is beyond the scope of this question and would unduly complicate this example.  For the MWE I have three files:  footnote.tex  \setfootnote{first footnote}{This is just an example footnote.} \setfootnote{another footnote}{sf;ksdf  sf;lskf s;df spewr po s;fksf; sdkf.}   main_matter.tex  \input{footnotes}  Here is an illustration of using my footnotes.\aefootnote{first footnote} This is another footnoted sentence.\aefootnote{another footnote}   master_doc.tex  \documentclass{article} \makeatletter %% #1 = footnote identifier  %% #2 = footnote content \long\def\setfootnote#1#2{%%   \expandafter\long\expandafter\def\csname ae@footnote@#1@ftnt@\endcsname{#2}} \def\aefootnote#1{\footnote{\csname ae@footnote@#1@ftnt@\endcsname}} \makeatother \begin{document}  \input{main_matter}  \end{document}   This works pretty well for me.  It cleans up the content of the master document.  I can see where the footnotes are, but I don't have to be distracted by their content when writing and editing the main matter.  But memory-wise this is an extremely wasteful approach.  If I have a long document, then I'm forcing LaTeX to know and remember my footnotes for the entire life of the document.  I could implement a garbage collection system.   That is, I could track the macros for my footnotes by the file currently being compiled by storing their names in a macro such as \ae@garbage@collection.  When I'm done compiling that file I could then do something along the following lines  \expandafter\let\csname ae@footnote@.....@ftnt@\endcsname\ae@undefined@macro   where ..... is the identifier for each footnote note macro I'm deleting.  This could be automated through a macro \ae@delete@garbage.  In other words, I'm saying I know ways to get around cluttering up LaTeX's memory with things it only really needs once.  What I'm interested in knowing is whether someone has suggestions for a better approach.  Is there a more efficient way of managing footnotes which nevertheless avoids cluttering up the source file(s) for the master document?


I recently installed Ubuntu 13.10 alongside Win8. The different Win8 partitions (the main partition, recovery partition and a couple of others) are showing up in Ubuntu. Now I'm wondering if they're supposed to be showing up in Ubuntu in the first place? If I try to enter (mount?) either of these partitions the following, or similar, message applies:  Error mounting /dev/sda4 at /media/jonas/Acer: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda4" "/media/jonas/Acer"' exited with non-zero exit status 14: Windows is hibernated, refused to mount. Failed to mount '/dev/sda4': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option.   Anything I should worry about?


Solving $4x = e^x$ without graphing and looking for intersection

If I want to solve the equation $4x = e^x$, is there a way to solve for $x$ without graphing and looking for intersection?


Should an XML sitemap include redirecting URLs?

Should I include URLs that redirect in my site's XML sitemap?   If page X is permanently redirected to page Z, would I include the page X, or only page Z?


I have Ubuntu 14.10 installed on my laptop. How can I install Windows 8.1 alongside? Can I dual boot Windows 8.1 with Ubuntu 14.04?


Send string from custom Adapter to Activity

I have a custom listView row which looks like this:    I have a customAdapter with the following getView method (not interesting parts were deleted)  @Override public View getView(final int i, View view, ViewGroup viewGroup) {     holder.viewProfileImageButton = view.findViewById(R.id.viewProfileImageButton);     holder.viewProfileImageButton.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View view) {            String pubKey ((objClass_foundUsers)foundUsersList.get(i)).getPublicKey();             Intent getToUserProfileIntent = new Intent(context,activity_1_3_my_profile.class);             context.startActivity(getToUserProfileIntent);         }     }); }   When the user clicks on the first imagebutton in the row this user's profile should be displayed. In order to do this I get the publicKey of the user in the onClick method in my customAdapter and want to pass it to another activity.  When using    getToUserProfileIntent.putExtra("pubKey", pubKey);   in the onClick method in the customAdapter and   pubKey = getIntent().getExtras().getString("pubKey");   in my activity it throws a NullPointerException saying:  java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference   How can I send the publicKey from this adapter to another activity?


What dimensions should my Illustrator artboard be when designing for a wallpaper for the walls of my office?

I am planning to design some patterned wall paper for the walls of my office and I was wondering if there are recommended dimensions for the artboard when designing it via illustrator.


Remove subscribers from Auto Suppression List

How do we delete subscribers (emails) from Auto suppression list using SSJS. Also, Auto suppression list maintain at SF end or application level.


Can contour integration be used to integrate $~u^u(1-u)^{1-u}~$?

I am told contour integration can be used to show  $$\int_0^1 e^{i \pi z} z^z(1-z)^{1-z}=\frac{i\pi e}{24}$$  but am skeptical as the integrand contains log functions which do not admit simple closed contours for example to use the Residue Theorem.  However I suspect perhaps a pochhammer contour might work, i.e, a (closed) analytically-continuous figure-8 contour going around $~0~$ and $~1~$ similar to the integral representation of the beta function.  Might someone be familiar with this integral and the method used to integrate it and give me some ideas?  Thanks, Dominic


In what sense is a scalar field observable in QFT?

Consider a QFT consisting of a single, hermitian scalar field $\Phi$ on spacetime (say $\mathbb R^{3,1}$ for simplicity).  At each point $x$ in spacetime, $\Phi(x)$ is an observable in the sense that it is a hermitian operator (operator-valued distribution) on the Hilbert space of the theory, but is each such operator observable in a stronger, more physical sense?  Is there an experiment one could hypothetically perform to measure the value of such a field at a given spacetime point? This is one of those questions I glossed over while learning QFT, but now it's bugging me.  In particular, I think this point is central in preventing me from understanding certain basic assumptions in QFT such as microcausality which I also never really think about anymore.


Definition of lebesgue integral with respect to measure $\mu$

In Rudin's Real and Complex Analysis, the Lebesgue integral is defined as:  L et $(X,m,\mu)$ be a measure space, where $X$ is a set, $m$ is a $\sigma$ algebra on $X$ and $\mu$ is a measure. Then, if $f:X \to [0,\infty]$ and $E \in m$, we define $$\int_E f d\mu  = \sup \int_E s d\mu \tag{1}$$ where the supremum is taken over all simple functions $s, 0 \leq s \leq f$   I do not have much background in measure theory, and I am wondering why we assume $f$ to be measurable to define its integral.  EVEN IF $f$ is not a measuarable function, the above definition (1) would still be well-defined.   Why do we define integral only for measurable $f$?


I'm trying to make something very similar to this example:      I basically am trying to create various versions of fabric in Illustrator to show the layering process of fabrics in clothing. Any idea on how to achieve this? I'm looking into 3D Extrude and Bevel but I can't quite seem to get the natural curve.


append() element to a specific dimension of array

The question is actually pretty simply, just look at the code:  In [1]: collection = [[]] * 4  In [2]: collection Out[2]: [[], [], [], []]  In [3]: collection[0].append(1)  In [4]: collection Out[4]: [[1], [1], [1], [1]]   Why append 1 to collection[0] also append it to all the other dimensions? If that's not the correct way to add element into a specific dimension, then what's the right way?


Why does Ubuntu release version at x.04 and x.10?

Possible Duplicate:          Why does Ubuntu release at versions x.04 and x.10?   Eg. 10.04, 10.10, 11.04, 11.10, 12.04 etc


Undefined control sequence error message for binary math symbol \medbackslash

I'm getting the following error message. Any ideas?


What does the volatile keyword do? In C++ what problem does it solve?  In my case, I have never knowingly needed it.


file.table not found using lualatex but found with pdflatex

I try to compile with lualatex the simple file :  \documentclass{article}  \usepackage{tikz}    \begin{document}           \begin{tikzpicture}            \draw[color=blue]             plot[id=sin,domain=0:6,samples=100] function{sin(x)};         \end{tikzpicture}    \end{document}   The file essai.sin.gnuplot is created but not essai.sin.table. My problem is that the code compiles very well with pdflatex.  Here the beginning of the file.log  This is LuaTeX, Version 1.0.4 (TeX Live 2017) system commands enabled.   Some questions seem similar but I can't find a good answer.


Why isn't there just a generic off-topic flag?  This question really should be flagged as such, but it would be too bothersome to flag with a custom reason:


How to edit Parameters for an Object after it is created?

When you first add a cylinder, you have the option to change the number of vertices, etc, but once you do anything else in blender, it seems you no longer can edit those parameters.   Is there a setting anywhere or an add-on that allows these parameters to be edited later on? If not, how easy would such an addon/feature be to create for anyone reading this?


How to open JavaScript "onclick" links in new browser tab

Some websites, for reasons I'll never understand, implement links using JavaScript in the onclick event, like this:  <div onclick="document.location='/target_url';">   This doesn't allow me to open it in a new window, either by middle-clicking or even right-clicking and selecting "Open in new tab" in the context menu. Is there a way to allow this, either in Chrome or Firefox on Windows? For example, maybe there is some extension that can rewrite the HTML according to certain patterns, a bit like the Stylish extension does for CSS?


I can't seem to find the answer to my problem so here I am. I have a tree that has been filled in with strings from a file and need to count how many times a string is seen. So everything works fine except me counting the strings right. So here is the code where I attempt to count the occurrences of each string.  /* Function for postorder traversal */ public void postorder(Scanner file) {     postorder(root,file); }  private void postorder(BSTNode r,Scanner file) {     int counter = 0;     String key;     if (r != null)     {         key = file.next();         postorder(r.getLeft(),file);         postorder(r.getRight(),file);         if(key.compareTo(r.getData()) == 0)         {             counter++;         }     System.out.println(r.getData() +", " + counter);      } }   If it'll help this is the output to the console I'm getting:  McGurkus, 0  Kircus, 0 call, 0 I'll, 0 I, 0 circus, 0 it, 0 my, 0 for, 0 put, 0 tents, 0 think, 0 the, 0 up, 0 to, 0 ready, 1 All, 1   Everything is supposed to be 1. Any help or guidance to where I can derive the solution will be greatly appreciated.


Book series about teens who gain enhanced senses after adopting a wolf

I'm looking for a book series about a group of teens who developed increased senses after adopting a baby wolf that was experimented on. The main character is a girl that becomes friends with a group of boys, one of their names was Ben, I think. Each of them had developed one sense that was greater than the others, they each had either an increased sense of smell, sight, hearing , or general physical ability.


Uniqueness of a function $F:CW \to \Bbb Z$ satisfying some rules

Let $CW$ denote the collection of all finite CW complexes, and for some fixed integer $n$, consider a function $F:CW \to \Bbb Z$ satisfying the followings:  (1) If $X,Y \in CW$ are homotopy equivalent, then $F(X)=F(Y)$.  (2) If $X \in CW$ and $A$ is a subcomplex of $X$, then $F(X)=F(A)+F(X/A)$.  (3) $F(S^0)=n$.  I know that such a function $F$ exists, namely, $F(X)=n(\chi(X)-1) $, where $\chi$ is the Euler characteristic.  What I want to show is uniqueness, but I got stuck. How can I show that such an $F$ must be unique?


Stacking words above of a summation symbols

For this equation:  P_{\lambda \sigma} = 2 \sum\limits_{i}^{\hbox{occupied  molecular  orbitals} } c_{\lambda i} c_{\sigma i}   I want the words "occupied molecular orbitals" stacked 3 high.  I tried \vbox, but that did not work.


When can we reasonably assume a sequence of r.v.'s is IID in real life scenarios? My question is based off the following example from Wasserman's All of Statistics:  Suppose we test a prediction method, a neural net for example, on a set of $n$ new cases. Let $X_i=1$ if the predictor is wrong and $X_i=0$ if the predictor is right. Then $\bar{X}_n = n^{-1}\sum_{i=1}^n X_i$ is the observed error rate. Each $X_i$ may be regarded as a Bernoulli with unknown mean $p$. Intuitively, we expect that $\bar{X}_n$ should be close to $p$. How likely is $\bar{X}_n$ to be within $\epsilon$ of $p$? We have that $V(\bar{X}_n)=V(X_1)/n=p(1-p)/n$ and $$P(|\bar{X}_n-p|>\epsilon \leq V(\bar{X}_n/\epsilon^2) = p(1-p)/n\epsilon^2 \leq 1/4n\epsilon^2$$ where the last equation follows from Chebyshev's inequality.  In the above example, the variance of the sum of Bernoulli variables is calculated by assuming they are IID. Why is it reasonable to make this assumption?


NullPointerException while finishing Activity

In the following code, I check the menuitem for android.R.id.home to handle up button clicks to finish the activity, but on a Gionee device running Android 4.2.2, this causes a NullPointerException.  @Override public boolean onOptionsItemSelected(MenuItem item) {     switch (item.getItemId()) {         case android.R.id.home:             finish();             return true;     }     return super.onOptionsItemSelected(item); }   The crash happens on the finish() line. And I'm not overriding the onFinish() function.  The stacktrace is:  java.lang.NullPointerException        at android.os.Parcel.readException(Parcel.java:1434)        at android.os.Parcel.readException(Parcel.java:1379)        at android.app.ActivityManagerProxy.finishActivity(ActivityManagerNative.java:2114)        at android.app.Activity.finish(Activity.java:4165)        at com.Valmeeki.Valmeeki.activities.ReadingRoomActivity.onOptionsItemSelected(ReadingRoomActivity.java:115)        at android.app.Activity.onMenuItemSelected(Activity.java:2566)        at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:325)        at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:147)        at android.support.v7.internal.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:100)        at android.support.v7.internal.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:100)        at android.support.v7.internal.widget.ToolbarWidgetWrapper$1.onClick(ToolbarWidgetWrapper.java:196)        at android.view.View.performClick(View.java:4248)        at android.view.View$PerformClick.run(View.java:17723)        at android.os.Handler.handleCallback(Handler.java:800)        at android.os.Handler.dispatchMessage(Handler.java:100)        at android.os.Looper.loop(Looper.java:194)        at android.app.ActivityThread.main(ActivityThread.java:5421)        at java.lang.reflect.Method.invokeNative(Method.java)        at java.lang.reflect.Method.invoke(Method.java:525)        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)        at dalvik.system.NativeStart.main(NativeStart.java)   Any idea what I'm doing wrong here? Is it some Android bug? Or am I safe in forgetting about this and just calling finish() within a try-catch?  As a final note, this is not a duplicate of . I know very well what a NPE is and I've had my fair share during my life as a programmer. This question was asked only because it is thrown only on a certain device and at a seemingly improbable place for a NPE. I request the user who flagged this as a duplicate to read the question atleast once.


Does allowing multiple answers by the same user make sense on the main site?

On all SE sites users can post multiple answers to the same question. There is a warning dialog if you do that, reminding you that you can also edit your existing answer.  The only valid reasons for writing multiple answers I can think of are:   They are single-item answers to recommendation questions, which are discouraged anyway It's on meta, and they are about different approaches. Separating them allows the community to properly vote on them.   Invalid uses of that feature that I have encountered are self-deletion and reposting to get rid of downvotes as well as reposting moderator-deleted answers.  If you want to provide two fundamentally different approaches to the same question on the main site, I think a comprehensive answer discussing both is better than separating the answers. If you provide multiple approaches, an important part of the answer should be detailing the advantages and disadvantages of them. This can be done better in a single post than in multiple ones, in my opinion.  Multiple answers also don't play nice with the reputation system, they are often perceived by the community as a cheap reputation-grab. The availability of this feature can mislead users into using it inappropriately, as there are only few cases where it is actually useful.  So, does it make sense to allow multiple answers on the main site, or should this feature be disabled? To be clear, I want to keep it on the meta sites, as it is useful there.


Does Google treat different ports as different sites?

I host my website on Azure and I have recently activated a feature to make it possible for me to directly access each server instance in our web farm by a port number. For example http://example.com:10015 and http://example.com:10016.  I'm a bit nervous of duplicated content in Google and I do not want Google to detect these URLs in some way and start to index them. I recently had this problem with Azure's default cloudapp.net domains and I have now both added a 301 for this domain and also a robots.txt rewrite so I disallow bots for this domain.  I wanted to use a robots.txt rewrite rule for the different ports as well but it doesn't seems to work for some reason. I don't know if it has to do with Azure's handling, but for example the SERVER_PORT variable is returning port 80 even if I go the to port 10015.  Anyhow, I was just trying to add my site with a port specification in Google Webmaster Tools, but that didn't work. So basically my question is if I have to worry about this at all, does Google even treat different ports as different sites?


I'm trying to create a buffer but the layer I get is very large    Buffer settings:    Bad result:    What am I doing wrong? The idea is to have an area of influence of 10 meters


I am new to Ubuntu 20.04. I was using windowsXP and i did a dual boot in my pc. It looks everything is good but i am not able to detect wifi connection. $ iwconfig      enp7s0    no wireless extensions.      lo        no wireless extensions.  and lspci -knn   ETHERNET CONTROLLER [0200]: Intel Corporation PRO/100 VE Network Connection [8086:1092] (rev 02) Subsystem: Hewlett-Packard Company PRO/100 VE Network Connection [103c:30bb] Kernel driver in use: e100 Kernel modules: e100  I read responses to similar thread and some suggested installing bcmwl-kernel-source On trying that I get an error : Unable to locate package bcmwl-kernel-source  $ lspci -knn | grep Net; rfkill list 02:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4311 802.11b/g WLAN [14e4:4311] (rev02) 05:08.0 Ethernet controller [0200]: Intel Corporation PRO/100 VE Network Connection [8086:1092] (rev 02) Subsystem: Hewlett-Packard Company PRO/100 VE Network Connection [103c:30bb] 0: hp-wifi Wireless LAN       Soft blocked: no       Hard blocked: no


Why I am getting StackOverflowError at line 11.  The line that I am getting error: System.out.println(new JavaInnerClass().callInnerClassMethod(animalQuantity));  Here is the full code:   public class Dog extends Animal { private String animalName; private int animalQuantity;  public Dog(String animalName, int animalQuantity) {     animalName(animalName);     quantity(animalQuantity);     // JavaInnerClass.tempDog name = new JavaInnerClass.tempDog();     // System.out.println(name.totalQuantity(animalQuantity));     System.out.println(new JavaInnerClass().callInnerClassMethod(animalQuantity)); }  @Override public String animalName(String animalName) {     this.animalName = animalName;     return animalName; }  @Override public int quantity(int animalQuantity) {     this.animalQuantity = animalQuantity;     return animalQuantity; }   }  the JavaInnerClass:     public class JavaInnerClass {  Dog[] dog = { new Dog("Husky", 90), new Dog("Boxer", 100) };  tempDog temp = new tempDog();  public static class tempDog {      public int totalQuantity(int quantity) {         return quantity + 200; // assuming a statement     }  }  public int callInnerClassMethod(int quantity) {     return temp.totalQuantity(quantity); }  public static void main(String[] args) {     new JavaInnerClass(); }   }


Why are there so many "linux-" kernel packages on my machine, and what do they all do?

In my usage of Ubuntu, I have noticed a baffling array of different Linux kernel packages.  Some of them are listed below:   linux-generic linux-headers-generic linux-headers-generic-pae linux-headers-x.x.xx-xx linux-headers-x.x.xx-xx-generic linux-image-generic linux-image-generic-pae linux-image-x.x.xx-xx-generic linux-image-x.x.xx-xx-generic-pae linux-image-extra-x.x.xx-xx-generic linux-image-extra-x.x.xx-xx-generic-pae   My question is, why are there so many different kernel packages, often for the same version number (e.g., 3.5.0-24), and what are the differences between them?  Edit to deduplicate: This question is not asking about the differences between generic, server, and virtual kernel packages; instead, it is asking about what all of those packages (as well as the ones in the list) are.


What is a word for getting an award in a competition or being one of the top three?

I am writing about a competition I won in which I got third place. I want to say that I am the first out of my school to get an award in this competition, with a third place award but that sounds a little bulky. What would be a short phrase or word to describe this. I am thinking maybe I can say "I placed in the competition" but I am not sure that will work.


Adding a new bounty on a question that already has a bounty and is newer than 48 hours?

I want to add another bounty (or increase it) on a question that already has a bounty which is newer than 48 hours.  If this is possible, please explain how?


Travelling outside Germany with only a German D visa in the absence of a residence permit

I have a long-term German National D Visa for research.  I have an upcoming short trip outside Germany to the Schengen Zone but I don't have a residence permit yet. I've been informed that I should get the residence permit before travelling abroad but that is contrary to what I've been reading online i.e. the D visa can be used for short-term stays in European countries outside Germany.   Does anyone have experience regarding this issue or can tell if I am allowed to travel outside Germany?


Difference between "sorts" vs. "kinds" vs. "types"

I am Brazilian and I often read the terms "sorts," "kinds" and "types."  To me, they each have the same meaning. Is there a difference for the native English speakers?  Context:     Does NAG develop the same sorts of products as our local Boston area   company MathWorks (e.g., MATLAB)? And why/how is XML important to math   software products?   Source:


How to make that elegant and succinct: "Live for the moments that make life worth living"

My friend wants to get a tattoo in English. He's very specific about what he wants it to express, but for both of us English is a foreign language and we're not quite sure how to say that using a short but aesthetic phrase. The closest I can get as far as the meaning is concerned is this:     Live for the moments that make life worth living   but that's too long and I guess not very elegant. Is there a good succinct way to express something like that in English?


Ubuntu 13.10 installer on SSD boots to black screen with blinking underscore

What I have done:   Downloaded Ubuntu-130.10-desktop-amd64.iso  Partitioned my SSD into a single partition with Ext4 file system Checked hashes - Hash for the .iso is ok Ran following command  sudo cat Ubuntu-13.10-desktop-amd64.iso > /dev/sdX  Tried to boot the SSD - This is when the black screen with blinking underscore comes. Tried different SATA port for the SSD - Same problem. New SSD is #1 in boot order   I am partitioning and putting the installer in to SSD from another Ubuntu instance on a different hard drive.  Any ideas what I am doing wrong?  What is the recommended way to put the .iso installation to the SSD?


How do you disable the INSPECT ELEMENT option in the menu from Chrome and Firefox etc?

I actually like and use Firebug for web development every single day; sure it is slow on boot for Firefox but I love Firebug once the browser is up. (Update this has been resolved in later editions)  Firefox 10 has a new Inspect and developer mode - it is pretty much like Google Chrome - I don't like it, you cannot edit on page CSS, you can't edit text and tags simply like Firebug - I would be on Chrome now if it fully had Firebug.  How can I disable firefox inspect? How can I disable the inspect mode in chrome? (I would rather use the light firebug)


Is there a reason to create a method in the constructor in c#?

I have a chunck of code where methods are created like that:  class myClass{     myClass(type arg){         method1 =() => {do something with arg}         method2 =() => {do something else with arg}     }     public readonly Action method1;     public readonly Action method2; }   If I understand how c# works, there 2 references of arg that are created in method1 and method2 instead of one in the object and lambda are slower. (I have heard)  What is the interest of doing that instead of that:  class myClass{     myClass(type arg){         this.arg=arg     }     private arg;     public void method1() {do something with arg};     public void method2(){ {do something else with arg}; }


Low lying fog bounding object rendering as solid

I'm trying to make a low lying fog, and the box I used as a boundary on the smoke rendered as a solid object, blocking everything inside it. How can I fix this?