creating a static library containing templates

I'm developing static library for matrix operations using templates wherein we can perform basic matrix operations on various datatypes(short, int, long, long long, float, double, long double). But as far as I know when using templates, class declaration and definition can't be kept in separate files(.h and .cpp files). If this is the case how do I create the library without exposing my implementation code(only class syntax declaration and library has to be provided to an other user). This is what I've written so far  MatrixClass.h  #ifndef __MATRIXCLASS_H__ #define __MATRIXCLASS_H__  #include<iostream> #include<vector>   template<typename T> class CMatrix {  public:     CMatrix();     ~CMatrix();      unsigned long rows;     unsigned long cols;      std::vector<std::vector<T> > data;      void setMatrixSize(unsigned long rows, unsigned long cols);     void printMatrix();     void add(CMatrix<T>& A, CMatrix<T>& B);     void sub(CMatrix<T>& A, CMatrix<T>& B);     void mul(CMatrix<T>& A, CMatrix<T>& B); };   template<typename T> CMatrix<T>::CMatrix() {     this->rows = 0;     this->cols = 0;      data.clear(); }   template<typename T> CMatrix<T>::~CMatrix() {     this->rows = 0;     this->cols = 0;      data.clear(); }   template<typename T> void CMatrix<T>::setMatrixSize(unsigned long rows, unsigned long cols) {     this->rows = rows;     this->cols = cols;      data.clear();     data.resize(cols, std::vector<T>(rows, 0)); }   template<typename T> void CMatrix<T>::printMatrix() {     for(unsigned long i = 0; i < rows; i++) {         for(unsigned long j = 0; j < cols; j++) {             std::cout << data.at(i).at(j) << "\t";         }         std::cout << std::endl;     }  }   template<typename T> void CMatrix<T>::add(CMatrix<T>& A, CMatrix<T>& B) {     if((A.rows == B.rows) && (A.cols == B.cols)) {         for(unsigned long i = 0; i < rows; i++) {             for(unsigned long j = 0; j < cols; j++) {                 data.at(i).at(j) = A.data.at(i).at(j) + B.data.at(i).at(j);             }         }     } }   template<typename T> void CMatrix<T>::sub(CMatrix<T>& A, CMatrix<T>& B) {     if((A.rows == B.rows) && (A.cols == B.cols)) {         for(unsigned long i = 0; i < rows; i++) {             for(unsigned long j = 0; j < cols; j++) {                 data.at(i).at(j) = A.data.at(i).at(j) - B.data.at(i).at(j);             }         }     } }   template<typename T> void CMatrix<T>::mul(CMatrix<T>& A, CMatrix<T>& B) {     if((A.cols == B.rows) && (rows == A.rows) && (cols == B.cols)) {         for(unsigned long i = 0; i < A.rows; i++) {             for(unsigned long j = 0; j < B.cols; j++) {                 for(unsigned long k = 0; k < A.cols; k++) {                     data.at(i).at(j) += A.data.at(i).at(k) * B.data.at(k).at(j);                 }             }         }     } }  #endif


For $n=1,2,...,$ let $f_n(x)=\frac{2nx^{n-1}}{1+x},x\in[0,1].$ Then $$ \lim_{n\to \infty}\int_{0}^{1}f_n(x)dx=?$$  Here $f_n(1)=n$. So the limit function of $f_n(x)$ is not continuous.  Also I was calculating $$\int_{0}^{1}\frac{x^{n-1}}{1+x}dx$$ but I wasn't able to do that.  Any help is appreciated. Thank you.


Failing Review Audit because I added a comment that it was a duplicate post

I reviewed a post in the Super User First Post queue and thought it sounded familiar.  I searched for the subject and found a previous post with the same question.  I then  added a comment recommending they search for previous questions and gave them a link to the duplicate question and answers.  Since the audit changed the name of the user, there was no way for me to know otherwise.  So why would I fail then?


Split Line at Points not splitting at every point in ArcGIS for Desktop?

Why does  not split at every point encountered, even if run in an iterative fashion?  Following the suggestions of a thread here and several others, I made a set of points in order to split polylines at specified intervals. In order to do this, I used linear referencing to turn my lines into routes. Then, I exported the attribute table, divided each length by 5, and set points at multiples of 1/5 the length of the line. I used this as the event table to create a layer of events. So, each line has 4 equally spaced points along it, and I thus ultimately need the 5 segments separated by those points.  Curiously, though, when I try to do the second part "Split Line at Point," it seems that only one point is used on a given line at a time, and I'm not sure how it chooses the point (maybe order in its attribute table?) I could run the tool multiple times, but this doesn't seem to solve the problem either. For example, I could see how it would continue splitting segments as more segments are generated, but on e.g. the 4th run I see that some lines are still only split 3 times, even though there is a point within a line segment that was never split and existed before I ran the tool. I'm not sure how the splits are generated, but in any case, it doesn't seem to do what I want it to do, which is produce a split at "each" point.  What should I do to split lines at ALL points along the line?


Context Around this Code: I am making a schedulable class run each Sunday to track a couple of metrics important to the team.   Question: I am looking to consolidate DML operations and a big part of this is understanding pass by reference vs pass by value.  I want to pass the salesOps user object to the method SDREfficiencyLastWeek. I made the return type void, because I figured that I will be passing this by reference and I can make all the updates in the method without having to anything.   Why I am confused:    I read the above article and am thrown off by the following statement:  "Non-primitive data type arguments, such as sObjects, are also passed into methods by value. "   If the object is indeed passed by reference, then the query for the salesOps user in my code should be sufficient enough to edit all fields on that object without actually having to state each field in the query.  global class SDREfficientMetricsSchedulable implements Schedulable  {     global void execute(SchedulableContext sc)      {         User salesOps = [SELECT ID FROM USER WHERE id = '0056A000002Z3p9QAC'];         List<String> queries = new List<String>();          String contactsWorked_lastWeek  = 'select count(id) results from contact where LastActivityDate = last_week';         queries.add(contactsWorked_lastWeek);          String demosSet_lastWeek            = 'select count(id) results from form__c where CreatedDate = last_week';         queries.add(demosSet_lastWeek);          String demosCompleted_lastWeek  = 'select count(id) results from opportunity where (stagename = \'Unqualified Demo Completed\'  OR stagename = \'Qualified Demo Completed\' )  and RecordTypeId = \'0126A000000yudDQAQ\' and CloseDate = last_week';         queries.add(demosCompleted_lastWeek);          String qualifiedDemos_lastWeek  = 'select count(id) results  from opportunity where RecordTypeId = \'0126A0000004Ao6QAE\' and isclosed = false and  SDR_Owner__c != null and CreatedDate = last_week';         queries.add(qualifiedDemos_lastWeek);          String closedWon_lastWeek       = 'select count(id) results  from opportunity where RecordTypeId = \'0126A0000004Ao6QAE\' and iswon = true and  SDR_Owner__c != null and CloseDate = last_week';         queries.add(qualifiedDemos_lastWeek);            SDREfficiencyLastWeek(queries, salesOps);          update salesOps;     }       public void SDREfficiencyLastWeek(List<String> queries, User salesOps )     {        }  }


d'Alembert-like functional equation: $f(x+y)+g(x-y)=\lambda f(x)g(y)$

The D'Alembert functional equation is $f(x+y)+f(x-y)=2f(x)f(y)$. Let $f:\mathbb{R}\rightarrow\mathbb{R}$ satisfy the functional equation for all $x,y\in\mathbb{R}$. It's well known that $f$ is of the form $f(x)=\frac{E(x)+E^∗(x)}{2}$, for some $E:\mathbb{R}\rightarrow\mathbb{C}$. How can I use this functional equation to solve the following problem?     Let $\lambda$ be a nonzero real constant. Find all functions $f,g:\mathbb{R}\rightarrow\mathbb{R}$ that satisfy the functional equation $f(x+y)+g(x-y)=\lambda f(x)g(y)$   for all $x,y\in\mathbb{R}$.


What does $\lim\limits_{x \to \infty} f(x) = 1$ say about $\lim\limits_{x \to \infty} f'(x)$?

Given that $f$ is differentiable, what does $\lim\limits_{x \to \infty} f(x) = 1$ say about $\lim\limits_{x \to \infty} f^\prime(x)$ ? Intuitively I feel that it's $0$.  I attempted to solve this by trying to evaluate $$\lim_{x \to \infty} \lim_{h \to 0} \frac{f(x + h) - f(x)}{h} $$ by trying to interchange the limits after showing that $\frac{f(x + h) - f(x)}{h}$ converges uniformly as $x \to \infty$. But I couldn't proceed further.  Trying to work backwards, as a specific example, $f(x) = \arctan(x)$ came to my mind. It's derivative certainly goes to $0$ as $x \to \infty$. Doesn't this show that $\frac{f(x + h) - f(x)}{h}$ converges uniformly to $0$ as $x \to \infty$ ?  I'm totally confused! I would really appreciate if anyone told me what I am doing wrong.


I'm trying to add every task which has been created in constructor  static private int Id = 0; private int id = 0; private Date StartDate; private Date EndDate; private static ArrayList<Task> Tasks; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");   public Task(java.util.Date StartDate, java.util.Date EndDate) {     try{         this.setStartDate(StartDate);         this.setEndDate(EndDate);         setId(Id++);          System.out.println(this.id + this.EndDate.toString() + this.StartDate.toString());         Tasks.add(this);     }     catch(Exception ex){         System.out.println(ex);     } }   It throws NullPointException.  I couldn't find out a way to solve this.  Thanks in advance!


In my Chrome on Ubuntu 16.04 LTS, Devanagari fonts are not displayed correctly.    How can I correct it?


I am working in my own git-branch in a big project. Once I have a stable feature I send a pull request to get my updates into master.  Other colleagues however have their own branches and we have a blessed repo that we merge into our own branch to have the current newest stable global state.  Now here is the problem: When I fetch and then merge the blessed repo into my own branch, then I encounter a merge conflict (A prompt opens and just states -> conflicting)  Now the issue is that this happens for all the pom.xml (basically my whole project explorer is glowing red with merge conflicts in all the pom.xml, even on ones I never touched and are not relevant for my files)  If I open a pom.xml there are merge annotations like <----- HEAD and so on.  Now how do I resolve this? Do I really have to manually go into each and every file and edit this? Can't I just have the merge overwrite all my stuff ... except for the few classes I edited?


How to update existing curly brace positions in IntelliJ IDEA?

I've been given Java code by others which use curly braces on new lines, and I'd like them on the same line after I import the file without having to change them line-by-line?  How do I do it?  private void someMethod() {    //Some code here }   I want it to look like this:  private void someMethod(){    //The same code }   Thanks!


How did Han bypass a planet's shields in hyperspace and then land?

As far as I understand, gravity wells prevent hyperspace travel.   What's the in-universe explanation for how Han was able to hyperspace travel through the First Order's shields, and even land successfully, in The Force Awakens?


I have a problem with inserting a comment in lstlisting environment.  LaTeX says:     ! Package inputenc Error: Unicode char \u8:�\expandafter not set up   for use with LaTeX.      See the inputenc package documentation for explanation.      Type H  for immediate help.      ...      l.49 \%komentář      Your command was ignored.   I want the character % to start a comment which ends at end of line.  I tried \lstset{morecomment=[l]\%} but I get the error above.  Here is a :  \documentclass[12pt,a4paper,oneside,openany,titlepage]{report} \usepackage[utf8]{inputenc} \usepackage[czech]{babel} \usepackage{listings} ... \begin{document} \lstset{ language=Matlab, comment=[l]{\%} } ... \begin{lstlisting}[title=Výpočet] %komentář code \end{lstlisting} ... \end{document}


How can I catch up with the story in Magic: the Gathering?

I'm trying to figure out how far back I need to go to get the full picture of the current Magic: the Gathering story.  There's a full list  which seem to be split into various cycles not all of which are relevant, and is missing the web articles.   For the sake of simplicity, I'm interested up until the Theros series which seem to  the last full length novels, then I can read the web article stories. In less there're relevant articles from before the Theros series.


Why can't we compare a float value with some numerical value

I tried the below code i assigned a float value to variable and i compared it with a floating point value but it did not gave the desired output. Here as a==13.30 is true i thought it will print "a" instead it prints "5"  #include<iostream> using namespace std; int main() {     float a=13.30;     if(a==13.30)     cout<<a;     else     cout<<"5";  }   output is "5" not "a"


What format would the verb has to be singular/plural/depends? I have been using plural for this type of sentence, but I couldn't find any rules about this.  For example, does John have a cat? If does is omitted then I would be John has a cat. Do you change the verb has to plural form, have, if you put does in front of the sentence?


$Γ \models α $if and only if $Γ ∪ \{(¬α)\}$ is not satisfiable.

Let $\Gamma$ be some set of well formed formulas and let $\alpha \in \mathrm{WFF}$. Prove the following statement:   $\Gamma \models \alpha$ if and only if $\Gamma \cup \{(\lnot\alpha)\}$ is not satisfiable.   So far I have done this:      edit: whatever I did was wrong, so can you tell me what could be done?


What are Apple's policies on font sizes for iPhones, especially 6/6+?

Trying to understand how font sizes in 3rd-party apps will be different on iPhone 6/6+ compared to 5S when all apps get iPhone 6/6+ support:   What are Apple's guidelines for app developers in terms of font sizes for 6/6+? How are they different compared to earlier iPhones? How strictly are those guidelines enforced via app moderation (or any other means)? Should all apps effectively demonstrate the same font size for similar UI elements, or they are allowed to decide on the size individually? Should DisplayZoom be strictly supported by every app developer? Should Dynamic Type be strictly supported by every app developer?


Java - Method outputs not returning new value?

I'm trying to figure out some issue I'm having.  Basically what my issue is, is that the values that are being returned by my methods aren't right.   I have the print line statement just to be sure it's working but it always returns 1, even when I call to another method that should return a String.  The variable current_number/image_number is supposed to be updated every time I call to a method (If I keep calling to forward starting from 1, I should be getting 2, 3, 4 etc..).   This is my code  public class Menu {      static final int MIN_NUMBER = 1;     static final int MAX_NUMBER = 8;     static int image_number = 1;     static boolean exit;      public static int forward(int current_number) {         if (current_number < MAX_NUMBER) {             current_number++;         } else if (current_number >= MAX_NUMBER) {             current_number = MIN_NUMBER;         }         return current_number;     }      public static void showMenu() {         int current_number = image_number; // global int that equals 1          while (!exit) {             Scanner input = new Scanner(System.in);             Random rand = new Random();             int randomvalue = rand.nextInt(MAX_NUMBER) + MIN_NUMBER; // used in another method              System.out.println("1. forward"); // menu with options             System.out.println("2.");             System.out.println("3.");             System.out.println("4. Exit");             System.out.println(current_number);              int choice = input.nextInt();              switch (choice) {                 case 1:                     forward(current_number);                     break;                  case 4:                     exit = true;                     break;             }         }     } }


Lately, I've been finding my horse to be more of an annoyance to use than an asset to have.  But, maybe I'm missing something that could resolve this - or maybe it's the game that's missing this.  I'm hoping someone here can help.  First, there's the bit about not being able to fight while on horseback.  Okay, I'll acknowledge that's a game limitation and we have to live with it.  But, it's still no less annoying and actually leads in to the problem I'm really asking about here.  There's often times where I'll get off my horse to do battle, or perhaps explore something in the area that's caught my eye.  Then, in the course of natural events, I'll shortly find:   I've wandered too far from my horse, in too many odd directions, to quickly find my way back to it. OR   Something's attacked or otherwise spooked the horse into wandering from where I'd left it.     In either case, I'm then left out in the middle of nowhere (a description that probably fits about 85% of the land area in Skyrim) and often times I was well on my way to somewhere that I don't have a nearby Fast Travel location I can jump off from to get to.  My options here are:   Wander around aimlessly and hope I stumble across my horse. OR Walk the rest of the way to my destination. OR Fast Travel to the nearest available location (which may not really be so near) and start my trip over again with my horse, who's then magically teleported nearby.   Two much more ideal options would be:   Whistle for my horse to come to me.  (Must be within a certain range of the horse.) OR   Add a horse tracker to my compass.   Are these features that I'm missing, or features that the game is missing?  Does anyone have other suggestions as to how I can avoid these situations, or better recover from them?


I have eleven ciphertexts that were encrypted with the same key (which I don't know). I want to decrypt the last ciphertext. I read similar question like  but I can't solve my problem with their answer.  I'm new in Crypto can anyone tell what can I do?  I know when XOR two ciphertext (Let's assume that the plaintexts consist only of spaces and ASCII letters) if both of them were space the result is null. If one of them was space and another was ASCII we have a new ciphertext. If both of them were ciphertext we have new word that is XOR of orginal message but how can I reveal the plain-text?


Setting background-image using jQuery CSS property

I have an image URL in a imageUrl variable and I am trying to set it as CSS style, using jQuery:  $('myObject').css('background-image', imageUrl);   This seems to be not working, as:  console.log($('myObject').css('background-image'));   returns none.  Any idea, what I am doing wrong?


Prove that $v_1, \dots v_n$ is a basis of V.

Prove that if $e_1, \dots e_n$ is an orthonormal basis of $ V$ and $v_1, \dots , v_n$ are vectors in $ V$ such that $$\|e_j - v_j\| < \frac{1}{\sqrt{n}}$$ for each j, then $v_1, \dots v_n$ is a basis of $V$.  I have fiddled around with this for a while now unfortunately nothing came close, so I'll just say I have no idea how to do this. Help :(?


Is a function increasing if the derivative is positive except at one point of an interval?

Let $f: \mathbb{R} \to \mathbb{R}$ be differentiable on $(a,b)$. Suppose $f' > 0$ on $(a,b)$ except at a point $c \in (a,b)$ (that is, $f'(c) \leq 0$).  Is $f$ increasing on $(a,b)$? Must $f'(c)$ be zero, or can it be negative?  Clearly $f$ is increasing on $(a,c) \cup (c,b)$ but I'm not sure about how the value at $c$ compares with the values at other points. And I think $f'(c)$ must be zero: If $f'(c) < 0$ then for small positive $h$ we have $\frac{f(c+h) - f(c)}{h}$ is also negative (by definition of the derivative as a limit of this ratio), so $f(c+h) - f(c) < 0$. Since $f'$ is positive on $(c,c+h)$, the Mean Value Theorem implies that $f(c+h) - f(c) = f'(d)h$ for some $d \in (c, c+h)$, and $f'(d)h$ is a product of two positive numbers, hence positive. So $f(c+h) - f(c) > 0$, a contradiction.


Plugin translations files outside plugin directory?

I'm using the excellent Codestyling Localization plugin to translate themes and plugins.  But there's a problem when translating plugins, namely that the translated strings are saved to wp-content/plugins/gravityforms/languages/gravityforms-LANG-CODE.* for example.  This resulting in overwritten translations for subsequent plugin upgrades.  Is it possible to move the language files to another location? For example wp-content/languages or something else?


I want use db_update to update a field,instead of update a field with new value (replace) , I want add a value to last value,  I know I can do it with mysql command    UPDATE `databasename`.`tablename` SET fieldB = fieldB + 1 WHERE fieldA='2';   but I use below code, It is not add to credit field, only replace it with $credit value,  anybody know where is my problem and how can I achieve this job?  $cr_update_no = db_update('rah_cc_credit') // Table name no longer needs {}                 ->fields(array('uid' => $user->uid,'update_date'=>REQUEST_TIME,'last_code'=>$code ,'credit' => 'credit'+ $credit))                 ->condition('uid', $user->uid, '=')                 ->execute();


How can I change the data usage cycle for Mobile data?

The mobile data cycle (Settings -> Data usage) looks quite arbitrary. Since I have changed my data plan, now the new cycle should start at the first day of the month instead of the 6th.  How can I change the begin of a data cycle? I cannot seem to find some edit button, though I vaguely remember seeing it at the Data usage cycle menu.  Affected versions: Android 4.0, 4.2.2, 4.3.1.


I replaced a non-protected receptacle with a GFCI type and now my circuit tester trips the GFCI as soon as it is plugged in.  The receptacle tested fine before replacement, ground, neutral, hot, etc.  I've double checked the hot/neutral/ground connections.  I've also tried it with the downstream load disconnected.   The GFCI trips the moment I plug in my circuit tester (before pushing the test button).  Otherwise things check out OK.  I can plug in a power tool without it tripping.  Also, the integrated test/reset button work correctly.   I've read that the integrated test button is the only one that truly matters. Is this correct or should I be concerned? I'm sure a home inspector will red flag this if their tester has the same result.  Update  My tester is by "Commercial Electric".  The tester is one of the palm sized three prong type with three leds to indicate the condition of the circuit and a button on top to test GFCI. It's new from the local box store.


How can I dynamically hide a button from a view?

I would like to dynamically hide a button in one of my views depending on a certain condition.  I tried adding some code to the view controller's -viewWillAppear method, to make the button hidden before displaying the actual view, but I still don't know how to do that.  I have a reference to the button through an IBOutlet, but I'm not sure how to move forward from here. For reference, this is a UIBarButtonItem instance.


I have made a custom command which includes an image if it exists and writes an missing file text if it does not. The problem is that if I use underscore in the file name or path it is does not print the path right.  \documentclass[a4paper, 10pt]{report}  \usepackage[utf8]{inputenc} \usepackage[export]{adjustbox}  \newcommand{\includegraphicsmaybe}[2]{     \IfFileExists{#2}         {\includegraphics[valign=c, width=#1]{\detokenize{#2}}}         {\fbox{\parbox[c][#1][c]{#1}{\center \textbf{File not found}\\ \detokenize{#2}} }}}  \begin{document} \centering \includegraphicsmaybe{0.4 \textwidth}{example-image} \includegraphicsmaybe{0.4 \textwidth}{something.png}\\[1cm] \includegraphicsmaybe{0.4 \textwidth}{something_1.jpg} \includegraphicsmaybe{0.4 \textwidth}{something_1.png}  \end{document}     How can I solve this?


I have a recipe I want to use that calls for "hulled pumpkin seeds (the green ones)". I have pumpkin seeds saved from carving pumpkins. Do I just... peel them? Any fast way to do this? Is there any other preperation needed?


Show that the number $n$ is divisible by $7$

How can I prove that $n = 8709120$ divisible by $7$? I have tried a couple methods, but I can't show that. Can somebody please help me?


There exists more than one set of numbers $(m,n)$ so that $132m+34n=\gcd(132,34)$?

Does there exists more than one set of numbers $(m,n)$ so that $132m+34n=\gcd(132,34)$?   I was comparing to, and thinking about how and why euclids algorithm solves for one set.   How might one find the other sets?


Can the "Sacrifice (this card):" activated ability be placed back on the stack?

This is a broad question so for simplicity I will use  and .  Scenario 1: Common exchange- creating a baseline.   Player A uses Naturalize on Seal of Fire  Player B Sacrifices SoF in response. SoF is highest on the stack and goes off first.  This leaves Naturalize without a valid target.   Scenario 2: Complicated exchange- Is this legal?   Player B Sacrifices SoF. In response Player A targets it with Naturalize. SoF is on the stack and it's ability has not resolved. Player B (as above) sacrifices SoF in response to the Naturalize.    Can Seal of Fire be placed back on the stack by re-activating its ability, potentially with a new target?


Is two answers by one user for a single question acceptable?

I have a weird question about this post:    There are two answers posted by one person (I will call him simply "the user" because it doesn't really matter who it was).  This is what appears to have happened:   The question was posted. The user posted  and the consensus by other people was that this answer was correct because it has 2 upvotes. OP decided to update the question with more information. The user decided to post  that reflects the additional information.  It is a different answer in general, too. In the meantime, other people gave answers that aren't duplicates of anything else there. OP accepts the second answer by that one user.     Since the answers are different (because they're based on different amounts of info provided in the question), is it okay that the one user posted two answers?  Or, since it's a new user, maybe they just didn't know to update the old post.    Since one has upvotes and the other is accepted, would it even make sense to edit the answers together and flag a moderator to delete one?  The user would lose a fair amount of points to have either answer removed, seeing as they don't have much rep to begin with.    tl;dr?  Someone posted two answers; one is accepted, the other has upvotes.  Do I flag it or ignore it?     Edit:  I think I have my answer already but let me just clarify something... the first answer this user gave is no longer relevant anymore since OP provided some more code to clarify the issue.  It's text contains just this:      This part of code is correct, there might be some problem in the Login section of the code, where you create these SESSION variable.     It's not like it's two valid but different approaches to solve the same exact question....  The second answer given by that user shows how to correct specific parts of the code in question.


I downloaded the virtual box deb from   I had virtual box installed previously. So, I did:  sudo apt-get remove virtualbox-\* sudo apt-get purge virtualbox-\*   Now, I tried to install it from the deb, the software centre wont have the install button and says:  Breaks existing package 'virtualbox' that conflict: 'virtualbox'.   Also, the virtual box icon is still present on my system.  And when I open it: it says Runtime Error: File not found. (Since I Had deleted the previous Virtual Box folder).  I just want to install it. PLease help.


Please consider the following derivation of the wave equation:    Questions:   I am just starting to learn about waves so this might be trivial. In the above, why are we interested in the transverse force which seems to be defined as the component of the tension force (which I am assuming is the force in the direction of the curve of the string) in the $f$ axis direction? Why is the wave equation modeled on the vertical displacement of this line segment under tension force?  Lastly, is this supposed to model a fixed profile wave moving at a constant velocity? Or is the string supposed to change shape as a function of time? What is the geometric interpretation?


The source directory / does not appear to contain CMakeLists.txt

I was trying to install opencv. And I followed the steps given in . But, after cloning the directories opencv.git and opencv_contrib.git and running the command:  cmake -D BUILD_TIFF=ON -D WITH_CUDA=OFF -D ENABLE_AVX=OFF -D WITH_OPENGL=OFF -D WITH_OPENCL=OFF -D WITH_IPP=OFF -D WITH_TBB=ON -D BUILD_TBB=ON -D WITH_EIGEN=OFF -D WITH_V4L=OFF -D WITH_VTK=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib/modules /opt/opencv/   I  get the above error CMakeLists.txt does not appear to exist. What is the solution to this?  Added:I created a new opt folder in home directory which should have been in the root... there was where I made the mistake maybe.


US visa refuse twice under section 214(b)

I am a executive grade officer working for Sri Lanka government & holding Sri Lankan Official Passport. Currently working as Municipal Commissioner for Anuradhapura Municipal Council. Anuradhapura Municipal Council is a member city of World Tourism Cities Federation (WTCF). Annual world summit of WTCF will be held in Los Angeles from 17-21 september 2017 and received invitation from Los Angelese Tourism & convention board to attend the WTCF world summit. The all expences should be born by WTCF.  I applied B1 visa twice and both applications refused under section 214(b).  I submitted official invitation, Recommendation from Ministry of Foreign Affairs, Sri Lanka.  What I can do next?.  Could I ask for reasons to refuse my visa or to whom I can appeal?


Prove that $f$ is a polynomial if one of the coefficients in its Taylor expansion is 0

Suppose $f$ is an analytic function defined everywhere in $\mathbb{C}$ and such that for each $z_0 \in \mathbb{C}$ at least one coefficient in the expansion  $$f(z) = \sum_{n = 0}^{\infty}c_n(z-z_0)^n$$  is equal to $0$. Prove that $f$ is a polynomial.  The problem hints to use the fact that $c_nn! = f^{(n)}(z_0)$ and use a countability argument.  My attempt at a solution  The only thing I can think of in this case is that the coefficients $c_n$ of the above Taylor expansion are defined as:  $$c_n = \frac{f^{(n)}(z_0)}{n!}$$  The only way one of these $c_n$ could be zero is if the derivative of order $n$ vanishes everywhere. Thus, this would mean that $f$ is a polynomial of order $k < n$.  Does this suffice as a proof? How would I use a countability argument to prove this instead? Thanks.


Can you get the stimulus check if you do not file a tax return for 2018 or 2019 and you do not get Social Security?

In the CARES Act that just passed (text ), section 2201 provides the recovery rebate tax credit for 2020, with section (f) providing advance refunds (the check). It says that the advance refund amount will be determined based on the amount of credit you would have gotten if it were applied to your 2019 tax return, or (in subsection (f)(5)), if you haven't filed a 2019 tax return by the time they make the determination, your 2018 tax return, or, if you didn't file that, based on amounts from your SSA-1099 or RRB-1099. However, SSA-1099 and RRB-1099 are Social Security or Railroad Retirement benefit statements, which you would only have if you had one of those retirement benefits.  So what if you are someone who did not (and does not by the time they make the determination) file 2018 or 2019 tax returns (e.g. because your income is below the threshold for being required to file), and you are not getting Social Security benefits? Does that mean that you won't get the check (advance refund) and will have to claim the credit on your 2020 tax return? Or can they figure out your income from other sources and still give you the check?


matrix product of two positive definite matrices

If $A>0$ , $B>0$   what are conditions on $A , B$ to conclude $AB>0$.


Is the sequence $a_{n+1}=a_n-\frac{1}{a_n}$, $a_0=2$ bounded?

The sequence again for convenience $$ a_{n+1}=a_n-\frac{1}{a_n},\;a_0=2 $$ My friend asked me this question and I do not know how to tackle it. It's clear it does not have a limit, but I am not sure whether it is unbounded; it seems to oscillate with a large amplitude when you simulate it numerically.    I also can't seem to get anywhere with generating functions, but I also don't know how to use them for nonlinear recurrence relations.


how to search for a string and replace it with other string in linux?

I want to search for a string and replace it with another string recursively under a directory. for example: I want to search for a string   "var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");"   and replace it with   var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-7044592-1']);_gaq.push(['_setDomainName', 'news4u.com']);_gaq.push(['_trackPageview']);   How to achieve it ?


Proving this non-empty set and binary operation is a group

Suppose we have a non-empty set $P$ equipped with an associative binary operation $\bullet$ such that for every $a \in P$ there exists a unique $b \in P$ with $aba=a$. How would we go about proving this is a group?   I have tried various things, and proved some smaller results such as for the element $b$, the corresponding unique element $c$ such that $bcb=b$ satisfies $c=a$, but every attempt to show this structure is in fact a group seems to rely on circular logic that either a unique identity exists, or each element has a unique inverse, both of which we obviously have to prove!  Any help would be much appreciated.


\documentclass[tikz]{standalone}  \usepackage{pgfplots}  \begin{document}  \begin{tikzpicture}     \begin{axis}[]     \addplot {x^2 - x +4};     \addlegendentry{$\to$}     \end{axis} \end{tikzpicture}  \end{document}      ! Missing control sequence inserted.\inaccessible   \addlegendentry{$\to$}    I wanted to use $\to$ in a legend entry in pgfplots but this leads to an error.  Other math stuff works fine, e. g. \addlegendentry{$\alpha$} works. The solution so far is to encapsulate it with extra pair of curly brackets: \addlegendentry{{$\to$}}.  Is this an expected behavior? What is so special about $\to$?   Edit     There is already a pgfplots bug report:    Solution at the moment (March 2017) is to use \rightarrow.


Unable to upgrade Ubuntu 14.04 LTS to Ubuntu 16.04 LTS

I'm running Ubuntu 14.04 LTS and I would like to upgrade to Ubuntu 16.04 LTS.  When I launch the Software Updater, I am not prompted to upgrade to Ubuntu 16.04 LTS.  Anyway, settings for the Software Updater are correct.  Thanks for your help.


@Schism - perhaps that's something that needs to be fixed? A notification that "Your edit was rejected, please view the reasons why and try and do better next time" would be good –    Would be extremely beneficial to let editors know what they are doing wrong if their edit is rejected, and would really help improve the quality of edits on the site.


What is the difference between `print(x)` and `print(*x)` in python 3?

I can't remember where I saw this but I don't understand what's going on here. What use does print(*x) provide? The following code:  x = [(1, 2), (3, 4)] print(x) print(*x)  y = [1, 2, 3, 4] print(y) print(*y)  z = 1, 2, 3, 4 print(z) print(*z)   Gives the following output:  [(1, 2), (3, 4)] (1, 2) (3, 4) [1, 2, 3, 4] 1 2 3 4 (1, 2, 3, 4) 1 2 3 4   I see what is happening but I don't know what is happening. In the previous cases, it just outputs them without any brackets or commas. But when I use this with a dictionary:  a = {1: "a", 2: [1, 2, 3], 3: (4, 5, 6)} print(a) print(*a)   I only get the keys back with the second print:  {1: 'a', 2: [1, 2, 3], 3: (4, 5, 6)} 1 2 3


I am using the gbm package and I am using the gbm.step function. In the ?gbm.step I see tree.complexity sets the complexity of individual trees. Is this equivalent to the depth of the tree ?


how to execute shell command from python

how can I execute the following command in python please  sudo mount --bind /media/networkshare/camera /var/www/media


sum of double precision gives weird results

I've been making a sum of a column containing about 500.000 records of double precision numbers. All numbers in the database should normally be of two ciphers behind the period. However when making the sum I get 6 numbers after the period: 123123123.549977  Either I have bad data in my database where there are records with more numbers after the period or there is something I'm missing about the sum function.  So my questions are:   Does the sum function have any rounding properties which may cause this? Is there a way to select all records containing more than two numbers after the period?


Is it adviseable to stack internal hard disk over each other (after removing them from the casing)

Would it damage or cause any interference to the non-operational (whereby electricity or power is removed or disconnected from the hard disk and it will be store inside a cupboard or container either made of plastic or metal) hard disks (IDE, SATA)?


Switch from single to double column in the same page

I need to write a text just in this format   \documentclass[twocolumn]{article}.   But I need to switch between single column and double column several times in the same page, without jumping to a new page every time I switch the format. Is this possible without using any package like  \usepackage{multicol} ?


Can MOOCs help me improve my profile for an MS in Computer Science?

I wish to apply for an MS in CS in the United States or Canada for Fall 2022. I am from non-CS background (engineering physics) and currently work as a software developer. I had programming experience in college and took undergrad courses in data structures, algorithms and machine learning. But I have not taken core CS courses like operating systems, compilers or computer architecture. If I take any online courses on these topics and mention the certificate link in my statement Of purpose, can it help boost my profile? Considering the fact that I would need to start applications 6 months from now, I was wondering if such online courses are worth the time now. If yes, can someone suggest online courses on these topics which have the same level of rigor as an undergraduate course?


Why can't a real scalar couple to the electromagnetic field?

If we have a complex scalar $\phi$ we know that the gauge-invariant interaction with $A$ is given by $A^\mu J_\mu$, where $J$ is the Noether current of the $U(1)$ symmetry of the Lagrangian $$ J_\mu\sim \phi^\dagger\partial_\mu\phi-\phi\partial_\mu \phi^\dagger \tag{1} $$  If we have a real scalar instead, $J=0$ and the field doesn't couple to $A$: real particles aren't charged.  My question is: what if we took $$ J_\mu\sim \phi\partial_\mu\phi \tag{2} $$ to couple $\phi$ to $A$? The interaction is Lorentz invariant and renormalisable, but it is not gauge-invariant, which is probably a bad thing. At what point would this theory break down?  This is probably very naïve, but I think that the Feynman rules for this theory are straightforward. So I guess the theory makes sense at least perturbatively. The theory is probably flawed at a more fundamental level, but I cant't seem to find where (some kind of gauge anomaly perhaps?)


Generating a simulated dataset from a correlation matrix with means and standard deviations

I have a standard correlation matrix from an academic paper with means and standard deviations:       mean sd   var1 var2 var3 var1 4.23 1.23 1.00  var2 3.01 0.92 0.78 1.00 var3 2.91 1.32 0.23 0.27 1.00   How can I generate a simulated dataset with a specific N (e.g. 212) using R?


Why image distorted by UV Map node is like lowres on output?

Image texture distorted in compositor by UV Map node koks like lowres on output. For distortion is used render of UV pass. Screen bellow explanes situation better. Did I missed something in setup?    Example-blendfile is linked for short time. Or is it possible to upload zip file too?


My own proof of "Every neighborhood is open" (Rudin's definition)

Previously, someone posted his/her proof of "every neighborhood is open" . I am focusing on the same statement, but it seems that my approach is different from his/hers. Could someone comment on my own proof? Here we go:  Let $X$ be a metric space and $p\in X$. Fix $r>0$. Define a neighborhood around $p$ as $N_r (p)=\{q\in X| d(p, q)<r\}$. Now, take $w = \frac{r}{2}$. Then, $N_w (p)\subset N_r(p)$. In other words, every point of $N_r(p)$ is interior. Therefore, $N_r (p)$ is open. Since $r$ is arbitrary, this proves every neighborhood is open.  Update:  Under my definition of "neighborhood," can I prove in this way instead: For all $m\in N_r(p)$, take $w=\frac{r−d(m,p)}{2}$. Then, $N_w(m)\subset N_r(p)$.   Update2  From the hints given in comments, I solve it:  Assume $m\in N_r(p)$ and $q\in N_w(m)$. Take $w=r-d(m, p)$. Then, $d(p, q)\leq d(p, m) + d(m, q)< d(p, m) + r-d(m,p) =r$.   Thanks to @JoséCarlosSantos and @fleablood !


Can I get access to my webcam data, like a real digital recording system?


It is possible to use a GDAL in plugin qgis?

I work on qgis plugin, and I say why not not work with GDAL, it'll be too useful. it is possible to integrate the GDAL library to develop QGIS plugin?


I have a simple particle game, where all the particles are arranged in a grid.  This game is for touch devices so to take advantage of it I am trying to have a multitouch gravity field thing going on.  Basically I am trying to get it so that each finger is basically a well in an otherwise non existent gravity field. That way the particles are pulled towards a finger.  My problem is I don't even know where to begin with these calculations, I have tried averaging a particles distance to each finger, its direction to each finger and nothing seems to work nicely!  I have seen other games do this.  What does the math for it look like?


Should capitals be used when verbing trademarks?

When using a trademark as a verb ("hoovering", "xeroxing", "photoshopping" and "googling"), should it be capitalized or uncapitalized?  Strictly speaking, Google and Adobe are opposed to their trademarks being used as verbs or as generic trademarks, but that's a separate topic.


Regarding the command apt autoremove, is it safe to use? Will it remove only unneeded files? Are there any reasons to use caution when running it?


The  says the following:     E.g.: pages=- will insert all pages of the document [...]   however, when I put \includepdf[pages=-]{foobar.pdf} in my LaTeX doc (compiled w/ xelatex), I get this error:  ! Package pdfpages Error: Cannot find file `-'.   Similarly, just using a range like \includepdf[pages={1,3,5-last}]{foobar.pdf} results in:   <use  "foobar.pdf" > ! Missing = inserted for \ifnum. <to be read again>                     - l.91 ...df[pages={1,3,5-last}]{foobar.pdf}   I'm using the latest pdfpages downloaded from CTAN.  Any idea where could the problem lie?  edit: MWE:  \documentclass{article} \usepackage{pdfpages} \usepackage[czech]{babel} \begin{document}  \includepdf[pages={1,3-5}]{foobar.pdf} \end{document}


Contraction Map on Compact Normed Space has a Fixed Point

Let $K$  be a compact normed space  and $f:K\rightarrow K$ such that $$\|f(x)-f(y)\|<\|x-y\|\quad\quad\forall\,\, x, y\in K, x\neq y.$$ Prove that $f$ has a fixed point.


Hi i am having a problem making a custom tag for this equation  \begin{equation*}\label{eq:3}         C_1 = \theta \left(Y_1^L -T_1+\frac{1}{1+r}(Y_2^L+T_2)+V_1\right) \tag(3)     \end{equation*}   I want to refer to an equation from a book (as part of my class) which i called equation 3. But i simply can't change it without getting a lot of syntax errors.  I have tryed different things form the forum, but so far without luck.  Hope you can help.


Can i apply for a schengen visa in UAE if i am having a tourist visa in UAE

I am an Indian Citizen, studying in Hong Kong and hence have a Student Visa in Hong Kong.  My Parents are in Dubai UAE and have a resident visa of UAE, and are planning a trip to Europe. My plan is to go to Dubai on a Tourist Visa and from there all of us travel together. Can i apply for the schengen visa when i am in Dubai on a tourist visa?


Is there a such thing as an exchange program in Harry Potter?

In the Harry Potter universe, is there any mention of an exchange student at Hogwarts or one of the Hogwarts students going on exchange at another school?  This happens all the time in the "muggle" school systems I'm sure it would happen in the wizarding schools as well.


Please can someone explain to me the meaning of Logical Volume, Physical Volume and Volume Groups? Of what importance and advantage are they in linux?


jQuery hover over picture with two sides

in jQuery, how do I hover over a picture and show another picture? I know about the hover() takes two parameters but I am not too clear on it. Someone please explain.


Warn user before leaving web page with unsaved changes

I have some pages with forms in my application.  How can I secure the form in such a way that if someone navigates away or closes the browser tab, they should be prompted to to confirm they really want to leave the form with unsaved data?


What can the eigenvalues of unitary matrices tell us?

I'm searching for applications where the distribution of the eigenvalues of a unitary matrix are important. Example properties of the eigenvalues could be that the eigenvalues are clustered, that they live in some half plane, that, in the case that the matrix is orthogonal, that a certain fraction are 1, etc.


When I type import pygame in Thonny I get an error. I installed pygame with sudo apt-get install python-pygame, but it's not working. Can somebody help?


Clarification on electric quadrupole moment definition

I have encountered two (?) definitions of the electric quadrupole moment. They are: $$Q_{ij}=\frac{1}{2}\int \rho(\vec{x}')x'_i x'_j\,\mathrm{d}^3x'$$ and $$Q_{ij}=\int (3x'_i x'_j-\delta_{ij}x'^2)\rho(\vec{x}')\,\mathrm{d}^3x'$$ I am trying to study radiation arising from the electric quadrupole. I am confused since sometimes the first definition is used while other times, the second. As such, which definition should be used and why?


How do I get permissions to delete files on Windows 7?

I updated my laptop's OS from Windows XP to Windows 7. There are some leftover files from Windows XP on the computer now. If I try deleting them I get the following error:     You need permission to perform this action.      You require permission from S-1-.... to make changes to this folder.   What's weird is that I am logged in with the only user account on this machine and I have administrator privileges. I tried turning UAC off, but I still can't delete the files.  How can I force removal of these files?


I was working in the Eevee renderer and when I switched over onto cycles I noticed that all the settings tabs that would have been under 'scene' were gone. Not only this but I couldn't change the material settings for any object which I usually would have done in the materials sidebar. I am able to use the materials side-bar when in Eevee. The only way I can change the materials is by doing it in the shader editor. This is really odd and hasn't happened to me before, so I was wondering if anyone has come across the problem before and has any idea of how to fix this predicament I am in. Below are some images that illustrate the problem I am having.    Many thanks!


How to use awk to print nth column and remove duplicates?

I am using awk below to print 8th column and remove duplicates in that very column.  awk -F "," '{print $8}' filecsv | awk '!NF || !seen[$0]++'   How to do it with just one awk instead running awk twice in the above pipline


How to create fixed width table columns with text raggedright/centered/raggedleft?

I would like to create a table with some columns' width specified, while the text in those columns should be centered both horizontally and vertically. I found out that  \usepackage{array} \begin{tabular}{| c | c | m{5cm} |}   vertically centers the text in the last column, but justifies it horizontally (like text in normal paragraphs).  Update: With Jake's method, it seems both \\ and \hline cause an error. How to fix it?


First characters of the command repeated in the display when completing

The first two chars were repeated while I use Tab to do completion. In the screenshot below, cd is repeated.    I have tried rxvt-unicdoe, xterm, terminator.  All these terminal emulators have this issue.  Zsh version 5.0.2, config file


When I load up  the Interesting tab is selected by default.  I'm not complaining, because they are all, by and large, very interesting but many of these questions have either no answers, no upvotes or both, so I am interested to know how you define interesting? Is this automated or are questions marked as Interesting by experienced moderators? If it is automated, what properties does a question needs to have to be classed as Interesting?


Must present perfect tense be used if the action takes place more than once?

I was told that if an action is completed once in the past, the simple past is used. Ex:  I saw that movie.  If the action is completed more than once, the present perfect tense must be used. Ex:  I have seen that movie twelve times.    So, "I have seen that movie twelve times on Tuesday." is correct and "I saw that movie twelve times on Tuesday." is incorrect?


I want to solve the integral .Solve is difficult. I want to use statistical methods to solve them. $$\int_{0}^{+\infty}x \exp\{ ax-b x^2\}d x=\int _{0}^{+\infty} x\exp\{-b(x^2-\frac{a}{b}x)\}dx=\\ exp\{\frac{a^2}{4b^2}\}\int_{0}^{+\infty}x\exp\{-b(x-\frac{a}{b})^2\}dx=\sqrt{\frac{\pi}{4}}\exp{\frac{a^2}{4b^2}}\int_{0}^{+\infty}\frac{\sqrt{2}}{\pi(1\2)}x \exp\frac{-b}{2(1\2)}(x-\frac{a}{b})^2dx=\frac{\pi}{4}\exp\{\frac{a^2}{4b^2}\}.E(HN) $$ Wherever a and b are fixed and HN half normal distribution. What is the final answer


Prove/Disprove $f(x) = x + \frac{x}{{x + 1}}$ is uniformly continuous at $\forall x,y \in [0,\infty )$    This is my trial:  $$\forall \varepsilon  > 0\exists \delta  > 0.\forall x,y \in [0,\infty ):$$ Let $$\left| {x - y} \right| < \delta $$  $$\left| {x + \frac{x}{{x + 1}} - y - \frac{y}{{y + 1}}} \right|... \le \delta  + \frac{\delta }{{(x + 1)(y + 1)}}$$  As you can see after some algebra I got an expreesion with denominator involving $x,y$. I need to "get rid" of $x,y$ at the denominator.    One way doing it is just multiplying by $(x+1)(y+1)$, because then I left with just $2\delta$ which is great. what do you think? Am I doing it right?


Observing starlight bending in high gravity

I note that there is a fair amount of light-bending questions, but I don’t really see the observer effect I am asking about. I apologize there is an answer already. I wonder if the Earth’s gravity – at least in principle - were to enter the calculation of the effect of starlight bending noted by Eddington 1919. Alternatively, one might wonder: If the observer of starlight bending around the Sun, such as the case for Eddington’s measurements 1919, is hypothetically placed in a field of gravity equal to that of the Sun, i.e. if the Earth’s gravity during Eddington’s experiment were equal to that of the Sun, what would the observer see, in terms of apparent stellar displacement? Would there be no effect at all, a classical Newtonian effect, i.e. the same as for an object with near light velocity in the same path, or something else again?


Should we reduce the required reputation to review close votes?

I have tried to find a duplicate of the question but not able to. so please excuse me if there is a duplicate of this.  This is my suggestion that we should reduce reputation cap require to review "Close Votes" from 3k to 2k.  This is primarily because there are 97k close votes are there which is quiet a huge number(and situation will get worst).  If we reduce reputation cap require to review "Close Votes"  then it might be possible more user will be able to review it and which will eventually reduce the number of "Close Votes".


Do I need a transit visa in Zurich as a Tanzanian?

I have a flight from Edmonton Canada to Zurich (2-hour layover) to Dubai. I am Tanzanian.  Is a transit visa required?


can anyone tell me why am i getting this error

public static Long relativeTime(String dateToParse) {      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");     sdf.setTimeZone(TimeZone.getTimeZone("UTC"));     Date d = null;     try {         d = sdf.parse(dateToParse);     } catch (ParseException e) {         e.printStackTrace();     }      SimpleDateFormat output = new SimpleDateFormat("d MMM yyyy  HH:mm");          output.setTimeZone(TimeZone.getDefault());       String formattedTime = output.format(d);     Date gg = null;     try {         gg = output.parse(formattedTime);     } catch (ParseException e) {         e.printStackTrace();     }      return gg != null ? gg.getTime() : 0; }   it is giving me error      java.lang.nullpointerexception attempt to invoke virtual    method long java.util.date.gettime on a null object reference at   java.util.calendar.settimecalendar.java1197   java.text.simpledateformat.formatimplsimpledateformat.java527   java.text.simpledateformat.formatsimpledateformat.java829   java.text.dateformat.formatdateformat.java314   co.helpdesk.faveo.pro.helper.relativetimehelper.java202   co.helpdesk.faveo.pro.frontend.adapters.ticketoverviewadapter.onbindviewholderticketoverviewadapter.java64   co.helpdesk.faveo.pro.frontend.adapters.ticketoverviewadapter.onbindviewholderticketoverviewadapter.java27   android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6356)


Can someone explain to me how the following summation goes from the left to the right: $\sum_{i=1}^{r}n(1-p)^{i-1} = \frac{n(1-(1-p)^r)}{p}$. I have used the formula for a Geometric series. My common ratio is: $(1-p)$. I get the following: $\sum_{i=1}^{r}n(1-p)^{i-1} = n\cdot\frac{1-(1-p^r)}{1-(1-p)}$. From here, I simply don't know how to get to $\frac{n(1-(1-p)^r)}{p}$


Implementation of Glide in Recyclerview Adapter crash app,

Trying to Implement Glide inside recyclerView App is crashing. Logcat saying          W/ResourceType: No package identifier when getting name for resource number 0x00000000 V/studio.deploy: Package broadcast exit hook { cmd=3, time=75125210000000, thread=2 }     Fixing application and activity contexts W/ResourceType: No package identifier when getting name for resource number 0x00000000 E/RecyclerView: No adapter attached; skipping layout D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main     Process: com.example.tc, PID: 26232     java.lang.IllegalArgumentException: You must pass in a non null View         at com.bumptech.glide.GenericRequestBuilder.into(GenericRequestBuilder.java:685)         at com.bumptech.glide.DrawableRequestBuilder.into(DrawableRequestBuilder.java:457)         at com.example.tc.TCAdapter.onBindViewHolder(TCAdapter.java:44)         at com.example.tc.TCAdapter.onBindViewHolder(TCAdapter.java:22)    My Implementation code is  Glide.with( context ).load( tcImages.get( position ).getFullName() ).into( holder.imageView );   My full Adapter code is   public class TCAdapter extends RecyclerView.Adapter<TCAdapter.MyViewHolder> {      List<TCImages> tcImages;     Context context;       ImageView imageView;      public TCAdapter(List<TCImages> tcImages, Context context){         this.tcImages = tcImages;         this.context = context;     }      @NonNull     @Override     public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {         LayoutInflater inflater = LayoutInflater.from( context );         View view = inflater.inflate( R.layout.item_tc_recycler, parent, false );         return new MyViewHolder(view);     }      @Override     public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {         holder.textView.setText( tcImages.get( position ).getEmail() );         Glide.with( context ).load( tcImages.get( position ).getFullName() ).into( holder.imageView ); //        Glide.with( context ).load( "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" ).into( holder.imageView ); //        Toast.makeText(context, tcImages.get( position ).getFullName().toString(), Toast.LENGTH_LONG).show();     }      @Override     public int getItemCount() {         return tcImages.size();     }      public class MyViewHolder extends RecyclerView.ViewHolder {         TextView textView;         ImageView imageView;         public MyViewHolder(@NonNull View itemView) {             super( itemView );             textView = (TextView) itemView.findViewById( R.id.txtItem );             imageView = (ImageView) itemView.findViewById( R.id.imageView );         }     } }    Tried pasting direct string of image address even then it's crashing


A lot of song lyrics include phrases where "do/don't" is used instead of "does/doesn't" with subjects in 3rd person singular.  We are taught that is incorrect grammar. But, given how widespread that practice is, is it really incorrect? Or is it just informal?  How do you feel about it if you're a native American or British speaker and you encounter such a phrase, please?   Thanks!


Lemma: Suppose that $A,B \subseteq X$ are connected and $A \cap B \neq \emptyset$ , then $A \cup B$ is connected.  How would I go about proving this? I think I understand the consequences of the lemma and it seems sort of obvious why it would be true, but I can't figure out how to prove it.   Any help would be great.


Modelling pillow with cloth simulation model floating

So I'm trying to model a pillow with the cloth simulation in blender 2.8. When I try to simulate the model I can see its forming the shape but eventually it starts to float or falls down. I set the Gravity to 0 in the Field weights and enabled object collision but it seems that my model doesn't stay in place. Also is there a way to have a seam to my pillow or do I also have to model it? Any suggestions will be appreciated, Thanks.


Why are discussions discouraged on various SE's but a staple of their corresponding Metas?

Background  Stack Exchange sites and their metas do necessarily serve different purposes, as depicted on the :     Meta has required tags.      On the main site, we ask that you avoid using meta-tags.      Because meta-discussion sites are different and serve multiple purposes, some meta-tags are okay, and even required. Each meta question is required to have one of the following tags:      [support], which indicates a request for assistance with one of the site's features.      [bug], denoting a reproducible problem on the site that you believe is due to a mistake, malfunction, or programming error      [feature-request], for a proposal for a new feature on the site, or requests a change to an existing feature.      [discussion], for posts that may not have a clear-cut right or wrong answer and are often subjective. If it's not a bug or feature request, it is probably a discussion.   The page on meta tags describes that they exist, and what each one is, but doesn't go beyond "the sites are different and serve multiple purposes". This seems very general reasoning for the diametrically different scope of discussions in particular. The  tour page expressly forbids discussion. Others, while not expressly forbidding discussion, forbid  (in the politics stack exchange for example) that then likely lead to discussion.  Question  Why are viewpoints on the scope of discussion in each SE and its corresponding meta so vastly different?


Is it worth getting a suspension seat post as a cheap alternative to full suspension bike?

I'm planning a ride from Birmingham to London on the Grand Union Canal (UK), which will be quite bumpy for most of the 145 mile distance.  I have a front suspension bike and can't afford a new full suspension bike.  Do suspension seat posts actually work?  If so, I'll get one of them.  Can anyone recommend a good model?


What is a "back link" and how does it affect search ranking?

I have heard about back links but am not sure what they are or how they affect search rankings and search engine optimization.


Prove that $f(x_0)=g(x_0)$ and $f'(x)\le g'(x)$ for $x\ge x_0$ implies $f(x)\le g(x)$ for $x\ge x_0$

Suppose that $$ f (x_0) = g(x_0) $$ and that $$ f'(x)\le g'(x), \qquad x \ge x_0. $$ Then show that $$ f(x)\le g(x), \qquad x \ge x_0. $$   This is an "obvious" fact if one assumes that the second equation means that $g$ grows faster than $f$  on $[x_0, \infty)$ (or at least as fast). But how would you go about to prove this from the definitions? Thanks in advance!


find the number of ring homomorphism from $\mathbb Z_{12}$ to $\mathbb Z_{28}$   My attempt :we know that the number of ring homomorphism from $\mathbb Z_m$ into $\mathbb Z_n=  2^{[\phi(n)-\phi(n/\gcd(m,n))]}$ , where $\phi(n)$ denotes the numbers of prime divisors of positive integer n.  so by   formula we get number of ring homomorphism from $\mathbb Z_{12}$ to $\mathbb Z_{28}$ is  $$2^{[\phi(28)-\phi(28/\gcd(12,28))]}= 2^{[\phi(28)-\phi(28/4)]}=2^{[\phi(4 \times 7)-\phi(7)]} =2^{[\phi(4) \times \phi(7)-\phi(7)\times \phi(1)]} =2^{2 \times 6 - 6\times 1}= 2^6$$  Finally i got   $2^6$  answer   is its correct ?


How to Install Ubuntu by replacing Windows but without formatting other partitions

I'm using Windows 7 on my PC (1 GB RAM,160 GB HDD). I want to install Ubuntu and remove Windows 7 I have Partitioned my PC into 2 drives , C  Drive - 40 GB and D Drive - 120 GB. I want to install Ubuntu on the C drive without formatting D drive so how can I do that? I know that I will have to select the Something Else option when the Installation Type Screen appears but I don't know how to proceed from there.


can you tell me how can I put questions and get more answers ! what I should do to get more interaction with my posts ! waiting for hours and days maybe months to get an answer or comment is not good ... Really I want some advices , thanks in advance


How come a user with 1 rep has been able to comment following a question he does not own?

I have been reading the contributions following   when I noticed  has posted  below one of the existing answers.  I am wondering how come the user has been able to comment when his reputation is only 1. Normally, we can comment only if we have at least 50 reputation (if the post is not ours, as in this case). So how did this happen?


I repeatedly get an error about unmet dependencies for adobe-flashplugin while trying to install anything

Whenever I try to install anything I repeatedly get the error below and then the installation stops. Moreover I also get the error that I have to fix the Ubuntu software center but I cant due this same error.  For example, when I run the command:  sudo apt-get install unity-tweak-tool   I get this error:  Reading package lists... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies:   adobe-flash-properties-gtk:         Depends: adobe-flashplugin (= 1:20160310.1-0ubuntu 0.12.04.1)                   but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages     (or specify a solution)


If red blood cells have no mitochondria how are they able to metabolize glucose?

I have read that red blood cells (RBCs) metabolize glucose. However they don't have any mitochondria because there is just so much hemoglobin that there is no room for mitochondria without expanding the cell.   So how is it possible for them to metabolize glucose if it is mainly O2, CO2, H2O, fatty acids (in cell membrane), and hemoglobin?


Can I publish (online) a photo I took of someone else's house?

I have a collection of photos that I have taken while touring through display homes that were part of a home-design show.  I want to publish the photos online to share with others the architectural design that inspires me.  Photography was allowed in the homes by the administrators of the tours.  I may have agreed to some type of restrictions by purchasing the ticket, but I did not sign anything.  I have read  here to attempt to gain an understanding of this issue, but I want to make sure there are no other restrictions that apply to this specific case.  My questions are:   When taking photographs of someone else's property, can I still publish the photo legally? What about when taking photographs on someone else's property? If the property in the photo is "identifiable" as belonging to someone else (or as the work of some architect or designer), does that change things at all? If the "conditions" of the ticket purchase did place some restrictions on photography, but the ticket holders do not sign anything, will that still hold up?   I realize that if I were to commercialize my endeavor, I would be well-advised to talk to a lawyer (and I may need to anyway), but I am just looking for some starter advice here.


Problem with filling two-dimensional list python 3

I need to fill two dimensional list in python 3. I wrote some example code but it doesn't work. For some reason, each new line is overwritten. Why is this happening? code: testA = [0]*3 tmpA = [0]*3  for n in range(0, 3, 1):             for x in range(0, 3, 1):         tmpA[x] = x*n+1      testA[n] = tmpA     print("-", testA)     print("--", tmpA)  output: - [[1, 1, 1], 0, 0] -- [1, 1, 1] - [[1, 2, 3], [1, 2, 3], 0] -- [1, 2, 3] - [[1, 3, 5], [1, 3, 5], [1, 3, 5]] -- [1, 3, 5]


How do we know the size of the universe?

Ok, from astronomical observations we can tell that the observable matter is separating - so rewind the clock about 13.7 billion years and it was all at a single point.  However, how do we distinguish between the following two options:     Universe is expanding   Matter distribution is increasing into infinite void   Clarification 1: (My notion of) The traditional notion is that all time/space/matter was created at the instant of the big bang.  I.e. BB was inital conditions of: $t=0$, $V=0$, $E=very big$  People say "the universe is expanding", rather than "observable matter is separating".  Why is this?  How do we know that the big bang event wasn't started by all matter condensed at a single point within a larger (otherwise empty) universe?  How do we know that BB wasn't: $t=0$, $V(universe)>0$ but $V(matter)=0$, $E=very big$?


Why there's no possible conversion (generic type restricted with interface)?

I've got following classes.  interface ICommand {. . .}   class ShutdownCommand : ICommand { . . .}  class Message<T> where T : ICommand { . . .}  class Communicator {     void Send(Message<ICommand> a_msg) { . . .} }   When I call following code, I get an error that there's no possible conversion from the type Message<ShutdownCommand> to the Message<ICommand>. It's not intuitive for me since ShutdownCommand inherits from ICommand.  var message = new Message<ShutdownCommand>(); m_communicator.SendCommand(message);   I know I can solve such problem with adding non-generic interface for a Message class and use it as parameter type in Send() method. Regardless it could be fixed in the way I described above... I'm curious why there's no possible conversion if from the code above arises conversion should be possible.


Question:  let the matrix   $A=(a_{ij})_{n\times n},i=1,2,\cdots,n,j=1,2,\cdots,n$,  and the matrix   $M=(a_{ij})_{(n-2)\times (n-2)},$  mean  that  $$A=\begin{bmatrix} a_{11}&\cdots&a_{1n}\\ \vdots& M&\vdots\\ a_{n1}&\cdots&a_{nn} \end{bmatrix}$$ show that  $$\det|A|\cdot \det |M|=A_{11}A_{nn}-A_{1n}A_{n1}$$ where $A_{ij}$ is cofactor with the matrix $A$.  This problem is from linear problem book ,and this problem I can't deal it. because this value $$|A||M|$$ I can't choose something to  deal it?


Why use a z test rather than a t test with proportional data?

When testing the difference between 2 proportions why do we use a z-test rather than a t-test?    Further, is there a simple way to conduct an omnibus test for significant differences between more than 2 proportions (in the form of percentages). Is there an equivalent to a one-way ANOVA for this?  I imagine that you could use logistic regression (assuming you have the original data for the proportions in the form of 0s and 1s) Are there other options?


I installed a second linux distro wiped it and it removed grub

I'm running Ubuntu as my only OS right now. I added elementary OS and decided I didn't like it. I then deleted the partition and added the space back to my main Ubuntu partition. This proceeded to wipe grub. I did the ls command on grub recovery mode found the ext2 partition my computer was running on but insmod came up with a error every single time. The only way I was able to get my machine running again was to install a second copy of ubuntu on a 20gb partition on my same drive and leave that on there. I'm going to be installing windows as a second OS in a day or two here and need the extra ubuntu gone cause its wasting space. I need help finding a way to ensure grub remains function after I delete the extra partition with ubuntu and before I restart my system and it loses track of my main ubuntu. I'm not sure what to do. Thanks in advance!


Are gravitational waves transverse or longitudinal waves, or do they have unique/unknown properties?

propagate through a medium of space-time. Are they traverse waves or longitudinal waves? Or do they propagate without oscillating?


To compute $\frac{1}{2\pi i}\int_\mathcal{C} |1+z+z^2|^2 dz$ where $\mathcal{C}$ is the unit circle in $\mathbb{C}$

Let $\mathcal{C}$ denote the unit circle in $\mathbb{C}$ centred at the origin taken anticlockwise. Compute the value of the integrtal $$\frac{1}{2\pi i}\int_\mathcal{C} |1+z+z^2|^2 dz$$   I don't recon we can use the residue theorem to compute this integral because the integrand is not analytic anywhere.  I then tried substituting $z=e^{i\theta}$ and integrating it the traditional way but cant make much of the integrated $|1+e^{i\theta}+e^{2i\theta}|^2$.  Any help would be much appreciated. Thanks.


Proof that the image of a closed cone under a linear transformation is a closed cone

The question is:  Let $T : \mathbb{R}^n \rightarrow \mathbb{R}^m$ be a linear map. Let $C$ be a closed subset of $\mathbb{R}^n$ which is also a cone. Prove that if $\ker(T) \cap C = \{0\}$ then $T(C)$ is a closed cone in $\mathbb{R}^m$.  I can show that $T(C)$ is a cone but I can't figure out how to show it is closed.  This question was on my PhD qualifying exam I took recently and I'm going back over it to study.


Which package can I use to draw this diagram?

I wan to draw this digram below with latex which package can I use to draw it?  ]


Problem:  Show $(B_t )^2$ i.e. square of a Brownian motion is a Markov process.  To do this, I want to show $$P( B_t ^2 | B_{t_1} ^2 ,  ... ,  B_{t_n} ^2 )= P( B_t ^2 |  B_{t_n} ^2 )   $$ where $0<t_1<...<t_n<t$.  My attempt:  $ B_t ^2 = (B_t -B_{t_n})^2 +2 (B_t -B_{t_n})B_{t_n} + B_{t_n} ^2$ and $(B_t -B_{t_n})$ is independent with $ \sigma (B_{t_1} ^2 ,  ... ,  B_{t_n} ^2) $ while $B_{t_n} ^2$ is measurable w.r.t. $ \sigma (B_{t_1} ^2 ,  ... ,  B_{t_n} ^2)$. However,  $ B_{t_n}$ is not measurable w.r.t. $\sigma (B_{t_1} ^2 ,  ... ,  B_{t_n} ^2)$ so I cannot apply the standard lemma which states that I can integrate the "independent part".  I have also tried to calculate the joint p.d.f of $B_{t_1} ^2 ,  ... ,  B_{t_n} ^2 , B_t ^2$ by change of variables from the marginal distribution of Brownian motion, but it is not very easy.  Any hint is appreciated.


How do I get the source code of the Ubuntu operating system? How do I run the modified code? What programming languages can be used to modify the code?


Is the car/wall comparison valid for speeds close to $c$?

At school, people commonly think about momentum and conservation of energy using the example of a car collision. A common phrase is "Do not try to think of two objects moving, think of one moving at the sum of both speeds and the other stopped. After all you are in one of the cars, and from your point of view, your are still and the wall is coming really fast!".  Does that principle apply to near light speeds? Will I see the other guy "growing" in my field of view and by projection, calculate his speed at $2c$ or will time dilatation work some kind of really cool phenomenon there?


Function not working in a bash script - error messages relate to '\r'

I have recently installed a fresh version of Debian. I created this simple script:  #!/bin/bash  print_something () {   echo Hello I am a function }  print_something print_something   However this displays this error upon me issuing bash test.sh:  test.sh: line 3: $'\r': command not found test.sh: line 4: syntax error near unexpected token `$'{\r'' 'est.sh: line 4: `print_something () {   What am I doing wrong? Many thanks!


At $z=0$ the  function $f(z)=\exp({z\over 1-\cos z})$ has    $1$. A removable singualrity  $2$. A pole  $3$. An essential singularity  $4$. Laurent series around $z=0$ has infinitely man positive and negative power of $z$  I see $\lim_{z\to\infty}f(z)=\infty\cup -\infty$ if you approach to $0$ from left and right side of the real line, so $f$ can not be bounded near $0$ so it has $f$ essential singularity?


If two bodies are moving towards each other along a straight line at a speed of $0.6c$ ($c=$ speed of light) w.r.t an inertial observer, then w.r.t each body, the other body is moving faster than light ($1.2c$). If each frame of reference is equally valid, how can the two bodies explain the velocity of approach of the other? (since velocity is always relative and hence the body cannot assume that it has absolute velocity in space)


Linux Alt + Mouse drags windows instead of selecting edge

I just started learning Blender from YouTube. I got a problem here:   I am on a GNU/Linux system with XFCE DE (XFWM4 WM). My problem is when I want to select vertices of an object (also, described in the video) with Alt + Primary Mouse button, it starts dragging the windows of Blender. Alt + Primary mouse button is also what I use all the time to drag windows. What is the alternative way to select all the edges of an object?


How to use /setblock to set a command block down with a command pre written inside of it Minecraft 1.13

I might be the only one who hates this new 1.13 update because Mojang messed with the commands waaay too much. Anyways, I want to set down a command block with  a command I've written inside of it using the /setblock command. However, Mojang has either removed or completely changed how this worked like it did in 1.12. It used to worked like this: "/setblock    command_block 0 replace {Command:"INSERT COMMAND HERE"}". However, this no longer works. How do you do this in 1.13. Thanks!


Michelson interferometr electromagnetic wave formula

I don't understand why we use this formula:    Instead of this formula:    I mean, why we ignore $\omega\cdot t$ part.


Only reference key appears when using biblatex

I'm trying to include the references directly into the main file. The problem is that citations are undefined and only the reference key will appear.  \RequirePackage{filecontents} \begin{filecontents*}{\jobname.bib} @book{gladwell,     author = {Malcom Gladwell},     title = {The Tipping Point},     publisher = {Little, Brown and Company},     year = {2002} } \end{filecontents*}  \documentclass[a4paper,man,12pt]{apa6}  \let\Citeauthor\relax  \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage{csquotes} \usepackage{textcomp} \usepackage{amsmath} \usepackage{graphicx} \usepackage[colorinlistoftodos]{todonotes}  \let\biblabelsep\relax \let\bibparsep\relax \let\bibhang\relax \let\citename\relax \let\bibfont\relax \let\Citeauthor\relax  \usepackage[backend=biber,style=apa]{biblatex}  \title{Title} \shorttitle{Short} \author{Some Random Guy} \affiliation{School}  \addbibresource{\jobname}  \begin{document}  \maketitle  \renewcommand{\baselinestretch}{1.5}  \setcounter{secnumdepth}{3}  \section{Bla}  \parencite{gladwell}  \subsection{Blubb}  \subsubsection{Lalala}  %\bibliographystyle{apacite} %\bibliography{jobname} \printbibliography  \end{document}


I want to set environment variable in JAVA . For this , I have searched a lot in internet and got the following code .   void set_up_environment_var() throws IOException {      ProcessBuilder pb = new ProcessBuilder("CMD.exe", "/C", "SET"); // SET prints out the environment variables        pb.redirectErrorStream(true);         Map<String,String> env = pb.environment();         String str1 = ";C:\\naved\\bin";      String path = env.get("Path") ;//+ ";C:\\naved\\bin";        System.out.println("ok , I am coming . "+path.toLowerCase().contains(str1.toLowerCase()));      env.put("Path", path.concat(str1));        Process process = pb.start();        BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));        String line;        while ((line = in.readLine()) != null)        {       //     System.out.println(line);        }   }   But after execution , the envorinment variable is not set in "PATH" varaible . Why ?


Move files by reading their file names to different directories

I need to move files by reading their names. I have to move system generated files and the names include a time stamp. I need to move the files by reading the file name by month.  If the file name contains 201601*.txt, then move to 2016/January directory. If the file name contains 201602*.txt then move to 2016/February directory etc.


Windows 7, left alone for 5 mins and system pushes cpu to 20% until i press a key or move mouse

I have scanned with avast a few times for virus's but nothing has been found, however.. every time i leave my computer for about 5 minutes the process labelled 'system' which is the 'ntoskrnl.exe' bumps the CPU of the entire machine up to 20-24% which of course spins the fans up high..  The strangest bit, once I press a key or move mouse the machine recognises i am back and system drops off to next to nothing.. I have googled it but cannot see anything that matches this scenario so thought I would ask on here.      After reading through a link ()  from a commenter who has since removed their comment i arrived at..  This link () which I then found the item within system ramping up cpu is ntoskrnl.exe_misaligned_access+0x3f0  The guys reply in the above thread is to kill processes that end up there.. but I'm not sure if that is wise?    So i turned off the scheduled idle task and this has not made any difference, i just went away to get a coffee, returned to the sound of heavy fan use and cpu up to 20%.. the culprit in task manager, "system"


Null pointer Exception in an integer array

New to JAVA. I am getting a Null Pointer Exception at line 30 in the following. I know that an array must be initialised when it is declared to avoid getting the exception. But in this case, I do not know the size of the array to be initialised. So, can someone please explain how i can rectify this error? Can you also explain about what happens when we declare and initialise a variable?       import java.util.*;  class Person {     protected String firstName;     protected String lastName;     protected int idNumber;  // Constructor Person(String firstName, String lastName, int identification){     this.firstName = firstName;     this.lastName = lastName;     this.idNumber = identification; }  // Print person data public void printPerson(){      System.out.println(             "Name: " + lastName + ", " + firstName          +   "\nID: " + idNumber);     }  }  class Student extends Person{ private int[] testScores;  //exception Here  Student(String firstName,String lastName,int id,int[] scores){          super(firstName,lastName,id);          for(int i=0;i<scores.length;i++)              {                  testScores[i]=scores[i];          } }  char calculate(){    int avg=0,i=0;    for(i=0;i<testScores.length;i++)              {              avg=avg+testScores[i];          }    avg=avg/(i+1);    if(avg>=90 && avg<=100)        return 'O';    else if(avg>=80 && avg<90)        return 'E';    else if(avg>=70 && avg<80)        return 'O';    else if(avg>=55 && avg<70)        return 'P';    else if(avg>=40 && avg<55)        return 'D';    else        return 'T'; }  }


If $f(x)\cdot f(f(x)) = 1$ for all $x \in \mathbb{R},$ and if $f(10) = 9$ then find the value of $f(5)$

If $f\colon\mathbb{R}\rightarrow \mathbb{R}$ is a continuous function satisfying $f(x)\cdot f(f(x)) = 1$ for all $x \in \mathbb{R},$ and if $f(10) = 9$ then find the value of $f(5).$  Attempt: Put $x=10,$ we have $f(10)\cdot f(f(10)) = 1.$  So, $9\cdot f(9) = 1,$ then $f(9) = \frac{1}{9}.$  Could someone help me how calculate $f(5)$ ? Thanks.


Is there an idiom that implies that you reach me when I was planning to reach you?

I was planning to send an email to someone when actually this person reached me first! I wanted to say "oh I was planning to reach you when you actually reach me first" Like in my native language we have a phrase we use. Is there anything like this in English literature or idiom?


Adding multiple plugins to custom menu in QGIS3

I have a set of Plugins that I have to restructure according to different sub menus in a Global Menu. For the moment, I have two plugins but each time it recreates the menu for me while I integrate the second plugin directly on the Global menu as the first plugin to Create. class ClassGeneraleMenu:     def __init__(self, iface):         self.iface = iface         # Declaration de mon Menu Global en premier lieu         self.ambition_menu = QtWidgets.QMenu('MenuGlobal')      # Function qui me crée des sous menus dans ma MenuGlobal     def atrqgis_add_submenu(self, submenu):         self.ambition_menu.addMenu(submenu)      # Function iniGuit     def initGui(self):         # Insertion du Menu dans la barre menu de Qgis         self.iface.mainWindow().menuBar().insertMenu(self.iface.firstRightStandardMenu().menuAction(),self.ambition_menu)          # Sous Menu Par projet         # Myprojet Sous Menu         self.adn_menu = QtWidgets.QMenu(QCoreApplication.translate("atrqgis", "&Myprojet"))         self.atrqgis_add_submenu(self.adn_menu)                  # CONTROLE DESIGN Submenu         self.controle_design = self.adn_menu.addMenu('Contrôle')          # Ajout des actions dans dans la fenetre execution         icon = QIcon(os.path.dirname(__file__) + "/icons/import.png")         self.animate_lines_action = QtWidgets.QAction(icon, "A.1.1 Import de données", self.iface.mainWindow())         self.animate_lines_action.triggered.connect(self.baba_fonc)                  # Ajout de l'action dans la CONTROLE DESIGN Submenu         self.controle_design.addAction(self.animate_lines_action)  This example is the same for all my Plugins, except that I want each Plugin to insert into an existing menu


The \show command is extremely useful for figuring out what's going on with a particular macro.  Similarly, using \the can tell me the value of a counter.  I'd like to know if there's something similar for lengths and skips.  At the moment, I end up doing something like \rule{1pt}{\unknownlength} but that's a fairly crude method.


I removed nautilus from my laptop and I had lost everything. When iam trying to install nautilus it requires some dependencies. How can I get it now?? I used sudo apt-get remove --purge nautilus to remove nautilus


Why does curling a wire decrease its amperage/wattage?

I picked up an extension cord today, and I noticed that it had a different value for its wattage and its ampage, based on whether the cord is wound around its base or not.     (I apologize that the picture is blurry. In the left box it says, ”Max current wound - 4 Amps (960 Watts),” and in the right box it says, “WARNING - Max current unwound - 13 Amps (3120 Watts).”)   Why does this make a difference? Assuming that the wire is properly insulated, shouldn’t it transfer the electricity just as efficiently wound as unwound? Is there a formula that I can use to calculate a cord’s wattage/amperage when only part of it is wound, or when all of it is wound, given its wattage/amperage when straight, how much of it is wound, and how tightly it’s wound, and maybe some other variable I can’t think of?   Obviously my question assumes that it has nothing to do with a liability concern or the like.


This is an exercise from my calculus class. The function is defined as $x\sin (1/y)+y\sin (1/x)$ if $x\neq0 $ and $y\neq0 $, and $0$ if $x=0 $ or $y=0$.  I'm pretty confident the limit exists and should be $0$, because: $$\lim_{(x,y)\to(0,0)}[x\sin (1/y)+y\sin (1/x)]=\lim_{(x,y)\to(0,0)}[x\sin (1/y)]+\lim_{(x,y)\to(0,0)}[y\sin (1/x)]$$  And: $x\leq x\sin(1/y)\leq x$, so $\lim_{(x,y)\to(0,0)}[x\sin (1/y)]=0$ right? (The same can be said for $\lim_{(x,y)\to(0,0)}[y\sin (1/x)]$)  However, I tried checking my answer, and according to Wolfram Alpha the limit doesn't exist. Is this because I'm wrong, or is it just because $x\sin (1/y)+y\sin (1/x)$ is undefined for $y\neq0 $ and $y\neq0 $


This is somehow related to my question .  I process tons of texts (in HTML and XML mainly) fetched via HTTP. I'm looking for a library in python that can do smart encoding detection based on different strategies and convert texts to unicode using best possible character encoding guess.  I found that  does auto-detection extremely well. However auto-detecting everything is the problem because it is SLOW and very much against all standards. As per chardet  I don't want to screw the standards.  From the same FAQ here is the list of places where I want to look for encoding:   charset parameter in HTTP Content-type header. <meta http-equiv="content-type"> element in  the <head> of a web page for HTML documents. encoding attribute in the XML prolog for XML documents. Auto-detect the character encoding as a last resort.   Basically I want to be able to look in all those place and also deal with conflicting information automatically.  Is there such library out there or do I need to write it myself?


Can I enter a country using just my seaman's book?

I am a UK citizen, working offshore of Angola. The shipping agent took my passport when I went through the Angolan port authority, to join my vessel. The Angolan authorities have my passport, as my work visa is getting renewed.  Can I go onshore into Angola with my seaman's book and wait in a hotel for the return of my passport?  Edit: i am not joining a vessel. I am remaining on land in the country without the visa


Checkystyle issue in ActionListener: Reference to instance variable 'x' needs 'this.' in Java

At first I am beginner in Java. I have problem with checkstyle error mentioned in thread title.  Consider having similiar code:  public class myClass {   JButton[] buttons;        public myClass() {         this.buttons = new JButton[2];         //constructor code....          this.buttons[0].addActionListener( new ActionListener() {                     public void actionPerformed( ActionEvent e ) {                                         firstMethod(0, 1);                       secondMethod(5, 10);                     }                 });        }        public void firstMethod( int x, int y ) {         // do something       }        public void secondMethod( int x, int y ) {         // do something       }      }   In constructior I've created onclick event for button from attribute buttons, where when the button is clicked it will perform method firstMethod(int, int) and secondMethod(int, int), everything working of course, but the checkstyle throws me the error. For some reasons I cannot just use this.firstMethod() as I am inside another object (ActionListener).  Any ideas how to throw myClass reference into actionListener?


If $t_n=\frac{1}{2n+1}-\frac{1}{2n+2}+\frac{1}{2n+3}-\frac{1}{2n+4}+\cdots +\frac{1}{4n-1}-\frac{1}{4n}$  Find $\lim_{n \to \infty} nt_n$  First attempt: $t_n$ is positive(grouping two terms and performing subtraction we will get it) so is $nt_n$. Now can we prove it is monotonically decreasing? If so then $\lim_{n \to \infty} nt_n=\lim_{n \to \infty}[(\frac{1}{2+1/n}-\frac{1}{2+2/n})+(\frac{1}{2+3/n}-\frac{1}{2+4/n})+\cdots +(\frac{1}{4-1/n}-\frac{1}{4})]$ and each of these terms will go to zero so is the limit.  Second attempt: I was trying to use Riemann summation $t_n=\frac{1}{2n+1}-\frac{1}{2n+2}+\frac{1}{2n+3}-\frac{1}{2n+4}+\cdots +\frac{1}{4n-1}-\frac{1}{4n}= \frac{1}{2n+1}+\frac{1}{2n+2}+\frac{1}{2n+3}+\frac{1}{2n+4}+\cdots +\frac{1}{4n-1}+\frac{1}{4n}-2[\frac{1}{2n+2}+\frac{1}{2n+4}+\cdots \frac{1}{4n}]\Rightarrow \lim \frac 1n [nt_n]=\int_0^2\frac{dx}{2+x}-\int_0^1\frac{dx}{1+x}=\ln4-\ln 2-\ln 2=0$  So $\lim t_n=0$  So what will happen with $\lim nt_n$  Edit: As I got the answer is not $0$ because of the flaw. So can we have different approaches even with Riemann Sum to have the answer?


How to resize the view of specific software

Looking at the image attached the problem is self-explanatory. The tabs and icons within the software (photoshop in this particular case) are extremely small so that they are barely visible and difficult to use. It happens to some of the software just installed in a newly bought pc(very high resolution screen).  How can I resize them specifically (I know the trick for general resizing).  Would the software "sizer" help?


"He came by foot": correct the error.   What is the error? I guess it is not about 'on foot' vs 'by foot' as some articles show that both are correct, though I am not sure.


Let R be a commutative ring with identity. Prove that R is a field if and only if (0R) is a maximal ideal.

I'm confused on how to go in both directions and how to start this proof.


This subspace of $L^2$ is finite dimensional?

For the Lebesgue measure let F $ \subset L^2( [0,1], \mathbb{R} ) $ be a closed linear subspace of $ L^2 $ and also $ F \subset (\mathcal{C} [0,1]) $.   With the Banach isomorphism theorem i proved that $ (F, \| \|_{ L^2} )  \cong   (F, \| \|_{ \infty} )  $  and so both norms are equivalent on F.   3) Suppose that $ ( \varphi_n)_{1 \leq n \leq N} $ is a orthonormal subset in $ (F, \| \|_{ L^2} ). $ For all $ y \in [0,1] $ we consider ,  $ f_y : x \in [0,1] \mapsto \sum_{n=1}^N \varphi_n(x) \varphi_n(y) $  a) for $ y \in [0,1] $ compute $ \| f_y \|_{ L^2} . $  b) for $ y \in [0,1] $ find a lower bound to $ \| f_y \|_{ \infty} . $  4) Conclude that F is finite dimensional.  So i found  $ \| f_y \|_{ L^2} = (\sum_{n=1}^N \varphi_n^2(y))^{1/2}  $  And $ \varphi_i (y) \leq   \| f_y \|_{ L^2}   \leq \| f_y \|_{ \infty} .  \forall i $     How do i conclude that F is finite dimensional ?  I tried using the Riesz Lemma (compactness of unit ball thus finite dimensional) without any success. I know that $ L^2 $ is a separable Hilbert Space hence it has a countable Hilbert basis but i'm not sure if that helps here.  Thanks in advance for any help on the matter.


What do hats get me after winter bash is over?

the hats get put back in their boxes on January 4th   Do the hats affect me in any way after the 4th? A badge or something in my profile about how many I unlocked?  Edit: Can I request some form of persistence... please?


If I buy raw chicken breasts from nofrils on June 21 and expiration date says June 23 can I cook it on June 23 and eat the left overs the next day?  Would that make the chicken okay to eat still, or should I freeze it and cook it on June 23?


Is it possible to highlight text inside of a textarea using javascript? Either changing the background of just a portion of the text area or making a portion of the text selected?


I need to write a program or a bash script, which will run every now and then (based on cron). The program will contain a state machine and will behave differently depending on which state it is in.  The program (or bash script) is not user specific, so it shouldn't be in the /home folder.  Where (by convention) to store the file with program internal state on Ubuntu Server?  Bonus question: What is the best place for the script itself?


Apache Rewrite specific domains to subdomain

I want to redirect all domains from a specific directory to a new subdomain (invisibly).  e.g. example.com/literal/some/path/to/file.html -> sub.example.com/literal/some/path/to/file.html AND  www.example.com/literal/some/path/to/file.html ->  www.sub.example.com/literal/some/path/to/file.html  Where "literal" should be constant, and anything that comes after it is arbitrary.  I've tried things like   RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com/literal RewriteRule ^(.*)$ http://sub.example.com/$1 [L]   But I can't get all the options right. Any help appreciated.


What is the difference between [-2:] and [2:]?

Question Given a string, return a new string made of 3 copies of the last 2 chars of the original string. The string length will be at least 2.  This is what I did, but it didn't return true on every case.   def extra_end(str):     return str[2:]*3   So I checked the solution and found this answer:  def extra_end(str):     return str[-2:]*3   My question is what's the difference between [-2:] and [2:] ?


Why do I get "integer expression required"?

I'm trying to have a small function that I then call.  To keep it simple I just want to validate that 12 is divisible by 2,3 and 4  The code is:  divisible_by () {   under_test=12   from=2   to=4   divisible=0   for ((check=from; check<=to; check++)) {     echo "check= $check"     if [ $under_test % $check -ne 0 ]; then       divisible=1     fi     }   return $divisible }  x=divisible_by if [ $x -eq 0 ]; then   echo "true" else   echo "false" fi   Currently I get   ./5_divisible_by_1_to_10.sh: line 16: [:  divisible_by: integer expression expected false   I'm also finding it hard to pass the number in as a parameter but maybe it's related.


PHP mail form is being sent to Gmail spam

Can someone help me figure out why the below PHP is causing the email to be sent to Gmail spam? I tried following other directions for setting proper headers, but I still run into problems with my emails going into the spam filter in Gmail.  Any help would be appreciated!  <?php  //set validation error flag as false $error = false; //check if form is submitted if (isset($_POST['submit'])) {     $name = trim($_POST['txt_name']);     $fromemail = trim($_POST['txt_email']);     $inquiry = trim($_POST['txt_inquiry']);     $message = trim($_POST['txt_msg']);      //name can contain only alpha characters and space     if (!preg_match("/^[a-zA-Z ]+$/",$name))     {         $error = true;         $name_error = "Please enter a real name";     }     if(!filter_var($fromemail,FILTER_VALIDATE_EMAIL))     {         $error = true;         $fromemail_error = "Please enter a valid email address";     }     if(empty($inquiry))     {         $error = true;         $inquiry_error = "Please enter your subject";     }     if(empty($message))     {         $error = true;         $message_error = "Please enter your message";     }     if (!$error)     {         //send mail         $toemail = "myemail@gmail.com";         $subject = "inquiry from visitor " . $name;         $body = "Here goes your Message Details: \n\n Name: $name \n From: $fromemail \n Inquiry: $inquiry \n Message: \n $message";         $headers = "From: $fromemail\n";         $headers .= "Reply-To: $fromemail";         $headers .= "Return-Path: $fromemail";          if (mail ($toemail, $inquiry, $body, $headers))             $alertmsg  = '
Message sent successfully.  We will get back to you shortly!
';         else             $alertmsg = '
There is error in sending mail.  Please try again later.
';     } }   ?>


How to assign random numbers to the matrix of Buttons [5][5]. The numbers ranging from 1 to 25.please answer

my question is....How to assign random numbers to the matrix of Buttons [5][5]. The numbers will be ranging from 1 to 25.please answer.please answer me.


What  type of file should I make the partitions, what size should I make them and do I need a storage partition for a total of 3. 1-OS Partition, 2-Swap Partition, and 3-Storage Partition?


Recover original utf8 data from latin1 mysql db

We forgot to change charsets in our mysql db after migration on new server.  Current situation:  mysql> show variables like 'character%'; +--------------------------+----------------------------+ | Variable_name            | Value                      | +--------------------------+----------------------------+ | character_set_client     | latin1                     | | character_set_connection | latin1                     | | character_set_database   | latin1                     | | character_set_filesystem | binary                     | | character_set_results    | latin1                     | | character_set_server     | latin1                     | | character_set_system     | utf8                       | | character_sets_dir       | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+  mysql> show variables like 'collation%'; +----------------------+-------------------+ | Variable_name        | Value             | +----------------------+-------------------+ | collation_connection | latin1_swedish_ci | | collation_database   | latin1_swedish_ci | | collation_server     | latin1_swedish_ci | +----------------------+-------------------+   But table charset is utf-8:  mysql> show create table inbox\G *************************** 1. row *************************** Create Table: CREATE TABLE `inbox` (   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,   # ...   `message` varchar(2048) DEFAULT NULL ) ENGINE=InnoDB AUTO_INCREMENT=4001 DEFAULT CHARSET=utf8   We're using Node.js (0.10.*) for backend and latest felixge  (connection is UTF8_GENERAL_CI by default).  Before we've found incorrect config, there are a lot of messages saved to table (~4000), most of them are utf-8. Sure, currently we see a lot of question marks ?????????? instead of normal text.  I've tried , but no luck.  var db = require('mysql').createConnection({   // credentials });  var iconv = new require('iconv').Iconv('latin1', 'utf-8');  db.query('select message from inbox where id = 42', function(err, result) {   var msg = result[0].message;   console.log(iconv.convert(msg).toString());   db.destroy(); });   Is there any chance to recover original utf-8 data?