How does Principal Coordinate Analysis (PCoA) work, as compared to PCA?

I am familiar with PCA from  where you either normalize the data (to standard normal or centered?) and construct a covariance matrix or just construct the correlation matrix, eigendecomposition, sort eigenvalue/vector pairs by eigenvalue in descending order (the ratio of these eigenvalues to their sum is the explained variance), and finally, transform the original data to be projected onto the new eigenvalue axes matmul(X, sorted_eigenvectors.T)  This makes sense to me but WHAT IS PRINCIPAL COORDINATE ANALYSIS?  I understand you use a distance matrix instead of a correlation matrix.  What does this mean in terms of eigenvectors?  In PCA, the eigenvectors are in the direction of maximum variance but what about in a distance matrix space?   Here's some Python 3 code I made to do PCA.    import numpy as np import pandas as pd from sklearn.datasets import load_iris from sklearn.preprocessing import StandardScaler from sklearn import decomposition  np.random.seed(0)  # Iris dataset DF_data = pd.DataFrame(load_iris().data,                         index = ["iris_%d" % i for i in range(load_iris().data.shape[0])],                        columns = load_iris().feature_names)  Se_targets = pd.Series(load_iris().target,                         index = ["iris_%d" % i for i in range(load_iris().data.shape[0])],                         name = "Species")  # Correlation matrix (Note: StandardScaler of data and then covariance = correlation) DF_corr = pd.DataFrame(np.corrcoef(DF_data.T),                        index = DF_data.columns,                       columns = DF_data.columns)  # Eigendecomposition Ve_eig_vals, Ar_eig_vecs = np.linalg.eig(DF_corr)  # Sorting eigenpairs eig_pairs = [(np.fabs(Ve_eig_vals[j]), Ar_eig_vecs[:,j]) for j in range(DF_data.shape[1])] eig_pairs.sort(); eig_pairs.reverse() Ar_components = np.array([x[1] for x in eig_pairs])  # Projection matrix Ar_Wproj = np.array([x[1] for x in eig_pairs]).T  DF_transformed = pd.DataFrame(np.matmul(DF_data.as_matrix(),Ar_Wproj),                               columns=["PC_%d" % k for k in range(1, Ar_Wproj.shape[1]+1)]) #          PC_1      PC_2      PC_3      PC_4 # 0    2.669231 -5.180887 -2.506061 -0.115201 # 1    2.696434 -4.643645 -2.482874 -0.105533 # 2    2.481163 -4.752183 -2.304354 -0.102643 # 3    2.571512 -4.626615 -2.228277 -0.276660 # 4    2.590658 -5.236211 -2.409756 -0.153814 # 5    3.008099 -5.682217 -2.456525 -0.221893 # 6    2.490942 -4.908714 -2.106376 -0.181431 # 7    2.701455 -5.053209 -2.444074 -0.209103   Can I literally just replace the correlation matrix (DF_corr) w/ a distance matrix?   from scipy.spatial import distance  Ar_MxMdistance = distance.squareform(distance.pdist(DF_data.T, metric="braycurtis")) DF_dism = pd.DataFrame(Ar_MxMdistance, index = DF_data.columns, columns = DF_data.columns)


I have an ArrayList<String> that I'd like to return a copy of.  ArrayList has a clone method which has the following signature:  public Object clone()   After I call this method, how do I cast the returned Object back to ArrayList<String>?


Size of files in Windows OS. (It's KB or kB?)

One "kilobyte" (KB) is 1024 bytes in JEDEC-standard, whereas the definition has shifted, in most contexts, to mean 1000 bytes (kB) in accordance with SI. To resolve this difference, binary prefixes (kiB) are used.  So we have 3 choices for using prefixes - JEDEC, IEC (both in Binary), and Metric (in Decimal).  My questions are-   What prefix standard does Windows use in showing the file size? (surely it's not IEC standard) Why does Windows OS show sizes of files in KB (using a capital alphabet "K") when it's a small alphabet "k" for a Kilo in SI units?   A capital "K" represents Kelvin in SI system of units.  Am I missing something here in understanding?


Poor WAMP performance when using SMB/UNC Paths

I've configured a WAMP (Windows Apache MySQL and PHP) stack when when configured to use local storage takes 3-4 seconds to load. When I use an SMB/UNC share it takes 12-15 seconds to load.  Here are the two lines in my httpd.conf:   #DocumentRoot "//10.99.108.11/test_htdocs"  #<Directory "//10.99.108.11/test_htdocs">   #DocumentRoot "C:/www"  #<Directory "C:/www">   Is there performance tuning I can do on windows server 2008 R2 to improve performance or is there another way to improve performance using smb


Prove that $n! + k$ is a composite number

Recall that if $n$ is a positive integer, $n! = n(n-1)\cdots 3\cdot2\cdot1$.  a) Let $n$, $k$ be positive integers with $1< k \le n$. Prove that $n! + k$ is composite.  b) Using part a, find $100$ consecutive integers all of which are composite.  c) In part b you gave a sequence of $100$ consecutive integers all of which are composite. You should be able to use the same idea to find $\ell$ consecutive integers which are composite for any positive integer $\ell$. In other words, you can find sequences of any length which consist of consecutive integers and contain no primes. Does this contradict the fact that there are an infinite number of prime numbers?


Linux system rebooting automatically every 1 minute

Whenever I power up my Linux system, it starts and reboots continuously. All I can see is the logo.    i have some details but i cann't understand please help and the details are below  UBIFS: recovery completed UBIFS: mounted UBI device 0, volume 0, name "data" UBIFS: file system size:   278562816 bytes (272034 KiB, 265 MiB, 2159 LEBs) UBIFS: journal size:       13934592 bytes (13608 KiB, 13 MiB, 108 LEBs) UBIFS: media format:       w4/r0 (latest is w4/r0) UBIFS: default compressor: lzo UBIFS: reserved for root:  4952683 bytes (4836 KiB) <30>udevd[1184]: starting version 3.2.5 <27>udevd[1184]: NAME="%k" is ignored, because it breaks kernel supplied names, please remove it fro  /etc/udev/rules.d/usb.rules:1 <30>udevd[1191]: starting eudev-3.2.5 Checking partition consistency done Initializing random number generator... done. Starting system message bus: done Starting rpcbind: OK Starting network: eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1) udhcpc: started, v1.27.2 udhcpc: sending discover PHY: 0:00 - Link is Up - 100/Full udhcpc: sending discover udhcpc: sending select for 192.168.80.1 udhcpc: lease of 192.168.80.1 obtained, lease time 1468 /usr/share/udhcpc/default.script: Adding NTP server 192.168.66.11 restart: Unknown instance:  OK Starting nginx...


Definition respective derivation of angular momentum formula

I am reading An Introduction to Mechanics by Kleppner and Kolenkow (2014). On page 241 is the definition of the :      Here is the formal definition of the angular momentum $\vec{L}$ of a particle that has momentum $\vec{p}$ and is at position $\vec{r}$ with respect to a given coordinate system: $$\vec{L}=\vec{r} \times \vec{p}$$   In the book there is no explanation why this formula should be true. From this equation the formulas for torque and moment of inertia are derived.   My question is: Why is the formula above correct? Why isn't the formula for angular momentum something completely different, like $\vec{L}=\sqrt{(\vec{r} \times \vec{p})2\pi M}$? Is the formula for angular momentum just a mere definition and if not, how to derive it? How did people come across that particular formula?


I created a zpool, called zstorage, on two mirrored drives, on Ubuntu 18.04.  The OS is installed on an SSD, with the /home directory on its own partition on that same SSD.  I want to migrate /home to the ZFS pool.  As you can see, the pool has been set up and ready - as far as I know.  Where do I go from here?    Ordinarily, when moving /home to another drive, one can edit fstab, but ZFS doesn't use fstab.  I'm rather stuck at knowing how to move my existing /home to /zstorage/home and how to mount /zstorage/home. The command  sudo zfs set mountpoint=/home zstorage/home  gives me the error   cannot mount '/home': directory is not empty property may be set but unable to remount filesystem.


Compare by multiple methods in java compareTo?

I don't think that's the best way to word that title but I can't think of a better way to word it. Here's my problem: I have to write a method that compares in several different ways. If the last names are the same, I then need to compare by first name. If the first names are the same, then I need to sort by section. What would be the most effective way to sort a data structure in this hierarchy? Here's what I've currently got and I think I understand why it doesn't work but I can't come up with a different way to write this function:  //Student class structure, each field has a public get/set method public class Student implements Comparable<Student> {   private String fname;   private String lname;   private int section; }  //My current compareTo method @Override public int compareTo(Student s) {   /*     -compare by last name     -if the same, compare by first name     -if the same, compare by section   */    String slast = s.getLastName();    if(lname.compareTo(slast) == 0)   {     String sfirst = s.getFirstName();      if(fname.compareTo(sfirst) == 0)     {       int sclass = s.getSection();        return Integer.compare(section, sclass);     }      else     {       return fname.compareTo(sfirst);     }   }    else   {     return lname.compareTo(slast);   } }


I am having a doubt between the usage of which and that.  Which one of the following is correct and why?  The cougar is a member of the cat family that grows around 8 feet in length.  or  The cougar is a member of the cat family which grows around 8 feet in length.  Hope you can clarify it ASAP.


What's the best way to find cheap flight tickets from any place from a set of places to any place in another set of places?

For example, how do I find the cheapest tickets from any place in India to any place in either of England, Germany, Netherlands, Spain. Hope the questions makes sense?


A question on identifying normal subgroups of $S_4$

Let $H=\{e,(1 2)(3 4)\}$ and $K=\{e,(12)(34),(13)(24),(14)(23)\}$ be subgroups of $S_4$, where $e$ denotes the identity element of $S_4$. Which of the following are correct?   $H$ and $K$ are normal subgroups of $S_4$. $H$ is normal in $K$ and $K$ is normal in $A_4$. $H$ is normal in $A_4$ but not normal in $S_4$. $K$ is normal in $S_4$ but $H$ is not.  I know the condition for a subgroup $H$ to be normal in $G$ but that includes too much computation as $S_4$ has $24$ elements in all. I have studied the group of symmetries of square i.e. $D_4$ and its geometrical interpretation and I think that might be a clue to solve such type of problem relatively easy. Kindly correct me if I am wrong and provide any possible short method to do this.


How to install the latest version of Git on Ubuntu?

I have version 2.5 of Git on Ubuntu:  $ git --version git version 2.5.0   but Git is at version 2.7.1 now.  The Git website says to do  apt-get install git   to install it.  But I tried both sudo apt-get install git and sudo apt-get upgrade git and it is still version 2.5.  How do I upgrade it to the latest version?


Derive formal or informal proofs using Modus Ponus and Deduction Theorem - Logic

How do I show the following by producing formal or informal proofs?   ⊢ (¬A → ¬B) → (B → A ) ⊢ ¬B → (B → A)   I can use the Modus ponus (MP) rule, and deduction theorem (DT). And I have these 3 axioms:   α → (β → α) --- (A1) (α → (β → γ)) → ((α → β) → (α → γ)) --- (A2) (¬β → ¬α) → ((¬β → α) → β) --- (A3)   Thank you!


Text mining of machine logs to find correlation between errors in R

I've with me 50 MB data from a machine consisting of event logs such as device status, warning and error. I wish to perform text mining on the same to find correlation between errors i.e. one error could trigger another in future and take a prescriptive action on it. I've used hierarchical clustering in R to generate a dendrogram but the result couldn't yeild expected insight. Hence, I've planned to perform Apriori Algorithm on the same.  My queries are:   Is Hierarchical Clustering suggested to find such correlations? Is Apriori an apt algorithm in such situation and why? Or, is there any other approach to solve this problem?   The logs that I've looks like this :


In the following code, the setText() function is giving an error, not allowing the text to be changed for JLabel a and JLabel b. What is the fix?  public void actionPerformed(ActionEvent e) {     boolean is1 = true;     if (e.getActionCommand().equals("r")) {         if (is1 == true) {             r1++;             a.setText("Dice Rolls: " + r1);         } else {             r2++;             b.setText("Dice Rolls: " + r2);         }     } }   Initializations:  public class Clacker implements ActionListener {     JLabel a;     JLabel b;     int r1 = 0;     int r2 = 0;     ...     public Clacker() {         JLabel a=new JLabel("Dice Rolls: " + r1);         JLabel b=new JLabel("Dice Rolls: " + r2);     } }


so I have a 700x700 screen and I want to create an object (an asteroid) to travel from the left side of the screen to the right side. As soon as it gets out of screen, I want it to spawn back at a random Y ana do the same thing. So far, I have created the object to spawn at a random Y and travel to the right, however, between 0:100 pixels and 600:700 pixels, I have objects and I do not want my object to spawn and travel through those objects. I want the random Y to be between let's say 101 and 599.  if (centerX > width + 200) {                 isTravelling = false;                 centerX = -200;                 centerY = (int)(Math.random());             }


Difference between git merge and git fetch?

What is the difference between 'git merge' and 'git fetch'? I have some problems with these two commands. I don't know when I should use one or the other.


Let $K$ be a field. Then $K[x,y]$ is not a PID because $x$ is irreducible but the quotient $K[x,y]/(x)$ is isomorphic to $K[y]$, which is not a field.  So there must be an ideal in there which is not principal. What is an example of such an ideal?


Is depleting batteries of MacBook Pro 2018 still a thing in 2018?

I was looking for battery related applications in Brew and found  which refers to an  as justification why this application matters. Referring an old page as justification it's a bit suspicious for me. Depleting battery frequently - the page says monthly is a good cadence - still something I have to pay attention to?


Is there a package or way that let's me use characters like ï and à just by typing them?

So i've come to find it annoying that i have to type every ï as \"{i} same with à and other such characters, isn't there a package which allows me to type it freely or program that changes it automatically, thanks in advantage.


Module over integral domain, "Rank-nullity theorem", Exact Sequence

I have read questions related to $\mathbb{Z}$-module and exact sequence of it.  I have a question about generalising this result (or finding counter example)  Let $R$ be an integral domain and $0\rightarrow M_1\rightarrow M\rightarrow M_2\rightarrow 0$ be an exact sequence of finitely generated $R$-module.  Then, is $rank(M)=rank(M_1)+rank(M_2)$ true?  (Definition of rank: $rank(M)$ denotes the cardinality of the largest linearly independent subset of $M$)  I have read statements online and I found that "flat modules" satisfy this result (though I have not learnt tahings about maps and tensor product so I cannot effectively understand all proofs), but there are no general result about integral domains.  Hence, I would like to ask this question here and seek for help.    Thank you for your kind help!  (I have stuck in this for half a week and I am not making any progress. The current state of my  work is that:  I have (kind of?) proved that $Rank(M)\geq Rank(M_1)+Rank(M_2)$ by putting their linear independent sets together and prove that it is still linearly independent.    I have proved that the statement is true if $Rank(M)-Rank(M_1)=0$ or $1$.  The proof of $0$ is by torsion module, and the proof of $1$ is proved by hardcoding (but it cannot be generalised to $2$ or larger.  )


Connecting two power supplies with almost like voltages to an amplifier in parallel

I have recently been working on a custom sound system in my living room. For the subwoofer, I am using a 1000W amplifier. This is currently running off of a 12V computer power supply that outputs around 650W (The power supply shuts off at a certain volume because of lack of power). I have another power supply (not a computer power supply) that is 500W but has a voltage of 13.5V, not 12. I've read that this voltage is actually better for running car audio equipment and I am using another 13.5V power supply for the head unit to power the highs and mids.  I am wondering if it would be possible for me to connect these two power supplies in parallel to increase the power to this amplifier since they are both safe voltages. Would this be possible? Would I need to use a resistor to match voltages? Or is this just not a good idea altogether?  Update: This is car audio equipment so high power ratings should not be a shock.


In his , Ian Thorpe says:     I had swum 1:49.16, the fifth-fastest heat time as it turned out. It meant I had a good lane in one of the semifinals later that night.   This begs the question: What makes a lane "good"?


Showing that a non-abelian group of order $21$ has an outer automorphism.

I am trying to solve the following problem:  Let $G$ be a non-abelian group of order $21$. Show that $1)$ $Z(G)$ is trivial. $2)$ $G$ has an automorphism which is not inner.  Could you please give me a hint on how to solve it? Thanks!   My Work: $Z(G)$ can have order $1, 3, 7, 21$. It can't be $21$ since $G$ is not abelian. It can't be $3$ or $7$ since $G/Z(G)$ would be cyclic, and therefore $G$ would be abelian. Thus $|Z(G)|=1$. I also know that $G/Z(G) \cong \text{Inn}(G)$, so there are $21$ inner automorphisms. Thus if I could show that $|\text{Aut}(G)| >21$, I would be done. But I have no idea how to do that. I kow that we can write $G$ as a semidirect product, but I don't see how that helps.


Do not ask me to read the similar questions because I already did and my question is different  There is an idea about saving the current machine stat in a virtual machine (virtualizing a physical machine) and save it in an external storage then install 64 Bit system and install the virtual machine to reinstall all the programs , services , registry keys and the files . So with this way I will be able to upgrade from 32 Bit to 64 Bit without reinstalling my programs , so does anyone of you have any idea about that If it is then share it with me here please ?(I'm using windows 10)


By considering:  $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^1}{n^{2}} = \frac 1 2$$ $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^2}{n^{3}} = \frac 1 3$$ $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^3}{n^{4}} = \frac 1 4$$  Determine if this is true: $$\lim_{n\to\infty}\frac{\sum_{k=1}^n k^m}{n^{m+1}} = \frac 1 {{m+1}}$$  If it is, prove it.  If it is not, evaluate $\lim\limits_{n\to\infty}\frac{\sum_{k=1}^n k^m}{{m+1}}$.


Is there the Lunatic Cultist on Terraria 1.2.11979? I defeated the Golem but the Cultist won't spawn.


I'm planning to do my Dev 401 exam. I have been working in Salesforce platform for an year and would like to know what study materials I should go through and study before doing the exam. I would also like to know any useful tips and preparation questions, mock question.. where can I find them ? thanks !


When I enter unzip ../founation-latest.zip, it outputs this:     warning [../foundation-latest.zip]:  248 extra bytes at beginning or within zipfile (attempting to process anyway)   The file is 138KB. It unzips correctly, but why am I getting this error?


Cannot boot into the bootable USB stick on Lenovo G470

I want to help my sister to move from Windows 7 to Linux Ubuntu 14.04.1. When I boot the computer into the bootable USB stick, it just show me :     ------------------------------------------------↓ Then ↓------------------------------------------------  Black background with a underline sign winking _________________________________________ | _                                     | |                                       | |                                       | |                                       | |                                       | |                                       | |                                       | |                                       | |                                       | |                                       | |                                       | _________________________________________   I have tested for Ubuntu 14.04 also, I encounter the same problem. =[  I wonder if Ubuntu 14.04.1 do not support the hardware of Lenovo G470.


How to upgrade to Windows 8.1 but keep the files

I am upgrading from Windows 7 to Windows 8.1. I have a lot of data stored in my PC, It would be very tedious to back up all of the data. I have stored the data in local disks other than the system files containing disk (local disk: C), so is there any way to uninstall Windows 7 and upgrade it to newer OS without deleting any of my personal data?


Can we explain what the pins mean in the Help Center?

I read  and it is marked as .  There seems to have been no action taken from the "completion"  From the answer on related post:     I think people who have spent time on traditional forums expect a pin icon to mean that a post is "sticky", or always at the top, which is what these pinned items are. However, we also added a sentence in the hero image on the help center landing page that instructs users to begin by reading the pinned articles first. This should make it pretty clear that the pinned articles are the most important.    The bold part of the answer above never seemed to come to fruition.  So again -- Can these pins please be clarified on the actual  as to what they mean?


Receiving unallocated space from /home Partition after resizing it

I am new to Ubuntu 17.10 and there is a problem I can't solve on my own or with doing research on the Internet. First of all, I resized the partition to get space for another one for having Windows 7 and Ubuntu coexisting on my Computer.  So as the title says, I want to receive that unallocated space which lies within my /home partition. I unmounted and resized it by login as root in terminal, using the following command:  resize2fs /dev/sda5 500G   The screenshots show my problem, as the space within the resized partition isn't assigned to the unallocated space and I can't get it to.


What is the use of static synchronized method in java?

I have one question in my mind. I have read that static synchronized method locks in the class object and synchronized method locks the current instance of an object. So what's the meaning of locked on class object? Can anyone please help me on this topic?


How do I use sudo to redirect output to a location I don't have permission to write to?

I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to.  The trouble is, this contrived example doesn't work:  sudo ls -hal /root/ > /root/test.out   I just receive the response:  -bash: /root/test.out: Permission denied   How can I get this to work?


extract day of the month and hour of a given date format shell scripting

I am writing a script where I am looking for help. I am using date format in my script as below (YYYY MM DD HH MM):  $ echo $DT 202002252216   Now my requirement is to compare two dates listed in the file and calculate output in hours.  cat /home/postgres/pglinux_mm_cfg MM_START=202002261015 MM_END=202002261530 MM_SERVER=pglinux    Here is my script, timediff.sh  ENV=/home/postgres MM_START=`grep MM_START ${ENV}/\`hostname\`_mm_cfg |awk -F"=" '{print $2}'` MM_END=`grep MM_END ${ENV}/\`hostname\`_mm_cfg |awk -F"=" '{print $2}'`  MPHR=60 STARTIME=$(date +%Y%m%d%H%M -d ${MM_START}) ENDTIME=$(date +%Y%m%d%H%M  -d ${MM_END}) MINUTES=$(( ($ENDTIME - $STARTIME) / $MPHR ))  echo $STARTIME $ENDTIME $MINUTES   How to get date difference between MM_END AND MM_START in day's and hours?  I am using ksh.


how to add click event to multiple items with jquery

I have a jquery code that gets json data and list them in a ul list. I want to populate this Items on click.  $('#places) is a ul list.   $.each(data, function (id, item) {                      $('#places').append('' + item.name + '');       });    Ul list items are links that included latitude and longitute values. I want to add click event to that links. Which I click link zoom to that location. How can add event?


First off, this is a very tiny bug that doesn't really affect anything here except my perfectionism.  When a suspended user tries to accept an answer on their question, the following message comes up:     Suspended user cannot vote   I believe this should read     Suspended users cannot accept answers


Why are random forest predictions over a smaller range than the true target variable?

I have been running a random forest regression to predict a normalized target variable (where scores range between 0 and 1). However, whilst I am getting a reasonable level of overall performance, comparing the predicted values against the actual scores I have noticed that the range of predictions is on a much smaller scale. In other words, my predictions are all between 0.24 and 0.77, almost 50% smaller than the true 0-1 range. Why is this? I am using 10-fold CV, so presumably the extreme actual scores are contained within the 90% of the training sets. Talking with a colleague, we couldn't understand if this is normal random forest behavior, or if we have missed something. Thinking it through, my understanding is that within each fold approx. two-thirds of the training data is used to construct the forest (the remainder being contained within the OOB sample). Presumably this means that the extreme true scores will only be used in training two-thirds of the time. Further, my understanding of a random forest when predicting a continuous variable is that any observations within the leaf node are averaged together. Surely this means that predictions will always be pulled away from the extreme ends (unless pure leaf nodes have been generated). Does this sound a plausible explanation or is it likely I have made an error along the way?


The reciprocal of many prime numbers p in base 10 have a set of repeating digits p-1. Why?

I've noticed that the reciprocal of many prime numbers have a curious number of digits. For example. 1/7 has 6 repeating digits, 1/17 has 16 repeating digits, and 1/47 has 46. There's a rule here that makes this pattern, and I haven't quite figured it out. Does anyone have some insight on this?  There are a few other numbers that follow the pattern subversively. For example, 1/3 has two repeating digits: 33. 1/11 has ten repeating digits: 0909090909. The number 1/13 has a set of six that repeats twice, which makes a set that's 12 digits long.  For reference, here is a website that lists reciprocals of numbers 2 through 70, including non-primes.   The ones that break the rule are 1/2 and 1/5, but they seem to be a matched pair, where the 2 and 5 switch places in the equation 1/X = Y/10  What is the rule that makes this pattern? I'm very curious.


How to remove duplicates from SharePoint Enterprise Search results?

I am facing an issue in SharePoint Search. I have connected External content type in SharePoint site collection and my source has single entity of particular item but in SharePoint search I am getting duplicate records for the single item. I don't why it is coming.  I tried this TrimDuplicates=true but also getting duplicate results.  Help me to solve this issue. SharePoint Search service has an issue but how to solve that issue ?


I have 3 files to compile:  main.cc transcoder.hpp transcoder.cc   The g++ commands I'm running are:  g++ -c -Wall -g transcoder.cc transcoder.hpp -I. -lboost_system -pthread g++ -c -Wall -g main.cc -I. -lboost_system -pthread g++ -o main main.o transcoder.o -I. -lboost_system -pthread   After the last line, I get an undefined error reference error for when code in main.cc tries to call a function defined in transcoder.hpp/transcoder.cc. Does anyone know what I'm doing wrong?  Edit to add code snippets:  transcoder.hpp  #include <boost/network/protocol/http/server.hpp>  namespace transcoder {  template<class T> class Transcoder {  public:   void HandleRequest(const typename ::boost::network::http::server<T>::request& request,                      typename ::boost::network::http::server<T>::response* response); };  }  // namespace transcoder   transcoder.cc  namespace transcoder {   using boost::network::http::server;    template<class T>   void Transcoder<T>::HandleRequest(const typename server<T>::request& request,                             typename server<T>::response* response) {     // random implementation  } }  // namespace transcoder   main.cc  const server<Handler>::request request; server<Handler>::response response ::transcoder::Transcoder<Handler> transcoder; transcoder.HandleRequest(request, &response);   Exact error message:  main.o: In function `(anonymous namespace)::Handler::operator()(boost::network::http::basic_request<boost::network::http::tags::http_server> const&, boost::network::http::basic_response<boost::network::http::tags::http_server>&)': /some_dir/main.cc:16: undefined reference to `transcoder::Transcoder<(anonymous namespace)::Handler>::HandleRequest(boost::network::http::basic_request<boost::network::http::tags::http_server> const&, boost::network::http::basic_response<boost::network::http::tags::http_server>*)'


Minimizing the number of operations of subtracting one so as to get to $0$

Hello Community! The above problem you see is a combinatorics problem, more like an algorithmic problem that I could not solve. :(  This problem requires that every child gets satisfied. In brief terms, this problem asks you to choose one number and subtract $1$ from the rest of the numbers and eventually we have to get to $0$ in all of them. We have to do this as least times as possible.  I tried hit and trial one by one but how can I guarantee to find the minimum value?      Also, if you have seen the other posts I have made in a while, it can be observed that all these problems that I am posting right now are pretty unusual combinatorics problems and I seriously need some help on how to solve these. Can anybody please suggest me some problem solving strategies for these kind of problems?   Any help would be appreciated. Thank You!


Two layovers in the Schengen zone with a Canadian passport. Do I need a visa?

I am asking this question again as I have not seen any that pertain to Canadian passports. I am a Canadian citizen with a Canadian passport.  I have a flight to a non-Schengen country. However I have two layovers in Schengen countries (Zurich, Vienna). Would I need a visa?  So my flight is Montreal > Zurich (50 minute layover) > Vienna (1 hour layover) > Destination.  Or am I exempt from the visa? I heard from some that I am not exempt, and from some that there is a limit to my time of stay (24/48 hours) I don't know who to believe and I want to book my flight with confidence so I don't lose the offer until tomorrow by calling an embassy.  Thank you!


What do we mean by saying "Explained Variance"

I'm studying linear regression and there is a concept I can't wrap my head around.  I've heard many times the expression "the independent variable explains $a$% of the variance of the dependent variable $y$. (where $a$ is a number)  The variance of the random variable $y$ is the distance of the observartions from the mean value of $y$. By adding our independent variable $x$ in the model, we want it to explain some of this variance.  I think that when we say the word explain, we don't actually mean that we explain something and it's a metaphorical way of using it but I'm not really sure what it means.  I've found another similar question here but the answer didn't help me understand it.  I'd really appreciate some help!  Thanks


I formatted the unallocated space to fat32 (don't know if that was right). Now I want to extend my dev/sda5 for more memory as I'm currently getting warnings about my low memory space. Above My /dev/sda5 is New Partition #1 with 19.53 gigs and below it is the linux-swap. I can take memory from the linux swap as well as I have quite a bit of RAM.  I read that I'm meant to boot off USB and run GParted, unswap the linux-swap and then delete it. Unmount the sda5 and after that, resize the /dev/sda5 to take up some of that hard drive space and then turn on swap afterwards. Is this right? Double checking because I already messed it up once.    Thank so much! Reading from here:


Why is my gradient printing like a faint white box?

I am trying to print from an Illustrator file and my items with gradients/shadows look fine on screen but when printed I get a faint white box. What setting am I missing??


Is there a place to ask about the impact on creativity in programming when taking an education?

I don't think what I'm asking for is fit for Stack Exchange, but I felt I should at least ask anyway.  I'm a self taught programmer who's been working in the field for a couple of years. I took a look at some tests from courses in a good school nearby, and felt like it was all about right/wrong rather than creativity and making things awesome.  Now I'm looking for advice from someone who can share some experience on how schooling has impacted their personal style and joy of programming. Is there a place to ask such a question on Stack Exchange?


Proving an expression is an integer (number theory)

Suppose that $r$ is a real number such that $r + \frac{1}{r}$ is an integer.  Prove that  $r^{2017} + \frac{1}{r^{2017}}$ is an integer.  I thought of using prove by induction, but I don't think it really suits in this case. I've also thought of using modulos in some kind of way but not sure how. Also, can we assume that both $r^{2017}$ and $\frac{1}{r^{2017}}$ are both integers, since adding them make up an integer?


Minecraft SelectedItem: help with block data tags?

Basically, I need to make a testifier commands that checks for players to hold Blue or Red wool in the hand. To do this I've tried the following:  /testfor @a[team=Blue] {SelectedItem:{id:minecraft:wool}}   (it says that the UUID is in invalid format, but the team specification is not necessary so I removed it)  /testfor @a {SelectedItem:{id:minecraft:wool}  (It seems it only works with white wool)  /testfor @a {SelectedItem:{id:minecraft:wool 14}   Still not working and  /testfor @a {SelectedItem:{id:minecraft:wool,Data:14}}   But still not recognizing it as red wool... I just can't understand how and where I put the block variation Data...


Finding a simple spline-like interpolating function

I am looking for a continuous function $y=f(x,\alpha)$ for the interval $0\le x \le 1$ such that $0\le y \le 1$ and $y(0,\alpha)=0$ and $y(1,\alpha) = 1$ and $y(\alpha,\alpha) = 1-\alpha$ and $dy/dx|_{x=\alpha}=1$. It is effectively symmetrical about the line $y=1-x$. Typically $0.2\le \alpha \le 0.8$.  It looks like a parabola but rotated so that the new y axis is along $y=1-x$, but since I need to be able to compute $y$ given $x$, I have not yet been able to work it out.  The exact form is not too important, but since this is to go in a OpenGL vertex shader I am trying to come up with something that is as simple as possible in terms of math operations.


There is given a countable set $A$. Prove that $(x+A)\cap A=\emptyset$ for some $x$

There is given a countable set $A\subset \Bbb{R}.$ Prove that there exists an $x\in R$ that $(x+A)\cap A=\emptyset$, where  $x+A=\{x+a: a\in A\}$.


What is the "/usr/local/src" folder meant for?

I wanted to put my work files (code) in /usr/local/src, but I think it's already a folder that has some other semantic meaning.  What is that? Should I put source code there, or is there a better place?  Edit - I am the sole user and admin of the machine, and I don't want to use my home directory because it's on an NFS drive.


Capitalization of "the" beginning a proper noun

When should "the" be capitalized when it begins a proper noun?  There are some proper nouns that seem to have their leading "the" included as part of their name/title. For example, The Real Ghostbusters. But there are others, such as the Greenhill School that seem like they could go either way (as in, Greenhill School could also be acceptable, so "the" is not part of the proper noun). What's the rule?


Prove $\forall p\in(0,1), \theta\in [0,\pi /2];\cos^p(\theta)≤\cos(p\theta)$

Take $\log(\cos^p(θ))≤\log(\cos(pθ))$ and use derivative, I can find a proof here.   I am wondering this can be solved without using derivative.


How do I hide contact name from whatsapp notification on iphone5

I saw someone's iphone5 whatsapp notification pop up with only the whatsapp badge and the word "message" but I can't figure out how to do that on my iphone5


Convergence in measure of product of convergent sequences

Let $(X,\Sigma,\mu)$ be a finite measurable space ($\mu(X)<\infty$). Suppose $f_n \xrightarrow{\mu} f$ and $g_n \xrightarrow{\mu} f$, prove that $f_ng_n \xrightarrow{\mu} fg$  I'll write what I could do up to now:  Let $\lambda>0$, then $$\lambda<|f_ng_n(x)-fg(x)|$$$$=|f_ng_n-fg_n+fg_n-fg|$$$$\leq|g_n(x)||f_n(x)-f(x)|+|f(x)||g_n(x)-g(x)|$$  Let $S=\{x \in X: |f_ng_n(x)-fg(x)|>\lambda\}$, then $S \subset \{x \in X:|g_n(x)||f_n(x)-f(x)|>\dfrac{\lambda}{2}\} \cup  \{x \in X:|f(x)||g_n(x)-g(x)|>\dfrac{\lambda}{2}\}$  If I call $S_1$ and $S_2$ to the first set and second sets of the union respectively, then given $N>0$, $$S_1 \subset A_1 \cup A_2,$$where $$A_1=  \{|g_n| \geq N\dfrac{\sqrt{\lambda}}{4}\} \cap\{|f_n-f|<N^{-1}\dfrac{\sqrt{\lambda}}{4}\}$$ and$$A_2= \{|f_n-f| \geq N\dfrac{\sqrt{\lambda}}{4}\} \cap\{|g_n|<N^{-1}\dfrac{\sqrt{\lambda}}{4}\}$$   Similarly, $S_2 \subset B_1 \cup B_2$ with $$B_1= \{|f| \geq N\dfrac{\sqrt{\lambda}}{4}\} \cap\{|g_n-g|<N^{-1}\dfrac{\sqrt{\lambda}}{4}\}$$ and $$B_2=\{|g_n-g| \geq N\dfrac{\sqrt{\lambda}}{4}\} \cap\{|f|<N^{-1}\dfrac{\sqrt{\lambda}}{4}\}$$   I know how to find a bound for $A_2$ and $B_2$ using the fact that $f_n \xrightarrow{\mu} f$ and $g_n \xrightarrow{\mu} g$, but what about $A_1$ (or $B_1$)?  Thanks in advance


How to resolve E: Internal Error when using apt-get remove?

I use:   apt-get remove    To remove some software, but it displays:  error:E: Internal Error, No file name for libssl1.0.0 .   I also try this to resolve the error:  wget http://launchpadlibrarian.net/102991621/libssl1.0.0_1.0.0e-2ubuntu4.5_i386.deb sudo dpkg -i libssl1.0.0_1.0.0e-2ubuntu4.5_i386.deb   But it also gives an error :   libssl1.0.0:i386 1.0.0e-2ubuntu4.5 cannot be configured because libssl1.0.0:amd64 is in a different version (1.0.1-4ubuntu5.3)   I want know the correct way to solve this problem.


How to vertically center a floating element

* {   margin: 0px; } .container {   background: #ccc;   line-height: 50px;   verticle-algn: middle;   clear: both; } .float {   overflow: hidden;   float: right; } <div class="container">   <button class="inside">inside</button>   <button class="float">float</button> </div>     Please check this example.I want the .float element to be vertically centered of the .container element as the .inside element.But no matter I trigger BFC or add a pseudo element, I can not clear the impact of the float element.I don't think margin is a best way to solve this.Can you tell me how to fix it, thanks for your help.


Why pp. disappear in the Ref. when I add letters in the pages = "--"?

In the Ref. When I have   @article{Common,     .     .    Pages = "07104-07109",    .   .}   I get pp. 07104-07109, which is perfect!   But when the pages for example do have a letter such as letter B   @article{Common,     .     .     Pages = "07B104-07B109",     .    .}   I do not get pp.! But just get 07B104-07B109, why pp. does not appear?!  I use biblatex package.


Graphing lots of data crashes my browser

I wanted to run a  query to return a large amount of data so I could export the lot to CSV. Problem is, the page is crashing my machine - the query triggers graphing, and the graphing code can't handle the data!  This screenshot of the insane graph was just barely obtained by another user:   I'm currently unable to modify the SQL as it kills the browser (latest Chrome on a Mac). EDIT Initially I thought it was simply due to the amount of data and perhaps that pagination would help, however the comments (thanks guys!) have uncovered that it was the graphs being drawn.


I have a PSN account that belongs to region X. It has a PS+ subscription. I have acquired many games throughout the years; some are PS+ free games, some are digital medias bought from PS Store. I'm moving to region Y.   Question: will I be able to play all of them normally on while I'm in region Y, specially those free PS+?  In other words, will I be able to keep using the same PSN and PS+ accounts and get access to my games in the library?  PS: I believe it is not possible to change country of a PSN account, isn't that so?


how to import XML data that have apostrophe with in the data

I have PHP code that takes a XML file that is updated daily and  imports it into a MYSQL database. It was working fine until the other data I realized that players who have apostrophe with in their names weren't in the database. Below I listed the coding I am currently using and a XML example. Any help on this matter would be greatly appreciated  xml example of a player that uses an apostrophe in there name  <player> <playername id="62583">Sa'Belle</playername> <allianceid id="729"/> <allianceroleid id="4749"/> <race id="2"/> </player>   Coding I am currently using       set_time_limit(0); // unlimited max execution time require_once 'kodadb.php';  function Unaccent($string) {     if (strpos($string = htmlentities($string, ENT_QUOTES, 'UTF-8'), '&') !== false)     {         $string = html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|tilde|uml);~i', '$1', $string), ENT_QUOTES, 'UTF-8');     }     return $string; } function getGenDate($file, $elemName,$db) {         $count = 0;     // Open the file     $reader = new XMLReader();     if (!$reader->open($file)) {         die("Failed to open '" . $file . "'");     }     while ($reader->read()) {         if ($reader->name === $elemName) {             $count++;             $doc = new DOMDocument;             $node = simplexml_import_dom($doc->importNode($reader->expand(), true));                 $gendate = $node->datagenerationdatetime;                 return ($gendate);           }      }      $reader->close();      return ($gendate); }  function xmlReader($file, $elemName,$db,$genDate) {     $count = 0;     // Open the file     $reader = new XMLReader();     if (!$reader->open($file)) {         die("Failed to open '" . $file . "'");     }     while ($reader->read()) {         if ($reader->name === $elemName) {             $count++;             $doc = new DOMDocument;             $node = simplexml_import_dom($doc->importNode($reader->expand(), true));             $player['allianceid'] = $node->allianceid['id'];             $player['allianceroleid'] = $node->allianceroleid['id'];             $player['race'] = $node->race['id'];             $player['id'] = $node->playername['id'];             $player["Player_name"] = $node->playername;             if ($player['id'] !== null) {                 $sql = "INSERT INTO `players`(`player_id`, `Player_name`, `alliance_id`, `alliance_role_id`, `race_id`) VALUES ('" . $player['id'] . "','" . $player["Player_name"] . "','" . $player['allianceid'] . "','" . $player['allianceroleid'] . "','" . $player['race'] . "');";                 echo $sql."<br>";                 $db->query($sql);                 if ($db->connect_errno) {                     printf("Connect failed: %s\n", $db->connect_error);                     exit();                 }             }         }     }     $reader->close();     return($count); } $rustart = getrusage();  $db = doDatabase(); $sql = "TRUNCATE TABLE `players`"; $db->query($sql); $file = "./tmp/datafile_players.xml"; $elemName = 'server'; $genDate = getGenDate($file, $elemName,$db);  $elemName = 'player'; $numRows = xmlReader($file, $elemName,$db,$genDate); //echo "Inserted ".$numRows. " records into 'players'.";  function rutime($ru, $rus, $index) {     return ($ru["ru_$index.tv_sec"]*1000 + intval($ru["ru_$index.tv_usec"]/1000))      -  ($rus["ru_$index.tv_sec"]*1000 + intval($rus["ru_$index.tv_usec"]/1000)); }  $ru = getrusage(); echo "This process used " . rutime($ru, $rustart, "utime") .     " ms for its computations\n"; echo "It spent " . rutime($ru, $rustart, "stime") .     " ms in system calls\n";


I'm trying to create a method that validates that the user did not leave the JTextField empty. No error handling is needed, I just need to make sure it is not empty and the user entered the number of meals. I wrote the following: private void validateMeals() {     if(mealsField.getText() == "")     {         JOptionPane.showMessageDialog(null,"You must enter number of meals",         "Rocky Jonhs Management System", JOptionPane.ERROR_MESSAGE);         mealsField.setText("");     }     nameField.requestFocus(); } //end validateMeals() method


Eigenvalues of $L^\dagger L$ are positive

Let $L$ be a linear operator on a complex vector space $V$, how to show that eigenvalues of $L^\dagger L$ are positive? I guess this might be a statement taught in a functional analysis class or an advanced linear algebra class?


In microprocessor 8085, how can I clear/reset all flags(s,z,ac,p,cy) without affecting contents of accumulator?

I only know the code in which accumulator contents are affected. It is not a duplicate as I have asked for a solution which doesn't affect accumulator.


Confusion about effect of atmospheric pressure on depth at which an object floats

The bottom 3.5cm of a plastic block is submerged in water from the lower end of a spring. Why doesn't atmospheric pressure affect the position of the object?   My book says the downward force exerted is cancelled by the upward force of the water on the object. How is that possible if the downward force is on the water and the upward force on the object? Please explain with a diagram if possible. I'm very confused.


GCD in polynomial rings with coefficients in a field extension

Let $E/F $ be a field extension and $f,g$ $\in$ $F[x]$ (the polynomial ring with coefficients in $F$ ). Let's denote with $\gcd_F(f,g)$ the greatest common divisor of $f$ and $g$ in $F[x]$. Is it true that $\gcd_F(f,g)$ $=$ $\gcd_E(f,g)$ ?


Exact Values of the integal $\int_0^\infty \frac{r^{n-1}}{(1+r^2)^{\frac{s}{2}}}\,dr$

Does any one know the exact expression of the integral,  $$E_n(s)=\int_0^\infty \frac{r^{n-1}}{(1+r^2)^{\frac{s}{2}}}\,dr~~~~s>n, n\in \mathbb{N}$$ or more generally, $$E_a(s)=\int_0^\infty \frac{r^{a-1}}{(1+r^2)^{\frac{s}{2}}}\,dr~~~~s>a, a\in \mathbb{R}$$ For the special case $s=n, n+2$ I find out by induction that $$ E_{n-1}(n)=\frac{\omega_{n-1}}{2\omega_{n-2}}~~\text{and}~~E_{n-1}(n+2)=\frac{\omega_{n-1}}{2n\omega_{n-2}}. $$ where $\omega_{n-1} = \frac{\pi^{\frac{n}{2}}}{\Gamma(\frac{n}{2})}$ is the  surface measure of the n-dimensional sphere of $\mathbb{R}^n$. Further result is welcome


What modifies the PATH variable on macOS?

echo $PATH returns a different result than the PATH variable I define in .bashrc. .profile is empty.  What else could be modifying the PATHvariable?  The directories listed are all things I would have entered (i.e., not done by software), probably after having read something online, but I don't remember where.  This question is for macOS Mojave, not OS X Mountain Lion. Yes, the answers are the same, but the questions are not.


I would like to ask a question for computing a hashvalue for a empty file. I need to compute a hash_value when the file f is first created and is empty. Then, at the end I will update the hash_value again. My code is not working for windows os. Can you tell me how to handle this? Thanks.               objectFile = File(fullFilePath);             fileInputStream = FileInputStream(objectFile);             data = IOUtils.toString(fileInputStream, 'UTF-8');              persistent digest;                          if isempty(digest)                 digest = MessageDigest.getInstance('SHA-256');             end              hash = digest.digest(java.lang.String(data).getBytes('UTF-8'));   Error Message      digest.digest(java.lang.String(data).getBytes('UTF-8'))     Java exception occurred:     java.lang.NullPointerException          at java.security.MessageDigest.update(Unknown Source)          at java.security.MessageDigest.digest(Unknown Source)


Is it possible to get the expiration time of a specific cache? I was hoping to find something like this:  HttpRuntime.Cache(key).ExpireTime


How can I sync Reminders with Google Tasks?

I was looking for a way to sync my reminders from Google Calendar with the reminders app in iOS 5.  I have Google Sync set up, and on my "Mail, Contacts, Calendars" settings page, it says "Mail, Contacts, Calendars, Reminders" are being synced with Google Sync, but reminders created on the gmail tasks (or google calendar tasks) do not show up on the phone, and vice versa.  What can I do to get them to sync?  --update:  :     You can also save your tasks to Google Calendar or Exchange servers,   which then handle the syncing separately.   But it doesn't say how to do it...


ImportError: No module named application

I am running a flask application and connecting to database with Flask-mysqlAlchemy when I am running my script with python 2.7 I am getting below error.  Traceback (most recent call last):   File "app2.py", line 8, in <module>     from database.dbconfig import db, myAccounts2 ImportError: No module named database.dbconfig   whereas this is running fine in python3 I need this running in python 2.7 as my server is pre-installed with it. I am not able to figure out what the issue is. I have installed all dependencies in my server and keep getting this where as it works in my local machine with python3.  Here is my main script  My directory is like this  Main folder | +--->database |   | |   +------> dbconfig.py |    +----->app2.py     Here is my app2.py  #!usr/bin/python import boto3 import json import urllib2 import urlparse #import urllib.request #import urllib.parse from database.dbconfig import db, myAccounts2 from flask_sqlalchemy import SQLAlchemy from flask import Flask,render_template,jsonify,json,request  application = Flask(__name__)   Here is my dbconfig.py  from flask import Flask from flask_sqlalchemy import SQLAlchemy  app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:password@pushbuttontest.us-east-1.rds.amazonaws.com:3306/test_pb' app.config['SQLALCHEMY_TRACK_MODIFICATIONS']= 'False' app.config['SECRET_KEY'] = "random string22" db = SQLAlchemy(app)  class myAccounts2(db.Model):     #__tablename__ = 'myAccounts'     id = db.Column(db.Integer, primary_key=True)     account_name = db.Column(db.String(45), primary_key=True)     vpc = db.Column(db.String(55))     subnet = db.Column(db.String(55))     instance_type = db.Column(db.String(90))      def __init__(self,  account_name, vpc, subnet, instance_type):         #self.id = id         self.account_name = account_name         self.vpc=vpc         self.subnet=subnet         self.instance_type=instance_type


I must find out if T value equals default(T) value. Is there any simple to do that ?


Recommend of algebraic number theory books

I have studied some basic algebraic number theory, including Dedekind theory, valuation theory, and a little local fields. Now I am thinking to study more and deeper, and hoping to study class field theory, so please help me which book should I choose?  The teacher told me that I should read Lang's or Neukirch's, but I don't know which is better and to choose, or if there is a better one?  Thanks in advance.


Cannot implicitly convert type short to Enum

I cannot initialize this data:  NewUpload.Currency = Convert.ToInt16(data.Rows[i]["Currency"]);   because i've got an error.  I have this model structure:  public Currency Currency { get; set; }   How will i resolve this error? Thanks for the help.


Two files in one of my directories are rendered as gray on PuTTy.  Running ls -l --color=always | less shows a list with most file names preceded by ESC[01;32m  But those two files do not. The filename is preceded by the timestamp, just as in a regular ls -l command. What causes this?


If the kernel of a matrix is the 0 vector, why is the basis of the kernel non existent?

If the kernel of a matrix is the $0$ vector, why is the basis of the kernel non existent?   If I have the matrix  $\begin{bmatrix}1 & 2\\3 & 4\end{bmatrix}$  The kernel is the $0$ vector  Why is the basis of the kernel non-existent? Shouldn't the basis of the kernel be $0$?


Is it safe to have a USB stick under this situation?

I found this kind of magnet key ring:    Is it safe to attach one end to an USB stick?


Best way to *confidently* search files and contents in Windows without using an indexing service?

Back in Windows XP I knew that doing a file search and checking "Search file contents" (or whatever it was) I would get my results if I waited patiently.  In Vista, I felt I had absolutely no confidence that what I had typed had been thoroughly searched for, even with all the "Search non-indexed locations" etc. checked.  In Windows 7 I feel better and usually find stuff, but am suspicious when I don't. I'm not left feeling "confident".  I don't want (the weight of) Google Desktop.  I want a solid, brute file search utility. I found one I thought looked good recently (installed Windows 7 RTM last week and can't remember what it was called) but it still didn't seem to find files I placed as tests.


Can I say: I have not gone to the cinema for a long time

Joe asks me: "Do you often go to the cinema?"  I reply: "No, I have not been to the cinema for a long time"  This is correct.  But can I say:     "I have not gone to the cinema for a long time"


Is a scaled-up aircraft carrier 'ski-ramp' a viable system to impart enough velocity to significantly assist a spacecraft to orbit?

Not a boost straight up to escape velocity, just sufficient added momentum to make a significant economic saving on fuel cost, mass and complexity of a standard launch. It seems ludicrous to me how much fuel in a standard launch appears to be wasted pushing thousands of tonnes of rocket fuel in a vertical direction from a standing start.  The system I envisage would have a horizontal track of possibly 2-3km (distance to be debated), acceleration via external systems (electromag or JATO?), continue up a ramp of slowly increasing gradient, with craft's own engines now running, and exit the ramp at between Mach 1 or 2. Safety run-off track if craft's own engines fail to ignite properly. Winged style craft for stability from ramp & shuttle-style landing.  Similar I know to the Phys.SE  question here, but acceleration could be more survivable. Had a longer script but it appeared to over-run the site limit. Acknowledge AdamRedwine's railgun question -would have added my contribution to that but my Reputation today is only 1.  Acknowledge Gerry Anderson's Fireball XL5 puppet show on British TV in the '60s - the launch concept has always stayed with me! Submitted for criticism.


Add institution logo to presentation slides

I please want to include the logo of my institution at the top right of my first slit of my presentation at the bottom slit of my presentation. How should i go about this?


the disk drive for /dos is not ready yet or not present

I had Windows and Ubuntu 14.04 installed on my computer. My disk drives were mounted in Ubuntu. Only windows installation drive were mounted to /dos. But after re-installing windows, I had to recover Ubuntu boot and since then      The disk drive for /dos is not ready yet or not present    Continue to wait or press s to skip mounting or M for manual recovery   and every time I have to press "s" to enter ubuntu. I tried remounting but didnot work. On disk info application it showing "Device- /dev/sda2" . What should I do?  Edit:   /etc/fstab:  # <file system> <mount point>   <type>  <options>       <dump>  <pass> # / was on /dev/sda7 during installation UUID=99958f24-0ff1-4317-b73f-f3380a01675d /               ext4    errors=remount-ro 0       1 # /dos was on /dev/sda2 during installation UUID=6A16052B1604FA39 /dos            ntfs    defaults,umask=007,gid=46 0       0 # /home was on /dev/sda9 during installation UUID=5af218fd-721a-460c-8a55-f3cf06d6ac39 /home           ext4    defaults        0       2 # /windows/entertainment was on /dev/sda6 during installation UUID=08E89C1BE89C0958 /windows/entertainment ntfs    defaults,umask=007,gid=46 0       0 # /windows/personal was on /dev/sda5 during installation UUID=F4C02C8CC02C5760 /windows/personal ntfs    defaults,umask=007,gid=46 0       0 # /windows/software was on /dev/sda3 during installation UUID=0E9CF5219CF503CD /windows/software ntfs    defaults,umask=007,gid=46 0       0 # swap was on /dev/sda8 during installation UUID=b3a60872-5000-40d7-9ee5-3e4d6e84f7c4 none            swap    sw              0       0 UUID=0C76B0D476B0C02E /dos ntfs defaults,umask=007,gid=46 0 0   -> This came entering "sudo lsblk"  NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda      8:0    0 931.5G  0 disk  ├─sda1   8:1    0   500M  0 part  ├─sda2   8:2    0  99.9G  0 part  ├─sda3   8:3    0   100G  0 part /windows/software ├─sda4   8:4    0     1K  0 part  ├─sda5   8:5    0   200G  0 part /windows/personal ├─sda6   8:6    0   450G  0 part /windows/entertainment ├─sda7   8:7    0  27.7G  0 part / ├─sda8   8:8    0   5.7G  0 part [SWAP] └─sda9   8:9    0  47.7G  0 part /home sr0     11:0    1  1024M  0 rom     and this came aftering "sudo blkid"   /dev/sda1: LABEL="System Reserved" UUID="D484A83F84A82648" TYPE="ntfs"  /dev/sda2: UUID="0C76B0D476B0C02E" TYPE="ntfs"  /dev/sda3: LABEL="Software" UUID="0E9CF5219CF503CD" TYPE="ntfs"  /dev/sda5: LABEL="Personal" UUID="F4C02C8CC02C5760" TYPE="ntfs"  /dev/sda6: LABEL="Entertainment" UUID="08E89C1BE89C0958" TYPE="ntfs"  /dev/sda7: UUID="99958f24-0ff1-4317-b73f-f3380a01675d" TYPE="ext4"  /dev/sda8: UUID="b3a60872-5000-40d7-9ee5-3e4d6e84f7c4" TYPE="swap"  /dev/sda9: UUID="5af218fd-721a-460c-8a55-f3cf06d6ac39" TYPE="ext4"    N.B. - I tried editing /etc/fstab by reading  . But still no good


Logistic regression - how good is my model?

I am a beginner in ML so apologize in advance if this sounds silly.  I did a logistic regression on a real data set and I am having problems measuring how well my model fits. I still don't understand how to apply the F1 score in my case.  After performing the error analysis on the cross validation set I got the following values:  Precision:  0.8642534 Recall: 0.8488889 Accuracy:   0.8222222 F1 score:   0.8565022  Are those good values? What do I compare them with? Is this a sign of a strong relationship between my predictor variables and the response variable? The classes on the response variable are not skewed (I am predicting a gender). Any help ... I would much appreciate. Thanks a lot


In Stack Overflow the  badge is awarded for reading the entire about page. Why is the informed badge not awarded on Meta Stack Overflow? We have an about page  too.


Why using vague (or noninformative) priors?

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


When $$ typed in terminal, it results in number as follows:  $ echo $$ 2992   So, I want to know what it outputs and what 2992 indicates?


Python 3.7 - Passing a method that uses self

I'm trying to pass a method to class Fighter. The method requires me to pass the instance of a the fighter class where I would normally just be able to use self. Is there any way to use self in a function that I'm passing to a class.  The constructor looks like this def melee_attack(fighter, target) and I would rather it look like this def melee_attack(self, target): so that when I call it I can just call fighter.attack(target) instead of fighter.attack(fighter, target)


Ambiguity regarding got/gotten usage (in AmE)

I am aware of the way to use got/gotten in BrE vs AmE.  I have come across a phrase which, to my eyes at least, seems one where both can be used (we're talking about AmE now).  He opened his drawer and removed two items. He then came closer and showed me what he'd gotten  Now, following the rule stating that gotten is used when indicating that the subject had acquired/obtained something, the phrase above is obviously correct. But, I was thinking, since we are talking about two items that (in the context) actually belonged to that person (as in, they were in his drawer), would not the form showed me what he'd got also be acceptable?  Note: This question has been marked as a duplicate. It's not, I understand the differences mentioned in the other article. I'm asking about ambiguity - i.e. cases (such as this particular example) where both as possible. Let me try to rephrase the question:  Is it possible to make a subtle difference in meaning as follows?  1) He showed me what he'd got (he showed me the items he had in his drawer)  2) He showed me what he'd gotten (he showed me the items he obtained from his drawer)


What exactly is contrast matrix (a term, pertaining to an analysis with categorical predictors) and how exactly is contrast matrix specified? I.e. what are columns, what are rows, what are the constraints on that matrix and what does number in column j and row i mean? I tried to look into the docs and web but it seems that everyone uses it yet there's no defition anywhere. I could backward-engineer the available pre-defined contrasts, but I think the definition should be available without that.  > contr.treatment(4)   2 3 4 1 0 0 0 2 1 0 0 3 0 1 0 4 0 0 1 > contr.sum(4)   [,1] [,2] [,3] 1    1    0    0 2    0    1    0 3    0    0    1 4   -1   -1   -1 > contr.helmert(4)   [,1] [,2] [,3] 1   -1   -1   -1 2    1   -1   -1 3    0    2   -1 4    0    0    3 > contr.SAS(4)   1 2 3 1 1 0 0 2 0 1 0 3 0 0 1 4 0 0 0


$c\mid a,b\iff c\mid\gcd(a,b)$ [GCD Universal Property]

If $c$ is a common divisor of $a$ and $b$ then $c$ divides the greatest common divisor of $a$ and $b$.  What can we use to prove this?


"sudo apt-get install foo-" causes removing foo package and everything depending on it

While working in command prompt, I accidentally typed following command:  sudo apt-get install python3-   and ubuntu started removing python3 and everything that depends on it (including Firefox and much more). Fortunately I closed that terminal immediately and reverted everything by checking dpkg log file, but I was wondering why an install command should act like remove?   Is it a bug?   Consider the situation that you are looking for a package name (pressing Tab twice) and going through possibilities by pressing Enter key and those Enter keys remain in the keyboard buffer and.... youhaaaa... apt-get is removing the entire installation in front of your eyes.


How come Queuable apex accepts sobjects where as future methods doesn't?

As we know we cant pass sobjects to @future method due stale of data during the processing time,where as not same in case of Queable apex.How exactly its working by using Sobjects here?


How does the force on two positive point charges change when an infinite conducting plane is inserted?

This kind of a configuration struck me when I read  question.   The original question asked how the force on the two charges would change if a metal plate was inserted between them. This question addresses what would happen if it was an infinite plane (those are so much more convenient).  I gave it some thought and the result is rather interesting.   EDIT: This question is very different from the original in that:   The infinite plane is grounded, a plate with definite dimensions does not have to be One can't use image charges with the plate If the plate is uncharged, positive charges will accumulate on the edges and create their own field, in case of an infinite plane these positive charges are at infinity and do not affect the configuration. A plate does not provide electrostatic shielding or a simple boundary region to apply the uniqueness theorem in. The charge distribution on a finite plate is much harder to model.


How to split 7.1 soundcard outputs to 4 stereo outs with ALSA

I have a Xonar DX (CMI8788 driver) 7.1 surround sound card installed on my Ubuntu 11.10 system.   I want to use the outputs of the card as 4 separate stereo outputs and I am struggling with ALSA to get it to work.  This is my asound.conf:  #/etc/asound.conf pcm_slave.eightchannels {         pcm "hw:0,0"            # or "hw:1,0" for the second card         channels 8 } pcm.stereo1 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 2 3 ]         } } pcm.stereo2 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 4 5 ]         } } pcm.stereo3 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 6 7 ]         } } pcm.stereo4 {         type plug         slave.pcm {                 type dshare                 ipc_key 87882222                 slave eightchannels                 bindings [ 0 1 ]         } }   This is my aplay -l output:  $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: DX [Xonar DX], device 0: Multichannel [Multichannel]   Subdevices: 1/1   Subdevice #0: subdevice #0 card 0: DX [Xonar DX], device 1: Digital [Digital]   Subdevices: 1/1   Subdevice #0: subdevice #0 card 1: Intel [HDA Intel], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]   Subdevices: 1/1   Subdevice #0: subdevice #0 card 1: Intel [HDA Intel], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]   Subdevices: 1/1   Subdevice #0: subdevice #0   This is my aplay -L output:   The system seems to completely ignore my configuration. However, I am sure that the config is used, because when i insert a random string at the top, i get a parsing error.  Any help is greatly appreciated.


Avoid vertical spaces before figure to fill the page

I'm writing a latex document which contains a table. This table is doesn't fit the actual page so it's placed in the next page.  The problem is that vertical spaces are added automatically in the previous page in order to fill the page and I want to avoid that from happening.  I use H in order to add the table figure.


Although I have researched on input form label alignment, I need solid suggestion on when to use form label alignment top and when to use left and why?  For example in the below form username and password is left align.     Here user name and password is top align.


Visually stunning math concepts which are easy to explain

Since I'm not that good at (as I like to call it) 'die-hard-mathematics', I've always liked concepts like the  or the , which are easy to understand and explain but are mathematically beautiful at the same time.  Do you know of any other concepts like these?


I was just tempted to vote to migrate a  from stackoverflow to . However it seems only possible to migrate to superuser or serverfault.  Is there a good reason why migrating to other sites is not a good idea?


What is i(t) from circuit with differential equation?

When t<0 Components in circuit are Jt = 4 A, R1 = R2 = 2 Ω, R3 = 4 Ω ja L = 10 H      At t=0 switch K will be closed and i need to figure out what iL(t) is when t=4  So i tried to figure out iL(t) with  differential equation. First i combined R1 and R2 to get R12=1Ω  Then i transformed power supply from current to voltage Et=Jt*R12=J*1Ω =J Then i combined R12 and R3 to get Rz=5Ω Now i can create equation which is  $$E_t=L*\frac{di(t)}{dt}+R_ti(t)          $$ After adding constant i get $$J_t=10*\frac{di(t)}{dt}+5i(t)          $$ First i found the roots $$10r^t+5r=0 -> r=-\frac{1}{2}$$ So for homogeneous part i get $$y^h=C_1*(-\frac{1}{2})^t$$ And for nonhomogeneous part $$J_t=A$$ $$ \frac{dJ_t}{dt}=0 , \frac{d^2J_t}{dt^2}=0$$ So i get $$  10*0+5=A->A=5  $$  For complete equation i get $$ y(t)=C_1*(-\frac{1}{2})^t+5  $$ To figure out what is C1 i use t=0 $$ y(0)=C_1*(-\frac{1}{2})^0+5=4 ->C_1=-1  $$ And now for t=4 i get  $$ y(4)=-1*(-\frac{1}{2})^4+5=4.5   $$ I know this answer isn't correct but i don't know what went wrong Also sorry if its little bit hard to read this, i'm new to this


How do I invite someone to my world in Minecraft PE?

I want to invite my girlfriend to my world so she could visit my fun-fair, how can I accomplish this?


I wrote a program that uses POSIX memory-mapping function (mmap)  The program takes a file (a.dat) and memory-maps it for reading/writing.  Due to errors in the program, every time I run the program a file with some weird names (e.g., ?d?P?^z??d?P?^z?) is created. The error is resolved but I am not able to delete the files.  I am not able to delete it either using command line or by select/deleting from window manager.  So how should I delete it? I'm using Ubuntu 11.04.


Is it okay to favorite one's own question in the hopes that it will influence people's voting?


adding date to calendar is not updating month

I'm working on an android application and new to it.  I have to get date from user and then add 28 days and store it in database.  This is what I have done so far  private void saveDate() throws ParseException {     DatabaseHelper db = new DatabaseHelper(ActivityPeriodToday.this.getActivity());      String pDate = periodDate.getText().toString().trim();     String pTime = periodTime.getText().toString().trim();     String next_expected = getNextExpected(pDate);      boolean isInserted = db.insertPeriodTodayIntoPeriods(pDate, pTime, early_late, pDifference, pType, next_expected);      if (isInserted == true) {         Toast.makeText(ActivityPeriodToday.this.getActivity(), "Saved", Toast.LENGTH_SHORT).show();      } else {         Toast.makeText(ActivityPeriodToday.this.getActivity(), "Could not be saved", Toast.LENGTH_SHORT).show();     }  }  private String getNextExpected(String pDate) {     SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");     Calendar c = Calendar.getInstance();     try {         c.setTime(sdf.parse(pDate));     } catch (ParseException e) {         e.printStackTrace();     }      c.add(Calendar.DAY_OF_MONTH, 28);     return sdf.format(c.getTime()); }   But is code is not incrementing month.     Ex. If user selects 01/11/2016, then date is incremented and is saved   29/11/2016. But if user selects 16/11/2016 then saves date is   28/11/2016 but this should be 14/12/2016


How do I detect running processes using a library package?

This command is doing the rounds for detecting currently running processes using glibc:  lsof | grep libc | awk '{print $2}' | sort | uniq   I find it intensely annoying, since /libc/ matches not only libc, but on my system:  /lib/x86_64-linux-gnu/libcap.so.2.24 /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0 /lib/x86_64-linux-gnu/libcom_err.so.2.1 /lib/x86_64-linux-gnu/libcrypt-2.19.so /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/libcamel-1.2.so.45.0.0 /usr/lib/unity-settings-daemon-1.0/libcolor.so /usr/lib/unity-settings-daemon-1.0/libcursor.so /usr/lib/x86_64-linux-gnu/colord-plugins/libcd_plugin_camera.so /usr/lib/x86_64-linux-gnu/colord-plugins/libcd_plugin_scanner.so /usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libcanberra-gtk3-module.so /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2.11301.0 /usr/lib/x86_64-linux-gnu/libcairo.so.2.11301.0 /usr/lib/x86_64-linux-gnu/libcanberra-0.30/libcanberra-pulse.so /usr/lib/x86_64-linux-gnu/libcanberra-gtk3.so.0.1.9 /usr/lib/x86_64-linux-gnu/libcanberra.so.0.2.5 /usr/lib/x86_64-linux-gnu/libcap-ng.so.0.0.0 /usr/lib/x86_64-linux-gnu/libck-connector.so.0.0.0 /usr/lib/x86_64-linux-gnu/libcolordprivate.so.1.0.23 /usr/lib/x86_64-linux-gnu/libcolord.so.1.0.23 /usr/lib/x86_64-linux-gnu/libcroco-0.6.so.3.0.1 /usr/lib/x86_64-linux-gnu/libcupsmime.so.1 /usr/lib/x86_64-linux-gnu/libcups.so.2 /usr/lib/x86_64-linux-gnu/samba/libcliauth.so.0 /usr/lib/x86_64-linux-gnu/samba/libcli_cldap.so.0 /usr/lib/x86_64-linux-gnu/samba/libcli-ldap-common.so.0 /usr/lib/x86_64-linux-gnu/samba/libcli-nbt.so.0 /usr/lib/x86_64-linux-gnu/samba/libcli_smb_common.so.0 /usr/lib/x86_64-linux-gnu/samba/libcli_spoolss.so.0 /usr/lib/x86_64-linux-gnu/samba/liblibcli_lsa3.so.0 /usr/lib/x86_64-linux-gnu/samba/liblibcli_netlogon3.so.0   I understand that libc is used by pretty much everything, but I'd like to refine this command. Consider its applications for other libraries. How can I do this?  The flaw in this approach, in my opinion, is that the package providing libc may include a whole host of other shared library files (all of which may or may not be covered under the umbrella term that is the library name, like glibc, or libboost-python). Using a word boundary or - to mark the end of libc doesn't really fix this. This may not be a flaw, perhaps, as Braiam points out, since many or all of these .so files may link to a core file in which the flaw resides, as is the case for libc6 on Debian.   If a specific OS/distro is needed, assume Debian Linux.  Also annoying is that this command could be condensed to lsof | awk '/libc/{print $2}' | sort -u.


Is there a synonym for lazy with a positive connotation?

Is there a word or phrase to describe someone who is willing to do extra work in the short term to avoid work in the long run? I have seen "lazy" used for this, but I'd like to know if there's a more precise term.


How could Rhodey fit into the Mark II armor?

I realize this is probably going to come off as a bit silly, but in Iron Man II how could James Rhodes easily don the Mark II armor that was designed to fit Tony Stark?  As you can see in this image (which isn't an "in universe" shot) Tony and Rhodey are roughly the same height, but it appears that Rhodey has a smaller frame than Tony, which would seem to make for an ill fit of the armor, especially for flight.  This issue could of course have been addressed by the Air Force during the retrofit with Justin Hammer.


I am a bit stuck on how to sort the frequency of a word from any text file input.  I was able to code the frequency of each code but I'm not sure how to sort them out from the most frequently occurring word.  This is what I have for the frequency.  For example. I have a file text that read.  This is a test run.  I come with no wrapping or pretty pink bows.  I am who I am from my head to my toes.  I tend to get loud when speaking my mind.  Even a little crazy some of the time. I. am. who. I. am.   the output with this code is.  2   a 2   am 2   am. 1   bows. 1   come 1   crazy 1   even 1   from 1   get 1   head 4   i 2   i. 1   is 1   little 1   loud 1   mind. 3   my 1   no 1   of 1   or 1   pink 1   pretty 1   run. 1   some 1   speaking 1   tend 1   test 1   the 1   this 1   time. 2   to 1   toes. 1   when 1   who 1   who. 1   with 1   wrapping   I was also wondering how can I ignore the period because some same words are being overcounted because of the period.     Scanner input;             try {                 input = new Scanner(file);                  Map<String, Integer> wordCounts = new TreeMap<String, Integer>();                     while (input.hasNext()) {                         String next = input.next().toLowerCase();                         if (!wordCounts.containsKey(next)) {                             wordCounts.put(next, 1);                         } else {                             wordCounts.put(next, wordCounts.get(next) + 1);                         }                     }                      //  report frequencies                      for (String word : wordCounts.keySet()) {                         int count = wordCounts.get(word);                              System.out.println(count + "\t" + word);                     }             } catch (FileNotFoundException e1) {                 // TODO Auto-generated catch block                 e1.printStackTrace();             }


Prove that $$\sum_{n=1}^{\infty}\frac{1}{n^2}=\frac{\pi^2}{6}$$  I have actually got the HINT for this Proof from a very nice book:  The HINT i started with is:  $$\frac{1}{\sin^2 x}=\frac{1}{4\sin^2\left(\frac{x}{2}\right)\cos^2\left(\frac{x}{2}\right)}=\frac{1}{4}\left(\frac{1}{\sin^2\left(\frac{x}{2}\right)}+\frac{1}{\sin^2\left(\frac{x+\pi}{2}\right)}\right) \tag{1}$$  Now we have:  $$1=\frac{1}{\sin^2\left(\frac{\pi}{2}\right)}=\frac{1}{4}\left(\frac{1}{\sin^2\left(\frac{\pi}{4}\right)}+\frac{1}{\sin^2\left(\frac{3\pi}{4}\right)}\right)$$  Applying $(1)$ Repeatedly we get  $$1=\frac{1}{16}\left (\frac{1}{\sin^2\left(\frac{\pi}{8}\right)}+\frac{1}{\sin^2\left(\frac{3\pi}{8}\right)}+\frac{1}{\sin^2\left(\frac{5\pi}{8}\right)}+\frac{1}{\sin^2\left(\frac{7\pi}{8}\right)}\right)$$  So Generalizing we get:  $$1=\frac{1}{4^n}\sum_{k=0}^{2^n-1} \frac{1}{\sin^2\left(\frac{(2k+1)\pi}{2^{n+1}}\right)}$$  EDIT:  Ok let me explain the next step the author of the book has followed: $$1=\frac{1}{4^n}\sum_{k=0}^{2^n-1} \frac{1}{\sin^2\left(\frac{(2k+1)\pi}{2^{n+1}}\right)}=\frac{2}{4^n}\sum_{k=0}^{2^{n-1}-1} \frac{1}{\sin^2\left(\frac{(2k+1)\pi}{2^{n+1}}\right)}$$  My doubt is how a factor of $2$ came outside and why the upper limit has changed?


I need way to find post(s) without featured image set. I use WP as gallery site and for every post I set featured image. I wish to check if there is any post(s) without featured image.  Any code to paste on same custom page template to list post(s) (if any) without featured image?


Expected value of number of heads when number of flips is based on die roll?

In this experiment, we first roll a fair 6-sided die, and let that number be n. Then we flip a coin n times with probability of heads = p. X is the number of heads obtained.  I know that E(X) would be np, but since n is dependent on the die roll, finding the sum of P(X=1), P(X=2), ... manually I got 1/6(p) + 1/6(2p) + 1/6(3p) + ... eventually getting 21p/6 for the mean. Is this calculation correct?  And then to find the variance E(X^2) - (E(X))^2, would it be 91p/6 - 49p^2/4?  Thanks


Getting window back that contains modifiers, etc

I accidentally got rid of the menu/window at the right side of the screen which contains the modifiers button and the textures button (and a bunch of other stuff).  Now it's just the Outliner window over there.  How do I get the default one back?  I tried clicking on the little button that contains a bunch of different window types (Properties, 3D view, etc.) but none of them were the right one.


Why is this quotient of the Gaussian integers a field?

Suppose $\alpha = (1+i)\mathbb{Z}[i]$, where $\mathbb{Z}[i]$ denotes the Gaussian integers. I am trying to show that  $$\mathbb{Z}[i] \big/ \alpha$$ is a field.   My current argument is this: $\ 2 = (1+i)\cdot(1-i)\ $ so $2 \in (1+i)$. Therefore, in $\mathbb{Z}[i] \big/ \alpha,\ $ $2=0$. With this, $1+i$ is also $0$, implying $1=-i \implies 1^2=(-i)^2=-1$. So we have that the quotient is just the $2$-field, $\mathbb{F}_2$.  Is this sufficient? To me it seems to fall short of a proper proof. Any help would be appreciated!


Exception error message with incorrect line number

When an exception is thrown in an Asp.Net web page, an error message is displayed with the complete stack trace.    Example below:       Stack Trace:     IndexOutOfRangeException: Index was outside the bounds of the array.    MyNameSpace.SPAPP.ViewDetailsCodeBehind.LoadView()  +5112   MyNameSpace.SPAPP.ViewDetailsCodeBehind.Page_Load(Object sender, EventArgs e) +67   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +13   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +43   System.Web.UI.Control.OnLoad(EventArgs e) +98   ... ...   The problem is that the Line number displayed does not correspond to the line in my code that originated the exception. In the example above, the stack shows line number 5111, yet my code behind .cs file only has 250 lines!  The aspx page is stored in a SharePoint site and the Assembly with the code behind has been deployed to GAC. Also, I've compiled in Debug mode. Given the settings above, how can I find out what line in my code caused the Exception?    Clarification as pointed out by :     In Release mode the number in front of the exception is NOT the line of code. Instead it's an offset to the native compiled code, which doesn't have any meaning to humans. More about this here:       In debug mode the PDB file will automatically map the native code offset to your .cs line in code and the number displayed WILL be the corresponding line in code.


Need a command sequence that will move files from one directory to another based on a particular year?

I'm looking for a sequence of commands (one liner would be ideal) which will identify all the files created in particular year, and move the resulting files to another directory.


Find $\displaystyle \int x^ne^xdx$.   I haven't been able to figure this out. Do I just keep repeatedly applying integration by parts?


Increase font size in pop up dictionary window in OS X Sierra

On my Macbook Air running Sierra 10.12.5, there is no longer a Dictionaries directory under /Library, so the below suggested fix no longer seems to apply:   Is there still a way to do this?


How to prove that the set of rational numbers are countable?

Can any one tell me how to prove that the set of rational numbers are countable? Prove give me a prove?  Thanks.


Why is "His theory got disproved" bad English?

I've been told that "His theory got disproved" is not correct English (even in colloquial speech), and that I should say "His theory has been disproved" instead. I usually use "to get" as a substitute for "have been" (e.g. "He got thrown out of school" instead of "He has been thrown out of school"), but why is that not possible in the sentence mentioned in the title (or is it not possible at all, and I've been using "to get" wrong all the time)?


Issues when upgrading Lenovo Ideapad Flex 2 14 with an SSD

After purchasing a Lenovo Ideapad Flex 2 14, I tried to upgrade it and replaced the HDD with an SSD from my older laptop. After putting in the SSD, I encountered a numerous amount of problems.  First, the Windows installation program didn't see the SSD, even the Diskpart utility didn't see it, so I decided to install Ubuntu instead, which was installed successfully. Everything was fine, but after messing around with the BIOS, the laptop wouldn't load the OS unless I first went into BIOS and exited it.  Windows still never saw the SSD, even after I installed Ubuntu on it and then tried to install Windows again. What could be the problem? Also, the HDD that came with this laptop works just fine, and the SSD works in another laptop just fine, too. The SSD is Intel 335 series 240GB. I'm gonna try to install Windows 7 a little later and see if that will work, but other than that I've already wasted an entire day trying to figure it out.


Null Pointer Exception Orthographic Camera

im currently creating a Menu Screen for my libgdx Game. I want to draw a Rectangle to dectect if my Menu Play Button is touched. Unfortunately by unprojecting the camera i get a Exception even tough i initialized the camera and checked muliple times for mistakes. Dont wonder about the OrthoCamera Class it just inheriting from the OrthographicCamera class and has some additional Functions.   Menu Class:  public class MenuScreen extends Screen {   private OrthoCamera cam;  private PlayButton pb; private ExitButton eb; private Background bg;  @Override public void create() {     // TODO Auto-generated method stub     cam = new OrthoCamera();      cam.resize():      pb = new PlayButton();      eb = new ExitButton();      bg = new Background();   Play Button Class:  public class PlayButton  {  Texture texture; Sprite sprite;  public PlayButton(){      texture = new Texture("button.png");      texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);     TextureRegion region = new TextureRegion(texture, 59, 52, 300,250);      sprite = new Sprite(region);     sprite.setSize(sprite.getWidth() / 2, sprite.getHeight() / 2);     sprite.setOrigin(-sprite.getWidth() / 2, -sprite.getHeight() / 2);      sprite.setPosition(MyGdxGame.WIDTH / 2  - 317, MyGdxGame.HEIGHT /2 -110);     }      public void render(SpriteBatch batch) {     // TODO Auto-generated method stub     System.out.println("es wird gerendert");     sprite.draw(batch); }      public void update(OrthoCamera cam) {          // Source: http://stackoverflow.com/questions/24834399/how-to-detect-if-a-texture-has-been-touched-libgdx-without-scene2d          System.out.println("update");          if(Gdx.input.isTouched())          {        Vector3 tmp = new Vector3(Gdx.input.getX(),Gdx.input.getY(),0);        cam.unproject(tmp);       Rectangle textureBounds=new Rectangle((MyGdxGame.WIDTH / 2-317),            (MyGdxGame.HEIGHT /2 -110), 300, 250 );             if(textureBounds.contains(tmp.x,tmp.y))               {                ScreenManager.setScreen(new GameScreen());               }          }            }    }  @Override public void render(SpriteBatch batch) {      batch.begin();     bg.render(batch);     pb.render(batch);     eb.render(batch);      batch.end();  }    public void update(OrthoCamera cam) {     // TODO Auto-generated method stub     //cam.update();     pb.update(cam); }        If i click on the screen the Game crashes and the console says:         Exception in thread "LWJGL Application" java.lang.NullPointerException at buttons.PlayButton.update(PlayButton.java:58) at screen.MenuScreen.update(MenuScreen.java:109)


I don't have a .Xauthority file in my home folder. I want to create it, please tell me the steps to do so in ubuntu 10.10.  Thank You!


MySQL phpMyAdmin not showing in web browser in Ubuntu LAMP server

LAMP is not installing in Ubuntu 16.04. When I typed localhost/phpmyadmin in Firefox it showed this message:  404 Not Found The requested URL /phpmyadmin was not found on this server.   Apache/2.4.18 (Ubuntu) Server at localhost Port 80


How to execute file on pendrive with FAT file system?

I want to execute file ex from my memory stick with FAT file system. I typed:  /media/user/844E-0486$ sudo chmod 777 ex   However still I haven't got permission to execute it.   /media/user/844E-0486$ ls -l total 8 -rw-r--r-- 1 user user    0 lut 18 17:46 ex drwxr-xr-x 2 user user 8192 lut 18 17:44 System Volume Information   Is there any way to run it?


Stack Overflow: Friends and question precomments

Today an idea came to me. What if we could have Friends in Stack Overflow (like the relations in LinkedIn). And when we would post a question they would be the first ones to know. If we have misspellings or syntax errors in our questions they will be the first ones to see them and they would inform us, or they could help us correct them.


Unable to aquire valid session id using an apex class

I wrote my own apex class with the following code:  @AuraEnabled     public static String getSessionId(){         return UserInfo.getSessionId();     }   This code works when I import it into my Lightning component. I retrieves a session id but it is invalid. If i try to do the same thing inside an apex page it works perfectly and it gives me a working session id. How can I retrieve a working session id?


arrangement of $n$ oranges and $n$ apples around a circle

what is the total number of distinct arrangements of $n$ oranges and $n$ apples around a round table? I have no idea how to go about.


how do I write an ISO file to disk under Ubuntu 16.04?

I downloaded Windows 7 Home Premium and want to burn the ISO image to DVD. I right click on the ISO file but "Write to Disk" does not come up.  I am running Ubuntu 16.04.  What do I do, please?


Ubuntu 14.04 LTS live USB boot error (gfxboot.c32:not a valid COM32R image)

I downloaded Ubuntu 14.04 (64 bit) lts. I made a bootable usb stick. But I keep receiving this error message upon booting:  SYSLINUX 4.04 EDD 20110518 Copyright (C) 1994-2011 H. Peter Anvin et al Unknown keyword in configuration file: gfxboot.c32: not a COM32R image


Is the Hogwarts Express visible to muggles when it travels across Britain?

Can non-magical persons see the Hogwarts Express during its journey to and from Hogwarts?


Time Difference between two Strings by converting it to Date Format in android

I have to find time difference between two String values.I used the following code in my app,  public String diff(String first,String last) {     SimpleDateFormat format = new SimpleDateFormat("hh:mm:ss aa");     Date  d1 = null;     Date d2 = null;     try {         d1 = format.parse(first);         d2 = format.parse(last);     } catch (ParseException e) {         e.printStackTrace();     }     long diff = d2.getTime() - d1.getTime();     int diffMinutes = (int)diff / (60 * 1000);     int diffHours = (int)diff / (60 * 60 * 1000);     String res=Integer.toString(diffHours);     String res1=Integer.toString(diffMinutes);     String fin= res+res1;     return fin; }   This is a function which accepts my two Strings and returns a String(Time Diff) which i can use in my class. But my app force closes when i am calling this function on a button click.  Here is the Logs!  Process: mypackage.com.work, PID: 3551     java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String mypackage.com.work.UpdateTracker.diff(java.lang.String, java.lang.String)' on a null object reference             at mypackage.com.work.UpdateTracker.onClick(UpdateTracker.java:138)             at android.view.View.performClick(View.java:4756)             at android.view.View$PerformClick.run(View.java:19749)             at android.os.Handler.handleCallback(Handler.java:739)             at android.os.Handler.dispatchMessage(Handler.java:95)             at android.os.Looper.loop(Looper.java:135)             at android.app.ActivityThread.main(ActivityThread.java:5221)             at java.lang.reflect.Method.invoke(Native Method)             at java.lang.reflect.Method.invoke(Method.java:372)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)`  Here is the code of calling that function           String in_db=txtTime.getText().toString();             String out_db=txtTime2.getText().toString();             String d=up.diff(in_db,out_db);   If I just comment this and insert just a hard coded String,its working fine!.So I think no problem with DB code  Help me out to figure this!!  Thanks in advance


Javascript: How to compare a string against an array of strings

I want to be able to check if a string is equal to any of the strings inside an array. I know you can check multiple parameters like so:  let value = 'sales';  if ( value == 'sales' || value == 'broker' ){}   But I need to use an array like:  let value = 'sales'; let array = ['sales', 'broker'];  if ( value == array ){}   How can I do this?


User account doesn't appear on first login screen

After restarting my computer when I am presented with the initial login screen (the light gray one with the restart and shut down buttons), I see only two of my three user accounts.  If I log in with one of these accounts, I can see, and log in to, the third (missing) account by either:   Logging off (Apple > Log Out...) to reach the second login screen (the dark gray one with sleep/restart/shut down buttons) Clicking on the fast user switching menu.   How can I restore this account in the initial (light gray) login screen?  I tried repairing disk permissions to no avail.  If I create a new account, it does show up in the list.


I trying to show  $$ \lim_{x\to\infty} \left(\frac{x}{x+1} \right)^x $$  I know the answer using wolfram or a calculator,  but I stuck trying to figure out how to apply L'hopital.


"have read" vs "read" - Is this simple present vs present perfect?

I have read an interesting book yesterday and underlined the new words which are simple but effective.    Present perfect tense specifies an action that has recently finished. The above sentence is present perfect if I am using have (I believe).  But in my book have is given as error and the sentence is corrected by removing have. I believe by removing have we are changing the tense to simple present. But simple present does not indicates an activity that is finished.  I am not sure why have is error in the above sentence. Please suggest.


Samba - Create Subdirectory Shares with their own permissions

I have a Samba share containing many folders like this:  share   - folderA   - folderB   - folderC   - folderD   There are around 20 users accessing those shares. Every user can have their individual access to some of the directories, for example Ben can access folderA and folderC, but not folderB and folderD. Jenny can access folderB and folderC, and so on.  I don't want the users to mount each folder they need. I want them to mount the folder "share" which contains all the subfolders. The access is then limited by setting the linux permissions.  I created a group for every subdirectory and added the users to those groups. The access control works perfectly for existing files. But whenever a user creates a file in a subdirectory, it is denied for every other user having the permission for read/write access in that directory. To solve this, I played around with the samba masking but can't get it to work.  My Samba conf looks like this:  guest ok = no  [global] workgroup = WORKGROUP security  = user encrypt passwords = yes  [Share] path        = /var/samba valid users = @everybody read only   = no writeable   = yes  [folderA] path        = /var/samba/folderA valid users = @users_folderA read only   = no writeable   = yes  create mask          = 770 directory mask       = 770 force directory mode = 770  force group = users_folderA  [folderB] path        = /var/samba/folderB valid users = @users_folderB read only   = no writeable   = yes  create mask          = 770 directory mask       = 770 force directory mode = 770  force group = users_folderB  [folderC] path        = /var/samba/folderC valid users = @users_folderC read only   = no writeable   = yes  create mask          = 770 directory mask       = 770 force directory mode = 770  force group = users_folderC  [folderD] path        = /var/samba/folderD valid users = @users_folderD read only   = no writeable   = yes  create mask          = 770 directory mask       = 770 force directory mode = 770  force group = users_folderD   So obviously every user is in the group everybody, so they can mount the share with the subdirectories. The access for each subdirectory is working perfectly fine. But whenever Ben creates a file in folderC, the file gets the file permissions -rwxr--r-- but it should be -rwxrwx---  I think the shares for the individual folders don't work at all because I tried to set writeable = no and read only = yes to test it. Restarted smbd and nmbd and remounted the network share (in Windows 10). The users were able to create files and modify their own.  This runs on a raspberry pi with raspbian. The hard drive with the files is formatted as ext4 and mounted via fstab.


Wait for question to close before rejecting migration

question was recently asked on superuser, flagged as off topic and migrated to WebApps StackExchange (), all of which makes perfect sense, since the question is about a Web app, Google Hangouts. On WebApps, the question was put on hold because it was unclear, which again is true. If I understand correctly, putting the question on hold automatically caused the migration to be rejected.   However, I believe that the purpose of putting a question on hold is to allow for time for an edit to be made to fix the problem before the question is closed. If the question should be migrated, but still is not a complete question, shouldn't it be kept around on the migrated site as editable?  To me, it would make more sense to keep the migration until the question is closed, and at least make the question editable. Of course, the question linked is not the perfect example, but if a question clearly should be migrated but also should be edited, doesn't it make more sense to allow edits to be made while the question is on hold or even closed, at least until the question is deleted?   EDIT: Seems like a good resource for migration information is


Is my solution for the proof of $x^2+xy+y^2 > 0$ correct?

The problem requires you to prove: $x^2 + xy + y^2 > 0$ assuming that $x$ and $y$ are not both zero  I made use of a property proven earlier ($x^3 - y^3) = (x-y)(x^2 + xy + y^2)$) and rewrote $x^2 + xy + y^2$ as $\dfrac{x^3 - y^3}{x-y}$. Then I simply tested for the three cases $x = y, x > y, x < y$  For the last two, it's easy to show that the condition holds. But when I consider $x = y$ then the statement that I got evaluates to zero, which is clearly not greater than zero, even though the statement $x^2 + xy + y^2$ should not be zero.  Edit: One stupid mistake. $x = y$ is undefined as it requires division by zero. What do I do from here?


Variable substitution with an exclamation mark in bash

I have the following lines in my .cfg bash script file  DDF_SOURCE="siebel_DATA_DATE_FORMAT" DATA_DATE_FORMAT=${!DDF_SOURCE}   how is ${!DDF_SOURCE} evaluated? It would be !siebel_DATA_DATE_FORMAT, which doesn't make sense to me.