Why is "consistent nearest neighbour" Non-parametric?

Definition of "Consistent nearest neighbour", runs our usual KNN classifier but instead of viewing k as a hyper-parameter it always sets k = ceil[log(n)].  So far, I looked-up many references and websites and researched on how to determine if a method is between parametric or non-parametric. I came up with below definitions,     A parametric algorithm has a fixed number of parameters. In contrast, a non-parametric algorithm uses a flexible number of parameters, and the number of parameters often grows as it learns from more data.   From .  Moreover, I found,     A parametric model, we have a finite number of parameters, and in nonparametric models, the number of parameters is (potentially) infinite.    From .  My question is, why do we count it as a Non-parametric model, while    the number of parameters can increase to infinity in the mentioned    method and it will gets more complicated by increasing test data?


show that$ X$ is uncountable if $(X,d)$ is connected

if $(X,d)$ is a connected metric space and there exist non-constant real-valued continuous function $f$ in $X$, show that $X$ is uncountable


Add Exposure Time multiple times from the same image

According to this , it's possible to add the add the exposure time of multiple images. so i can take 20 pictures with a exposure time 1 second and get the same result as a image with 20 seconds exposure time. can i use (in the first case) the same image 20 times? i'm a bit in doubt of this technique, this would make exposure time obsolete.


How should I fix my Homebrew installation after upgrading OS X?

Context  My employer gave me a MacBook Pro for development work; however, most of the development work I do in my research group is for Linux platforms, and for a host of policy reasons, I can't install virtualization software on this laptop. Homebrew looks like a good way in which to install these tools, especially because it looks very hackable (since it uses Ruby; MacPorts does not look hackable, because it uses Tcl). However, Homebrew relies on system libraries, and for security reasons, my employer may (and from what I hear, frequently will) upgrade my system at any time. I've heard that OS X upgrades will break Homebrew. (See, for instance, ).  Question  How would I go about fixing my Homebrew install after an OS X upgrade? I am fine with deleting it and starting from scratch again, as long as I can do so in an automated way. (For instance, using Puppet plus a Homebrew provider to script a configuration that will automatically build upon running a shell script.) I've been Googling everywhere and can't seem to find any answers to this question.


Preparing spaghetti without boiling water

I saw a commercial on televison for preparing spaghetti without boiling the noodles, just place them in water for about on hour.  Can this be done?


I have an interface:  public interface Condition {      boolean check();      JSONObject toJSON();      Condition fromJSON(); }   And i need to ensure that, every implementation of this interface overrides method fromJSON and i need that method to be static. Is there any way how to do that??  I tried making that method static in the interface, but it does not work as i want.  I also dont want to make it abstract class as every implementation has different functionality of the method.  Is there any other method ho to ensure that every implementation has static method fromJSON ??


Lost my APFS partition after using EaseUS partition manager on Bootcamp


Opening Google/YouTube URLs in Chrome by default when Safari is default browser

Safari is my default browser, and I like it that way. But I want to open Google URLs (Google Docs, YouTube, etc.) in Chrome by default, e.g., when I click on a link in Mail. Is there a system-level way to set the default browser for a sub-set of domains?


Show that the free group on $n$ generators is a finite index subgroup of $F_2$

Using covering spaces, prove that for each integer $n \geq 2$, $F_n$ is a finite index subgroup of $F_2$, where $F_n$ is the free group on $n$ generators.  I get how the cayley graph of $F_n$ would be a wedge of $k$ circles and the cayley graph of $F_2$ would be a graph of a vertex and two edges, but I don't understand how we can create an injective map from $F_n$ to $F_2$ and show its a subgroup.


null pointer exception in java when coding

I am a newbie in objective programming so forgive me if this question is dumb.  I am developing a small to-do program as a exercise. But when I try to load existing txt file & folders for task storage, IDE told me Exception in thread "main" java.lang.NullPointerException. I read the popular one from this site describing this error, I kinda understood why it happened, but I just coudn't find the problem.  Line 17-26 of ListProcess:  public ListItem[] loadList() throws FileNotFoundException {         ListItem[] listitem = new ListItem[200];         int listCount=0;         for (String txts : loadTxtsList()) {             File file = new File(txts);             Scanner scanner = new Scanner("List/"+file);             listitem[listCount].isFolder = false;             listitem[listCount].name = txts.replace(".txt", "");             listitem[listCount].description = scanner.nextLine();             int i = scanner.nextInt();   and yes, I'm using a class called ListItem to store these tasks.  ListItem class:  public class ListItem {     boolean isFolder=false;     String name;     String description;     String[] tags = new String[10];     Status status; }


Questions regarding usage of software/apps

I am presently a Windows user planning to switch to Ubuntu. My only concern is whether I will be able to use applications like Bit Torrent and Adobe products like Photoshop, Indesign and Premiere


how to install adobe reader in ubuntu 18.04 in dell inspion 14 laptop

I am a fresher to ubuntu.please help me to install adobe reader in 18.04.


Question about evaluating the integral $\int_0^\infty \frac{1-\cos(ax)}{x^2}dx$ using the residue theorem

Question: Evaluate the integral $$\int_0^\infty \frac{1-\cos(ax)}{x^2}dx$$ where $a \in R$.  My attempt: So, I actually have a worked out solution for this, but I'm confused on a few points and I'm hoping to get some help. The solution considers the function  $$f(z) = \frac{1-e^{i|a|z}}{z^2},$$  and evaluates it around the contour $\Gamma = C_R \cup [-R,-\epsilon] \cup C_\epsilon \cup [\epsilon,R]$, for $R$ large, $\epsilon$ small, $C_R$ the semicircle in the upper half plane of radius $R$, and $C_\epsilon$ the semicircle in the upper half plane of radius $\epsilon$ but with negative orientation.  The next step they do is show that $|f(z)|$ on $C_R$ goes to $0$ as $R \to \infty$. I think that I understand this part, but I'm not 100% sure, so I'd just like to check:  $$\left|\frac{1-e^{i|a|z}}{z^2}\right| \le \frac{|1-e^{i|a|R\cos\theta} - e^{i|a|R\sin\theta}|}{R^2}\le \frac{2+|e^{-|a|R\sin\theta}}{R^2},$$  and the RHS of the above goes to $0$ as $R \to \infty$. So, first question: 1) is my above reasoning correct? In the solution, they have a $1 + |e^{-|a|R\sin\theta}$ as the numerator in the last term, but I'm not sure how to get that stronger bound, so I'm unsure if my weaker one is correct.  Ok, so after this they write:   $$\int_0^\infty \frac{1-\cos(ax)}{x^2}dx = \frac{1}{2}\Re\left(\pi i \cdot \text{res}_{0}f(z)\right)$$ $=\frac{\pi |a|}{2}.$$  This is the step that is driving me a little insane. I guess I must be missing something. So, I have a few questions here:  2) First of all, what I think they are saying is that  $$\int_\Gamma f(z)dz = \int_{C_R}f(z)dz + 2\int_{\epsilon}^{R}f(z)dz + \int_{C_\epsilon}f(z)dz,$$  and then taking limits as $\epsilon \to 0$, and $R \to \infty$. But what happens to the integral over $C_\epsilon$???   3) I guess maybe they are saying that as $\epsilon \to 0$, the integral over $C_\epsilon$ approaches the residue at $0$. But I don't understand why that's valid - why are we allowed to use the residue theorem on this integral? It's not even a contour, it doesn't have an interior, and I guess I'm just very confused here.  Thanks!


How to generate an e-mail whenever a git commit is being done in remote branch?

How should I check any git commit done in remote git branch and generate an email after any code is checked in to remote repository while working on local branch so that any merge conflict can be avoided.


Is it possible to remove animals from a Minecraft map?

I recently opened a map which I thought was broken, because I could not load it anymore. I increased the memory for the Java VM to 8GB and now I can open it but it is impossible to play on this map, because there are thousands of cows! I think this is why the map could not be opened with 768 MB of memory for Java.  So my question is, if there is any tool with which I can remove those cows. I've heard of several tools to manipulate the landscape, your spawn point, etc. But I don't know if there are tools that let you remove and place animals without having the map opened. When I open the world I have like one frame every 5 seconds...  Can you recommend a tool with which I can remove animals or other entities from a Minecraft world?


If $P(X=a)=1$ there are only $2^n$ independent non-constant real-valued random variables.

Let $(\Omega,\mathscr{F},P)$ be a probability space. We call a real-valued random variable constant, if $ P(X=a)=1$ for some $a\in\mathbb{R}$. Show that if $\Omega$ has $n\in\mathbb{N}$ elements, then there exists at most $2^n$ independent non-constant real-valued random variables on $(\Omega,\mathscr{F},P)$.   While I could think about it in the context of discrete probability spaces, I have really no idea how to start proving it for the general case, since we are talking about non-constant and real-valued random variables here, which makes it impossible to think about it in terms of combinatorics.


I m just try to make Free energy using buoyancy

Can I make power (electricity ) using buoyancy see diagram. if this diagram is possible then how much power i get . I just need formula for upwards speed.


Who does Kiba marry?    Who does Tenten marry?  I've searched so many times and I'm still confused about this.


Using a Duplicate Site During Scheduled Maintenance by Changing Document Root

EDIT:  I am not asking about the creation of a staging environment.  I need to rephrase my question for clarity:  Is there a reason why I wouldn't want to change the document root for the domain of our website to point to the document root on the staging website during a site upgrade, and leave it there permanently, with the production site now becoming the staging site?  Will it affect search engine traffic or the way that Google crawls the website if the document root folder changes entirely?  Sorry, if there is a duplicate question with answers on this already, but I am not seeing answers addressing the change of the document root specifically, or how it could affect traffic, seo, etc.  OLD QUESTION text to follow:  My company's website needs to undergo some big upgrades.  We want to avoid downtime for our users if at all possible.  Are there reasons why we wouldn't want to create a duplicate site, and during maintenance simply change the document root for our domain name to this site's folder?  This way, we could create a duplicate site, perform the upgrade, ensure everything is working, and when it is, change the document root folder.  I have been scouring the web for information about how this could affect our site, such as whether this would change anything in the eyes of Google, etc. and so far, I've found nothing about it.  I'm worried I'm missing something big.


signInWithEmailAndPassword. Getting a NullPointerException

I wanted to start my new and also first app, and it crashes every time i hit the button to login. It tells me that there is a NullPointerException, but i have no clue why. Could someone help me? Have been looking for solutions but can't find any helping ones so far.  package com.glowchat.app;  import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast;  import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser;  public class LoginActivity extends AppCompatActivity {      private Button loginbtn;     private EditText email;     private EditText password;      private FirebaseAuth auth;     private FirebaseUser user;      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_login);          loginbtn = (Button) findViewById(R.id.loginbtn);          loginbtn.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                  email = (EditText) findViewById(R.id.inputEmailLogin);                 password = (EditText) findViewById(R.id.inputPasswordLogin);                  String loginemail = email.getText().toString();                 String loginpassword = password.getText().toString();                  if (loginemail.isEmpty() || loginpassword.isEmpty()) {                     Toast.makeText(LoginActivity.this, "Please fill out all fields.", Toast.LENGTH_SHORT).show();                 } else {                     auth.signInWithEmailAndPassword(loginemail, loginpassword).addOnCompleteListener(LoginActivity.this, new OnCompleteListener<AuthResult>() {                         @Override                         public void onComplete(@NonNull Task<AuthResult> task) {                             if (task.isSuccessful()) {                                 Toast.makeText(LoginActivity.this, "Authentication successfull.", Toast.LENGTH_SHORT).show();                                 user = auth.getCurrentUser();                             } else {                                 Toast.makeText(LoginActivity.this, "Authentication failed. Check your input and your internet connection.", Toast.LENGTH_SHORT).show();                                 user = null;                             }                         }                     });                 }             }             });     }  }   This is what i get in the Run tab:  E/AndroidRuntime: FATAL EXCEPTION: main     Process: com.glowchat.app, PID: 29274     java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.signInWithEmailAndPassword(java.lang.String, java.lang.String)' on a null object reference         at com.glowchat.app.LoginActivity$1.onClick(LoginActivity.java:47)         at android.view.View.performClick(View.java:6935)         at android.widget.TextView.performClick(TextView.java:12742)         at android.view.View$PerformClick.run(View.java:26211)         at android.os.Handler.handleCallback(Handler.java:790)         at android.os.Handler.dispatchMessage(Handler.java:99)         at android.os.Looper.loop(Looper.java:164)         at android.app.ActivityThread.main(ActivityThread.java:7000)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)


operator overloading with templates in c++

I need to overload basic operators to work with primitive types:  Frac - Common fraction class; Frac(a,b) = a/b. This is overload of operator >  template<typename t> bool Frac::operator > (const t &right) { if((long double)right)     return ((long double)right < this->toLongDouble()); else     cout << "Error!"; }   in main:  cout << ((Frac(1,2) > 2.5));   I have error:   Error: undefined reference to `bool Frac::operator><double>(double const&)'


How can I have less blank space on the top ?     \documentclass{beamer} \mode<presentation> {   \usetheme{default}      % or try Darmstadt, Madrid, Warsaw, ...   \usecolortheme{default}   \usepackage{beamerthemesplit}% or try albatross, beaver, crane, ...   \usefonttheme{default}  % or try serif, structurebold, ...   \setbeamertemplate{navigation symbols}{}   \setbeamertemplate{caption}[numbered] }  \usepackage{subfig} \usepackage[lmargin=3.81cm,tmargin=2.54cm,rmargin=2.54cm,bmargin=2.52cm]{geometry}  \usepackage[utf8x]{inputenc} \usepackage{amsmath}     \begin{frame}{Aspects financiers}      \begin{figure}[h]         \begin{minipage}[c]{.46\linewidth}             \centering             \includegraphics[width=5.5 cm]{Frequence.PNG}             \caption{Fréquence apparation réelle / estimation}         \end{minipage}         \hfill%         \begin{minipage}[c]{.46\linewidth}             \centering             \includegraphics[width=5.5 cm]{gausienne.PNG}             \caption{Courbe de Gauss}         \end{minipage}     \end{figure}     Espérance : 100     Ecart type : 7.7      \end{frame}


Create a module to get taxonomy terms list

Can someone please explain to me how i can to retrieve the taxonomy terms of a specific vocabulary step by step ? i saw many answers and code but since i'm new to drupal i don't know where the code should be in the module that i created to retrieve the taxonomy terms.


I have a bit of confusion on the pre-processing of remote sensed images. Do  atmospheric correction methods such as Dark Object Subtraction convert the DN into reflectance values? If not, it is considered an acceptable pre-processing to perform only a Dark Object Subtraction, or before is always required a radiometric calibration?


How do I install the wise-Tiger WT-AC9006 driver?

I want to install the driver for the wise-tiger external wifi adapter (model: WT-AC9006).  However, when I try to follow the steps available in the read-me file (available on-line on ), I  get completely lost.    Could someone hold a newbie's hand and help me out with this one.  Merci!! :)  After running lsusb  Bus 001 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 004: ID 0a5c:21d7 Broadcom Corp. BCM43142 Bluetooth 4.0 Bus 001 Device 003: ID 0bda:5756 Realtek Semiconductor Corp.  Bus 001 Device 002: ID 8087:8001 Intel Corp.  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 002: ID 0bda:0811 Realtek Semiconductor Corp.  Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


Is $2^n-1$ always a prime for odd values of $n$? $n\not=1$ Taking some odd values of $n$, I observed outcome is coming as a prime number. How to verify it?  Or at-least, is $2^n-1$ always coprime to $n$?


Period $T$ of oscillation with cubic force function

How would I find the period of an oscillator with the following force equation?  $$F(x)=-cx^3$$  I've already found the potential energy equation by integrating over distance:  $$U(x)={cx^4 \over 4}.$$  Now I have to find a function for the period (in terms of $A$, the amplitude, $m$, and $c$), but I'm stuck on how to approach the problem. I can set up a differential equation:  $$m{d^2x(t) \over dt^2}=-cx^3,$$  $$d^2x(t)=-{cx^3 \over m}dt^2.$$  But I am not sure how to solve this. Wolfram Alpha gives a particularly nasty solution involving the hypergeometric function, so I don't think the solution involves differential equations. But I don't have any other leads.  How would I find the period $T$ of this oscillator?


Does $\lim\limits_{n\to\infty}\frac{a_{n+1}}{a_n}=1$ imply that $a_n$ convergent?

Does the condition $\lim\limits_{n\to\infty}\frac{a_{n+1}}{a_n}=1$ imply that $a_n$ convergent?  When I say convergent I mean to $L\in \mathbb{R}$ or to $\infty$ or to $-\infty$  I have a gut feeling this statement is false, just can't find a series which contradicts it.  Thanks a lot


Can ps display only non kernel processes on Linux?

How can I ask ps to display only user processes and not kernel threads?  See  to see what I mean...


Anyone knows how I can make my animation generate faster on the viewport? More exactly, when I try to simulate cloth for example, just 14-20% of my CPU is used, and to preview animation it's slower.... How can I make blender use 100% of CPU when it do that simulation?


Any tips on how to get a cheap flight to China

A month ago, I saw US$500 round trip flights from Dallas to Shanghai. Now I can't seem to get anything less than $750, no matter what time of the year pick. I am searching Expedia, and Travelocity.  I am going to wander around China to immerse myself in the language, for a month, as a continuation of my Mandarin language studies - so I am not fussy about what time I go. I just want to lower my costs.  Do you have any tips for me? How can I get the cheapest flight to China?


ubuntu 17.04 usb installation asking for username and password

I am trying to install ubuntu 17.04 through a bootable usb drive.. But as the system boots, the ubuntu loin screen is shown and it asks for username and password. Can't go further.


How do I add my Ubuntu computer to my Windows 7 network?

I installed Ubuntu 12.10 on a computer and accessed the wireless network on which I have  primary and secondary computers running on Windows 7.  I can see both computer icons on all computers except I cannot see the Ubuntu computer on the network.   How do I add it to the network?


Is there a way to filter/sort your questions by whether you have accepted an answer on your profile page?

Every so often I like to go through my questions and make sure I haven't forgotten to accept an answer on each of them. However, when you have more than a few pages worth of questions it can be kind of cumbersome to page through them all and find the ones you still have outstanding (without an accepted answer).  Is there a way to sort or filter the questions on your profile page by whether or not they have an accepted answer? If not, I'd like to submit that as a feature request.


Show that $(n!)^2>n^n$ for $n \in \Bbb Z_+$. I tried induction but I was getting stuck in the last step. Please help.  Hints only, please.


so I'm relatively new to lightning web components and still not understanding all of the eventhandling. I'm creating a component for a customer and I'm having some problems with my lightning-datatable.  i have a parent-child structure like this  parent.html  <c-custom-data-table table-data={tableData}></c-custom-data-table>   parent.js  export default class fastOrder extends LightningElement {     @track tableData = [];     localTable = [];      setRowData(event) {         this.localTable.push(event.detail);         this.tableData = this.localTable;         this.template.querySelector('c-custom-data-table').setTableData(this.tableData);     } }   child.html  <lightning-datatable                               key-field="Produktcode__c"                 data={tableData}                 columns={columns}                 onrowselection={getSelectedRecords}>         </lightning-datatable>   child.js  export default class BasicDatatable extends LightningElement {     @track columns = columns;     @track tableData = [];      @api setTableData(detail) {         this.tableData = detail;      } }   Im calling setRowData(event) from another child-component in the context of an event. The first time I'm doing this the view of the datatable is refreshed after the tableData property gets updated. But every other time than the first one theres no refresh of the view. according to the console the tableData property gets properly updated but i dont see any new rows in my datatable.  I also tried changing the binding to @api with getter and setter   @track _tableData = [];     @api      get tableData() {         return this._tableData;     }     set tableData(value) {         this._tableData = value;     }   with exactly the same effect.  Am I missing something here? I saw examples with @track binding which got constantly refreshed with the update of the tracked property. I searched and tried for hours but maybe someone already encountered this kind of situation and can help me with a workaround (or atleast an explanation).  Thanks in advance!


Usage of dash (-) in place of a filename

For a command, if using - as an argument in place of a file name will mean STDIN or STDOUT.   But in this example, it creates a file with the name -:  echo hello > -   How can I make - in this example mean STDOUT? Conversely, how can I make - mean a file named - in examples such as:  cat -


Method overloading with Parent and Child class as parameter

I have 3 classes GrandParent, Parent and Child, where  Child extends Parent and Parent extends GrandParent  public class Main {     void test(GrandParent gp){System.out.println("GrandParent");}     void test(Parent p){System.out.println("Parent");}      public static void main(String args[]){         GrandParent obj = new Child();         Main mainObj = new Main();         mainObj.test(obj);  // This calls test(GrandParent gp)          mainObj.test(new Child()); // This calss test(Parent gp)     } }   In above code in the 2 calls to test() method both with Child object calls different methods. In one it's doing compile-time and in other run-time binding. This sounds little weird to me. How would you explain this?


$5$ points are randomly chosen on the plane, what is the probability that the resulting conic is parabola, ellipse, hyperbola.

$5$ points are randomly chosen on the plane, what is the probability that the resulting conic is a parabola, an ellipse, or a hyperbola? By randomly chosen on the plane I mean chosen uniformly.


X is a random variables not negative satisfy $E[X^a]<\infty$ with $a>0$.Prove $$E[X^a]=a\int\limits_{0}^{\infty} x^{a-1}(1-F(x))dx$$.


.run file is not working. I double click and get: could not display, file is of unknown type

So, the only thing I can think of is that Ubuntu did not correctly install some software as it doesn't recognize .run files. I checked "allow to run as executable file", but nothing.


I use this Enum for available user roles types: public enum Role implements GrantedAuthority {   ROLE_ADMIN, ROLE_CLIENT;    public String getAuthority() {     return name();   } }  Full code:  But when I try to convert the list using this code: claims.put("auth", roles.stream()                         .map(s -> new SimpleGrantedAuthority(s.getAuthority()))                         .filter(Objects::nonNull)                         .collect(Collectors.toList()) );  I always get NPE when I try to get s.getAuthority(). Do you know how I can fix this issue?


How do tags influence Stack Exchange's SEO?

How do tags influence Stack Exchange's ?  On  we've noticed we don't get as much traffic from Google as we would expect at this point.  One of the reasons we think this may occur is that our terms are often long, have ampersands, and otherwise don't match what people are searching on.  For example, "Dungeons & Dragons Fourth Edition", "Dungeons & Dragons Essentials", "Mutants & Masterminds Second Edition" are common games. Our most active tag is dnd-4e.  This isn't a common search term in Google.  A much more common term is D&D 4, or Dungeons and Dragons 4.  A search on dnd-4e has rpg.stackexchange.com questions pretty high in the list. But of course due to the 25-character limit and no special characters, our tagging options end up diverging from what people may search on.  In addition, people generally use the tags to avoid having to say all that stuff in their subject.  Do our tags have a lot of influence on how we're presented to Google? Should we be double-tagging items as e.g. [dungeons-and-dragons] and [dnd-4e] to try to get the SEO? Is there some other solution to this problem?  Our site gets some decent SEO but not near as much as it should be for the content on it (as compared to other RPG sites).


Export lines or graphics without losing the details / generate graphics without having lines overlapping

I am new to ArcGIS.  How do I easily reproduce a spatial diagram such the one attached (Picture); from shapefiles on ArcGIS.    I very often have to reproduce networks on Powerpoint at different scale without loosing details such as number of lines from A to B. Exporting images directly from ArcGIS at certain scales makes those details difficult to notice, as lines close to each other tend to look like one.  Is there a way to export lines or graphics without losing the details, or is there a way to at least generate graphics without having lines overlapping?  (Note that in reality there only is about 30meters between the parallel lines, and that the distance between the red dot and the green square is 20km - I need to keep the relative location of point and the relative route of the lines, but at the same time represent all the lines although on the ground they are very close to one another )


export CLASSPATH=.;../somejar.jar;../mysql-connector-java-5.1.6-bin.jar java -Xmx500m folder.subfolder../dit1/some.xml cd ..   is the above statement for setting the classpath to already existing classpath in linux is correct or not


does textview in fragment needs to be declared static

i have started to learn android recently and i was looking at a fragment example in a video tutorial  in the tutorial they haven't made the textview static but when i tried to implement fragment with some changes in the code i started to get null pointer exception my code looks like this  public class BlankFragment2 extends Fragment {  TextView tv;  public BlankFragment2() {     // Required empty public constructor }   @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,                          Bundle savedInstanceState) {     // Inflate the layout for this fragment     return inflater.inflate(R.layout.fragment_blank_fragment2, container, false); }  @Override public void onActivityCreated(Bundle savedInstanceState) {     super.onActivityCreated(savedInstanceState);     tv= (TextView) getActivity().findViewById(R.id.txt2); }    public void setName(String name){     //tv=(TextView)getActivity().findViewById(R.id.txt2);     if(tv == null){         System.out.println("tv is null");     }     tv.setText("Hi "+name); } }   i am getting null pointer exception at settext unless i make the textview static can someone please explain why  this is not duplicate of what is NPE i know what NPE is and why it shows up my question here is that after initializing the textview in onActivityCreated why it is null again in setname function


How can I ask the user for an object variable's name and then change that variable's value in Python?

Very new programmer here, sorry if this sounds stupid. I'm doing an exercise of  in which I found that I needed to do something like this:  class Person(): """Just creates a person with name, address and email"""     def __init__(self, name, address, email):         self.name = name         self.address = address         self.email = email persons = {} #dictionary to store various persons as an address book, with each person's name as the key to their object def changeperson(): """This is going to be able to access any person in persons, and change their variables"""     persontochange = raw_input("What person do you want to change?")     thingtochange = raw_input("What do you want to change?")     result = raw_input("What should that be?")     #here assign to persons[persontochange].thingtochange the value of result, I don't know how   Sorry if this sounds stupid and for any problems with my English. Thanks for reading.


Calling a method always throws NullPointerException with PowerMockito

I'm quite new to testing with Mockito/Powermockito so I may have missed some important details about it. Here is a part of my code under test (I use the  library to encrypt the SharedPreferences data on my Android device):  public static boolean isTargetAddress(Context context, String address) {         EncryptedPreferences encryptedPreferences = new EncryptedPreferences.Builder(context).                 withEncryptionPassword(Constants.AES_PASSWORD).build();          Boolean bool = encryptedPreferences.contains("test");          return false; }   And this is my test case for this code:   @RunWith(PowerMockRunner.class) @PrepareForTest({EncryptedPreferences.class, EncryptedPreferences.Builder.class, Context.class}) public class BluetoothReceiverTest {     EncryptedPreferences encPreferences = PowerMockito.mock(EncryptedPreferences.class);     Context context = PowerMockito.mock(Context.class);      @Test     public void testNullTargetAddress() throws Exception {         PowerMockito.whenNew(EncryptedPreferences.class).withAnyArguments().thenReturn(encPreferences);          PowerMockito.doReturn(Boolean.TRUE).                 when(encPreferences).contains(Mockito.anyString());          PowerMockito.when(encPreferences.contains(Mockito.anyString())).thenReturn(Boolean.TRUE);          PowerMockito.when(encPreferences.contains("test")).thenReturn(Boolean.TRUE);          Assert.assertTrue(BluetoothReceiver.isTargetAddress(context, "test"));     } }   I want to mock the EncryptedPreferences class to test some edge cases of my program. The problem is that I get this error:  java.lang.NullPointerException     at com.lukanin.testappjava2.bluetooth.BluetoothReceiver.isTargetAddress(BluetoothReceiver.java:146)     at com.lukanin.testappjava2.bluetooth.BluetoothReceiverTest.testNullTargetAddress(BluetoothReceiverTest.java:37)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:68)   Line 146: Boolean bool = encryptedPreferences.contains("test");  Line 37: Assert.assertTrue(BluetoothReceiver.isTargetAddress(context, "test"));  What's wrong with my code? Why I can't mock the encryptedPreferences.contains(String str) method?  Is there any string like Mockito's MockitoAnnotations.initMocks(this); required for Powermockito in such case?  Edit 1:  I have read  and it's helpful, but doesn't address my problem.  I MOCKED the creation of the EncryptedPreferences object by using:  EncryptedPreferences encPreferences = PowerMockito.mock(EncryptedPreferences.class); PowerMockito.whenNew(EncryptedPreferences.class).withAnyArguments().thenReturn(encPreferences);   So then I think I can also mock the encryptedPreferences.contains(String str) method with   PowerMockito.when(encPreferences.contains(Mockito.anyString())).thenReturn(Boolean.TRUE);   But it doesn't work :(


Prove that if $\gcd(a,b)=1$ and $a|mb$ then $a|m$.

I've tried out a few pairs of numbers for $a$,$b$ where I have combinations of prime-prime, prime-non prime, non-prime-non-prime, and I know the statement is true, but how should I go about proving this?   I know that if $\gcd(a,b)=1$ and $a|mb$, then $m=a$, $m=2a$, $m=3a$ etc. Does this then prove that $a|m$?


Term that describes one who is an expert in a subject without having any first-hand experience?

I learned about this in college, but have since forgotten over the decades. An example is an anthropologist who has learned about a tribe but has never actually visited and studied the tribe first hand.


Why is $(x_i-\bar{x})^2$ in the formula for variance as opposed to $|x_i-\bar{x}|$?

For a data set $\bigcup_{i=1}^nx_i$ of $n$ values with mean $\bar{x}$ the variance is defined as $$\sigma^2=\frac{\displaystyle\sum_{i=1}^n(x_i-\bar{x})^2}{n}$$  My textbook says that “the square ensures that each term in the sum is positive, which is why the sum turns out not to be zero.” However wouldn’t $$\sigma^2=\frac{\displaystyle\sum_{i=1}^n|x_i-\bar{x}|}{n}$$ also prevent a sum of zero?


Conditionally format cells based on match in another sheet

I have an Excel spreadsheet with 2 worksheets. The first is just a header row and a single column of item names. The second is a list of item groups, with a header row and a title in the left most column, with each subsequent row being one item or another from the other sheet:  Sheet1:            Sheet2: +-------+--+--+    +-------+-------+-------+-------+-------+ | Item  |  |  |    | Group | Item1 | Item2 | Item3 | ... +-------+--+--+    +-------+-------+-------+-------+-------+ | Shirt |  |  |    | A     | Shirt | Hat   | Tie   | +-------+--+--+    +-------+-------+-------+-------+-------+ | Hat   |  |  |    | B     | Socks | Shirt | SHOES | +-------+--+--+    +-------+-------+-------+-------+-------+ | Socks |  |  |    | C     | Hat   | Socks |       | +-------+--+--+    +-------+-------+-------+-------+-------+ | Tie   |  |  |    | D     | Tie   | Tie   | Socks | +-------+--+--+    +-------+-------+-------+-------+-------+ | ...   |  |  | +-------+--+--+   I'd like to conditionally format all the cells in "Sheet2" such that any value that does not match a value in the first column of "Sheet1" is marked with a red background; those that do are marked with a green background. So all the cells in this example starting at B2 would be green except the value "SHOES". The value beneath that has nothing entered so would not be formatted at all.  The formatting rule for green I've tried is:  =AND(NOT(ISBLANK(B2)), COUNTIF(Sheet1!$A2:$A1000,B2)>0)   For red, about the same:  =AND(NOT(ISBLANK(B2)), COUNTIF(Sheet1!$A2:$A1000,B2)<1)   Both rules are "applied to" somewhat arbitrary range (I'd like it to apply to the whole sheet, less the topmost and leftmost row/col):  =$C$3:$E$10,$C$36:$Q$50,$E$11,$C$11,$C$2,$E$2:$Q$2,$C$12:$E$35,$F$3:$Q$35   This semi-works, but the results are unpredictable. Some values highlight as I expect but only for a few rows, and others don't. Probably my ranges are out of whack somehow, but I don't use Excel nearly as much as I once did. Can anyone lend a hand?  Thanks!


Is there a strict proof of the statement that a reversible process is always quasi-static?

I'm wondering if there is a clear proof of "a reversible process is always quasi-static". I really don't know whether this generally accepted idea is based on the strict mathematical proof or an intuition from experiences.  Could you give me some comments about this?  It looked  gives the answers but I think this answer is still statements rather than the proof.


I just enabled the Blenderkit addon but cannot seem to figure out how to edit the objects. I looked in this reddit thread and amazingly none of the solutions worked for me.  Making it a single user object, data, and materials did not work. I do not see any option to append when adding a model form the Blenderkit asset bar (I even tried saving it and appending the object in another instance of Blender and it still would not let me edit it). And when I right click I do not see an option to make local on outliner collection. I am using Blender 2.83 if that makes a difference but can use 2.9 if need be. Any other solutions?


Limit of $(n!)^{1/n}$ as $n\rightarrow \infty$.

How to prove that$(n!)^{1/n}$ tends to infinity as limit tends to infinity? I tried to do this by expanding $n!$ as $n\times (n-1)\times (n-2)\cdots 4\times3\times2\times 1$ and taking out n common from each factor so that I can have $n$ outside the radical sign, But then the last terms would be $(4/n)\times(3/n)\times(2/n)\times (1/n)$, which would tend to zero and would present indeterminate form of $0\cdot \infty$, but how should I further solve it. I would appreciate a little help.


Prove by induction that $\sum_{k=0}^n k\cdot k! = (n+1)!-1$

Prove by induction that $$\sum_{k=0}^n k\cdot k! = (n+1)!-1$$  I cannot manage to proceed after assuming that the equality works for $p$.


What is "( set -o posix ; set ) | less " doing?

On my search for a command to list all shell variables, I somehow realized, that there is a command to list all environment variables, but somehow there is no one to list all shell variables, for reasons unknown to me.   However, someone here gave an answer on how to display all variables, shell and environment ones.  ( set -o posix ; set ) | less   He actually did not explain for the layman what this expression does, and my fragmentary understanding is not enough to grasp the idea behind it.  This is what I know:   ( command1; command2) this causes the commands to be executed inside a child process of the shell. set is some way to declare variables, though do not know what the -o posix means and why a second set is executed in succession command | less This one is not the problem, even I understand it, it is a pager for more control about the output.


Code highlighting with E4X XML literals in ActionScript code blocks

When entering XML literals using E4X syntax in ActionScript the code highlighting can be broken:  package {  public class XMLTest {     public function XMLTest()     {        // here highlighting works ok        var aVariable:int = 0;        var aSprite:Sprite = new Sprite();          var xmlFragment:XML =          <root>            <node />            <node />            <node />         </root>;         // from now on all code highlighting is borked        var otherVariable:int = 0;        var yetAnother:Sprite = new Sprite();     } } }   There is a workaround:  package {  public class XMLTest {     public function XMLTest()     {        // here highlighting works ok        var aVariable:int = 0;        var aSprite:Sprite = new Sprite();          var xmlFragment:XML =          <root>            <node />            <node />            <node />         </root>; // / //<-- resets the parser and code remains valid         var otherVariable:int = 0;        var yetAnother:Sprite = new Sprite();     } } }


Star Trek TNG discrepancies with things leaving the holodeck

I was rewatching the first season when I realized that they weren’t following the “nothing created in the holodeck can leave the holodeck” rule consistently. In the pilot episode, Wesley falls in the water in the holodeck and is still soaking wet after he leaves, and in “The big goodby” Picard still has lipstick on his lips from when the female prospective  client kissed him in the holodeck earlier on. However at the end of the episode when Redbrick and Leech step out of it, they disintegrate after just a few moments. Was this just inconsistencies in the writing, or are there other rules about what can/cannot leave the holodeck that I’m not aware of?


What is the difference between su - oracle and pbrun /bin/su - oracle

Could anyone explain the difference between the below commands:  su - oracle   and   pbrun /bin/su - oracle


I get different results with hd and hexdump, aren't they the same?

When I run each command, I get the following output:  root@ubuntu:~# hd test.txt  00000000  31 32 33 34 35 36 0a                              |123456.| 00000007 root@ubuntu:~# hexdump test.txt  0000000 3231 3433 3635 000a                     0000007   But both commands are looking at the same location on the disk:  root@ubuntu:~# which hd /usr/bin/hd root@ubuntu:~# ls -l /usr/bin/hd  lrwxrwxrwx 1 root root 7 Jul  6 03:13 /usr/bin/hd -> hexdump   Can anyone tell me why the results I get are different from each other?


Why are Bitmap-Fonts used automatically?

I have the following LaTeX-document:  \documentclass[a4paper,11pt]{article} \usepackage[utf8x]{inputenc} \usepackage[ngerman]{babel}  \usepackage[T1]{fontenc}  \title{Sample} \author{Litb}  \begin{document}  \maketitle  \begin{abstract}  This is a report about my praxis phase at the company foo bar which I enjoyed. \end{abstract}  \end{document}   Much to my frustration, compiling with pdflatex creates a document with Bitmap-fonts. The reader's font-list shows that it uses Type3 fonts.  If I remove the fontenc loading, then I get a PDF using vector-fonts, but I heard that I should keep it, for having native German Umlauts working.  Does anyone know how I can get vector fonts with T1, and why it keeps using bitmap fonts if I have that package-load line in it?


I am new to Java and am learning class keywords. I have been given limited examples, but I am trying to understand the reasons why you would use an instance object over extending an object. In the tutorials I have seen there is a book class and a magazine is an instance of book. But if the class is abstract then you cannot have an instance only an extension. Why would I use extension over an instance and vice versa? Can anyone provide an example of when it would be better to use one over the other?


Looking for late 70s short story anthology, we'd call it YA now. May have included Leiber's "A Pail of Air"

Read this in the school library - all the stories were very dysotopian.  One involved a character named 'Emelen' who by the end of the story discovers they are just one of many discarded clones (MLN).  Another told the story of a boy and his science fair project involving cereal where he determined that the ruling government (which was a corporation who owned all of the US) was adding a drug to dumb down the populace.


How to draw good arrows explaining parts of equation?

I want to point out what the different parts of an equation is by arrows pointing into the equation. By using the \tikzmark command from  I have managed to come up with this:  \documentclass[12pt]{memoir} \usepackage[cmintegrals,cmbraces]{newtxmath} \usepackage{ebgaramond-maths} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{calc}  \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}  \begin{document} {\Large \begin{equation*}  V\tikzmark{V} = V\tikzmark{Vp}_p + V\tikzmark{Vt}_t\frac{fu\tikzmark{fu}}{fu_t\tikzmark{fut}} \end{equation*} \begin{tikzpicture}[overlay,remember picture]     \node (Ve) [below of = V, node distance = 3.5 em]{\footnotesize \textsf{Distribution volume}};     \draw[<-, in=180, out=-90] (V.south) to (Ve.west);      \node (Vpe) [below of = Vp, node distance = 2.5 em] {\footnotesize \textsf{Volume water in plasma}};     \draw[<-, in=180, out=-90] (Vp.south) to (Vpe.west);      \node (Vte) [below of = Vt, node distance = 1.5 em] {\footnotesize \textsf{Volume water in tissue}};     \draw[<-, in=180, out=-90] (Vt.south) to (Vte.west);      \node (fue) [right of = fu, node distance = 6 em] {\footnotesize \textsf{Fraction unbound drug in plasma}};     \draw[<-] (fu.east) to (fue.west);      \node (fute) [right of = fut, node distance = 6 em] {\footnotesize \textsf{Fraction unbound drug in tissue}};     \draw[<-] (fut.east) to (fute.west);  \end{tikzpicture} } \end{document}     However, the \tikzmark command doesn't really work for me cause I can't use it to point directly to one particular glyph. Furthermore I am having serious trouble making the arrows point to the beginning of the text and at the same time place the text so that it doesn't overlap. Seems like I would want the beginning of the text to be underneath and not the center. What is the tricks that I am missing here?


If I cast Thunderous Smite and Booming Blade, hit, and use Destructive Wrath to maximize damage, how many uses of Channel Divinity are expended?

How many uses of channel divinity should be expended in the following example?  Example:    A character is using that a weapon that deals 2d6 thunder damage on a hit. They cast Thunderous Smite, using a bonus action. Then cast Booming Blade (at 5th level), making a melee attack as an action. On a hit, the weapon does a total of 2d6 + 1d8 + 2d6 thunder damage.   Thunderous Smite:     The first time you hit with a melee weapon attack during this spell's duration, your weapon rings with thunder that is audible within 300 feet of you, and the attack deals an extra 2d6 thunder damage to the target.   Booming Blade:     At 5th level, the melee attack deals an extra 1d8 thunder damage to the target, and the damage the target takes for moving increases to 2d8.   Destructive Wrath:     When you roll lightning or thunder damage, you can use your Channel Divinity to deal maximum damage, instead of rolling.   I'm interpreting this as three separate rolls for thunder damage, each requiring a use of Channel Divinity to maximize. Instead of one use of Channel Divinity to maximize all of them at once.  One of the main reasons I'm thinking this, is because another use of Channel Divinity needs to be expended to maximize the secondary damage from Booming Blade, as it's a completely separate roll.


It seems that now we can retract close votes but we cannot retract reopen votes or delete votes.  I am trying to retract my reopen vote  but it does not allow me to.  Can we have that ability?


I'm a simple man living my life and enjoying mathematics now and then. Today during lunch my friend asked me about complex numbers and $i$. I told him what I knew and we went back to work.  After work I decided to read up on complex numbers and I somehow ended up with this equation:  $$ 1 = \sqrt 1 = \sqrt{(-1)(-1)} = \sqrt{(-1)} \  \sqrt{(-1)} = i \cdot i = i² = -1 $$  Somehow I got that $1 = -1.$  I can't see a contradiction. Did I just break math? What happened? Where is my mistake?


How should I write the abbreviation for "okay"? (ok, Ok, OK)

How should I write abbreviation for "okay"?  The options are: ok, Ok, OK.  I've never took any notice of it, but recently someone (that he's not a native English speaker) told me that I should write OK. Is that true?


Difference between ip addr and ifconfig?

If it's subnet then it should have 254 hosts. But it's showing me that it's my private ip address of my linux VM but it looks like subnet. If i use ip addr command it shows my ip is 10.0.1.178/24 as show below but if i use ifconfig command it show my ipaddres is 10.0.1.178 as show below Output of ip addr eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc fq_codel state UP group default qlen 1000     link/ether 02:e4:6b:7e:e5:ea brd ff:ff:ff:ff:ff:ff     inet 10.0.1.178/24 brd 10.0.1.255 scope global dynamic eth0        valid_lft 1928sec preferred_lft 1928sec     inet6 fe80::e4:6bff:fe7e:e5ea/64 scope link         valid_lft forever preferred_lft forever  Output of ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001         inet 10.0.1.178  netmask 255.255.255.0  broadcast 10.0.1.255         inet6 fe80::e4:6bff:fe7e:e5ea  prefixlen 64  scopeid 0x20<link>         ether 02:e4:6b:7e:e5:ea  txqueuelen 1000  (Ethernet)         RX packets 782364  bytes 646522004 (646.5 MB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 363184  bytes 42400501 (42.4 MB)


Are there stars that wouldn't look white to the naked eye?

I have a small YouTube channel in which I make videos about topics relating science and things I find interesting. The topic I'm working on recently is on the color of the sun. What I thought at the start was going to be an easy topic to tackle has turned into something a little more complex and with more nuances.  Now I will make some statements that I have infer from my little investigation. Feel free to challenge any so I can get to the bottom of this.   All stars emit light in the full light spectrum. Depending on the temperature of the star, it will emit certain wavelengths of light much more than others. We perceive the mixture of many colors as white (or more precisely the mixture of green, blue and red light in roughly equal amounts).   Well, certainly our sun does not emit equal amount of red light than of blue or green. But seen from the space the sun appears as white, even though it emits a little more green light than any other wavelength. So I assume there is certain threshold in which our eyes does not perceive the difference so they see just white.  Now, how often are stars like this? If we look at any other star in the space and with the naked eye (assuming we wouldn't mind burning our retina) will we just see white light? Have some stars in the universe a blackbody curve skewed enough so we would be able to see them in any particular color?


So I would like to present data using a color plot subdivided into squares. For a large data set, it is easy to use a 3D plot with surf, however when there is not so much information, this does not work so nicely.  Take for example:  \begin{tikzpicture} \begin{axis}[view={0}{90}]     \addplot3 [surf]         coordinates {             (0, 0, 1) (1, 0, 9) (2, 0, 3)              (0, 1, 4) (1, 1, 5) (2, 1, 6)              (0, 2, 7) (1, 2, 2) (2, 2, 9)}; \end{axis} \end{tikzpicture}     I have 9 data points, and 4 squares are displayed which reduces greatly the amount of data displayed.  An alternative I thought of was to use square marks  \begin{tikzpicture} \begin{axis}[view={0}{90}, enlargelimits=.3]     \addplot3 [scatter, mark=square*, mark size=24pt]         coordinates {             (0, 0, 1) (1, 0, 9) (2, 0, 3)              (0, 1, 4) (1, 1, 5) (2, 1, 6)              (0, 2, 7) (1, 2, 2) (2, 2, 9)}; \end{axis} \end{tikzpicture}     but the result is less than pleasing, and would require a lot of mucking around with the size of the marks.  The only "alternative" is to use interpolation so that at the vertices the correct color is displayed  \begin{tikzpicture} \begin{axis}[view={0}{90}]     \addplot3 [surf, shader=interp]         coordinates {             (0, 0, 1) (1, 0, 9) (2, 0, 3)              (0, 1, 4) (1, 1, 5) (2, 1, 6)              (0, 2, 7) (1, 2, 2) (2, 2, 9)}; \end{axis} \end{tikzpicture}  \begin{tikzpicture} \begin{axis}[view={0}{90}]     \addplot3 [surf, shader=interp, patch type=bilinear]         coordinates {             (0, 0, 1) (1, 0, 9) (2, 0, 3)              (0, 1, 4) (1, 1, 5) (2, 1, 6)              (0, 2, 7) (1, 2, 2) (2, 2, 9)}; \end{axis} \end{tikzpicture}     But without the correct interpolation, looks ugly. Besides, it doesn't exactly fix the problem of displaying only 9 data points.  So for small data sets, is there a way of plotting exactly the same number of squares as required?


How can I hide a div if a specific div does not exist using jQuery?

0" ng-show="ready" style="float: left; list-style: none; position: relative;  width: 240px;" aria-hidden="false">   How do I hide class "orange" if the div with class "grape" does not exist or is hidden?  I believe this can be done with a line of jquery. (If not possible, how do I hide class "orange" if the length of sliderItems is 0?)


We had a production emergency yesterday: out of the blue, in the middle of peak usage time, our SQL Server just stopped working.  Never mind no new connections; even existing connections stopped functioning.  I restarted the service and everything came right immediately, but in the interim we lost about 30 minutes of downtime and got serious egg on our faces.  There are no errors or warnings in the event log.  The only clue that something was going wrong is a series of "Information" messages in the event log from the time the outage began, every 5 minutes, saying:     New queries assigned to process on Node 0 have not been picked up by a worker thread in the last 1500 seconds. Blocking or long-running queries can contribute to this condition, and may degrade client response time. Use the "max worker threads" configuration option to increase number of allowable threads, or optimize current running queries. SQL Process Utilization: 0%%. System Idle: 98%%.   So it seems like we're running out of worker threads, of which we have 576.  And I have no idea how that can happen.  I know that there are no particularly long running queries, because I am constantly running a Trace to pick up anything longer than 2 seconds, and we're getting no more than one or two of those every 5 minutes.  Also, we have not made any significant changes to the system for the last several weeks, and this kind of thing has never happened before.  Perhaps our usage has been growing, but if it was a resource overload, I would have expected the CPU to be maxed out, rather than at the beach around 0-2%.    What could have happened?  How do we diagnose, and how do we prevent this happening again?  Microsoft SQL Server 2014 (SP2) (KB3171021) - 12.0.5000.0 (X64)      Jun 17 2016 19:14:09      Copyright (c) Microsoft Corporation     Standard Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)


I do not see deletd files in recycle bin

I can't see deleted files in the recycle bin. It looks empty but the desktop icon is 'full'.  If I have the recycle bin open when deleting a file I can see it appearing in the bin for two seconds, but after that the file disappears. Are they any solutions to fix it? Thanks!  I already scanned the computer. No viruses ... everything is OK.


Show if complex function $f(z)$ contains all real coefficients then $f(\bar z)$ = $\bar {f(z)}$

Note: Suppose $f(z)$ is a polynomial or a proper/strictly proper rational function.   Can someone demonstrate why if all coefficient of $f(z)$ are real then relation $f(\bar z)$ = $\bar {f(z)}$ hold  Is there a theorem for this result?


What is the difference between a white object and a mirror?

I was taught that something which reflects all the colors of light is white. The function of a mirror is the same, it also reflects all light. What's the difference?  Update: But what if the white object is purely plain and does not scatter light? Will it be a mirror?


Relation between eigen values of $AB$ and $BA$

Let say $A \in \mathbb{F}^{n\times m}$ and $B \in \mathbb{F}^{m\times n}$. I am wondering weather there is any standard result stating the relationship between eigen values of $AB$ and $BA$ matrices.  I know that eigen values are same for $AB$ and $BA$ when both $A$ and $B$ are square matrices. But in a general setup, we can not use the result that- $\det(AB) = \det(BA)$.


Printing contents of an associative array to a file in bash

I need to print the contents of my associative array to a file in bash.. The console output printing is working fine but when I try to print it to a file, only one element is getting printed. Here is my code  for KEY in "${!SYMBOLICLINK[@]}"; do     printf "$KEY --> ${SYMBOLICLINK[$KEY]}" > /tmp/symlinks.txt      # Print the KEY value      echo " $KEY --> ${SYMBOLICLINK[$KEY]}"       done     Can someone pls tell me what i am missing here I also went through this  but it didn't help


After installing 12.04 and Gnome Shell, I find that the arrow and delete keys, along with the insert, home, page up & down, and end keys have stopped working.  All these keys now appear to be XF86MonBrightnessdown whatever that is.  Any fix for this?


Evaluate $\int_{\left | z \right |=3} (e^{z}-1)dz/(z(z-1)(z-i))$

I want to evaluate the integral $$\int_{\left | z \right |=3} \frac{e^{z}-1}{z(z-1)(z-i)}\,dz$$    by using the following  theorem:      If a function $f$ is analytic everywhere in the finite plane except for a finite number of singularities interior to a positively oriented simple closed curve $C$, then    $$\int_{C}f(z) dz=2\pi i\text{Res}\left ( \frac{1}{z^{2}}f(\frac{1}{z}), 0 \right ).$$   I want to calculate this integral  by calculating the residue at 0 of $\frac{1}{z^{2}}f(\frac{1}{z})=\frac{1+\frac{1}{2!z}+\frac{1}{3!z^{2}}\cdot \cdot \cdot }{1-(1+i)z+iz^{2}}$ So I did long division but the coefficient of 1/z is 0.  I know the method of calculating the residues at each singularities 0, 1, i, respectively. This method gives me the answer $2\pi i(0+\frac{e-1}{1-i}+\frac{e^{i}-1}{i(i-1)})$ which is not 0. Why answers are different?? Why does not hold long division method? Any help please.


Are there any differences in calling function using this and not using this?

Class::Class() {     this->func(); }   and  Class::Class() {     func(); }   Are there any differences between these two ways of calling a function?


How do I permanently allow a website to access my location?

In iOS, I only need to be asked once whether I want to allow a website to share my location data. Is it possible to permanently do this in OS X version of Safari as well?


Can you play Minecraft on a normal Windows 10 fresh from the store

I’m getting a windows 10 PC so I’m wondering if I can play java on windows 10 fresh from the store.


Find highest level of a hierarchical field: with vs without CTEs

note: this question has been updated to reflect that we are currently using MySQL, having done so, I would like to see a how much easier it would be if we switched to a CTE-supporting database.  I have a self-referencing table with a primary key, id and a foreign key parent_id.  +------------+--------------+------+-----+---------+----------------+ | Field      | Type         | Null | Key | Default | Extra          | +------------+--------------+------+-----+---------+----------------+ | id         | int(11)      | NO   | PRI | NULL    | auto_increment |  | parent_id  | int(11)      | YES  |     | NULL    |                |  | name       | varchar(255) | YES  |     | NULL    |                |  | notes      | text         | YES  |     | NULL    |                |  +------------+--------------+------+-----+---------+----------------+   Given a name, how can I query the top-level parent?  Given a name, how can I query all of the id's associated with a record of name = 'foo'?  context: I am not a dba, but am planning to ask a dba to implement this type of hierarchical structure and would like to test some queries. The motivation for doing so is described by .    Here is an example of the relationships among ids in the table:    -- ----------------------------------------------------- -- Create a new database called 'testdb' -- ----------------------------------------------------- SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';  CREATE SCHEMA IF NOT EXISTS `testdb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ; USE `testdb` ;  -- ----------------------------------------------------- -- Table `testdb`.`observations` -- ----------------------------------------------------- CREATE  TABLE IF NOT EXISTS `testdb`.`observations` (   `id` INT NOT NULL ,   `parent_id` INT NULL ,   `name` VARCHAR(45) NULL ,   PRIMARY KEY (`id`) ) ENGINE = InnoDB;  SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;  -- ----------------------------------------------------- -- Add Example Data Set -- -----------------------------------------------------   INSERT INTO observations VALUES (1,3), (2,5), (3,NULL), (4,10),     (5,NULL), (6,1), (7,5), (8,10), (9,10), (10,3);


Chrome: lost multi-function reload button after update

Yesterday, I briefly discovered that holding the click on my Chrome's reload button opened a dropdown. It had:    reload (ctrl+r)  hard reload (shift ctrl +r)   clear cache and reload   .  A few seconds later my office mate said his Chrome needed updating and checking mine I saw that it did too.   Unfortunately, after updating the awesome extended multi-function features of the reload button are no longer there.  Has anyone else discovered the multi-function relaod button or still have it or know how to get it back? And it wasn't an extension or a plug-in, none of those changed or were updated.  Any help clearing up my mystery is appreciated.


Can I get a Turkish transit visa at Istanbul airport?

I am an Irish citizen and travelling to Nigeria through istanbul. can i get the transit visa at the airport since my transit time is about 14 hours?


Stack Overflow and Facebook Policy Matters: On-topic?

A question regarding policy matters for Facebook  (and has since been removed).  At first glance, this question seems to be off-topic for Stack Overflow. However, reading through the information the OP refers to, users are indeed told to get written permission, which obviously leads one to want to contact Facebook.   When going to the  with regards to policies it states:     For discussions or inquiries about technical issues, policy matters, or documentation, please go to .   Emphasis is mine.   So my question is, are policy matters with regards to Facebook indeed on topic for the (Facebook) Stack Overflow? Or should this phrase perhaps be altered/clarified?  Update:  From the responses so far it seems quite clear (unsurprisingly) that such topics are indeed off-topic for Stack Overflow and as such the erroneous instructions on the mentioned Facebook page should be modified.   As a result two things have happened so far (see the comments as well):   A  by @phwd on Facebook's Developer site.  (Stack Exchange's Chief of Staff) responded with the following (encouraging) message:     Thanks for bringing this issue up - we'll reach out to the Facebook team and have them change the page to reflect this.    Update 2:  It seems that a change has been made. The previously offending line now reads:     For discussions about technical issues, please go to Facebook Stack Overflow.   Great to see that's done.


Setting temperature trigger for Laptop fan

My laptop fan doesn't work at full capacity if the temperture is not at a dangerously high level, like 100C. I want to set a lower trigger. How can I do this in Ubuntu? I am using KDE.


When do we need composite order groups for bilinear maps and when prime order?

Why we need bilinear groups of composite order? What's the special security property of the composite order group in comparison with one of prime order? To put it in another way when do we need composite order groups for bilinear maps and when prime order?


How to enforce a consistent line height independent of font/glyph size

I'm using XeLaTex to load multiple TrueType fonts using fontspec's \newfontfamily. I want to keep a fixed line height throughout the document, let's say 16pt, even if I switch fonts or font sizes. The main but not only reason is that this is a 2-column layout and I want the lines match up in both cols. When I use a font at a typical font size, this works fine: \fontsize{12pt}{16pt plus 0pt minus 0pt} When I use a smaller font size, this works fine, too and XeLaTeX adds extra space between the lines to enforce the lineheight: \fontsize{8pt}{16pt plus 0pt minus 0pt} However if I use a font size close to or larger than the line height, depending on the font, the glyph heights seem to take precedence over the line height, making the text/paragraph higher: \fontsize{16pt}{16pt plus 0pt minus 0pt} How can I enforce the 16pt line height at the risk of lines/glypes overlapping (like in CSS)?


How to solve this set of symmetric polynomial expressions

So there's this set of polynomial expressions with degree n=3:  $$ \left\{ \begin{array}{c} x_1 + x_2 + x_3 = a \\ x_1^2 + x_2^2 + x_3^2 = b \\ x_1^3 + x_2^3 + x_3^3 = c \end{array} \right. $$  How to find atleast one set of x1,x2,x3 values, knowing that all variables and constants (a,b,c) are positive integers?  Thank you.    Update:  Alright, with the help in the comments I was able to transform this set into a single polynomial expression that can be solved in various ways.  Using Newton's identities: $$ \begin{array}{} x_1^2 + x_2^2 + x_3^2 = (x_1 + x_2 + x_3)^2 - 2(x_1x_2 + x_2x_3 + x_1x_3) \\ x_1^3 + x_2^3 + x_3^3 = (x_1 + x_2 + x_3)^3 - 3(x_1x_2 + x_2x_3 + x_1x_3)(x_1 + x_2 + x_3) + 3x_1x_2x_3 \end{array} $$  We can substitute expressions in the set:  $$ \left\{ \begin{array}{} x_1 + x_2 + x_3 = a \\ (x_1 + x_2 + x_3)^2 - 2(x_1x_2 + x_2x_3 + x_1x_3) = b \\ (x_1 + x_2 + x_3)^3 - 3(x_1x_2 + x_2x_3 + x_1x_3)(x_1 + x_2 + x_3) + 3x_1x_2x_3 = c \end{array} \right. $$  $$ \left\{ \begin{array}{} x_1 + x_2 + x_3 = a \\ x_1x_2 + x_2x_3 + x_1x_3 = \frac{a^2 - b}{2} \\ (x_1 + x_2 + x_3)^3 - 3(x_1x_2 + x_2x_3 + x_1x_3)(x_1 + x_2 + x_3) + 3x_1x_2x_3 = c \end{array} \right. $$  $$ \left\{ \begin{array}{} x_1 + x_2 + x_3 = a \\ x_1x_2 + x_2x_3 + x_1x_3 = \frac{a^2 - b}{2} \\ x_1x_2x_3 = \frac{c + 3a\frac{a^2-b}{2} - a^3}{3} \end{array} \right. $$  To simplify, let's assume (since the right halves of the last set are all constants):  $$ \begin{array}{} p_1 = a \\ p_2 = \frac{a^2 - b}{2} \\ p_3 = \frac{c + 3a\frac{a^2-b}{2} - a^3}{3} \end{array} $$  So we get:  $$ \left\{ \begin{array}{} x_1 + x_2 + x_3 = p_1 \\ x_1x_2 + x_2x_3 + x_1x_3 = p_2 \\ x_1x_2x_3 = p_3 \end{array} \right. $$  Now, using Viete's theorem for general polynomial of degree 3:  $$ P(x) = a_3t^3 + a_2t^2 + a_1t + a_0 $$  With the following properties:  $$ \begin{array}{} t_1 + t_2 + t_3 = -\frac{a_2}{a_3} \\ t_1t_2 + t_2t_3 + t_1t_3 = \frac{a_1}{a_3} \\ t_1t_2t_3 = -\frac{a_0}{a_3} \end{array} $$  Applying to our set:  $$ \left\{ \begin{array}{} p_1 = -\frac{a_2}{a_3} \\ p_2 = \frac{a_1}{a_3} \\ p_3 = -\frac{a_0}{a_3} \end{array} \right. $$  And assuming that $a_3 = 1$, the final polynomial will be the following:  $$ t^3 - p_1t^2 + p_2t - p_3 = 0, $$  where the three roots of $t$  are variables $x_1, x_2$ and $x_3$.  (Using Buchberger's algorithm might be a good way to solve it a well, but I was struggling with it and decided to do it this way for now.)


Parametrization for intersection of sphere and plane. $x^2+y^2+z^2=81$, $x+y+z=15$.

How can I find the parametrization of the curve given by the intersection of the sphere $x^2+y^2+z^2=81$ and the plane $x+y+z=15$.  Also it says that this intersection is a circle (clearly) with center $(5,5,5)$, and that $(7,4,4)$, $(4,7,4)$, $(4,4,7)$ are points on the curve (I don't know if this information is useful for the parametrization)  My try was to substitute $z$ in the sphere equation with the expression obtained for $z$ in the plane equation, but I can't conclude this way.


Typescript: Length of empty array not zero

I have an array which has a single element which I delete with the following code:  delete array[0]   At this point the array is empty. I'm therefore confused why array.length has an output of 1.   When I use console.log it displays the following:    Am I doing something fundamentally wrong or how do I check that the array is empty? Maybe an explanation of typescript array memory management would be useful.


Minimal Sufficient Statistic for the distribution $U(-\theta, \theta)$

I need to find the sufficient statistic for the parameter $\theta$ for a uniform distribution $U(-\theta, \theta)$ for a sample of size $n$. The joint density of the sample can be written as: $f(x_1, x_2,..,x_n|\theta) = (\frac{1}{2\theta})^n,-\theta<x_i<\theta \text{ for all i = 1,2,3,..,n}$. I can express it as : $f(x|\theta) = (\frac{1}{2\theta})^n \prod_{i=1}^{n} I_{(-\theta, \theta)}(x_i) = (\frac{1}{2\theta})^n  I_{(X_{(n)}, \infty)}(\theta)  I_{(-X_{(1)}, \infty)}(\theta) \prod_{i=1}^{n}I_{(-\infty,\infty)}$ Now, to prove a statistic, $ T(x)$, as minimally sufficient, we  need to prove that the ratio $\frac{f(x|\theta)}{f(y|\theta)}$ to be constant as a function of $\theta$. The ratio is computed as follows: $\frac{f(x|\theta)}{f(y|\theta)} = \frac{(\frac{1}{2\theta})^n  I_{(X_{(n)}, \infty)}(\theta)  I_{(-X_{(1)}, \infty)}(\theta) \prod_{i=1}^{n}I_{(-\infty,\infty)}}{(\frac{1}{2\theta})^n  I_{(Y_{(n)}, \infty)}(\theta)  I_{(-Y_{(1)}, \infty)}(\theta) \prod_{i=1}^{n}I_{(-\infty,\infty)}}$ We can only get constant as a function of $\theta$ after substituting $X_{(n)} = Y_{(n)}$ and $X_{(1)} = Y_{(1)}$. Hence, $(X_{(1)}, X_{(1)})$ will be minimally sufficient. Please take a moment to review my steps and let me know where exactly I went wrong because the correct answer is shown as max of $|Xi|$.


Can't install apps from App Store on iPhone with iOS 7

I upgraded my iPhone 4 to iOS 7 last night but now I can't download apps using the App Store on my iPhone. It's still possible to get the apps using iTunes on my computer and syncing my phone, but this is cumbersome.  I get errors as shown below:     Unable to Purchase   [app name] could not be purchased at this time. Please try again later.       Is this a known issue, and how can I rectify it?


WFS GetFeature request with different SRS

I'm having problems with a WFS GetFeature request. I'm using OpenLayers with an OSM map as base layers which use the Google projection. Overlaying the layer with WMS works perfect. When I do a request to return all features within the bounds of a polygon, no features are found.  My layer uses EPSG:28992. the base layer uses: EPSG:900913  My layer configuration in GeoServer:    When I set the declared SRS to EPSG:900913 and set "SRS handling" to "Reproject native to declared" it works fine, but I need OpenLayers to reproject it, not GeoServer.  Below is an example request I would do. I think the problem is that GeoServer does not convert the spatial filter to the native SRS.  http://mydomain.com/wfs?request=GetFeature&version=1.1.0& srsName=epsg:28992& typeName=Namespace:Layer1& propertyName=(*)& CQL_FILTER=year = 2011 and INTERSECTS(geometry,POLYGON((565585.61613069 6816272.786200799,565585.61613069 6817032.3791692,564362.62367835 6817032.3791692,564362.62367835 6816272.786200799,565585.61613069 6816272.786200799)))& outputFormat=GMl2&   Update  I just tried re-projecting some points from OpenLayers (EPSG:900913) via proj4js to EPSG:28992 (PostgreSQL and GeoServer). I took 3 points and  compared them. They all showed an offset.   Converted: POINT(233492,24349424947 582191,0681508556)  In Database: POINT(233530,852147064 582315,680920578)  Difference x: 38,60865281453 Difference y: 124,6127697224 Converted: POINT(133459,1980658749 455770,7481867363)  In Database: POINT(133486,356985081 455879,67223342)  Difference x: 27,1589192061 Difference y: 108,9240466837 Converted: POINT(176920,43262818802 317930,36182729155)  In Database: POINT(176954,154083767 318023,515324756)  Difference x: 33,72145557898 Difference y: 93,15349746445   If the offset was constant I could correct it. Now I'm not sure if the offset is caused by GeSserver or by proj4js. I'm guessing proj4js since the WMS layer does not show any offset.


Proof $\mathbb{A}^n$ is irreducible, without Nullstellensatz

As the title suggests, could anyone either provide me with or direct me to a proof that affine n-space $\mathbb{A}^n$ is irreducible, without using the Nullstellensatz?   This is an exercise in a second course on representation theory, so if there is a reasonably palatable representation-theoretic proof then that's probably what's expected but on the other hand it may just be totally unrelated but presented for the reader's enjoyment. (I'm under no obligation to do it so I wouldn't class it as 'homework'.)  I have spent some time banging my head against the exercise but to no avail, I keep just coming back to the Nullstellensatz proof I already know. As well as a representation-theoretic proof if one exists, any alternative, particularly beautiful proofs would be welcomed for their own sake. Many thanks for the help!


Why is $\mathbb{C}$ algebraically closed, but $\mathbb{R}$ isn't

Is there an intuitive explanation for why the complex numbers $(\mathbb{C}$) are algebraically closed, but $\mathbb{R}$ isn't?


We all know that literally is being overused currently. I want to know if literally should only be used in contrast to situations which are normally figurative in common usage. For example:     It literally took him an hour to get here. (not a figurative   expression)      I am literally starving to death. (Figurative expression made literal   because the person is actually starving to death.)   Literally is used for the latter example, correct?


My logrotate works perfectly, except for this configuration:  /var/awdata/awarchive.*.log  /var/log/awstats.log  {         rotate 12 }   This is my logrotate -d /etc/logorate.conf output:  considering log /var/awdata/awarchive.domain1.it.log    log needs rotating   and then:  rotating log /var/awdata/awarchive.domain1.it.log, log->rotateCount is 4 dateext suffix '-20120517' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' fscreate context set to unconfined_u:object_r:var_t:s0 renaming /var/awdata/awarchive.domain1.it.log to /var/awdata/awarchive.domain1.it.log-20120517 creating new /var/awdata/awarchive.domain1.it.log mode = 0666 uid = 99 gid = 501   logrotate seems to work perfectly, but it does not do what I wrote. :-(  ==  ls -lah /var/awdata/*domain1*   About domain1:  -rw-rw-rw-. 1 nobody nogroup 4.7G May 17 17:16 /var/awdata/awarchive.domain1.it.log -rw-rw-rw-. 1 nobody nogroup 7.6G May  9 04:16 /var/awdata/awarchive.domain1.it.log-20120509   The only rotate log *-20120509 was forced with the -f option.  [root@lnx1 awdata]# ls -ld /var/awdata drwxr-xr-x. 2 nobody nogroup 188416 May 17 18:52 /var/awdata   Any ideas?


How to escape spaces while using command's output in command line

I want to perform the following command in command line :   $ md5sum $(find . -type f)   But this would cause problems when it encounter files with spaces in filenames :   md5sum: Kaufmann: No such file or directory md5sum: Mobile: No such file or directory md5sum: 3D: No such file or directory md5sum: Graphics: No such file or directory


Prove that $x^2+y^2=z^4$ has infinitely many solutions with $(x,y,z)=1$   Since gcd of $(x,y,z)=1$ either $1$ of them is even and the other $2$ are odd or all $3$ are odd.  Since the square of an odd is the form $4k+1$, and the square of an even is $4n$. Then all three cannot be odd because the sum of two squares mod $4$ is $4k+1+4n+1=4(n+k)+2$.  Thus one of $x,y,z$ is even and it cannot be $z$, since then $z^2\equiv 0$ mod $4$ and $x^2+y^2\equiv 2$ mod $4$. So one of $x,y$ is even.  Not sure how to keep going from here.


How to set up proxy for Geoserver GetFeatureInfo call?

I have problems with cross domain, I call GetFeatureInfo in Leaflet API. I was looking for solution and saw that proxy could solve that problem. Can you help me how to set it up? I have geoserver run on Tomcat7 (ubuntu).  Thanks.


Associativity of smash product for compact spaces

The following is Problem 2.2.14 in Tammo tom Dieck's Algebraic Topology:     Let $Y,Z$ be compact or $X,Z$ be locally compact. Then the canonical bijection $(X\wedge Y)\wedge Z\to X\wedge(Y\wedge Z)$ is a homeomorphism.   I'm not working in the category of compactly generated spaces. I want to use this exercise to show that the iterated suspension is $\Sigma^nX\cong X\wedge S^n$ for any space $X$. So it remains to prove this exercise.  I could prove this for the locally compact case (using the fact that the product of a quotient map with the identity map of a locally compact space is again a quotient map), but for the case $Y,Z$ compact I have no idea how to do this. Any hints will be appreciated!


I tried every version of Flash player for Ubuntu 12.10, but it doesn't work. When attempting to install it, I got this error.  Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package flashplugin-nonfree   I found this solution, I ran:  sudo apt-get install -f    and then  sudo apt-get update   which I found from some other post that was trying to solve dependencies.  Then I ran  sudo apt-get install flashplugin-nonfree   But it still doesn't work!


Why are cyclic groups of order $p$ (prime) unique up to isomorphism?

It says  that "By the classification of cyclic groups, there is only one group of each order[prime] (up to isomorphism)".   What is the intuition behind this and how would you go about proving this? An proof would be greatly appreciated.


How to properly write a query to use two copies of a single table?

I need to show one attribute referring to two different instances of the same attribute.   I have a set of tables such as Branch, Address, Property_for_rent, State. I need to show properties data including the branch_state and the property_state. These two attributes come from the table state row name. My problem is that I haven't found a way to join the table state two times referring to two different instances. I already tried Full Join but sql doesn't recognize one copy of my table state, Union doesn't work because if I split the query into to I won't have the same amount of columns.  need to join this two queries:  SELECT p.property_no, p.prop_type, p.rooms, p.rent, s.name AS property_state, staff_no FROM state s JOIN address a ON s.state_id = a.state_id JOIN property_for_rent p ON a.address_id = p.address_id ORDER BY rent ASC;     +-------------+-----------+-------+------+----------------+----------+ | property_no | prop_type | rooms | rent | property_state | staff_no | +-------------+-----------+-------+------+----------------+----------+ | PR200       | Flat      | 3     |   24 | Nevada         | SQ523    | | PR901       | Flat      | 7     |   31 | Vermont        | SL569    | | PR806       | House     | 3     |   54 | Minnesota      | NULL     |     SELECT branch_no, z.name AS branch_state FROM branch b JOIN address a ON b.address_id = a.address_id  JOIN state z ON a.state_id = z.state_id;     +-----------+----------------+ | branch_no | branch_state   | +-----------+----------------+ | B424      | Kentucky       | | B947      | Massachusetts  | | B942      | South Carolina | | B714      | North Dakota   |   branch_state and property_state are alias for the name attribute in the state table.


Getting Null Object Reference on getCurrentUser().getUid() on Fragment

I'm creating a clone of WhatsApp and on the MainActivity there are 4 fragments side-by-side: Chats, Groups, Contacts and Requests. The last one developed was the ChatsFragment.   On it's onCreateView it gives the error on currentUserId = mAuth.getCurrentUser().getUid() with the error of java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.google.firebase.auth.FirebaseUser.getUid()' on a null object reference  This is the code:  public class ChatsFragment extends Fragment {      private View privateChatsView;     private RecyclerView chatsList;     private DatabaseReference chatsRef, usersRef;     private FirebaseAuth mAuth;     private String currentUserId;      public ChatsFragment() {         // Required empty public constructor     }       @Override     public View onCreateView(LayoutInflater inflater, ViewGroup container,                              Bundle savedInstanceState) {         // Inflate the layout for this fragment         privateChatsView = inflater.inflate(R.layout.fragment_chats, container, false);          mAuth = FirebaseAuth.getInstance();         currentUserId = mAuth.getCurrentUser().getUid();         usersRef = FirebaseDatabase.getInstance().getReference().child("Users");         chatsRef = FirebaseDatabase.getInstance().getReference().child("Contacts").child(currentUserId);          chatsList = privateChatsView.findViewById(R.id.chats_list);         chatsList.setLayoutManager(new LinearLayoutManager(getContext()));          return privateChatsView;     }     ... }   The ContactsFragment use the same logic to display the contacts of the user, but it doesn't crash when clicking on it, so it makes me wonder if as the ChatsFragment is the first one that opens automatically when the MainActivity is opening, is it possible that the ChatsFragment calls first for the mAuth before the MainActivity? Or am I missing something?  If it is this problem with synchronization, how could it be delayed?  Let me tell more, this error started on the first mobile phone (API 23), the second mobile (API 21 ) was ok but now it's crashing too. Now, the app only works on a virtual device (API 27). Hope it helps  Edit/Solution: as I as verifying the currentUser as davehenry said, one of the cellphones just blocked the screen and the app worked fine. Idk what happened, but when opening the app with the cellphone blocked, after unblocking it, the app was on the login page and it worked fine after that. I tryed it with the other cellphone and worked again... it's possible that the app had time to verify the currentUser on the MainActivity and then change to the LoginActivity, because since it's not logged in, the ChatsFragment would receive the User, but there was none and then the app crashed... the problem here is why the app opened first the fragment before verifying which activity should be opened first


How to add vertical and horizontal dashed lines in array and tabular enviroments?

I want to present big matrices using concatenation of rows and columns with dashed lines. Also, I need to do the same for some tables. Is there any way to insert dashed lines in arrays and tabulars, or should I use \cdot or something similar to emulate it?  A sample I made using the :    But, I hope to have  a better position and extend for dashed lines. The source associated to this sample is:   \documentclass{article} \usepackage{arydshln} \begin{document}  \begin{tabular}{ccc;{0.4pt/10pt}c;{0.4pt/10pt}c;{0.4pt/10pt}c} text & text & text & & & text \\ text & text & text & & & text \\ text & text & text & & & text \\ \cdashline{1-6}[0.4pt/10pt] \\ \cdashline{1-6}[0.4pt/10pt] \\ \cdashline{1-6}[0.4pt/10pt] \\ text & text & text & & & text  \end{tabular}  \end{document}   Thanks.


Evaluation of $\prod_{n=1}^\infty e\left(\frac{n}{n+1}\right)^{n}\sqrt{\frac{n}{n+1}}$

During my calculations I ended up with the following product: $$P=\prod_{n=1}^\infty e\left(\frac{n}{n+1}\right)^{n}\sqrt{\frac{n}{n+1}}$$ I tried to express it in terms of series by taking the logarithm  $$S=\ln P=\sum_{n=1}^\infty \ln\left(e\left(\frac{n}{n+1}\right)^{n}\sqrt{\frac{n}{n+1}}\right)$$ but I also got stuck. Numerical calculation suggests that it is equal to $$P\stackrel{?}=\frac{\sqrt{2\pi}}{e}$$ but I am not able to prove the conjecture. Any idea about how to evaluate the product? Any help would be appreciated. Thanks in advance.


Is there a problem with defrosting meat on the counter?

I generally defrost meat on the kitchen counter. A friend of mine suggested that this was dangerous and suggested that I defrost meat in the refrigerator. I am no biologist but it seems to me that as long as the meat doesn't get warm defrosting it on the counter should be safe.  Generally, I remove the frozen items from the freezer and place them on a plate on the counter in the packaging they were frozen in. When they are mostly / completely thawed I place the meat in the refrigerator.  Am I wrong and should I be defrosting in the refrigerator?


How do I determine for given two rectangles A & B, with B having constant dimensions, that B is more than 50% inside A?

I have 2 rectangles in a 2D plane, only in the first quadrant with limit 2000 x 2000:  A (black) & B (red) Look at the attached image  Both can change positions (coordinates, X & Y). B has fixed dimensions (width & height), always known. A's dimension can change, but they are always known.  I will always know the top and left coordinates of A & B (which can keep on changing) and can shift the rectangles to other quadrant.  Kindly look at the images below:    How do I determine whether more than 50% area of the red rectangle (B) is inside the black rectangle (A)?    I understand that (area of B intersected by A) divided by Area of A should be > 0.5. How do I take care of the coordinate system within 2000, 2000, and cases where A might be too small to fit B?


why is the variance of t-distribution with 1 and 2 degrees of freedom undefined while these distributions can be drawn?

The variance of a t-distribution is given by df/(df-2), hence the t-distribution with 1 and 2 degrees of freedom have no defined variance. Yet these distributions do exist and can be drawn, so one would say that their variances can be calculated. I hope somebody can explain this without using too much mathematics, as my skills in mathematical statistics are poor.


Add NOT NULL constraint to large table without table scan

Trying to add a NOT NULL constraint to a table with 1 billion rows. I cannot afford a table lock for more than a couple of seconds. Is there a way to prevent a full table scan during the alter table statement? I created an index on the column hoping it would be used but that doesn't seem to work. May be a check constraint? Other options? Thank you!


I don't know if my USB flash drive is broken, but I do know that I can hear the usual notification sound when I plug it into whatever which port I decide. The problem is that I can't find the path to the drive.  More info I can give you: I formatted it after it refused to assimilate files that I've tried to replace onto it. I'm confused: did I mess up my Kingston DT50 16GB flash memory drive by formatting? Also I can't find any drivers for it in the official site. What should I do?     The top half of this image shows the output of lsblk when I have it plugged in - it is recognized, but I can't find the path.


What is the formal definition of energy in physics?   My question is what is the definition of energy in physics in general ? Moreover is energy a naturally occurring quantity or is a term defined in theoretical physics, ( for example force is somewhat a naturally occurring and not a defined quantity, whereas work is defined term)?


Run script and not lose access to prompt / terminal

I am running jmeter by launching the .sh script, once I do that I cannot start using the prompt again unless I ctrl-z, ctrl-c, or the script ends in some other way.  How can I launch that script and still be able to use the same console after the script is launched.  (i used to know how to do this, it's easy =()  I guess another way of putting it is how do I launch the script independently of the terminal.


Display both data in different fields in QGIS attribute table

In my attribute table I have lat_1, long_1 and lat_2, long_2 in the same row. How can I display both at the same time. Is their any solution for that in QGIS. lat_1, long_1 are main location lat_2, long_2 are entry point location That means in attribute table field names should be unique right. So it will display only x and y. But in my attribute table their are entry points (lat, long) they are also coordinates. So I want the both x & y (main and entry) displayed.


Adjust table width without messing up preliminary set by paper guidelines

Hi I am in the midst of publishing paper to IJNT. I downloaded the page guidelines from the corresponding website. The only problem I am having is that I could not adjust the table to fit the page margin set by IJNT. Below is the code for my table      \documentclass[12pt,a4paper,twoside]{report} \usepackage{tabularx,ragged2e,booktabs,caption} \usepackage{amsmath} \usepackage{amsthm} \usepackage{bm} \begin{document} \begin{table}     \centering     \def\arraystretch{3.0}     \begin{scriptsize}     \begin{tabular}{|c|c|c|}     \cline{1-3}      $\mu \in Y$ & $\mu P \oplus T'$  & $Z(nP)$ \\ \cline{1-3}     $-4$ & $\bigg(\dfrac{4482}{361}\beta + \dfrac{3489}{361}, \dfrac{-52002}{6859}\beta + \dfrac{2057238}{6859}\bigg)$  & $2^{22}\cdot3^{44}\cdot19^{-32}\cdot \bm{13\cdot1789}\cdot[-46931113911612188165\beta + 242506871209270916181]^2$  \\ \cline{1-3}     $-3$ & $\bigg(\dfrac{-99}{8}\beta + \dfrac{93}{8}, \dfrac{-81}{16}\beta - \dfrac{5049}{16}\bigg)$  & $2^{-32}\cdot3^{34}\cdot\bm{5\cdot29}\cdot\bigg[\dfrac{-143654012463}{2}\beta + \dfrac{596091741497}{2}\bigg]^2$  \\ \cline{1-3}      $-2$ & $(162\beta + 681,-5994\beta - 24786)$ & $[2^{13}\cdot3^{22}\cdot5\cdot19\cdot379\cdot1433\cdot1481\beta + 2^{13}\cdot3^{23}\cdot199\cdot527732929]^2$\\ \cline{1-3}     $-1$ & $(-18\beta + 69, -162\beta + 918)$  & $2^{24}\cdot3^{34}\cdot\bm{5\cdot29}\cdot[95293 +23052\beta]^2$  \\ \cline{1-3}     $0$ & $\bigg(\frac{3}{2}(-5 - 9\beta),0\bigg)$  & $2^{10}\cdot 3^{44}\cdot \bm{13\cdot1789}\cdot[21\beta + 7]^2 $  \\ \cline{1-3}     $3$ & $\bigg(\dfrac{-99}{8}\beta + \dfrac{93}{8}, \dfrac{81}{16}\beta + \dfrac{5049}{16}\bigg)$  & $2^{-32}\cdot3^{34}\cdot\bm{5333\cdot97324757}\cdot\bigg[\dfrac{2188485}{2}\beta + \dfrac{12121421}{2}\bigg]^2$  \\ \cline{1-3}     \end{tabular} \end{scriptsize}     \caption{$Z(\widetilde{Q})$ a square for $\mu \in Y$.\label{znpsquare}}     \end{table}  \end{document}   Is there a way, (without messing up with their preliminaries), I can adjust this table to fit the margin. I have attach an image for the table generated.


Which of these is correct?     Our company has a philosophy that "People Matter".      Our company has a philosophy that "People Matter."   Does the period go inside the quotes here or outside?


Why "Dark Energy" is called energy instead of force?

The overly simplified explanation I'm giving myself right now is  causes the opposite of what gravity does, that's why the universe is expanding. Now where gravity is a force, why dark energy is "energy"? Why it's not called "Dark Force" instead? I think I must be missing something here.


How to remove objects out a jsonlist with filters?

I want to remove certain objects out of my array with filters.  This is the code that generates the array (JSON parser)  protected Boolean doInBackground(final String... args) {              JSONParser jParser = new JSONParser();             JSONArray json = jParser.getJSONFromUrl(url);              for (int i = 0; i < json.length(); i++) {                  try {                     JSONObject c = json.getJSONObject(i);                      String naam = c.getString("actNaam");                      String type = c.getString("actType");                     String datum = c.getString("actDatum");                      HashMap<String, String> map = new HashMap<String, String>();                      map.put("actNaam", naam);                     map.put("actType", type);                     map.put("actDatum", datum);                       jsonlist.add(map);                 } catch (JSONException e) {                     e.printStackTrace();                 }             }             return null;          }     }   This is the code where the array should be filtered befor displaying.  @Override         protected void onPostExecute(final Boolean success) {             if (dialog.isShowing()) {                 dialog.dismiss();             }              for (int i = 0; i < jsonlist.size(); i++) {                 if (wandeling == false && type == "wandeling") {                 //Here we want to remove the types that have the string wandeling                 //The boolean wandeling has to be false befor the items should be removed                 }                 if (fiets == false && type == "fiets") {                 //Here we want to remove the types that have the string wandeling                 }                 if (excursie == false && type == "excursie") {                 //Here we want to remove the types that have the string wandeling                 }             }              ListAdapter adapter = new SimpleAdapter                     (context, jsonlist, R.layout.list_activity,                              new String[]{naam, type, datum},                             new int[]{R.id.ActNaam, R.id.ActType, R.id.Actdatum});              setListAdapter(adapter);              lv = getListView();          }   We are making a list from a json file. The list has 3 item: naam, type and datum. We want the user to be able to 'filter' through the list with buttons. The button are the ones that give back the boolean values for wandeling, fiets and excursie.  So for example when the button 'wandeling' is not clicked (false) we want to remove every item from the array that has the type 'wandeling'; The types are safed in the json file with strings like this:  "actType":"wandeling" "actType":"fiets" "actType":"excursie"   Sorry for my bad English and thanks for helping!


How does crossing two 3d vectors produce a third one that is perpendicular to both?

Can someone help me understand the cross product a little better, for me it makes more sense for the new vector to be somewhere between the original vectors and closer to the bigger one but that would be just adding to one another right? how does crossing say for example vector $\vec A \times \vec B =\begin{bmatrix} 1 \\ 0 \\ 0 \\\end{bmatrix} \times \begin{bmatrix} 0 \\ 1 \\ 0 \\ \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 1 \\\end{bmatrix}= \vec C$?


When I first signed up on a Stack Exchange site and got a profile image, it was this one (see my current user card I'm actually not sure what I look like any more):     Later, I got  and SEDE profiles, and my user image there was a different identicon. Because . I would have a picture of it, but that's the problem. ... Thanks to , I have a picture:     On those two sites, it changed from that purple one to this new one recently:   I don't know when the change happened exactly, but I KNOW I didn't change it (I don't know how to change it, otherwise I would have changed it to my main pink one).  Why did this change? Can I get my other icon back or will I be stuck with this new one?   Also, are the gravatars at Area 51 and SEDE securely generated?    After looking in my profile settings, I really confused (I am seeing my wrong avatar in more and more places since I first posted this.):        Seriously.......    What...?    (I'm using this , but be warned that they will try to IP block you after a certain number of requests to force you to pay... May look for a better alternative later.)


Load fonts that are in a ./fonts directory

I'm new to TeX. I have the following problem: How can I load a font from a file in a directory, which is located in the root of the project?  Say I have something like:   /project   /fonts     DancingScript-Regular.ttf   main.tex   DancingScript-Regular.ttf   Loading it when it's right on the root seems to work.  %!TEX TS-program = xelatex %!TEX encoding = UTF-8 Unicode  \documentclass[a4paper,12pt]{book} \usepackage{fontspec} \setromanfont{DancingScript-Regular.ttf} \begin{document}  hello world  \end{document}   However I can't figure how to load it when it's in the fonts directory. I've tried ./fonts/DancingScript-Regular.ttf, fonts/DancingScript-Regular.ttf, "fonts/DancingScript-Regular.ttf" and file:./fonts/DancingScript-Regular.ttf. None of them work.  All guides seem to focus on some sort of "how to install the font" but I can't work with that since the fonts may change (regularly) and would cause a sort of font version hell; it's also not very version control friendly. The  doesn't seem to cover using your own fonts either.  Also, can I load the fonts as a sort of preset/alias? Since for a lot I have basically font families, so around 10 variants (oblique, bold, bold oblique, regular, etc). I would like to avoid repeating a declaration if possible.