C++ template error "Undefined reference to" and "Expected a type, got"

I have gone through the previous discussions on this topic ,  and , but found my situation to be unique. Hence this question.  I am trying to create a generic heap class, that depending on a template parameter, can become either a min or a max heap. I am pasting my code below. I am not sure what I am missing, but I either get an "Undefined error" or "expected a type, got st" error.   Heap.h  #ifndef __HEAP__H_ #define __HEAP__H_  #include <iostream> #include <cstdint>  #define PARENT(x)       x/2 #define LEFTCHILD(x)    2*x #define RIGHTCHILD(x)   2*x+1  template<typename T, size_t size, typename Comparator> class Heap { private:     T data[size];     Comparator comp;     uint8_t n;      //Main functions needed for maintaining heap structure     void BubbleUp(int value);     void BubbleDown(int value);      //Helper functions     void Swap(int value1, int value2);  public:     bool Insert(int value);     bool IsEmpty();     T ExtractTop();     T PeekTop(); };  #endif   Heap.cpp:  Based on the answer , I explicitly instantiate the template as shown below:   #include "Heap.h"  template<typename T, size_t size, typename Comparator> bool Heap<T, size, Comparator>::Insert(int value) {     if(n >= size)         return false;      data[n] = value;     BubbleUp(n);     n++;     return true; }  template<typename T, size_t size, typename Comparator> bool Heap<T, size, Comparator>::IsEmpty() {     return (n == 0); }  template<typename T, size_t size, typename Comparator> T Heap<T, size, Comparator>::ExtractTop() {     T value = data[0];     data[0] = data[n-1];     data[n-1] = NULL;     n--;     BubbleDown(0);     return value; }  template<typename T, size_t size, typename Comparator> T Heap<T, size, Comparator>::PeekTop() {     return data[0]; }  template<typename T, size_t size, typename Comparator> void Heap<T, size, Comparator>::BubbleUp(int value) {     int j = value;     while(j >= 1)     {         if(comp(j, PARENT(j)))             break;         else             Swap(j, PARENT(j));          j = PARENT(j);     } }  template<typename T, size_t size, typename Comparator> void Heap<T, size, Comparator>::BubbleDown(int value) {     int j = value;     int k = 0;      while(j < n)     {         if(comp(LEFTCHILD(j), RIGHTCHILD(j)))             k = RIGHTCHILD(j);         else             k = LEFTCHILD(j);          if(comp(j, k))             Swap(j, k);          j = k;     } }  template<typename T, size_t size, typename Comparator> void Heap<T, size, Comparator>::Swap(int value1, int value2) {     int temp;     temp = value1;     value1 = value2;     value2 = temp; }  template<typename T> struct SmallerThan { public:     bool operator()(T instance1, T instance2)     {         return(instance1 < instance2);     } };  template<typename T> struct GreaterThan { public:     bool operator()(T value1, T value2)     {         return (value1 > value2);     } };  SmallerThan<int> st; GreaterThan<int> gt; template class Heap<int, 0, st>; template class Heap<int, 0, gt>;   Main.cpp  template<typename T> struct GreaterThan { public:     bool operator()(T value1, T value2)     {         return (value1 > value2);     } };  const size_t size = 8; Heap<int, size, GreaterThan<int> > maxHeap;   EDIT 1:  Here is the error I get when I compile the above code:  Heap.cpp:118:31: error: type/value mismatch at argument 3 in template parameter list for ‘template<class T, unsigned int size, class Comparator> class Heap’  template class Heap<int, 0, st>;                                ^ Heap.cpp:118:31: error:   expected a type, got ‘st’ Heap.cpp:119:31: error: type/value mismatch at argument 3 in template parameter list for ‘template<class T, unsigned int size, class Comparator> class Heap’  template class Heap<int, 0, gt>;                                ^ Heap.cpp:119:31: error:   expected a type, got ‘gt’


null pointer exception in unbindDrawables

I'm getting NullPointerException in unbindDrawables whenever I run my app on the emulator   This is the code I'm using in MainActivity :        @Override         protected void onDestroy()         {                 super.onDestroy();                  unbindDrawables(findViewById(R.id.rootView));                 System.gc();         }      /**      * Not used for now but useful if any bitmap based drawable will be added      * @param view      */       private void unbindDrawables(View view) {             if (view.getBackground() != null) {                 view.getBackground().setCallback(null);             }             if (view instanceof ViewGroup) {                 for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {                     unbindDrawables(((ViewGroup) view).getChildAt(i));                 }                 ((ViewGroup) view).removeAllViews();             } }     This is the logcat     02-27 23:41:41.034: D/MainActivity(1365): chartBoost for more buttons 02-27 23:41:41.034: D/AndroidRuntime(1365): Shutting down VM 02-27 23:41:41.038: W/dalvikvm(1365): threadid=1: thread exiting with uncaught exception (group=0xa617e908) 02-27 23:41:41.050: E/AndroidRuntime(1365): FATAL EXCEPTION: main 02-27 23:41:41.050: E/AndroidRuntime(1365): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bomsn.fitnessquiz/com.bomsn.fitnessquiz.MainActivity}: java.lang.NullPointerException 02-27 23:41:41.050: E/AndroidRuntime(1365):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at android.app.ActivityThread.access$600(ActivityThread.java:141) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at android.os.Handler.dispatchMessage(Handler.java:99) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at android.os.Looper.loop(Looper.java:137) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at android.app.ActivityThread.main(ActivityThread.java:5041) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at java.lang.reflect.Method.invokeNative(Native Method) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at java.lang.reflect.Method.invoke(Method.java:511) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at dalvik.system.NativeStart.main(Native Method) 02-27 23:41:41.050: E/AndroidRuntime(1365): Caused by: java.lang.NullPointerException 02-27 23:41:41.050: E/AndroidRuntime(1365):     at com.bomsn.fitnessquiz.MainActivity.onCreate(MainActivity.java:168) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at android.app.Activity.performCreate(Activity.java:5104) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 02-27 23:41:41.050: E/AndroidRuntime(1365):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) 02-27 23:41:41.050: E/AndroidRuntime(1365):     ... 11 more 02-27 23:41:42.886: D/Volley(1365): [119] u.a: HTTP response for request=<[ ] https://live.chartboost.com/api/config 0x64ca17da HIGH 1> [lifetime=3152], [size=404], [rc=200], [retryCount=0]   It was working without a problem before I added more drawables to the xml file.


Keyboard shortcut/command for opening a new nautilus window and raise it

What is the shortcut for opening a new window (opening folders). for that I have to go to folder options and right click and then need to click on open new window.  or I have to make focus on the folder icon or open a folder then press  Ctrl+N  for opening a new window is there any direct command spcific to open a new window in ubuntu.


Chrome constantly claims that it didn't shut down correctly

For past month or so, from time to time (every 2-3 days) when starting up Google Chrome I see constant claims that it didn't shut down correctly.    This seems to be a false claim, because:   I always close Chrome with "x" button and always shut down the computer in the standard way. Every time I click on Restore Chrome opens my two startup pages and isn't actually restoring anything.   Where can I find some details about this behavior. Is it fixable? Can I do something to prevent or disable displaying this false warning?  I have recently upgraded my computer from Windows 7 Professional to Windows 10 Pro, but this should have no influence on reported problem, because I've seen this message before the upgrade, on Windows 7 as well.


I am a high school student and I am little confused in manometers, My teacher told me that we cannot equate pressure even at same horizontal level if different liquids are there, but he doesn't give the reason, can anyone explain why we cannot equate the pressure in different liquids , if the pressure is different here, then why the liquid in not flowing? it should be the same no matter which liquids are there.


Get specific GPS location somehow on windows 8

I have been googleing a lot. As far as I can tell it will require a lot of work to get the internal GPS chip in my lenovo helix working with any kind of map software. The new stuff is that in windows 8 the internal GPS is a sensor, and not available via the COM port interface. Most software uses the old COM port stuff. The new software from the app store in windows 8 uses the windows location service, which seems to be ignoring the internal chip all together. None of the apps in metro can get accurate coordinates. Just Geo locate by city using IP. This is so bad. Is the GPS functionality useless? Who is at fault, Lenovo or Microsoft?   Edit: I think I fixed it, part of it at least. Under device manager, all you have to do is de-activate and re-activate. Then it will work. It stops working after a couple of minutes. But now at least antenna malfunction is out of the question! Yey!


Inverse of $1-ba$ when $a,b$ are the elements of unital algebra $A$

I know if $a,b$ are elements of a unitral algebra $A$, then $1-ab$ is invertible if and only if $1-ba$ is invertible. And it follows from the observation that if $1-ab$ has inverse $c$ then $1-ba$ has inverse $1+bca$. But I can't prove it.


How do I connect a C-wire on a Triangle Tube Prestige Solo 110?

I purchased a  to use with my recently installed . I only have two wires at my existing heat-only thermostat. I understand that the c-wire is common. There is no terminal labeled "C" in the boiler, but all the grounds are to the chassis/terminal block backplane.   The existing connections at the thermostat are W, RH and a jumper between RH and RC. I contacted Honeywell customer service, and they said "call a contractor." Can I power the RTH6580WF by simply connecting the C in the new thermostat to household common, or do I need to run it back to the chassis or somewhere else of the boiler, or...? If I HAVE to add a separate transformer, where do I connect the + and - from the transformer to the thermostat?


Should I delete asker background/experience?

I'm tempted to delete the first paragraph of this question:       I'm about to dive in head first to creating a Javascript web app. I'm not a Javascript novice, I know my way around, this is just a best practice question. I have done some research on the topic and just wanted to hear what SO had.   The answer to this question does not depend on the user's background. It's just some irrelevant stuff to read before the real question begins.  Acceptable?


So lets say I am playing a level 12 Wizard, and I am in a dungeon when I find a spell book. So something similar happened in a quest I was playing and then the my DM said something along the lines of "So you can copy the spells in the book to your own book and you will have to buy...". So this made me think must I copy these spells to use them or can carry around both spells and cast from them whenever I want? Am I limited to spells from my book or can I use all spell books for spells


I just downloaded Ubuntu, to replace Windows 10, but cannot find how to install it, by running the usual .exe file (or its equivalent on Linux) needed to install a program. Looks also it was downloaded ... on my DVD drive, which seems odd, as normally, if there is no DVD, there is nothing on that drive.  Sorry if this seems a stupid question, I tried to find elsewhere before asking it.


Remove window title / window decorations in Gnome 3.10

Is it possible to hide window decorations or at least the title bar in Gnome 3.10? I found an extension called "Maximus", but when I try to install it (and Gnome asks whether I want to download it and install), nothing happens.


Tool for viewing LibreOffice Writer files in terminal window

I am using a couple of documentation files in LibreOffice (.odt) format. Normally, I access them with LibreOffice Writer of course. But there are times when I can only connect to the site with a text terminal.  I am wondering if there is a terminal-based tool that can show me the contents of these files in approximate correct format? (The files mainly contain simple text, bullet lists, and a few 1x1 tables, so it's relatively simple stuff in terms of formatting.)  P.S. This question is not about starting LibreOffice itself from the command line (which is anwered ).


How can I keep processes running on a remote server even after turning off the terminal machine?

..and then still be able to return to the same session/screen after restarting the terminal machine. I've tried screen but once I restarted my computer screen -d showed no sessions. Nohup seems to be what I want, but then I lose the ability to see the output later on, other than by saving it to a file. Cannot I pretend more?


I want remove date in this template:    I remove this line   \date{\today}   but this not work    i modify to \date{}    I want reduce the spacing


How to get an absolute file path in Python

Given a path such as "mydir/myfile.txt", how do I find the file's absolute path relative to the current working directory in Python? E.g. on Windows, I might end up with:  "C:/example/cwd/mydir/myfile.txt"


Quaternions remove the commutative property and octonions eliminate the associative property can we go any higher and eliminate more properties?


Apache + External IP from LAN + random image = nothing

First let me say a bit about my configuration:   Apache working on PC-1 at port 80 PC-1 has a static IP DMZ in router set to IP of PC-1   When I try to access any image on my webserver using the external IP of PC-1, with any of my computers in the same LAN of PC-1, they won't appear.   When I try to use the local IP of PC-1 it works correctly When I try to use the external IP, using a computer outside of the LAN of PC-1, it works correctly When I try to use the external IP, using any computer inside of the LAN of PC-1, it doesn't work   The URL of the image is correct, it doesn't work even if I try to use the direct link (example: ).  I also tried direct links for other content type like .rar or .txt, these both work correctly in the same situation I mention above. Pages also appear correctly (without the images of course).  Also, there are no errors in Apache error.log and I can find the GET request in Apache access.log  In short:  Only image files hosted on my server cannot be displayed if I use the external IP using a computer inside my LAN   EDIT: Some more information.   Tried with different browsers. Tried turning off firewalls.    EDIT 2: It's not the same problem and thus not the same question as the one marked as duplicated: Only images didn't work, html/php/txt content would load with external IP, unlike the "duplicated" question.


Which graphics driver in the Additional Drivers list should I choose?

Please tell me the best option among these options displayed in the screenshot.


Interactive texture modification (such as fluid mixing) in Unity

I am working on a game where I want to allow users to mix multiple colors (similar to shown in this video): . I have the following questions:  I am expecting that this is done using shaders. What kind of shader I have to use for such implementation? What will be the logic to create this type of shader?  Are there any other ways using which this feature can be implemented?  Are there any open source tutorials or examples?   I would appreciate any suggestions and thoughts on this topic. Thank you.


is it possible to combine grep -C or -A or -B with something that EXCLUDES the matching line

So with grep we can use -A to get lines "after" the match, we can use -B to get lines "before" the match. Also we can use -C to get lines both before and after.  I have some data like this  boring data boring data boring data interesting value MARK boring data boring data boring data interesting value MARK   I'd like to get output like this:  interesting value interesting value   With the option -B I get this:  # cat somefile | grep -B 1 MARK  interesting value MARK interesting value MARK   I'd like to exclude the MARK lines entirely.


I've seen many SE users (even high-reputation and experienced users) upvoting to counter a previous downvote. This mean many up-votes are being cast based on the fact that someone else dislikes the question.  This leads to a biased voting system. I understand this encourages new users to continue using SE. But votes based on another's vote is not constructive at all.   Analogy (TL;DR): You work for the local jury. A defendant is brought into court for some legitimate crime they committed. But you dislike the prosecutor, so you vote to release the defendant.  Is this proper use of upvoting?


When does it make sense to use private static methods in instance class

Ive inherited some code that are a regular class with some private static methods in them. The code (pseudo code) looks like this  public class Animal {     private string typeOfAnimal;      public Animal(string typeOfAnimal)     {         this.typeOfAnimal = typeOfAnimal;     }      public void MakeSound()     {         var sound = Animal.GetSound(typeOfAnimal);          // Make use of sound here            }      private static string GetSound(string typeOfAnimal)     {         if(typeOfAnimal  == "dog")             return "bark";         else if(typeOfAnimal == "cat")             return "mjau";     } }   Is there any benefit in doing like this compared to making GetSound a regular instance method?


Combinatorial proofs: having a difficult time understanding how to write them out

Can someone explain how combinatorial proofs work?  I've included an example questions that's been giving me a hard time.  Any insight on the topic would be great.  $$\sum_{k=1}^{n}k{n \choose k} = n2^{n-1}$$  Another one:  $${2n \choose 2} = 2{n \choose 2} + n^2$$  The solution says:  LHS: Pick two people from a pool of n men and n women. RHS: Pick two women, pick two men, and pick one of each.  But I don't see how this applies.  How does $n^2$ show that we're picking "one of each?"  Thanks for the help :)


A complex number $z=\cos(\alpha)+i\sin(\alpha)=e^{i\alpha}$ is called an $n$th root of unity if $z^n-1=0$, and is a primitive $n$th root of unity if in addition $z^k-1\neq0$ for $1\leq k<n$. The $n$th cyclotomic polynomial, $\Phi_n(x)$, is the monic polynomial of which the zeros are the distinct primitive $n$th roots of unity. Take $n>1$.      (a) Show that $\zeta=e^{2\pi i/n}$ is a primitive $n$th root of unity.      (b) Show that   $$\Phi_n(x)=\prod_{\substack{1\leq j\leq n\\ (j,n)=1}}(x-\zeta^j),$$   and that $x^n-1=\prod_{d\mid n}\Phi_d(x)$.      (c) By applying the inversion formula to $\log \Phi_n(x)$, or otherwise, show that   $$\Phi_n(x)=\prod_{d\mid n}(x^{n/d}-1)^{\mu(d)}.$$   In particular, conclude that $\Phi_n\in\mathbb{Z}[x]$.      (d) Suppose that $p$ is prime, $p\nmid n$, and $\Phi_n(a)\equiv 0\pmod p$. Show that   $\qquad$ (i) $\hskip0.11in p\nmid a$;   $\qquad$ (ii) $\hskip0.07in t\mid n$, where $t=\operatorname{ord}_p a$;   $\qquad$ (iii) $\hskip0.03in$if $a^{n/d}\equiv 1\pmod p$, then $d\mid\frac{n}{t}$;   $\qquad$ (iv) $\hskip0.03in$if $p^s\| (a^t-1)$, then $p^s\|(a^{mt}-1)$ when $p\nmid m$;   $\qquad$ (v) $\hskip0.07in$if $n/t>1$, then $p\nmid \Phi_n(a)$ [use (c)];   $\qquad$ (vi) $\hskip0.03in$the congruence $\Phi_n(x)\equiv0\pmod p$ is solvable if and only if $p\equiv 1\pmod n$.      (e) Show that there are infinitely many primes $p\equiv 1\pmod n$. [Hint: Consider $\Phi_n(np_1\cdots p_ry)$, where the $p_i$ are $\equiv1\bmod n$.]   These are a bunch of exercises on cyclotomic polynomial from Fundamentals of Number theory, p. 131, William J. Leveque. I have thought really hard, but still cannot prove most of them. Could anyone talk something about them or give me some reference books on that? I am really curious about their proofs. Thanks in advance.


I have this  public void otis() {     println("What is Otis?");     String otis = readLine(">");     println("You said " + otis);     println(otis);     println(otis);     if (otis == "dog"){         println("you got it right!");     }     else {         println("try it again!");         otis();     } }   But for some reason even when I respond "dog" it doesn't find a match. I can print the "otis" variable and it says "dog" but apparently that's not equivalent to "dog" somehow?


How to add System user that not be shown in lightdm login screen window or User Accounts?

I want to create an user with no login, no home and that not be shown in lightdm login screen window or User Accounts tool. Just like others users in /etc/passwd: sshd, syslog, avahi...  I've tried with this command line:   useradd -r -u 1001 -M -g 1001 media   But I still can see the user in user accounts tool:    Thanks in advance!!  Note: This question has been claimed to be duplicated but I don't think so. The main difference is what I want is to create a kind of user that never be shown in the lightdm login screen window neither User Accounts tool. An user that not have a properly defined $home is a different thing.


How to establish node-anchor-like points on a (tikz) rectangle path (is there a better method than the one described)?

Background and desired functionality  Rectangles can be drawn with tikz in a number of ways, one way of doing so is to define a rectangle node as follows:  \node (rectangle) [draw, rectangle] {A rectangle}; % Strictly speaking, rectangle is not needed in the [] as nodes are rectangular by default   A useful feature of this is that, as a node, it has anchor points around it such as rectangle.north, rectangle.south west and so on.  Another way is to draw a rectangle path, like this:  \draw (0,0) rectangle (3,2);   I would like to be able to use this second path-based method* but also be able to have (some) named anchors on the path.  Approach from the time of asking  MWE:  The method I had for this is demonstrated by the following MWE (inspired by  and later improved by ):  \documentclass{report}  \usepackage{tikz}  \begin{document}  \begin{tikzpicture}      \draw         (0,0)             coordinate [xshift=-{0.5\pgflinewidth},yshift=-{0.5\pgflinewidth}] (rectangle south west)         rectangle             coordinate (rectangle center)         (3,2)             coordinate [xshift={0.5\pgflinewidth},yshift={0.5\pgflinewidth}] (rectangle north east)         edge [draw=none]             coordinate (rectangle north)         (rectangle north east -| rectangle south west)     ;  \end{tikzpicture}  \end{document}   Obviously this only defines anchors for center, north, north east, and south west, but it can be fairly easily extended to provide south, east, west, north west and south east (as demonstrated in ).  Caveat:  As pointed out by Andrew Stacey in , there was a slight discrepancy between the positioning of these pseudo-anchor coordinates and the anchors on a normal rectangular node. The edge-based solution above originally placed the pseudo-anchors exactly on the coordinates of the rectangle whereas on a rectangular node they would be placed at the outside edge of the lines of the rectangle. Although this was only likely to cause issues with thick line widths I have now added some x/yshifting to the above code to compensate.  The following image shows the difference in anchor positioning between standard node rectangles, the original edge-based solution (without x/yshifting) and the above (revised) edge-based solution (with x/yshifting). The line widths for the lower pictures are set to 0.5cm.    Node rectangle labelling code to illustrate the key to the colours (and for the generally curious):  % styling yoinked from Altermundus' answer \tikzset{dot/.style={circle,fill=#1,inner sep=0,minimum size=4pt}} \node [dot=red] at (rectangle.south west) {}; \node [dot=blue] at (rectangle.center) {}; \node [dot=purple] at (rectangle.north east) {}; \node [dot=green] at (rectangle.north) {}; \node [dot=orange] at (rectangle.north west) {}; \node [dot=yellow] at (rectangle.south) {}; \node [dot=brown] at (rectangle.south east) {}; \node [dot=black] at (rectangle.east) {}; \node [dot=pink] at (rectangle.west) {};   Back to the question  Is there a neater/better way to establish node-anchor-like points on a rectangle path* than the method given in the MWE above?  * = An equivalent drawing method that also allows specifying a rectangle by corner coordinates would be more than acceptable!


Prove that for $n\geq 2, \: \sum_{k = 1}^{n} \frac{1}{k^{2}} < 2 - \frac{1}{n} $  I used induction and I compared the LHS and the RHS but I'm getting an incorrect inequality


I really hope that someone has the time to help out a complete newb regarding blender.  I hava a collada terrain thats been exported from QGIS. When exporting the terrain i get two files with the same name; one .dae (collada model) and one .png (texture).  I can import the collada file inte blender fine, but i really cant wrap my head around the texture file. When I export it i have a nice texturized terrain 3D modell (arial photo). In blender I get the bland collada file without any texture. I've tried looking at few dozen tutorials and forums, tried with materials, textures and shrinkwrap (in blender) but without any better results than getting the collade texturized with hundreds of miniversions of my picture.  Can anybody please explain how to get my arial photo on my terrain? Or at least point me in the right direction.  I would be extremely greatful since I'm starting to feel like a complete tech idiot (and I'm a GIS engineer :)  I've tried exporting to wawvefront and stl and importing in blender with the same results.


How do I convert (universal datetime) string to datetime in c#

I am trying the following statement and it throws an error:  DateTime.ParseExact("Wed, 06 May 2015 11:08:00 PDT", "ddd, dd MMM yyyy HH:mm:ss GMT", null)   I even tried this and it did not work:  DateTime.ParseExact("Wed, 06 May 2015 11:08:00 PDT", "R", null)


What causes the focus confirmation lights to blur?

I recently saw that the red lights on some of the focus points are blurred.  The lights in this picture are lights shown during the selection of focus points.  As you can see the lights in the lower parts are blurred.  This blurring was not there earlier.  This is a Canon EOS 600D with no lens attached.


How would it be to look at the sky if the earth were near the edge of the universe?

By looking at this picture:    The earth is near the center of the universe. I've read that the universe look the same no matter where the observer is located. It is the same distance everywhere.  So I understand that for general relativity the universe need to be homogeneous and isotropic, so it will look the same no matter where I am.  But what if I'm on one of the planets near the right or left of the image, then if I draw the same picture of the universe, but from my perspective, then I would be also located in the center? If that's not the case (I'm actually near an edge), then part of my sky would be completely dark, and all the sky that way won't be isotropic?


How am I able to stand up and walk down the aisle of a flying passenger jet?

The energy of a moving object is $E = mv^2\;.$ That is it increases with velocity squared.  I walk at say 3 miles per hour, or lets round that down to 1 meter per second for a slow walk. I weigh less than $100~\mathrm{kg}\;,$ but lets just round that up to $100~\mathrm{ kg}$ for convenience (it is just after Christmas).  So when I walk along the pavement, I have $100~\mathrm{kg\; m^2 s^{-2}}$, 100 joules of kinetic energy.  Now I get on a passenger jet, which is cruising at around 500 knots, call that 250 meters per second.  In my seat I have $100\times 250^2 = 6250000$ joules of kinetic energy. But when I walk down the aisle I have $100\times 251^2 = 6300100$ joules of kinetic energy. The difference between these is: 50100 joules.  It feels the same to me, walking down the pavement as walking down the aisle of the plane. I didn't have to make some huge effort to get up to speed on the plane, yet I needed 500 times the energy to do it.  How is this possible, and where did the energy come from?


Universal navigation menu across domains - would it be considered duplicate content?

Possible Duplicate:          Across different sites on different second-level domains exists a universal navigation bar with a collection of roughly 30 links. This universal bar is exactly the same for every page on each domain. The bar's HTML, CSS and JavaScript are all stored in a subfolder for each domain and the HTML is embedded upon serving the page and is not being injected on the client side. None of the links use any rel directives and are as vanilla as can be.  My question is about Google's duplicate content rule. Would something like this be considered duplicate content? Matt Cutt's  about duplicate content mentions boilerplate repetition, but then he mentions lengthy legalese. Since the text in this universal bar is brief and uses common terms, I wonder if this same rule applies.   If this is considered duplicate content, what would be a good way to correct the problem?


Bash script: check if a file is a text file

I am writing a menu based bash script, one of the menu options is to send an email with a text file attachment. I am having trouble with checking if my file is a text file. Here is what I have:  fileExists=10 until [ $fileExists -eq 9 ] do   echo "Please enter the name of the file you want to attach: "   read attachment   isFile=$(file $attachment | cut -d\ -f2)   if [[ $isFile = "ASCII" ]]     then       fileExists=0     else       echo "$attachment is not a text file, please use a different file"   fi done   I keep getting the error cut: delimiter must be a single character.


Only new folder in context menu on Windows 7

Is it normal for a fresh copy of Windows 7 Home Premium 64-bit to only have "Folder" in the "New" item of the Explorer context menu? Do I need to add items manually? See below for a screenshot:


What happened to with the alternate installer in Ubuntu 14.04?

vs.:     In the "old" times Ubuntu had a separated "ncurses-based" installer when people wanted to use Full Disc Encryption when installing. It was named: Alternate installer.   Question: What happened to the alternate install CD? Are there any


I have applied to a very well-known institution for PhD in Europe. They evaluate students first and then match them with advisors, so this is not a position with a specific supervisor; an admission committee will decide, not a single supervisor. I am thinking about an interview that one will have with them. This university has almost the best group in my field and is extremely famous for it. It’s obvious that many students, who are interested in this field, want to study there. I was thinking about the following question in their interview, and how I should answer? “Why did you decide to apply to this institution/Why in particular this university?” I am having a hard time in preparing an honest while strong answer to this question. The problem is that, as I said, it’s obvious they’re good and I think they aren’t interested in hearing this from an applicant. At the same time, that’s basically my reason for applying there: since there are great professors there, very talented students, etc. On the other hand, their research is very specific and I believe they do not expect from a candidate to show off with “knowing” their research in “detail”. I know what they are doing, I believe it is important and valuable, and it matches with my interest as my background shows. However, I cannot prove to them by examples or other ways I know in details what they are doing since that’s not right. My question is this: What is your suggestion to me? Should I start reading their research in detail to be able to make specific examples to support my reasons for applying to their group? I am a bit puzzle about this. Please if you think more information is needed leave a comment before writing an answer. Thanks a lot!


How do I draw shapes inside a tikz node?

I know how to draw different shapes using tikz, like this:  \documentclass{minimal} \usepackage{tikz} \begin{document}  \begin{tikzpicture} \draw (0,0) ellipse (1 and 1.5)       (0,2.5) circle (1)       (2.5,0) circle (1.5); \end{tikzpicture}  \end{document}     However, I would like to put a number of different shapes together inside a node, and I couldn't yet find a simple way to do that. I will make a little figure to include in a large diagram which is already made of several nodes.  If this is not possible, or not easy, then how do I include a JPG or EPS file in a node?  Thank you!


Windows wildcards with files having more than 3 characters extensions

On Windows 7, I have a directory containing the following four files:   xxx.txt xxx.txt2 xxx2.txt xxx2.txt2   With the file have more than 3 character as a file extension, the behavior of the wildcard * seems odd:  dir *.txt  10/13/2014  04:14 PM                 6 xxx.txt 10/13/2014  04:17 PM                 6 xxx2.txt 10/13/2014  04:17 PM                 6 xxx2.txt2 10/13/2014  04:14 PM                 6 xxx.txt2            4 File(s)             24 bytes            0 Dir(s)   6,660,980,736 bytes free   I would expect to see only the two files with txt extension and not the ones with txt2 (like it would on a Linux machine). Does MS-DOS ignore the truncate the file extension to 3 characters or does it add automatically another wildcard at the end? If I want to delete only the files with txt extension and not the one with txt2, which command should I use? Thanks


How can I map all black pixels in a greyscale image to alpha so that it looks the same over a black background?

I have a grayscale image, and I want to make all the black pixels transparent, keep all the white pixels the same, and make all the grey pixels partially transparent based on how dark they are. In other words, I want to get rid of all the black in this image, but I want it so it looks exactly the same as it did before when it’s on top of a black background. I’ve looked online I found info about how to do this with a layer mask, and it seemed pretty straightforward, but every time I try to do it the result is darker than the original and I’m not sure why. I want it to look exactly the same over a black background as it does now. Can anyone advise me here?  Edit: My question was marked as duplicate, but no matter how much I try the exact instructions in other answers, the result is slightly darker than the original.   Edit 2: I’m going to explain exactly what I’m trying. I have the layer I’m trying to remove black from. It has a transparent background, so I have it in front of a black background layer. I select the entire image and copy merged while only that layer and the black background are visible. Then I create a completely white layer that I put under the layer I want to remover Black from and in front of the white background. I add a layer mask to the new white layer. I go to channels, deselect all and select the mask channel. I paste the image I copied. Then I make the original layer I wanted to remove black from invisible. At this point, I can see the masked white layer in front of the black background, and it looks almost exactly how it should, but slightly darker. When I toggle the visibility of the original layer, it’s clearly slightly brighter. What gives?  The image was not in grayscale mode, but it was truly grayscale. As in, going to image -> adjustments -> black and white, and moving the sliders changes nothing.   Edit3: a play-by-play of what I am trying and the result:


I have published my NPM module  18 days ago. It has a title, description, and keywords. But if I search for detect-file-encoding-and-language npm on Google, it does not appear. Well, it appears somewhere but not on the first 10 Google result pages, which means that no one will find it. Interestingly, if I do the exact same search on Bing, it appears right on the first page as the first result. Why do other NPM packages show up right on the first page on Google but not my package?


Why does my ice cream have ice crystals?

I put icecream mixture in freezer but after taking it out of freezer, I found ice crystals in it. What should be done to avoid ice crystals in icecream?


Can a two-sided lightsaber have two different colored blades?

I have always seen two-sided lightsabers with both blades having same color. Can those blades have different colors? Have we seen them in the canon? Or, is it not possible theoretically because there can only be one crystal inside a lightsaber or something like that?


How can I use importance sampling to estimate $p$?

I have two density functions, $f$ and $g$. I generated a sample $X_1,\ldots, X_n$ using the distribution corresponding to density function $f$. I'm interested in the parameter $p_g = \operatorname{P}_g(Y_i > c)$, where $Y_i$ is a value drawn from the distribution corresponding to the density function $g$.   Question: How can I use importance sampling to estimate the parameter $p_g$?  I know how to estimate the parameter $p_f = P_f(X_i>c)$; I can just evaluate $$\tilde{p}_f = \dfrac{1}{n}\sum\limits_{i = 1}^n\mathbb{1}_{X_i>c}$$ However, if I want to estimate $p_g$ with importance sampling I would need to compute $$\tilde{p}_g = \dfrac{1}{n}\sum\limits_{i = 1}^n\mathbb{1}_{X_i >c}w(X_i)$$ where $w(X_i)$ is the importance weight. My problem is that I don't know what $w(X_i)$ has to look like in this case. When estimating the mean of the distribution corresponding to $g$ you would just evaluate $$\dfrac{1}{n}\sum\limits_{i =1}^n X_i \dfrac{p(X_i)}{q(X_i)}$$ but I can't see how this translates into what I want..


I would like to give a suggestion. It is great that you can ask other developers to revise your code, correct it and give you suggestions. But sometimes, you need help with configuring the best technology or a practice you could use, before starting coding. Such questions are not allowed on Stack Overflow. Why is that and can that be changed? Making a category of questions, which do not contain code but asking for suggestion for example.


Changing Default Apache version on MacOS Sierra

A DHS sweep of the network showed that one of the researchers Macs is running a non-safe version of Apache (2.4.25) and they would like him to update to at least 2.4.27.  He is having difficulty getting MacOS to use the new version of Apache rather than the one installed by default with Sierra. His issues are:  Mac OS X 10.12.6 Sierra   I have installed httpd 2.4.27 . . .  /usr/local/apache2/bin/ but the default httpd running is located at /usr/sbin/ I cannot install a new httpd into /usr/sbin/  - no write persmissions for sudo I made a root user active - but "root" does not have write permissions for /usr/sbin/ either   I cannot find any source on the web that describes how to change the httpd path from the default system version (/usr/sbin/httpd) to a new USER installed version, like /usr/local/apache2/bin/httpd  What steps am I missing?


How to clear a player's inventory he has two of the same unstackable item in inventory?

I'm trying to clear a player's inventory of an unstackable item if they have two of them in their inventory. This is a system to prevent duplication, while at the same time guaranteeing they still have this item and can't get rid of it.  The problem is: using an NBT tag selector for if the player has this item in their inventory only works for one item. Writing another entry within this NBT tag selector (like {Inventory:[{id:"minecraft:example"},{id:"minecraft:example"}]}) still treats it like one item and using {id:"minecraft:example",Count:2b} doesn't work either since these items can't be stacked.  How can I make this work the way I want it to? I'd rather not make 600+ different NBT tag selectors for each combination of possible {Slot:#b}'s if I can avoid it.


In what conditions should a pronoun use forms of singular they?

Are there grammatical errors in the following sentences? Semantically, one of them seems not right.  Someone parked their cars at the entrance. The scientist dedicated themselves to the research.


Is there a way to link a question to more than one stack exchange site?

I posted the following question, and answer (for documentation purposes), to Stack Overflow since that is where I originally looked for the answer (and didn't find one):    I thought it might fit on Server Fault as well so I was going to copy the question and answer over but was unsure if that was appropriate or if there was a better way of going about it.  Just like copying and pasting code is not a good programming practice, is there some way to reuse this question/answer on Server Fault?


Giving potion effect when I hold an Item

I've tried for some time to fix my problem alone, but now i need some help ! ( 1.16.4 version ) I am making server with friends using custom items and powers related to them, in this example it's a wand of levitation. So here's the command that I've used : execute if entity @a[nbt={SelectedItem:{id:"minecraft:stick",tag:{display:{Name:'[{"text":"WAND OF LEVITATION","color":"gold","bold":true},{"text":"","color":"gold","bold":false}]'}}}}] run effect give @s minecraft:levitation 1 3 true This isn't showing me any error, just not applying the levitation effect. why ? Command block on Repeat-Unconditional-Always active


Difference between "all the" and simply "all"

In a mail from my professor, I read      you need to specify all the fields.    Here, he gave us a form with about 25 fields. He asked us to fill out the fields.  I'm skeptical about the usage of the in his statement. I assume that it's used when we are particular about a single object, not for a group of objects (plural).   I smell something odd with professor's sentence. Am I right?


When to choose checked and unchecked exceptions

In Java (or any other language with checked exceptions), when creating your own exception class, how do you decide whether it should be checked or unchecked?  My instinct is to say that a checked exception would be called for in cases where the caller might be able to recover in some productive way, where as an unchecked exception would be more for unrecoverable cases, but I'd be interested in other's thoughts.


Someone else points his DNS to my webserver

I have a DNS registered at godaddy. The name of my DNS is: www.example.com and it works perfectly. I discovered that www.fake.de is also linking to my web server. The problem with this is that if someone search for www.example.com, google wont show my DNS but fake.de. Someone else is taking advance from my webserver.   Can someone please fix this?


Is there a convention for power of a half being the positive square root?

I know the $\surd$ sign refers to the positive square root.  Does the exponent 1/2 mean the positive square root too by convention?  I ask because I'm converting from parametric to cartesian here...  $x=t^2$ and $y=t^3$  So $t=\pm \sqrt{x}$  Then $y=\pm x^{3/2}$  Yet the given answer is $y=x^{3/2}$ in the textbook.  Can someone clarify please?  Thanks, Rob


Why and when should a goto be used in C / C++?

I know lots of questions about why not use goto, why goto is bad practice, why goto was create by devil, why the fingers of those who type goto should be ripped off, etc...  And in  , , and even at  it's possible to find reasons pro / against goto.  Even Stackoverflow has a goto tag :)  But, obviously, goto is accepted as a valid command, otherwise your compiler / interpreter wouldn't know what to do with it. Even in C / C++ it's possible to use goto, and that language even has a formal, ISO specification.  So, probably, there should be some case where only by using goto it's possible to accomplish some task. Then, why and when should a goto be used in C / C++ ?  Edit:  Just to make sure:  1 - this question doesn't require debate. It should be answerable: giving one or more cases where goto is the only solution, or stating no, it's always possible to avoid a goto. Of course, I'm not the only who can decide whether it should be closed or not, but I don't think that "too broad, asks for debate, etc" are reasons to close it.  2 - There might be some cases where goto make the code cleaner, faster, etc. I don't want those. I want to know if there exists one case where goto is the only solution (no, it's not a dup of that "give good examples of goto" question)  3 - I'll accept any downvote, with a smile on my face, if the downvote is justified. But I'm pretty sure that this question has an answer and has done previous research about the subject. Downvoting simple because those 4-letters taboo word that starts with a "G" was used... sorry...


Transform YYYYMM to DD-MM-YYY SQL Server

I have a column in sql server like 201801. How can I transform this in DD-MM-YYYY? Thank you!


What is the link between the BCS ground state and superconductivity?

The link between the BCS ground state $$ \left|\Psi_\mathrm{BCS}\right\rangle = \prod_k \left( u_k - v_ke^{i \phi} c_{k\uparrow}^{\dagger} c_{-k\downarrow}^{\dagger}\right) \left|0\right\rangle $$ and the property of superconductivity (carrying current with no resistance) does not seem obvious to me, but I can't find a satisfying explanation anywhere.  According to some authors, the gap explains superconductivity, but I am not convinced by this, since (1) insulators are gapped too, and (2) some superconductors have a vanishing gap for some values in $k$-space.  Isn't it possible to just calculate the linear response under DC field and compare with the normal state expectation value to see how this works? Does anyone know how to perform such a calculation?


Following is the proof of the above proposition given in my textbook.  Let, $\arccos{x}={\theta}_2$ and $\arcsin{x}={\theta}_1$  $$\sin({\theta}_1 + {\theta}_2)=\sin{\theta_1}\cos{\theta_2}+\sin{\theta_2}\cos{\theta_1}$$  $$\implies \sin({\theta}_1 + {\theta}_2)=x^2+(\sqrt{1-x^2})(\sqrt{1-x^2})$$  $$\implies \arccos{x}+\arcsin{x}=\arcsin{(1)}$$  $$\implies \arccos{x}+\arcsin{x}=\frac{\pi}{2}$$  Problem:  When, $\cos{\theta_1}=-\sqrt{1-x^2}$  and $\sin{\theta_2}=\sqrt{1-x^2}$  Then, $${\theta}_1 + {\theta}_2=\arcsin{(-1)}$$  $$\implies \arccos{x}+\arcsin{x}=-\frac{\pi}{2}$$  Doesn't it disprove the given proposition?


I have a database field is_enabled - which set to either 'Yes' or 'No'.  Following checkbox will have to set as checked if the db field is 'Yes'.  <input name="enab" type="checkbox"> <label>Enabled Status: </label>   JQuery:  $('[name=enab]').val(values.enab);   Anyone please help.


I feel like I have a good grasp of what the __name__ environment variable is in python in general. However, when I print out the __name__ variable from an __init__.py it prints out the name of the directory it's in (aka the package name). How does __name__ get defined in the init file?    Also, does each python file have its own local __name__ variable? because it's constantly changing between files... (maybe I don't understand __name__ as well as I thought I did)    EDIT: I really don't think this question is the same as the __name__ equals __main__ question. I understand what __name__ equals in most python files. I'm just still confused on what it's value is in the __init__ files.


Does the word Human exist in Middle Earth?

By Illuvatar's will, mankind is known as Man, not humans. As the secret history of our world, however, this is in our past. As such, is the word human known to Man during the time period in history written by Tolkien, and what instances of its usage are there, if any?


Derivative of an infinite series of functions equal to sum of the derivatives?

Suppose we have a series of functions $$\sum_{x=0}^\infty  h(\theta, x)$$  The question is: is it correct that $$\partial _\theta \sum_{x=0}^\infty  h(\theta, x)=\sum_{x=0}^\infty  \partial _\theta h(\theta, x)$$  I would assume that the following arguments are correct: Take first the sequence not to $\infty$ but to $n$ $$\partial _\theta \sum_{x=0}^n h(\theta, x)=\sum_{x=0}^n \partial _\theta h(\theta, x)$$  We already know that this holds. Now simply take the limit as $n\to \infty$. We see then that the desired result is correct, so long as for each $x\in \mathbb N$, $\partial _\theta h(\theta, x)$ exists, and if the sequence $\sum_{x=0}^n \partial _\theta h(\theta, x)$ converges.    However, my textbook says that we need additional assumptions. We need $\partial _\theta h(\theta, x)$ to be continuous, and we need the series $\sum_{x=0}^n \partial _\theta h(\theta, x)$ to "converge uniformly".   Why do we need these additional assumptions and what is wrong with my (sketchy) proof?


Drupal Behaviors uncaught reference error

I'm using Drupal 8.  What I'm trying to do is:   Access the active node From the node get the value of field_test and assign it to a variable Pass the variable to the drupalSettings function and subsequently to a custom module 'mycustommodule' that triggers an alert   In my content type, I created a field_test field, which is the field I reference in my code. The block is placed on a page of this content type.  This is the JavaScript code I am using.  mycustomblock.libraries.yml  custom:   version: 1.x   js:     js/custom.js: {}   dependencies:     - core/jquery     - core/drupalSettings   custom.js  (function ($, Drupal, drupalSettings) {   Drupal.behaviors.mycustomblock = {     attach: function (context, settings) {       var testMe = drupalSettings.mycustomblock.test;       alert(testMe);    } }; })(jQuery, Drupal, drupalSettings);   The error I get from the JavaScript console is this.    The error message is referring to this line.     Why is the instance of Drupal in the closing parenthesis throwing this error?


Why passing std::move(object) and member of this object to function causes SIGSEGV

The following code results in SIGSEGV and I cannot understand why is that.  #include <iostream> using namespace std;  struct C {     C(int x) { ptr = new int(x); }     C(C&& c) { ptr = c.ptr; c.ptr = nullptr; }      int* ptr; };  void foo(int* x, C c) {     cout << *x  << endl; }  int main() {     C c(10);     foo(c.ptr, std::move(c));        return 0; }   I would expect the pointer c.ptr to be passed by value to the function foo, however it behaves like its passed by reference.  Now, if I change the ordering of arguments: void foo(C c, int* x), than the problem disappears. The other solution is to create a local copy of c.ptr before calling to x, and than passing that local copy to foo.  I would like to understand why can't i pass c.ptr by value in the sample code above.


Checking to see if one array's elements are in another array in PHP

I have two arrays in PHP as follows:  People:  Array (     [0] => 3     [1] => 20 )   Wanted Criminals:  Array (     [0] => 2     [1] => 4     [2] => 8     [3] => 11     [4] => 12     [5] => 13     [6] => 14     [7] => 15     [8] => 16     [9] => 17     [10] => 18     [11] => 19     [12] => 20 )   How do I check if any of the People elements are in the Wanted Criminals array?  In this example, it should return true because 20 is in Wanted Criminals.


Which electronics components should I always have on hand?

I am thinking about ordering up some parts for every day use. I am thinking about making one big purchase so as to minimize on shipping and other charges.   What are some of the components that any electronics hobbyist should have around ALL the time?  To put a little more scope: typically working with Arduino's, PICs and sensors. 5V - low current projects.   Looking for: component, value or range (if any), manufacturer (optional)   For example -  Resistors, 1K through 100K 5W


Is such participle clause reducing usage constrained to only past tense?

As I saw on a grammar website, "She went into the home and left her shoes" equals "She went into the home, leaving her shoes".  Can this usage also be used with other tenses? Like future tense, present perfect tense, etc..  P.S. I mean, does the sentence "she has been working AND WRITING composion in her office" equal "she has been working, WRITING composition in her office".  .... and does "I will pay for it AND GIVE SOME PAMPHLET to you" equal "I will pay for it, GIVING SOME PAMPHLET to you"...etc.   that describes an action that happens just before another action.


Can this be stretched without an actual stretching?

Is there any way to make this picture in 1920x1080? Both sides are filled with a lot of pencil strokes and for me, this makes it nearly impossible to use even a stamp and duplicate a part of the background to fill the rest of the white sides.


Derivative of $T^{\mu \nu}_{\mathrm{mat}}$ in terms of $F^{\mu \nu}$ and $j^\nu$

A friend of mine encountered a problem while studying GR. I'm going to answer it myself if I get some time, but here it is.  The (symmetrized) energy-momentum tensor for the electromagnetic field is $$T^{\mu \nu} = F^{\mu \lambda} F^{\nu}_{\,\, \lambda} - \frac{1}{4} \eta^{\mu \nu} F^{\lambda \sigma} F_{\lambda \sigma} \, .$$  In this calculation, she had to assume conservation of energy-momentum in the form $\partial_\mu T^{\mu \nu} = 0$ to figure how it works out in the presence of field sources. In other words: $$T^{\mu \nu} = T^{\mu \nu}_\mathrm{matter} + T^{\mu \nu}_\mathrm{field}$$ The step that confused her was showing that  $$ \partial_\mu T^{\mu \nu}_\mathrm{matter} = F^{\nu}_{\, \, \mu} j^{\mu} $$  I tried to write it out using the Maxwell field equation $$\partial_\mu F^{\mu \nu} = j^\nu$$ and the Bianchi identity $$\partial_{[ \lambda} F_{\mu \nu ]} = 0$$ but something smelled fishy in my calculations and I didn't manage to get back to it.


Reconfigure keyboard layout - 13.10, 14.04

I always modify keyboard layouts to add special characters as my needs. To modify the layout I open the codes under:  /usr/share/X11/xkb/symbols/  The changes would apply after a re-login, or a reboot for the default one.  But now on Ubuntu 13.10 and 14.04, with the new text entry settings, the changes don’t take effect even after a reboot, if I’ve enabled them before editting.  Is there any way to force Ubuntu to reconfigure keyboard layouts, Somewhat like dpkg-reconfigure locales for locales? The files are saved correctly!


iCloud and AppleID 'married' to Macintosh

When purchasing a used Macintosh, what does one need to know (i.e. what will adverse outcome) regarding the Hardware (serial #?) being tie to an ID?  Apple Products: Due to Apple removing the old website they had to check for iCloud or Apple ID accounts tied to devices we cannot be certain whether or not a device was tied to an account in the past. There is a possibility that a device may bring down a lock from a previous owner after we have already processed it. If a device does bring down a lock past our standard 30 day return policy it will not be accepted for return.    What can be done and what resources are available to mitigate this risk before buying the used hardware?


Find all continuous real valued function such that $(f(x))^2+C=\int\limits_0^xf(t)dt$

Find all continuous real valued function such that $$(f(x))^2+C=\int\limits_0^xf(t)dt$$   for some $C\in\mathbb{R}$   If I set $F(x)=\int\limits_0^xf(t)dt$ then $F$ is differentiable and $F'(x)=f(x)$,  so $(f(x))^2+C$ is diferentible as it does $\sqrt{F(x)-C}=|f(x)|$,  and then $F'(x)=(|f(x)|^2+C)'=2|f(x)||f(x)|'=f(x)$.  and then I don't know how to continue. I just see the solution $f(x)=0$ whith $C=0$.


apt-get returning error "N: Ignoring file '20auto-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension"

Every time I update packages using apt-get i get this error code.  N: Ignoring file '20auto-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension   I think the problem arose after I used apt-get dist-upgrade (or maybe just apt dist-upgrade)  I know this question is very simular to  only the file name is different. This doesn't seem to be affecting my machine directly but I thought I might sort it out before it grows into a bigger problem.  I'm currently running 16.04


The body of the function set_bit(uint64_tx, int pos, bool value) which returns the modified value of the input x, where the bit at the pos position is replaced with the value value.  Remember that in the C language (this is defined in stdbool.h), true is the integer 1 while false is the integer 0.  Code  uint8_t a=0b00000000; uint8_t b=0b00001000; uint8_t c=0b11111101; uint8_t d=0b11011011;  // l'opération  ~( a ) renvoi 0b11111111 // l'opération (c & a) renvoi 0b00000000 // l'opération (c & b) renvoi 0b00001000 // l'opération (a | b) renvoi 0b00001000 // l'opération (d & c) renvoi 0b11011001    #include <stdint.h> #include <stdbool.h>  /* * @pre 0<= pos < 64 */  uint64_t set_bit(uint64_t x, int pos, bool value) {     // à compléter }


Assume I have a set $S$ of $N$ elements and I create subsets with $k$ elements from it. With no additional property the number of possible such subsets will be $N \choose k$. Now I want my subsets to satisfy some additional rules $R_i$: Given a set $X$ of subsets of $S$ with $k$ elements (i.e. $\forall A \in X, A \subset S , \#A=k$), $X$ satisfies $R_i$ if and only if for all $A$ and $B$ in $X$, $A$ and $B$ share at most $i$ elements, i.e. $\forall A , B \in X, \#(A \cap B) \le i$. Let's call $S_i$ the set of all such $X$ satisfying $R_i$. I want to know how large a set satisfying $R_i$ can be, i.e. what is $M_i = \max_{X \in S_i} \#X $ For example if $N=1000$ and $k=10$, trivially we have $M_9 = {1000 \choose 10}$: the largest ensemble of subsets of $10$ elements that share at most $9$ with one another is exactly the set of all possible combinations of $10$ elements out of $1000$. Similarly at the other extreme, still for $N=1000$ and $k=10$, we have $M_0 = 1000/10=100$. Is there a formula or clever (not brute force) algorithm to compute other less trivial cases for $i=1,2,\dots8$? BTW even if there is a nice formula, I'll ultimately want to implement a way to get a maximal $X$...


Execute commands against list of items in file in bash

I have a file listing 1 or more server's hostnames hostname_list that I generate using grep and awk. Now I need to execute salt commands against the hostnames. I am trying, as a test, to run test.ping to ping each server in the list. I have tried doing it as a for loop but I can't get it to work. I've tried numerous variations of: for i in hostname_list do      salt $i test.ping done


Show that $\mathbb{Q}(\zeta_n)$ is Galois over $\mathbb{Q}$ and $Gal(\mathbb{Q}(\zeta_n)/\mathbb{Q}))\cong \mathbb{Z_n}^*$

Question 1: For $n \in \mathbb{N}$ explain why $\mathbb{Q}(\zeta_n)$ is Galois over $\mathbb{Q}$   We must show that it is normal and separable.   $\mathbb{Q}(\zeta_n)/\mathbb{Q}$ is normal since it is a splitting field for $X^n-1 \in\mathbb{Q}[X]$ (I think... Is this correct?).  It is separable because it is of characteristic $0$  Question 2: $Gal(\mathbb{Q}(\zeta_n)/\mathbb{Q}))\cong \mathbb{Z_n}^*$  Is this because the primitive nth root of unity $\zeta_n$ acts as a generator for a cyclic group? I am unable to fill out a decent proof on this.   Thanks for your help


I came across the word "[b]ilingual" when reading  from Medical News Today.com.  Prof. Marian explains in the paper that "[b]ilinguals' ability to seamlessly switch between two distinct communication systems masks the considerable control exerted at the neural level."  This is my first time to see that way of using "[]" brackets like "[b]ilingual", and I wonder what it means or how you use it. Could you explain it?


Can a level 1 Warlock Cast a 4th level spell from 8th level Sorcerer with their warlock pact magic spell slots?

Can my player’s multiclass Warlock 1/Sorcerer 8 cast the higher level sorcerer spells from with their warlock pact magic spell slots?  My player argued that he could now cast his 4th level sorcerer spells with his level 1 warlock  spells slots. I think he interpreted pact magic as "highest spell slot possible",  so he figures that since he has 4th level spell slots, he interprets that the warlock spell slots are 4th level slots now too.


Is there a (cross-platform) way to get a C FILE* handle from a C++ std::fstream ?  The reason I ask is because my C++ library accepts fstreams and in one particular function I'd like to use a C library that accepts a FILE*.


Adding custom applications to GNOME launcher

Looking for a utility that allows me insert an item into the list of applications that GNOME knows about.   For example: I have downloaded Eclipse EE (I have some very special plugins that I need to work with, and those plugins don't "like" the version available in the default repository). I'm using GNOME 3, on Ubuntu 11.10. So I want to execute Eclipse w/o opening a terminal and running it.   It must be something very simple.


On my installation of CentOS 7, SELinux is enabled by default. This is preventing Apache from properly reading PHP files in the standard /var/www/html document root (the browser is blank when displaying web pages containing PHP script). When I disable SELinux the pages display normally.  Is there some way of setting SELinux to allow Apache to access PHP files from the document root? I would rather not disable SELinux entirely given that CentOS clearly believes it is a desirable security addition.


Name for "filler" words that potentially convey lack of self confidence

There are plenty of internet search hits for "filler" words, and how not to use them. I'm not asking about these. I would like to know if there is a name for language that people use which perhaps: aim to soften the sentence, make the sentence less formal, or are used subconsciously due to lack of confidence in what is being said / self confidence of the communicator. Some examples:  "Just" when not used instead of "only": "I just thought you'd like to be reminded of your meeting" "lol"/"haha" equivalents: "I like how you looked today haha" Sentences that don't get to the point: "I was wondering when you would be able to look at my report" vs "When will you be able to look at my report?"  Possibly these are all instances of beating around the bush. But it feels like there could be a more precise definition for these cases as what needs to be said is being said.


I was trying to make a game with a bow and arrow using lwjgl but I couldent get the arch right. I have a function called projectile that is updated once a frame for each arrow. my frame cap is at 60 fps. the projectile function looks like this.  public static void projectile(Entity arrow, double speed, double gravity){      Vector3f position = arrow.getPosition();     float rotX = arrow.getRotX();     float rotY = arrow.getRotY();     float rotZ = arrow.getRotZ();      //code      return; }   How can I use this function to move the arrow with it's speed and gravity along an arch. based on its rotation(for direction it moves in) and location. if you need more information please ask. thank you :)


How I create table View of webform submissions

I want to view webform submissions in table view. I created a view of webform submissions but it shows a link for the data submitted. I dont want to use link, I want only simple table view.


Determine if a sequence contains all elements of another sequence using Linq

Given two sets of values:  var subset = new[] { 2, 4, 6, 8 };  var superset = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };   how do I determine if superset contains all elements of subset?  I have come up with this:  superset.Intersect(subset).Count() == subset.Count()   Is this the most logical and efficient method?


Relationship of ServerName, ServerAlias, host.file and how to define them in httpd-vhosts.conf

I wonder what is the relationship of ServerName & ServerAlias with host.file. As I know ServerName sets the hostname and port that the server uses to identify itself and ServerAlias is the alternate names for a host. But does the ServerName and ServerAlias need to be identified in host.file? Do we need to put the exact domain name or it can be an alternate name in ServerName or ServerAlias? Let's say my actual domain is www.example.com and I have set up SSL and my website are now run as https+www.example.com, now I'm trying to redirect my website from http+example.com when I type it in the browser and I expect my browser will redirect me to https+www.example.com,  what ServerName or ServerAlias should I put in httpd-vhost.conf? Below are my host.file:  127.0.0.1 example.com www.example.com ::1 example.com www.example.com 127.0.0.1 localhost ::1 localhost   Below are my httpd-vhosts.conf:  <VirtualHost *:80>     ServerName example.com     ServerAlias www.example.com     DocumentRoot "d:/wamp64/www/example"     <Directory  "d:/wamp64/www/example/">         Options +Indexes +Includes +FollowSymLinks +MultiViews         AllowOverride All         Order allow,deny         Allow from all         Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"     </Directory> </VirtualHost>   Does my definition of ServerName and ServerAlias correct in httpd-vhosts.conf?  This is what I put in .htacess to redirect my website from http+example.com to https+ww.example.com but it does not work and I believe it related with my definition of ServerName and ServerAlias:  RewriteCond %{HTTPS} !on  RewriteCond %{HTTP_HOST} ^example\.com$ RewriteRule .* https://www.example.com%{REQUEST_URI} [R=301,L]   Below is the outcome of my redirection logs:  [perdir D:/wamp64/www/example/] RewriteCond: input='off' pattern='!on' => matched  [perdir D:/wamp64/www/example/] RewriteCond: input='' pattern='^example\\.com$' => not-matched   This is what I get from Firefox debugger:    Update  I've update my .htaccess to below:  RewriteCond %{HTTP_HOST} example.com [NC] RewriteRule .* https://www.example.com%{REQUEST_URI} [R=301,L]   I update my ServerName in vhost to www.example.com  Here's the logs that I got:  example per-dir prefix: D:/wamp64/www/example/index.php/news-and-events/news-and-events/news -> index.php/news-and-events/news-and-events/news applying pattern '.*' to uri 'index.php/news-and-events/news-and-events/news' RewriteCond: input='off' pattern='!on' => matched RewriteCond: input='www.example.com' pattern='example.com' [NC] => matched rewrite 'index.php/news-and-events/news-and-events/news' -> 'https://www.example.com/index.php/news-and-events/news-and-events/news' explicitly forcing redirect with https://www.example.com/index.php/news-and-events/news-and-events/news trying to replace prefix D:/wamp64/www/example/ with / escaping https://www.example.com/index.php/news-and-events/news-and-events/news for redirect redirect to https://www.example.com/index.php/news-and-events/news-and-events/news [REDIRECT/301]   Here is what I got from firefox debugger raw header:  GEThttp://example.com/  Request URL:http://example.com/ Request Method:GET  Request Headers (328 B)  Raw Headers Host: example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:74.0) Gecko/20100101 Firefox/74.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate DNT: 1 Connection: keep-alive Upgrade-Insecure-Requests: 1   This is what I get from Microsoft Edge:  General Request URL: http://example.com/ Referrer Policy: no-referrer-when-downgrade Request Headers Provisional headers are shown Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36 Edg/80.0.361.111   Please help and do point me out if I've done anything wrong and thanks in advance!


Can I travel to Australia for leisure but on a business visitor visa?

I have a two years Australian business visitor visa with multiple entry option. This visa lets me attend business related workshops for a project undertaken by our parent company which is located in Sydney. Now I want to explore this country and was hoping to spend my next holiday in Australia. For this purpose, do I need to re-apply for a new tourist visa or my business visitor visa will suffice all requirements?


My wife and I had a heated discussion on whether the move below was permissible under the official Scrabble rules. In this case, I added the letters O, I to form OE and OI. She claims it was a double movement, as OE was permissible because it was attached to the ending of MAZE, but OI was not permissible because I is attached to a word I just created hence the double movement. She claimed that if I wanted to add additional letters it can only be in the horizontal direction as it’s attached to the original word on the board being MAZE. I claimed it was permissible as I went in one direction (vertical) whilst creating a word that was originally on the board being MAZE. Can you please confirm whether my move was permissible?


Vertex groups can not be named in blender 2.70

For some reason the name text field doesn't appear for vertex groups in blender 2.70. I tried in 2.69 and it's there and works fine. Was this feature removed in 2.70 or am I missing something?


Rutherford experiment of alpha particles

What are the effect of electrons on alpha particles during this experiment?  Also why do we neglect them ?


Is there a standard procedure to 'unit test' an Ubuntu system against the deb packages?  Assume, a system has ubuntu-desktop installed according to the package manager. Can I find out, whether the file system has all the files in ubuntu-desktop and dependencies?   related question:


Consecutive spoiler blocks (>!) are shown as blockquotes

The markdown >! a  >! b  >! c  Will be shown as a blockquote with ! in front of it:   a    b    c  Instead of a spoiler for 3 paragraphs (or 3 spoiler blocks, whatever).


Let $a_1, \ldots, a_n > 0$. How to compute the limit $\lim_{n \to \infty} \sqrt[n]{a_1^n + \cdots + a_m^n}$?  My solution:  $$ \lim_{n \to \infty} \sqrt[n]{a_1^n + \cdots + a_m^n} \\ = \lim_{n \to \infty} (1 + a_1^n + \cdots + a_m^n - 1)^{1/n} \\ = \lim_{n \to \infty} \left( (1 + a_1^n + \cdots + a_m^n - 1)^{\frac{1}{a_1^n + \cdots + a_m^n - 1}} \right)^{ \frac{a_1^n + \cdots a_m^n-1}{n}}. $$ But then we need to have the condition $a_1^n + \cdots + a_m^n - 1 \to 0$ ($n \to \infty$).   Thank you very much.


How to make pushButton and lineEdit to connect and calculate in pushButton?

since there isn't any useful How-To for beginners of PyQt5,   I'm stuck with a little problem       。  @pyqtSlot() def on_pushButton_17_clicked(self):      """     Slot documentation goes here.     """     A=self.lineEdit_22.text()     B=self.lineEdit_23.text()     print(A + B)   Show 12 instead of 3（1+2=3）  I want to enter the number in the lineEdit inside the calculation by PushButton, and get the value.


Where and when can Treasure Goblin rifts appear?

Can you only find a Goblin Rift in Adventure Mode? Similarly, can treasure goblins found within Nephalem Rifts open up a Goblin Rift portal, or can only goblins found outside of Rifts open portals?  I already know that you have to be level 70, and that if a friend wants to enter they have to be nearby.


Gauss's Law for a Uniformly Charged Solid Sphere

We want to calculate $\vec{E}$ at a distance $r$ from the center $O$ of a spherical polar coordinate system.   Let the point on the Gaussian surface at which we want to calculate $\vec{E}$ is $P=P(r, \theta, \phi)$.  Applying Gauss's Law we get, $$ \oint_s \vec{E}(r, \theta, \phi) \cdot \hat{n}(r, \theta, \phi) \, ds = \oint_s E(r, \theta, \phi)\, ds = \iiint E(r, \theta, \phi)\, r^2 \sin\theta \, d\theta \, d\phi = \frac{Q_{enc}}{\epsilon_0}.$$  At this stage how do I know that $E$ depends only on $r$; i.e., $E=E(r)$?  Is it possible to give a mathematical proof that $E=E(r)$?


I would like to see if this is a correct induction proof and whether or not this is a good setting out of it A sequence is defined by $$a_n = a_{n-1} + a_{n-2} + a_{n-3}$$ for $n\geq 3, a_0 = 1, a_1 = 2, a_2 = 4$. Prove that $a_n \leq 4^n$ for all $n\in\mathbb{N}$.    Let $P(n)$ be the proposition that $$''a_n\leq 4^n{''}.$$  Now since we have $a_0 = 1 = 4^0 \leq 4^0$ then $a_0 \leq 4^0$. Also, $a_1 = 2 < 4 \leq 4 = 4^1$ then $a_1 \leq 4^1$. Also, $a_2 = 4<16 = 4^2 \leq 4^2$ so $a_2 \leq 4^2$.    Hence, $P(0),P(1),P(2)$ are true.    Now, let $k-3\in\mathbb{N}$ and suppose $P(k-3),P(k-2),P(k-1)$ is true. We must show that $P(k)$ is true.    Now by definition $$\begin{align}a_n &= a_{n-1} + a_{n-2} + a_{n-3} \\ &\leq 4^{n-1} + 4^{n-2} + 4^{n-3} \qquad \text{by the inductive hypothesis}\\ &= 21\times 4^{k-3} \\ &\leq 64\times 4^{k-3} \\ &= 4^{k}.\end{align}$$    Hence, $P(k)$ is true if $P(k-3),P(k-2),P(k-1)$ is true for $k\geq 3$. So by induction, $P(n)$ is true for all $n\in\mathbb{N}$.    Would appreciate any advice.


Count the number of positive solutions for a linear diophantine equation

Given a linear Diophantine equation, how can I count the number of positive solutions?  More specifically, I am interested in the number of positive solutions for the following linear Diophantine equation:  $3w + 2x + y + z = 47$  Update: I am only interested in non-zero solutions.


How to make Kalman filter results equivalent to linear regression?

Kalman filter appears to be a powerful estimator for linear problems. I understand one can tune the performance by adjusting parameters like process noise and measurement noise. Is it possible to adjust these parameters to make Kalman filter results converge to a classic linear regression? If yes, how?


Piping for loop output prevents local variable modification

I'm trying to write a simple bash function that takes, as its arguments, a number of files and/or directories. It should:   Fully qualify the filenames. Sort them. Remove duplicates. Print all that actually exist. Return the number of non-existent files.   I have a script that almost does what I want, but falls down on the sorting. The return value of the script as it stands is correct, but the output is not (unsorted and duplicates). If I uncomment the | sort -u statement as indicated, the output is correct but the return value is always 0.  N.B. Simpler solutions to solve the problem are welcome but the question is really about why is this occurring in the code I have. That is, why does adding the pipe seemingly stop the script incrementing the variable r?  Here's the script:  function uniqfile {     local r=0       for arg in "$@"     do           readlink -e "$arg" || (( ++r ))      done #| sort -u    ## remove that comment      return $r }


Libgdx Getting error when removing Sprite

I'm trying to remove my enemy sprite whenever they collide to a rectangle,I'm also using Pools.  while(enemyIterator.hasNext()){             Sprite sprite=enemyIterator.next();  //this is the line 65             if(enemyRect.overlaps(treeObj.treeRect))                 removeEnemy(sprite);         }   then on remove enemy method:  public void removeEnemy(Sprite sprite){         enemies.remove(sprite);         Pools.free(sprite);     }   I get this error:  Exception in thread "LWJGL Application"java.util.ConcurrentModificationException         at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901)         at java.util.ArrayList$Itr.next(ArrayList.java:851)         at com.dreamroad.savethetree.EnemyClass.update(EnemyClass.java:65)         at com.dreamroad.savethetree.MyGdxGame.render(MyGdxGame.java:51)         at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:215)         at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)   I followed the instruction from the question he linked and I still get the error, for now I'm only trying to remove the rectangles.  for(Iterator<Rectangle> rectIterator=rectangles.iterator();rectIterator.hasNext();){             Rectangle nextRect=rectIterator.next();             if(nextRect.overlaps(treeObj.treeRect))                 rectIterator.remove();         }


Time Travel movie with a scene in a control centre that shakes whenever the timeline changes

Looking for a movie about time travel, possibly made in the 80s. The only scene I remember is set in a control center. Every time there is a change in the timeline, the present adjusts which causes everything to shake like an earthquake.


In a recursive forecasting model, let's say you are trying to predict sales of Target for the next month and you will append that prediction to your input and predict the month after. Basically, your target is Sales quantity, which you lagged. But let's say you have other continuous numerical features like Price which you will lag as well. As your model is making predictions on Sales_QTY, it will feed it back to sales_qty as input so you will never ran out of values for that one. So how do you deal with your other features (other than the target) in order to generate them as next months inputs in a recursive forecasting model (because eventually you will run out of them)? DO you create a sub-model and try to predict them as well?


So, I was programming a very simple text based game, when it came to my attention that my while statement was exempting a crucial part of the game. The brackets were all correct. Maybe one of you can help me?  Here is the code:  if (isActionPile .equals("Attack Over")){         System.out.println("\n\nWelcome to the Travel Menu. Here you can decide where to travel, what items\n" +                 "and upgrades you wish to buy, and of course, see you inventory!");         while (isWhileStatementAssist != "Done") {             System.out.println(isTravelMenu);             isActionPile = Scan.nextLine();             if (isActionPile.equals("Item Shop")) {             //This part doesn't matter                 } //This is the trouble spot!             if ((isActionPile.equals("Character Menu"))) {                 System.out.println("Your attack is " + isArthurAttack + ", your Health Points are at " +                         isArthurHealth + " and you have $" + isArthurMoney + "\nTo leave this menu press enter.");                 isActionPile = Scan.nextLine();                 isActionPile = null;                 isWhileStatementAssist = null;             }             if (isActionPile.equals("Movement Menu")) {             //I haven't started this part yet!             }             }         }   So, I even went the extra mile to add the part that says "isWhileStatementAssist = null;". Can any of you see the problem?  Thanks, Dave


Can we write a matrix with zero trace as a commutator?

Let $F$ be a field, with $\text{char}(F) = 0$, and $A \in M_{n\times n}(F)$ with $\text{tr}(A) = 0$. Show that there are matrices $B,C \in M_{n\times n}(F)$ that $A = BC - CB$.


Prove that x_n tends to 0 (real-analysis)

Suppose $(x_n)$ is a sequence of positive terms and that the sequence $y_n$=$(x_{n+1})/(x_n)$ converges to a limit L<1. Prove that the sequence x_n converges to 0  I'm not sure exactly how to start it but I know that if $x_n$ tends to 0 then $1/(x_n)$ tends to $infinity$. I know it can be solved doing two parts.  The first part being induction and the second part is the squeeze theorem.   For example say $x_2 < Lx_1$ and then $x_3<Lx_2$. If say L=1/2 then L is monotone decreasing. I just don't know how to start the proof.


I have old magnesium 1931 newspaper photo plates..how to clean?

I want to get off the old ink and all the white specks and still keep the plates safe.


Similarities between Dune and Wheel of Time?

When I first read Wheel of Time (shortly after I read Dune), I was struck by the  between the Aiel and the Fremen, as well as the White Tower and the Bene Gessirit. Are there any other such similarities? Had Robert Jordan ever accepted whether he was influenced by Dune?


How to check for Integer data type in Jquery Validation form?

I have a problem using jQuery Validation forms where I want to put a Integer input only. For example,
   Interval   <input name="interval" type="text" class="form-control" id="interval"
  $("validation-form").validate({   rules: {     'interval': {       number: true,       required: true,     },  It works well, but it is a Float type because it can also take something like 5.6, but I want to have Integer type. The output should be:  Integer type is required.  How can I do that?


i do not know what this site is expecting to write. i've written my question above . saw in a question paper. again writing it.   is intersection of a countable collection of dense, open subsets of a complete metric space also dense in X?


Let $X$ be a Poisson random variable with parameter $\lambda$. What is the most likely outcome of $X$?   Please help me solve this exercise. Thanks in advance! :)


$A$ is a real orthogonal matrix, prove that $ (I+A)^{-1}(I-A)$ is skew-symmetric

$A$ is a real orthogonal matrix and $(I + A)$ is non-singular. Prove that $ (I+A)^{-1}(I-A)$ is a skew-symmetric matrix.  Attempt:  $[(I+A)^{-1}(I-A)]^t=(I-A)^t((I+A)^{-1})^t=(I-A)^t((I+A)^{t})^{-1}=(I-A^t)   ((I+A^t))^{-1}$   Please help me further.


Let $(X, \mathcal{T}_1)$ and $(Y, \mathcal{T}_2)$ topological spaces, let $A \subset X$ and $B \subset Y$ such that $A \times B$ is compact, let $W$ an open set such that $A \times B \subset W$. Prove that there exist $U \in \mathcal{T}_1$ and $V \in \mathcal{T}_2$ such that $A \times B \subset U  \times V \subset W$. My idea. Since $W$ is open in $X \times Y$ then $W= \bigcup_{\alpha \in I} \ (A_\alpha \times B_\alpha)$ where $A_{\alpha} \in \mathcal{T_1}$ and $B_\alpha \in \mathcal{T_2}$, and since $W$ is compact, we have that $$A \times B \subset \bigcup_{i=1}^n \ (A_{\alpha_i} \times B_{\alpha_i})$$ I take $U= \bigcup_{i=1}^{n} A_{\alpha_i}$ and $V= \bigcup_{i=1}^{n} B_{\alpha_i}$, but I'm not sure if $A \times B \subset U  \times V \subset W$.


Uniform Convergence and limit $(n+1)\int_0^1 x^nf(x) \; dx$

If $f$ is a continuous real-valued function, show that  $$ f(1)=\lim_{n\to \infty} \int_0^1 (n+1)\,x^n \,f(x) \; dx $$  I am looking for a general hint or steps to proceed but I want to fill them in. Looking at this I see the '$n+1$' along with the $\int x^n$ makes me very suspicious.   My first thought is that $(n+1)x^nf(x)$ converges to $f(1)$ uniformly on $[0,1]$ but I feel as though this is a fools thought. I then sat and tried the case $f(x)=x$ and $f(x)=x^{n_0}$. This was a bit illuminating. I then tried the case where $f(x)$ is a general polynomial and I can show that case. But of course $f(x)$ need not be a polynomial.   To try to make this method work, I considered using Stone-Weierstrass. I can find a sequence of polynomials $p_n(x)$ such that $p_n(x) \to f(x)$ uniformly. But I am unsure of how to make it fit in with the integral. I assume it is trivial to show $x^np_n(x) \to x^nf(x)$. I know that the above limit works with $x^np_n(x)$. However, does this imply that this -- under the limit -- must be the same as $x^nf(x)$? Or is this not at all how I should go about it? Is there a better or easier way? Or perhaps a more enlightening or 'quaint' way?


How can two people on opposite sides of the Earth both be accelerated?

As I understand it, then when I am standing on Earth I feel a force on my feet and is accelerated through spacetime. But what if a person is standing on the other side of Earth. That person is also accelerated. I kind of feel this is strange because it is in a different direction. But I guess it is because I am not allowed to look at it from the Earth frame? Or is it because I can´t use my own local frame to look at the other person?


Is CASE WHEN appropriate for optional parameters in a SQL query?

I'm wondering if I'm handling CASE WHEN appropriately below. I have optional parameters and want to make sure this is the best way to handle them.  Postgres version 9.3.14.  CREATE FUNCTION sp_contacts_get_all_by_id (user_id integer DEFAULT NULL::integer, vendor_id integer DEFAULT NULL::integer, filter_contact_type integer DEFAULT NULL::integer)    RETURNS TABLE(...)     LANGUAGE plpgsql AS $$    BEGIN      IF($1 IS NULL AND $2 IS NULL) THEN        RAISE EXCEPTION 'userId or vendorId is required!';     END IF;      RETURN QUERY       SELECT         *       FROM         myapp_contacts       JOIN myapp_contacts_assoc ON         myapp_contacts_assoc.contact_id=myapp_contacts.contact_id       WHERE         (CASE WHEN $1 IS NOT NULL THEN myapp_contacts_assoc.user_id=$1 END) AND         (CASE WHEN $2 IS NOT NULL THEN myapp_contacts_assoc.vendor_id=$2 END) AND         myapp_contacts.expired_at IS NULL AND         (CASE WHEN $3 IS NOT NULL THEN myapp_contacts.type=$3 END);   END; $$


Does Ubuntu erase all the Windows partitions with the Erase Disk option?

I'm finally getting rid of  Windows 10 and fresh installing Ubuntu for the first time. Pre-installed Windows 10 comes with some  The last 3 NTFS partitions are the ones . So, technically my harddrive size is 931 GB, but I can only use 916 GB of it. What I want to know is that when I do "erase disk and install Ubuntu"  will it wipe out everything on 931 GB harddrive (including those protected system and recovery partitions)? If yes, then does it mean that Ubuntu will let me use all the 931 GB storage (unlike Windows)? If no, then how can I get rid of those protected partitions before installing Ubuntu?


How to render WITH the default checkerboard as background?

Ok there are a ton of questions on getting a transparent background and NOT having background be checkerboard in final render, but what if you WANT this checkerboard pattern as your final background?    Ive tried unchecking my Transparent box - I'm in cycles.


How to merge google chrome user of home and work

I have the following configuration:   Google chrome at home Google chrome at work   I need to have the two chromes merged in one account, using differents users.  I want to be able to Sync my google account in others computers, and have the two users, work and home.  Anyone have some idea of what's the best way to achieve this?  Thanks!


`ls -lS` isn't showing true size of directory

I used ls -lS command in my home directory. This command is supposed to list down the contents of a directory by size. This is what I got after running this command  total 10148 -rw-rw-r--  1 rahul rahul 8053159 May 15 15:35 Costa_ODE.pdf -rw-rw-r--  1 rahul rahul 1755507 May 15 17:33 gnuplot.pdf -rw-rw-r--  1 rahul rahul  218048 May 13 22:14 out.log -rw-rw-r--  1 rahul rahul   98131 Feb 16 01:53 hs_err_pid8639.log -rw-rw-r--  1 rahul rahul   12364 Apr 19 14:01 Untitled 1.csv drwxr-xr-x  4 rahul rahul   12288 Jun  6  2016 cfitsio -rw-r--r--  1 rahul rahul    8980 Feb  7  2016 examples.desktop drwxrwxr-x  2 rahul rahul    4096 Mar 10 12:24 bin drwxrwxr-x  8 rahul rahul    4096 May  8 14:51 boxfitv2 drwxrwxrwx  2 rahul rahul    4096 Jan 30 11:50 dao2 drwxrwxr-x  2 rahul rahul    4096 Mar 12  2016 deja-dup drwxr-xr-x  6 rahul rahul    4096 May 16 02:12 Desktop drwxr-xr-x  3 rahul rahul    4096 May 15 10:53 Documents drwxr-xr-x  5 rahul rahul    4096 May  8 14:09 Downloads . . . .   and its a pretty big list. But I want you to focus on sub-directories, for example Desktop. Its size is shown as 4096 bytes. But when I tried to see the details of Desktop, this is what I got.    In short, the command ls -lS is not calculating the size of the contents of Desktop and other sub-directories. Is there any way to do it?    EDIT:  Output of ls -lsh command  total 10M 4.0K drwxrwxr-x  2 rahul rahul 4.0K Mar 10 12:24 bin 4.0K drwxrwxr-x  8 rahul rahul 4.0K May  8 14:51 boxfitv2 4.0K -rw-rw-r--  1 rahul rahul 3.2K May 13 13:28 c.c  12K drwxr-xr-x  4 rahul rahul  12K Jun  6  2016 cfitsio 7.7M -rw-rw-r--  1 rahul rahul 7.7M May 15 15:35 Costa_ODE.pdf 4.0K drwxrwxrwx  2 rahul rahul 4.0K Jan 30 11:50 dao2    0 -rw-rw-r--  1 rahul rahul    0 May 13 20:37 default.txt 4.0K drwxrwxr-x  2 rahul rahul 4.0K Mar 12  2016 deja-dup 4.0K drwxr-xr-x  6 rahul rahul 4.0K May 16 17:11 Desktop 4.0K drwxr-xr-x  3 rahul rahul 4.0K May 15 10:53 Documents 4.0K drwxr-xr-x  5 rahul rahul 4.0K May  8 14:09 Downloads  12K -rw-r--r--  1 rahul rahul 8.8K Feb  7  2016 examples.desktop . . .   Output of du -sh ~/Desktop command  80M /home/rahul/Desktop


Sharing unit tests with dependencies in maven project

I have maven project with module A and module B which depends on module A. For example I have abstract unit test in module A and I want to use this unit test in unit tests for module B. Is there any way to achieve that?


Which Certifications is more demanding for QA, and Software Testing professionals?

Which Certification Is demanding for Senior SQA Engineers?   ISTQB CSTE CSTP CTM   I am planning for QA certification but don't know which one is best.Please suggest me..


No Wifi Similar to: bcmwl-kernel-source broken on kernel: 5.8.0-34-generic

Similar to the post , but I can't seem to get any of the proposed work around solutions to work. I'm on a Macbook Pro 2012 model. My usual solution when the wifi has issues is to just run: sudo ubuntu-drivers autoinstall matthew@matthew-MacBookPro:~/Downloads$ sudo ubuntu-drivers autoinstall Reading package lists... Done Building dependency tree        Reading state information... Done 0 to upgrade, 0 to newly install, 0 to remove and 57 not to upgrade. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu5) ... Removing old bcmwl-6.30.223.271+bdcom DKMS files...  -------- Uninstall Beginning -------- Module:  bcmwl Version: 6.30.223.271+bdcom Kernel:  5.4.0-59-generic (x86_64) -------------------------------------  Status: Before uninstall, this module version was ACTIVE on this kernel.  wl.ko:  - Uninstallation    - Deleting from: /lib/modules/5.4.0-59-generic/updates/dkms/  - Original module    - No original module was found for this module on this kernel.    - Use the dkms install command to reinstall any previous module version.  depmod...  DKMS: uninstall completed.  ------------------------------ Deleting module version: 6.30.223.271+bdcom completely from the DKMS tree. ------------------------------ Done. Loading new bcmwl-6.30.223.271+bdcom DKMS files... It is likely that 5.8.0-34-generic belongs to a chroot's host Building for 5.4.0-42-generic, 5.4.0-52-generic, 5.4.0-53-generic, 5.4.0-54-generic, 5.4.0-56-generic, 5.4.0-58-generic, 5.4.0-59-generic and 5.8.0-36-generic Building for architecture x86_64 Module build for kernel 5.4.0-42-generic was skipped since the kernel headers for this kernel does not seem to be installed. Module build for kernel 5.4.0-52-generic was skipped since the kernel headers for this kernel does not seem to be installed. Module build for kernel 5.4.0-53-generic was skipped since the kernel headers for this kernel does not seem to be installed. Module build for kernel 5.4.0-54-generic was skipped since the kernel headers for this kernel does not seem to be installed. Module build for kernel 5.4.0-56-generic was skipped since the kernel headers for this kernel does not seem to be installed. Module build for kernel 5.4.0-58-generic was skipped since the kernel headers for this kernel does not seem to be installed. Building initial module for 5.4.0-59-generic This system doesn't support Secure Boot Secure Boot not enabled on this system. Done.  wl.ko: Running module version sanity check.  - Original module    - No original module exists within this kernel  - Installation    - Installing to /lib/modules/5.4.0-59-generic/updates/dkms/  depmod...  DKMS: install completed. Building initial module for 5.8.0-36-generic ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/bcmwl-kernel-source.0.crash' Error! Bad return status for module build on kernel: 5.8.0-36-generic (x86_64) Consult /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log for more information. dpkg: error processing package bcmwl-kernel-source (--configure):  installed bcmwl-kernel-source package post-installation script subprocess returned error exit status 10 Errors were encountered while processing:  bcmwl-kernel-source E: Sub-process /usr/bin/dpkg returned an error code (1)  I'm having no luck this time. I tried many of the solutions posted in response to Donald Sebastian's question, but none of the solutions seems to be working. I tried installing the bcwml-kernel-source file from here ( ) manually through the GUI installer, but I get this error: Unable to install bcmwl-kernel-source: Error while installing package: Installed bcmwl-kernel-source package scrip subprocess returned error exit status 10. Any help much appreciated.


Proof of connected graph having n-1 edge minimum with n vertices

How could I go about proving that for any connected graph with n vertices, the minimum amount of edges is n-1?


Given positive integers $b, c, d, x, y$ such that: $\frac{a}{b}>\frac{x}{y}>\frac{c}{d}$ and $ad-bc=1$ prove that $x\ge a+c$ and $y\ge b+d$ I was just trying to do the question above in the following way: $ayd>bxd>bcy$ and $ad-bc=1$. Hence we have that $ay>bx$ and $ad>bc$ and $xd>cy$. This is where I got stuck. I couldn't continue from here. Could you please explain to me how to finish off my thought if this is possible, and if it isn't, please show another method for solving it whilst explaining the intuitive thought process behind each step? The question as such has been answered here: as pointed out in the comments. However I would like to know please if it is possible to finish it off using my method and if not being able to use my method fully then which part of my method could be assimilated into the solution?


Randomly instantiate avoiding overlapping in Unity 5

I'm starting a 2D game where I want all the letters A-Z displayed in a random position and, then, the player collects them all in the correct order. I need to randomly instantiate the letters without overlapping. I use C#.


Null pointer Exception in a fragment while calling getholder fucntion

I am currently getting null pointer exception in a fragment while calling getHolder. here's the Code for the fragment  public class Camera_Fragment extends Fragment implements IVideoPlayer, View.OnClickListener { Button up, dowm, right, left;  SurfaceView CamView; private String VideoUrl = "http://192.168.0.4:81/videostream.cgi?user=admin&password=admin";  private SurfaceHolder Holder; private Surface surface = null; private LibVLC libVLC;  private int mVideoHeight; private int mVideoWidth; private int mVideoVisibleHeight; private int mVideoVisibleWidth; private int mSarNum; private int mSarDen;  @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {     View view = inflater.inflate(R.layout.cam1, container, false);     CamView = (SurfaceView) view.findViewById(R.id.Cam1_CamVIew);      up = (Button) view.findViewById(R.id.Cam_up);     dowm = (Button) view.findViewById(R.id.Cam_down);     right = (Button) view.findViewById(R.id.Cam_right);     left = (Button) view.findViewById(R.id.Cam_left);      up.setOnClickListener(Camera_Fragment.this);     dowm.setOnClickListener(Camera_Fragment.this);     right.setOnClickListener(Camera_Fragment.this);     left.setOnClickListener(Camera_Fragment.this);     return view; }  @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     Cam_Play(); }  private void Cam_Play() {     Holder = CamView.getHolder();     try {         libVLC = new LibVLC();         libVLC.setVout(LibVLC.VOUT_ANDROID_SURFACE);         libVLC.setHardwareAcceleration(LibVLC.HW_ACCELERATION_AUTOMATIC);         libVLC.init(getActivity().getApplicationContext());     } catch (LibVlcException e) {         e.printStackTrace();     }     surface = Holder.getSurface();     libVLC.attachSurface(surface, this);     libVLC.playMRL(VideoUrl); }   The above Code is working flawless in a Activity.. But in the fragment its not .. I am still a biggner in Android development.And i am using fragments for the first time. Any Solution or suggestion.  here's the logcat   11-17 01:03:52.301 5860-5860/com.fyp.tirz.wifisurveillance E/AndroidRuntime: FATAL EXCEPTION: main 11-17 01:03:52.301 5860-5860/com.fyp.tirz.wifisurveillance E/AndroidRuntime: Process: com.fyp.tirz.wifisurveillance, PID: 5860 11-17 01:03:52.301 5860-5860/com.fyp.tirz.wifisurveillance E/AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.SurfaceHolder android.view.SurfaceView.getHolder()' on a null object reference 11-17 01:03:52.301 5860-5860/com.fyp.tirz.wifisurveillance E/AndroidRuntime:     at Fragments.Camera_Fragment.onCreate(Camera_Fragment.java:62)


How can I iterate over a TreeMap of type

I have a TreeMap in which the keys are of type Integer and the values are of type ArrayList.  Here is some sample code:  import java.util.*; public static void iterThruTreeMap() {     ArrayList<String> contact = new ArrayList<String>();     contact.add("Jane");     contact.add("Doe");     contact.add("123-456-7890");      ArrayList<String> contact2 = new ArrayList<String>();     contact2.add("Jane");     contact2.add("Doe");     contact2.add("123-456-7890");      ArrayList<String> contact3 = new ArrayList<String>();     contact3.add("Jane");     contact3.add("Doe");     contact3.add("123-456-7890");      Map<Integer, ArrayList> list = new TreeMap<Integer, ArrayList>();     list.put(0, contact);     list.put(1, contact2);     list.put(2, contact3);      for (int key : list) {         // stuck     } }   What I want to do is extract the first and last names from each of the ArrayLists contained in the TreeMap. I tried using a regular for-loop and received a NullPointerException. I am getting an error using the foreach method as shown in my sample, I think because of type.  I have tried using an Iterator, but I don't think I wrote it correctly. If someone could point me in the right direction, I'd appreciate it very much!