Originally my NTFS partition which occupies the whole external drive(1.8T) was having problems reading one file. It was probably corrupted, so I attempted to fix it by using ntfsfix on the partition. However, by accident, I run it on the device instead: ntfsfix /dev/sda , instead of ntfsfix /dev/sda1.   Now the system no longer detects the partitions, and if I try using cfdisk, it just interprets it as having multiple smaller partition, probably because it can't read the original one which was overwritten.   Is the partition recoverable at this point? Or at least a portion of the data? If so, how?

I am on Ubuntu 12.04 64-bits  I accidentally deleted a NTFS 255 GB partition using Gparted, and yes it contains LOTS of important data.  Upon realizing the deletion I haven't yet created any file-system on it. So it still shows Unallocated.    I tried Testdisk , but it shows entire partitions created from the beginning.  This sdb is my secondary drive with Xubuntu and Kubuntu on it. And that 255 GB NTFS  partition was cross platform storage drive.  I am currently in sda with Ubuntu and Win7 in dual boot, which enables me to use it as Safe recovery option rather then Live USB drive.   First ,  should i allocate it to ? file-System for better recovery .  Second , i really need to recover data from this drive so please give me possible  suggestions and proven methods of data recovery.  Third ,does Testdisk requires deleted partition to be allocated for its recovery .  I am currently trying the answer seen here  with Testdisk scanning for partition second time, hoping to recover it.   It looks a duplicate but i can't confirm if the OP got it right. Since my first doubt is to allocate it or not.  If any clarification required please do comment ,i will add it.  Edit: TestDisk deeper search results.      The following partitions can't be recovered:          Partition               Start        End    Size in sectors     >  HPFS - NTFS          22241 107 11 55592   3 27  535777280        FAT32 LBA            274460 158 19 460576 228 16 2989957948  NTFS, 274 GB / 255 GiB & for FAT32 LBA 1530 GB / 1425 GiB


I am doing some independent study in asymptotic statistics and point estimation and am aware that you can get from log transformations of uniform random variables (exponential) all the way up to chi-squared distributions but I came across an intriguing question and I'm not sure how to handle it. I was thinking CLT or Delta Method but am unsure of myself. The thing I am trying to sort out is:  Given $X_1,\ldots X_n\overset{iid}{\sim}Uniform(0,\theta)$ and $Z_n=\left(\prod_{i=1}^nX_i\right)^{1/n}$ what is an example of a function of $Z_n$, i.e. $g(Z_n)$, so that $g(Z_n)\overset{d}{\rightarrow}\chi_{(1)}^2$, where $\overset{d}{\longrightarrow}$ denotes convergence in distribution and $\chi_{(1)}^2$ is a chi-squared random variable with 1 degree of freedom?  Maybe something like $g(h(Z_n))$ where $h(Z_n)\overset{d}{\rightarrow}Normal(0,1)$ and $g(t)=t^2$? Any help is greatly appreciated.  I have tried:  Let $Y_1=X_i/\theta$ I get $Y\sim Uniform(0,1)$ and so $-\log(Y)\sim Exponential(1)$. From here I know $-2\log(Y)$ is $\chi_{(2)}^2$ but I don't see how to relate $-\log(Y)$ back to a function of $Z_n$ that is $\chi_{(1)}^2$


I know about this:   I read it and other questions, and I still haven't satisfied my concerns. I understand that the type cast will occur implicitly, but the error is something I do not understand no matter how much I read these arguments.  The main argument is that int and pointer may have different sizes. For the sake of an example, let size of int* be 8 and size of int be 4.  int *x = (int*) malloc(sizeof(int));   First off, the number of bytes allocated by malloc() is 4, although the variable x will store a pointer of size 8 bytes.   I'm explicitly casting the return of malloc to (int *), which — by the way — has size 8. How come there's any loss of bits here?

In , someone suggested in a  that I should not cast the result of malloc. i.e., I should do this: int *sieve = malloc(sizeof(int) * length);  rather than: int *sieve = (int *) malloc(sizeof(int) * length);  Why would this be the case?


I carelessly pressed “show picture “in a spam e-mail that was in my unwanted folder When i clicked the link just disappeared and no picture was shown.how worried should I be? I did a disk clean-up after and ran my windows defender which found no threats

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


I am able to invoke the private function of the derived class. Is this Ok?  #include <iostream> class A { public:     virtual ~A() {}      virtual void func()     {         std::cout << " Printing from A" << std::endl;     } };  class B : public A { private:     virtual void func()     {         std::cout<< " Printing from B"<<std::endl;     } };  main() {     B b;     A* a = &b;      a->func();     // b.func(); Not possible as expected. }   Below is the output     Printing from B

Is there is any reason to make the permissions on an overridden C++ virtual function different from the base class?  Is there any danger in doing so?  For example:  class base {     public:         virtual int foo(double) = 0; }  class child : public base {     private:         virtual int foo(double); }   The  says that it is a bad idea, but doesn't say why.  I have seen this idiom in some code and I believe that the author was attempting to make the class final, based on an assumption that it is not possible to override a private member function.  However,  shows an example of overriding private functions.  Of course  recommends against doing so.  My concrete questions:   Is there any technical problem with using a different permission for virtual methods in derived classes vs base class? Is there any legitimate reason to do so?


I am reading about how to create a sevice like:  The first link I read is.   But when I type following line in prompt  $ sudo service nameservice start Failed to start nameservice.service: Unit nameservice.service not found   I create this script  /var/www/myproject/myscript.php   I checked all the permissions  -rwxrwxrwx 1 root root 1069 feb 2 15:49 nameservice  -rwxrwxrwx 1 root root 24 feb 2 15:56 myscript.php   /var/www/myproject/myscript.php has this content  <?php     echo "OK"; ?>   Could you help me? This is the first manual script I wrote.  My intention is to add this service and then call the url http://localhost/getanswer to show it to me in the browser.

I set up a new VPS instance of Ubuntu and am wondering what the easiest way is to get up and running with a basic LAMP stack (i.e. which packages are required, which configuration options need to be tweaked, if any, etc.).


I am new in shells, so I stuck with this kind of question. What is the simplest way to differentiate those commands?

Have a look at the code:  #!/bin/bash read -p "Eneter 1 for UID and 2 for LOGNAME" choice if [ $choice -eq 1 ] then         read -p "Enter UID:  " uid         logname=`cat /etc/passwd | grep $uid | cut -f1 -d:` else         read -p "Enter Logname:  " logname fi not=`ps -au$logname | grep -c bash` echo  "The number of terminals opened by $logname are $not"   This code is used to find out the number of terminals opened by a user on the same PC. Now there are two users logged on, say x and y. I am currently logged in as y and there are 3 terminals open in user x. If I execute this code in y using different ways as mentioned above the results are :  $ ./file.sh The number of terminals opened by x are 3  $ bash file.sh The number of terminals opened by x are 5  $ sh file.sh The number of terminals opened by x are 3  $ source file.sh The number of terminals opened by x are 4  $ . ./file.sh The number of terminals opened by x are 4   Note: I passed 1 and uid 1000 to all these executables.  Now can you please explain the differences among all these?


I writing a program for Hangman in Python 2.7. I'm trying to get the program to create the gallows and the hanged figure rather than me assembling them as a string and placing them in a list. My problem is the output from successive print statements gives me what I want but when I put the code in a function the result is skewed e.g.  print chr(47).rjust(4), # Right arm           print chr(124), # backbone print chr(92) + chr(124) # Left arm + tree    gives me this /|\ | --- inner slashed are concatenated  In a function:  def erect_gallows(bad_guess):     if bad_guess == 1:         print chr() - - -         .....         .....     this gives me this --  /  |  \  | with the slashes separated, out of alignment. Don't know why the print statements work outside but not inside the function. The function does not return anything, it just prints.

I'd like to do it in Python. What I'd like to do in this example in C: #include <stdio.h>  int main() {     int i;     for (i=0; i<10; i++) printf(".");     return 0; }  Output: ..........  In Python: >>> for i in range(10): print('.') . . . . . . . . . . >>> print('.', '.', '.', '.', '.', '.', '.', '.', '.', '.') . . . . . . . . . .  In Python print will add a \n or space, how can I avoid that? Now, it's just an example, don't tell me I can first build a string then print it. I'd like to know how to "append" strings to stdout.


I'm looking through a list of methods and want to identify those that return a primitive (or a primitive wrapper class). Other than a big switch statement is there a simple way to do this?  Method[] methods = fooObj.getClass().getMethods(); for(int i = 0; i < methods.length; i++) {     Method m = methods[i];     Class c = m.getReturnType();     if(c == void.class) {         println("does not return anything.");     }     if( ??? ) {  // <--- what expression to use?         println("a primitive, or primitive wrapper, is returned.");     } }

I have an Object[] array, and I am trying to find the ones that are primitives. I've tried to use Class.isPrimitive(), but it seems I'm doing something wrong:  int i = 3; Object o = i;  System.out.println(o.getClass().getName() + ", " +                    o.getClass().isPrimitive());   prints java.lang.Integer, false.  Is there a right way or some alternative?


I have my training data with the following approximate distribution:   Negative events : 90,000 positive events : 5,000   Training a model would require to oversample the minority class (and might also need to undersample the majority class) as the classes are vastly imbalanced in proportion.  To what extent is it fair to upsample? Let's say I want the distribution of events to be 50% - 50% in the training set. Should I oversample the positive events currently from 5,000 to 90,000 observations?   That is like upsampling the positive events 18 times! Would that not add unwanted noise? Or should I upsample it to something like 50,000 (10 times)  and downsample the majority class too from 90,000 to 50,000?  We can even upsample it to just 10,000 (2 times) and take equal number of random observations from the majority class, but then there rises the chance of this majority class sample not being representative of the entire population. We need to ensure we take a stratified sample from the majority class, which might be achieved by forming clusters and taking samples from each cluster in proportion to the respective cluster size. However, that is a different exercise altogether and a lengthy approach.  Please guide me on what should be the ideal approach to deal with such scenarios.

We already had multiple questions about unbalanced data when using , , ,  and a number of other similar questions, what makes it a very popular topic! Unfortunately, each of the questions seems to be algorithm-specific and I didn't find any general guidelines for dealing with unbalanced data.  Quoting , dealing with unbalanced data     (...) heavily depends on the learning method. Most general purpose   approaches have one (or several) ways to deal with this.   But when exactly should we worry about unbalanced data? Which algorithms are mostly affected by it and which are able to deal with it? Which algorithms would need us to balance the data? I am aware that discussing each of the algorithms would be impossible on Q&A site like this, I am rather looking for a general guidelines on when it could be a problem.


I'm having trouble understanding the following set: $$\mathbb{Z}[\sqrt{2}] := \{ a + \sqrt{2}b : a,b \in \mathbb{Z}\}$$ What elements does it actually contain? I thought $\mathbb{Z}$ only contains integers, so what does the root of $2$ behind $\mathbb{Z}$ mean? Thank you.

I ran into this expression in a paper I was reading, and I'm confused about part of the meaning.  Here $u$ and $v$ are two polynomials.  $$u, v \in \mathbb{R}[x]$$  I'm not really familiar with usage of $[x]$ here, but if it means "nearest integer", then isn't this expression equivalent to simply:  $$u, v \in \mathbb{Z}$$


equation 2 of  states that   $$ \lim_{t \rightarrow \infty} \sum_{i=0}^{t-1}(\alpha S)^i = (I - \alpha S)^{-1} $$  In this case $0 < \alpha < 1$ and the entries of $S$ are in the range $[-1, 1]$. How can I understand why this is true?

I am currently reading 'Vector Calculus, Linear Algebra, and Differential Forms: A Unified Approach' by J. Hubbard and B. Hubbard.  In the first chapter, there is the proposition:     Let A be a square matrix. If $|A|<1$, the series $$S=I+A+A^2+\cdots$$   converges to $(I-A)^{-1}$.   The proof first shows that $$S_k(I-A)=I-A^{k+1}$$ and similarly $$(I-A)S_k=I-A^{k+1}$$ where $S_k$ is the sum of the first $k$ terms in the series.  Then it shows that $$|A^{k+1}|\leq|A|^{k+1}$$ and according to the proof in the book, it can be said from this that $\lim_{k\to \infty}A^{k+1}=0$ when $|A|<1$.  Consequently, $S(I-A)=I$ and $(I-A)S=I$.  Therefore $S=(I-A)^{-1}$.  However I do not understand how it can be said that $\lim_{k\to \infty}A^{k+1}=0$ when $|A|<1$.  In addition, all similar propositions I have found on the internet state $|\lambda_i|<1$ as the necessary and sufficient condition.  How does this relate to the condition, $|A|<1$?


I'm using pdfTeX in MikTeX and have included   \fontfamily{cmss}\selectfont   in my preamble to make all fonts look like Latin Modern. However, this does not seem to apply to the font used in section and subsection names, and neither does the math typography change. Am I missing something?

I want to use arial font, but it doesn't generate any document. I'm using Texpad software. I tried with helvet package, but it doesn't work. Here's my code, maybe I'm not right. Can you help me?  \documentclass[10pt, a4paper]{article}  \usepackage{fontspec} \setmainfont{Arial} \usepackage{lipsum} \usepackage[ampersand]{easylist}  \begin{document}  \tableofcontents \newpage \section{TITLE} \section{TITLE} \subsection{Subtitle} \subsection{Subtitle} \section{TITLE} \lipsum \subsection{Subtitle} \subsection{Subtitle} \subsubsection{Title} \begin{easylist} & Title & Title && Subtitle &&& Title & Title \end{easylist} \subsubsection{Title} \subsection{Subtitle} \section{TITLE} \subsection{Subtitle} \subsubsection{Title}  \end{document}


I copied a file to destination without providing the path. It seems to have copied successfully, but i cant find the file in the destination, where could it be located?  rsync -av --progress file.txt user@host sending incremental file list file.txt   1048576000 100%   63.19MB/s    0:00:15 (xfer#1, to-check=0/1)

When using rsync to copy files over the network, I give a path so that rsync will know where to put the file on the remote server.  rsync -av /home/ME/myfile user@remoteserver:/home/ME/  If I leave off the remote path, where will rsync put the file? Eg:  rsync -av /home/ME/myfile user@remoteserver


Is there a way I can import a game from the Blender Game engine to both an iPhone or Android, whether it's using a different program or not? If not possible, is there a way I can import everything in that specific Blender file over to Unity without changing any of the textures (all image textures, since they were baked), locations of the objects, and settings for the lamps/cameras/etc.? Help is greatly appreciated. (Not a VR game)

I'm sorry if my question sounds clumsy, I'm not a seasoned BGE user.  I'd like to make a virtual tour for Gear VR and/or Google Cardboard in the BGE that works on Mobile.  Is this doable in a user friendly way using the BGE? Can I export to Mobile (android, IOS, Windows Phone)? I know this is possible using Unity, but I find Unity difficult to use. I've tried UE4, but the process is a big mess, it requires a buggy multi-level hack that only results in wasting my time.


Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


I wanted to know answers to questions something like:      "A man wants to take his wolf and two sheep across the river using a boat in such a way that he can take only one animal while travelling on the boat from one side to another side. Wolf eats sheep in the absence of the man. What does man do without wolf causing any harm?"   Where can I ask these kind of questions please?

Somewhere I can put thinking problems? If you don't know what I mean by that, an example is . I'm not asking a place to put riddles or math problems, rather to put long problems (that are most words) that can be put in an Computer Science Olympiad for example. Not actually coding, rather logical and algorithmic problems.  I hope you understand what I mean...


I've got input field which allows to search for values inside div blocks. For now, I'm using following construction:  var $this = $('.multiple-selector-wrapper');  $('.ms-search').keyup(function(event){     var value = $(this).val();     $this.find('.multiple-selector-table-row').hide();     $this.find('.ms-column:contains("' + value + '")').parents('.multiple-selector-table-row').show();       });   Problem is, search will always perform strict value case. Is it possible to ignore case for search?  JSFiddle is here:

Is there a case insensitive version of the  jQuery selector or should I do the work manually by looping over all elements and comparing their .text() to my string?


I'm trying to search my Movies folder to find the immediate folder of the .MKV file I'm searching for. The below works (echo 5) to save the immediate folder as a variable, BUT, it does not work if $mkvfile contains spaces. I've been unsuccessful in getting $moviename to work if $mkvfile contains spaces.  searchdir="/mnt/storagepool/storage/downloads" moviedir="/mnt/storagepool/storage/media/Movies"  #MKVs in root folder  for filename in $searchdir/*.mkv; do   #Get .MKV file from root of the downloads/search directory.     mkvfile="$(basename $filename)"     #echo 2 $mkvfile    #Search for the MKV file in the media/Movies directory to find the corresponding movie folder name     #echo 3 "${moviedir}"     #echo 4 $mkvfile     moviename=$(find "${moviedir}" -name '$moviedir' -prune -o -name "$mkvfile" -exec dirname {} \;)     echo 5 "${moviename}" done

The old advice used to be to double-quote any expression involving a $VARIABLE, at least if one wanted it to be interpreted by the shell as one single item, otherwise, any spaces in the content of $VARIABLE would throw off the shell.  I understand, however, that in more recent versions of shells, double-quoting is no longer always needed (at least for the purpose described above).  For instance, in bash:  % FOO='bar baz' % [ $FOO = 'bar baz' ] && echo OK bash: [: too many arguments % [[ $FOO = 'bar baz' ]] && echo OK OK % touch 'bar baz' % ls $FOO ls: cannot access bar: No such file or directory ls: cannot access baz: No such file or directory   In zsh, on the other hand, the same three commands succeed.  Therefore, based on this experiment, it seems that, in bash, one can omit the double quotes inside [[ ... ]], but not inside [ ... ] nor in command-line arguments, whereas, in zsh, the double quotes may be omitted in all these cases.  But inferring general rules from anecdotal examples like the above is a chancy proposition.  It would be nice to see a summary of when double-quoting is necessary.  I'm primarily interested in zsh, bash, and /bin/sh.


In the E03 S08 of Game of Thrones, the two living dragons, respectively ridden by Deanerys and Jon, fight against the dead dragon, ridden by the Night King.  During the fight, Jon's dragon happens to fall down to the ground. When I watched the episode, I supposed the dragon was dead.  At the end of the episode, a dead dragon come into Winterfell to breathe blue fire everywhere. Is it the first dead dragon the Night king was riding, or is it Jon's dragon, killed during the dragons fight, who came back to life after the Night King summoned all the dead on the battlefield ?  And finally, how many dragons do we have left ?

In Game of Thrones S08E03 ("The Long Night"), the Night King's dragon tore at the one Jon Snow rides (Rhaegal). He falls off of it and we don't see the dragon anymore, is it dead?


How to install ibus-m17n in Ubuntu 18.04LTS supported desktop?

I am learning how to use apt. When I do an apt-cache search git to see all packages matching git, I see a bunch of packages whose descriptions have nothing to do with git. Why is this so and how can I fix it? (Ubuntu 12.04.2 LTS).  Also, why is the search functionality found in a command that has "cache" in its name? What does search functionality have to do with caches?  Thanks.


In Rudin's 3e of Principles of Mathematical analysis, he associates $q = (2p+1)/(p+1)$. How does he create this number? What is the method for discovering this answer?

More specifically, I have to find a $q$ in $A$ such that $q$ is larger than any $p$ in $A$.  The only thing I can think of is using (${2 - {p^2}}$) somehow, or ${(p+x)^2}<2$, but other than that I don't know how to proceed. This exercise is taken from the very first chapter of Walter Rudin's Principles of Mathematical Analysis. Quoting the exercise:     To do this, we associate with each rational $p > 0$ the number:     $$q = p - \frac{{{p^2} - 2}}{{p + 2}} = \frac{{2p + 2}}{{p + 2}}$$   But he didn't explain how he came up with that number.   The only thing I've thought of is the following procedure:  $$\eqalign{   & {p^2} + (2 - {p^2}) = 2 \Rightarrow {p^2} + (\frac{{2 - {p^2}}}{2}) < 2,{\text{ and since }}2 - {p^2}{\text{ is always positive,}}  \cr    & {p^2} < \left[ {{p^2} + (\frac{{2 - {p^2}}}{2})} \right] < 2  \cr    & {\text{Therefore, let }}q = \sqrt {{p^2} + (\frac{{2 - {p^2}}}{2})} ,{\text{ then:}}  \cr    & p < q < \sqrt 2  \cr} $$  However, my result doesn't necessarily belong to ${\Bbb Q}$. I wonder how did he obtain the value of $q$ in the book.  EDIT: Feel free to point out if there are more appropriate tags for this question.


In continuation to the   How to use \glsaddall to list all the unused entries in list of nomenclatures and list of glossaries without printing the page numbers in the lists?

I would like to generate an index of notation using the glossaries-package such that certain page numbers are suppressed.  It is easy to define some standard notation and include it in the index using \glsaddall. But this adds the page numbers to the index, which is what I want to avoid.  Adding nonumberlist to the definition of an entry suppresses the page number. (nonumberlist also exists as package option, but not as option to \glsaddall.) But this has to be done for each entry and would also suppress future references.  Here is my question: How can I suppress all page numbers generated by \glsaddall?  In other words: \glsaddall ensures that all notation not referenced by \gls appears in the index, but without having a page number. All entries generated by \gls add page numbers.  Here is a good example:  \documentclass{article}  \usepackage{amsfonts} \newcommand*{\Z}{\mathbb{Z}} \newcommand*{\Q}{\mathbb{Q}}  % glossaries-user.pdf (v3.03): % If you use hyperref and glossaries, you must load hyperref first. \usepackage{hyperref} \usepackage[   style=long3colheader,   hyperfirst=false   ]{glossaries}  \newglossaryentry{integers}{name=\ensuremath{\Z},   description={the ring of integers}, sort=!} \newglossaryentry{rationals}{name=\ensuremath{\Q},   description={the field of rational numbers}, sort=!, nonumberlist}  \newglossaryentry{vector-space}{name=\ensuremath{V},   description={a vector space}, sort=V}  \makeglossaries  \begin{document}  \glsaddall  A vector space \gls{vector-space} \ldots  \printglossaries  \end{document}   The output is the following. The pages for Z and Q should not appear. (The page for Q is suppressed manually.)    (This question is related but not equal to .)


I'm an Australian Citizen who has been invited to volunteer in the States for 3 1/2 months with a letter of invitation. I will not be getting paid, all food and accommodation are covered by them and anything else is from me. Can I use the B1/B2 visa?

I am going to Santa Monica for 4 weeks to polish my English in July and would like to volunteer at the Planetary Society located in Pasadena.  I am a Swiss citizen and have a biometric passport. However, I don't have any special visa, as there is no visa needed for the school I am attending and using the Visa Waiver Program, I am allowed to stay up to 90 days in the US.  Am I allowed to do volunteer work during my stay?


I am trying to remake  but only with square and power of two, you can type a number and just click to get square root of two from the number, you can also click to make number squared. Everything works fine but after you click root and then power you get slightly different value. I tried a few javascript methods like toFixed() but for different values you have to sometimes round it and sometimes floor it for example after getting the root and exponentiating from:  2 it's 2.0000000000000004 so the result would have to be smaller 3 it's 2.9999999999999996 so the result would have to be bigger

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


I have the following setup

one

two

three

four

five

six

seven

eight

nine

ten

eleven

twelve

   with css  .bar>div {     display: inline-block;     margin-left: 10px; }   I want to make it so that if div.bar gets too small, its children disappear to the left. So "one" disappears first (completely or just partially).  My css knowledge is minimal so I don't even know where to start. I tried using overflow but to no success. I'm assuming it doesn't get triggered as inline-block automatically wraps.

I have a div with overflow:hidden, inside which I show a phone number as the user types it. The text inside the div is aligned to right and incoming characters are added to right as the text grows to left.  But once the text is big enough not to fit in the div, last characters of the number is automatically cropped and the user cannot see the new characters she types.  What I want to do is crop the left characters, like the div is showing the rightmost of its content and overflowing to the left side. How can I create this effect?


This question is from the perspective of complex analysis, with basic knowledge of topology. Let $\Omega$ be an open, path connected set in the complex plane ($\Omega$ being called a region). I have come across two definitions of simply connected regions :  A region $\Omega$ is simply connected if any two pair of curves in Ω with the same end-points are homotopic. (This is from Stein-Shakarchi)  A region $\Omega$ is simply connected if every closed curved in Ω is homotopic to a point in D. (This is from Mathematical Analysis by Apostol)   Its evident that definition-1 implies definition-2. But I am not able to see how definition-2 implies definition-1 ? Any help would be appreciated

A topological space $X$ is simply connected if it is pathwise connected and each closed path $u : I = [0,1] \to X$ is path homotopic to the constant path at $x_0 = u(0) = u(1)$. Recall that  A closed path $u$ is one with $u(0) = u(1)$. A closed path will also be called a loop and we write $\mathcal L'(X)$ for the set of all loops in $X$. If we want to be more precise, we say $u$ is a loop based at $x_0 \in X$ provided $x_0 = u(0) = u(1)$. By  $\mathcal L'(X,x_0)$ we denote the set of all loops in $X$ which are based at $x_0$. Also note that each constant path is a loop.  Two paths  $u, v : I \to X$ with the same initial point $x_0 = u(0) = v(0)$ and the same terminal point $x_1 = u(1) = v(1)$ are path homotopic, $u \simeq_p v$, if there exists a  homotopy $H : I \times I \to X$ such that $H(t,0) = u(t)$ and $H(t,1) = v(t)$ for all $t$ and $H(0,s) = x_0, H(1,s) = x_1$ for all $s$ (such a homotopy $H$ is stationary on the boundary $\partial I = \{0,1\}$; it is called a path homotopy). It is well-known that $\simeq_p$  is an equivalence relation on the set $\mathcal P(X)$ of all paths in $X$. Clearly $\simeq_p$ restricts to an equivalence relation on $\mathcal L'(X)$ and to an equivalence relation on each $\mathcal L'(X,x_0)$.  The set of equivalence classes $\mathcal L'(X,x_0)/\simeq_p$ is nothing else than the fundamental group $\pi_1(X,x_0)$ with base point $x_0$.   Question: Find a list, as complete as possible, of properties characterizing topological spaces which are simply connected. Each of these properties can then be taken as an alternative definition of simply connected. Note that many questions in this forum deal with aspects of simple connectedness. The answer to the present question will hopefully cover most of them.


I would like to create my own Ubuntu derivative with my desktop environment of choice and my preferred set of prepackaged programs.  What base should I start with and what modifications should I start adding?  I know two possible starting points:   , an official set of bare necessities () that seems suitable for creating appliance firmware or one's very own Linux distribution. Unlike , this is not a complete distribution, as it lacks a bootable image with an installer or a boot loader. , a fully working Ubuntu livecd containing only the minimal set of software to make the system work; not an official Ubuntu project. probably I could use  or something else as a base.   Then, I need to customize my distribution. I know of the following tools:        that should allow for me to easily customize my installation media. But what if I need not just something to create a one-off remix of Ubuntu for my own enjoyment, but a maintainable project with all its trappings: I guess I need to have a set of scripts trackable by version control system, amenable for automated testing and building with some build infrastructure. That's how they build a halfway decent OS distribution, right?  How should I best start creating my own Ubuntu derivative in a way that could naturally transcend a one-off custom CD for myself, and be built in a more controlled, robust manner, like proper Ubuntu derivatives supposedly do?

I would like to customize Ubuntu live CD by installing some additional packages. I have followed   but it doesn't seems to work. Can anyone provide clear instructions?   Note: I do not prefer Remastersys, manual way will be appreciated.  Customization  Packages that I want to install:   Thunderbird    Samba    SSH       Changes that I need:   Remove Games menu from the Application menu Firefox shortcut on Desktop Radiance as the default Theme Different default Ubuntu Wallpaper   Configuration file changes   I want the panel to be placed at the bottom I want to paste my Samba configuration file instead of default Samba configuration I have few Firefox shortcuts and folders I would like to show that in Desktop Also it will be nice if you say me how to change the icon sets   Recent Updates   I have customized Ubuntu 10.10 with Firefox shortcuts and few folders on desktops. Everything went smooth. But the installer gets crashes after choosing the timezone. How do i fix this issue? Also setting wallpaper affects the login screen. The wallpaper which i set is displayed on the login screen also. I just want the default one for the login screen.


Let say I have a typical java class like  public class Waiter {     private int Id;     private String name;     private int active;     //Including constructor, getter and setter }   And now I want to make a function that can change the variable in active. I know, in this case, I can simply use the setters, but I want to inside a function that I can call when I need to.  My function currently looks like this  public void login(int a) {     int b = 2;     a = b + a; }   Now I want to call it with  login(2)   but it won't update my a value in main?

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


This morning after updating the windows 7 which already existed  in my pc, I saw the windows 10 icon in notification panel.  But, there was a problem when I did shut down the pc and the next time after reopening  there was no windows 10 icon. I also reserved the windows 10 for my pc. I have been using dual boot system(windows 7, ubuntu). What can I do about  the updating process?

I want to get Windows 10, but I do not see this icon in the notification area (tray):    How do I get the icon to get Windows 10?


I would like to perform a few tasks at the beginning of the document so that I can later use them in a defined environment.  Why doesn't the following work?    \documentclass{article} \usepackage{tasks} \begin{document}  \section{Works not} \newcommand\examples{% \task Sample \task Sample \task Sample }  \newcommand\Examples{% %\settasks{debug} \begin{tasks}[style=itemize](2) \examples \end{tasks}}%  \Examples  \section{Works} \newcommand\ExamplesII{% %\settasks{debug} \begin{tasks}[style=itemize](2) \task Sample \task Sample \task Sample \end{tasks}}%  \ExamplesII \end{document}

I'm trying to switch from enumitem lists to tasks lists, but the following, which works in an ordinary enumerate environment, generates a "Something's wrong--perhaps a missing \item" error in the tasks environment:  \documentclass{article} \usepackage{tasks} \newcommand{\itemexpansion}{\item test \item test \item test \item test} \newcommand{\taskexpansion}{\task test \task test \task test \task test}  \begin{document} % OK \begin{enumerate}     \itemexpansion \end{enumerate} % Error \begin{tasks}     \taskexpansion \end{tasks} \end{document}   I can tell that there's an expansion problem here, but that's about as far as my comprehension extends. It doesn't seem to match the situations warned about in the manual. Is there a workaround that will allow me to dump the results of a macro (the contents of which are gathered elsewhere) into a tasks environment?


When talking about terms it should be with article (a/an) before the term?  For example:   1 What is an urticaria?    or  2 What is urticaria?  Thanks!

How do I know whether to use the definite (the) or indefinite (a, an) article, and when to omit it altogether?


Will the baby be male or female? If it was a random biological switch then, with a huge sample number, the sex ratio at birth would be exactly 50-50. But it isn't; the ratio is about 51-49 in favour of males. So how does this inequality arise?  Further to @Remib's comments. I was specifically thinking of the sex ratio in humans. Would it be true to say that the genetic determinant of the sex ratio would be exactly 50:50 M/F? If the disparity is environmental, then how does it work, and wouldn't an environmental effect be more variable than the 51:49% that we see?

For every 104 male babies, we have 100 female babies and there are statistics which are more reliable. (Those tell us that we have 997 female infants born per 1000 male infants born.) What is the reason for that? Why do we have more male babies than female babies?


Comments on my Meta SO posts are showing up in the iOS app:    But this comment was on a post I recently made which has (as of writing) 5 upvotes. I wasn't notified of those votes:    Shouldn't the votes / rep changes appear here?

I asked a question on meta SO for the first time since the split.   I received a couple of up votes (great), yet my rep hasn't changed.  Come to think of it, my rep appears to be my SO rep and my old Meta rep is no longer on SE Meta.  What happens when I'm upvoted on SO Meta?  I'm not really that bothered but some clarification would be nice.


In settings, my iPhone 5 shows I have 327.9 MB of free space remaining. However, when I open iTunes on my laptop I see 2.29 GB of unused storage space showing on the usage bar at the bottom of my screen. Which is correct?

When I look at the storage section of my phone, the various categories add up to about 2.5 GB of storage, but it says that 11.4 GB is being used. Is there any way to figure out what else is taking up space on my phone?


Do I need a visa for a 7 hour layover as I have South Africian passport on route from SF to London to Cape Town

I am travelling to Budapest and therefore have a Schengen Visa. I hold an Indian passport and a valid US visa. I'm travelling from Chicago-Heathrow-Budapest and returning by Budapest-Dublin-Chicago.  Would I need a transit visa for UK/Ireland?  UPDATE  Hoping this will help someone someday.   I was not allowed to board my return flight (BUD-DUB-ORD) because I do not hold an overnight Irish Transit Visa. They said I could have transited happily if the connecting flight was in the same day, but because I would have to originally land at 10 PM and catch the connecting flight next morning at 10 AM, I needed a transit visa. Well, I thought it was BS, but couldn't help comply with the rules. I booked another last minute ticket and flew via Warsaw via LOT.


I'm going to start running a gameserver soon and I want a way to reduce the the damage of a denial of service attack.  I want to make it so when someone joins the game their ip adress is added to a textfile (can already do this) and In the event of an attack I can simply use the text file as a whitelist and only allow connections to the server from the IPS that have joined the game in the past. Therefore allowing any user that has played before to join during an attack.  The server is running centOS. Is there anyway I can create a script that I can execute during and after an attack to enable/disable protection?  Or could anyone provide me with a command that uses iptables or whatever it is to whitelist a specified IP and a command that can pipe lines from a text file for use in this situation.  I am not very experienced at all with this kind of thing.  Thanks in advance.

This is a  about DoS and DDoS mitigation.   I found a massive traffic spike on a website that I host today; I am getting thousands of connections a second and I see I'm using all 100Mbps of my available bandwidth.  Nobody can access my site because all the requests time out, and I can't even log into the server because SSH times out too!  This has happened a couple times before, and each time it's lasted a couple hours and gone away on its own.  Occasionally, my website has another distinct but related problem: my server's load average (which is usually around .25) rockets up to 20 or more and nobody can access my site just the same as the other case.  It also goes away after a few hours.  Restarting my server doesn't help; what can I do to make my site accessible again, and what is happening?  Relatedly, I found once that for a day or two, every time I started my service, it got a connection from a particular IP address and then crashed.  As soon as I started it up again, this happened again and it crashed again.  How is that similar, and what can I do about it?


I want to pin programs to the left part of the Start menu, under the username, the same way as it worked in Windows 7. The area is completely empty (normally it would house the most used programs, but I have disabled that functionality). Using the "Pin to Start menu" context menu option results in a new tile being created in the right part of the start menu (the Metro ghetto). Dragging from within the Start menu or from Explorer to the left area of the Start menu only results in a no symbol icon appearing. The articles I've read (no doubt written at some point during the preview) indicate that dragging should work, but empirical evidence disagrees.

Has anyone figured out how to pin an item to the left side of the start menu? Articles online about this are referencing an older version of 10 where this was possible.   No matter the size of Start, clicking Pin to Start Menu will create another column and pin a tile there Cannot drag from right side to left, or from anywhere for that matter   Here's how my Start appears, after removing Most Used and Recently Added. Simply want an app pinned anywhere in the gray area:


I asked a question on Movies & TV about a series that did not have a tag yet.  Not having the 300 rep to add a new tag, I posed the question with the closest tag I could find, and then went to meta to ask someone to add the tag...  Only to find out that I was rate limited on meta as well (at least from the iOS app).  I wanted to ask for community help on meta, since I do not believe this issue warrants a mod flag.  Why does the question rate limit apply to meta questions as well?  Is it to prevent new users from (incorrectly) flooding meta with bad, potentially off-topic questions?  That's great for keeping new users in check, but hurts more experienced users wishing to start a discussion on meta around their question.  You can see my original post on Movies.SE , as well as a second time I ran into this on ReverseEngineering.SE .

People like myself are Stack Exchange trusted users with thousands of reputation points and hundreds of badges.  In other words, we've proven ourselves as people who are assets to Stack Exchange and are a key component in making it so profitable.  As such, I was surprised when I posted  on the  site, and then shortly afterwards tried to  on that same meta site, but was blocked with a message in red stating I had to wait 40 minutes before posting again.  Why is this limit present for trusted Stack Exchange contributors, and can it be changed?


I'm using stock android 9.0. I'd like to be able to get a list of the devices (IP and/or MAC) that are connected to my phone when it's used as a Wi-Fi AP.   Here are a few ways I tried but didn't work:   In the settings, there is an indicator of how many devices are connected (Network & internet / Hotspot & tethering / under Wi-Fi hotspot), but there is no list of them.  Fing only works when my phone is a client on a Wi-Fi network, not when it is an AP. On Oreo, the  /proc/net/arp file used to contain the list, but as of Pie, it doesn't (it's empty, even when something is connected).   I'm looking for a solution that does not require root.

This has been asked for    before, but none recently or with the Pixel/Nougat specifically that I was able to find.  Root is unavailable, so I need a way to do this as a regular user.  I really just want to see what IP my Raspberry Pi got assigned by the Android DHCP.  Also, if there's a way to set DHCP reservations to avoid having to look it up every time, I would love to know how to do that as well.


Following this question and its answers: , I am trying to fit a table in the presentation, so I did this:  \documentclass[table,dvipsnames,svgnames]{beamer}  \usepackage{multirow}  \begin{document}  \begin{frame} \begin{table} \begin{tabular}{|c|cccc|cccc|cccc|} \hline               & \multicolumn{3}{c|}{Sphere $n = 10^3, d = 10^4$} & \multicolumn{3}{c|}{Klein $n = 10^4, d = 10^2$} & \multicolumn{3}{c|}{MNIST $n = 60$k$, d = 784$} \\ \hline $\epsilon$    &  0    &  0.1  &  0.5  &  0.9  & 0    & 0.1  & 0.5  & 0.9  & 0    & 0.1  & 0.5  & 0.9  \\ \hline\hline {\tt BBD}     &  1.25 &  1.26 &  1.30 &  1.25 & 0.13 & 0.14 & 0.17 & 0.14 & 187.5 & 184.3 & 185.1 & 185.6 \\ {\tt LSH}     &  0.21 &  0.16 &  0.18 &  0.31 & 0.11 & 0.07 & 0.03 & 0.05 &  1.47 & 69.76 & 48.47 & 14.35 \\ {\tt FLANN}   & 25.0  & 25.4  & 25.5  & 25.6  & --   & --   & --   & --   & 244.6 & 217.2 & 157.3 & 142.0 \\ \geraf        &  0.06 &  0.06 &  0.06 &  0.06 & 0.06 & 0.06 & 0.06 & 0.08 & 8.167 & 8.567 & 8.579 & 8.565 \\ \hline \end{tabular} \caption{Build time (s) for three representative datasets. {\tt FLANN} does not finish after $4$~hr, which is indicated by `--' on Klein bottle or build times in gray on SIFT, where we have skipped configuration and used default values. {\tt BBD} runs out of memory on SIFT, as well as {\tt LSH} for $\epsilon = {0, 0.1}$.} \end{table}  \end{document}   However, I am getting this:     LaTeX Error: Something's wrong--perhaps a missing \item.   How to fix this please?    Edit:  If someone can provide another method of putting a table into the presentation with that format, this would also be acceptable, of course!!!

What is the best way of including large tables in a beamer presentation?


I noticed weird message about recent activity in  on mobile version of chat:        Chat room has been created today only, so last activity about 47 years ago is completely wrong. Looks like a using of an unitialized variable.

In fact, of these, only Charcoal shows a recent time stamp.


I've got my first home brew kit for blackberry wine, can I use normal household granulated sugar instead of brewing sugar?

Doing a homebrew for the first time, bought a kit to do it with; figured it be a good student method of saving money :).  Anyway, its currently in the fermenting bin, and when it comes to transferring I plan to transfer into a barrel rather than bottles.  One of the instructions is to add about 3oz of sugar per 5 gallons, but what kind of sugar would this be? Is it more brewing sugar, or can regular sugar or a different kind be used?  Thanks


I've been using the \addplot command to draw several functions in a \tikzpicture environment. The first 2 graphs were fine but somehow the other ones gave weird things that did not match the respective function.  For example the following code was used for a cubic function, and the graph showed at least 5 turning points for some reason.  \addplot[domain=-10:10, smooth, red]{2x^3 - x^2 + 8x - 6};   Does this have to do with me having several graphs and not "flusing inputs" (if that's a thing in LaTeX, I'm new to the \tikz and \pgfplots packages)? If not, what's wrong with my code? Any help appreciated, and thanks in advance.

I want to graph two quadratic equations using pgfplots. The first one work fine, however when I add the second equation, I get the following error message:  Package PGF Math Error: Unknown operator `x' or `x+' (in 'x^2 - 3x + 4').   It seems PGFplots will not let me multiply numbers at all. Functions such as 2x or even x * 2 don't seem to work. Here is what I am working with:  \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{pgfplots} \begin{tikzpicture} \begin{axis}[     axis lines = center,     xlabel = {$x$},     ylabel = {$ y = f(x)$} ]     \addplot[no markers, red]{x^2};     \addplot[no markers, blue]{x^2 - 3x + 4}; \end{axis} \end{tikzpicture}   The red plot works fine, but the blue one causes a compilation error.


I am trying to get a background image for my applet assignment for school and i am getting an error i don't understand. Also using Ready-to-Program if that is relevant   import java.awt.*; import java.awt.event.*; import java.applet.*; import java.net.*;  public class Summative extends Applet     implements ActionListener {     Button bttn1 = new Button ("Formulas");     Button bttn2 = new Button ("Start");     boolean Formulas = false;     boolean Start = false;     URL url;     Image background;     public void init ()     {         setSize (1000, 1000);         try         {             url = getDocumentBase ();         }         catch (Exception e)         {         }         background = getImage(url, "MathMeme.JPEG");          setBackground (Color.white);         bttn1.addActionListener (this);         bttn2.addActionListener (this);         add (bttn1);         add (bttn2);     }       public void paint (Graphics g)     {         g.setColor (Color.white);         g.drawImage (background, 0, 0, this);         /*if (Formulas == true)         {             Dimension d = getSize();             g.setColor(Color.WHITE);             g.fillRect(0, 0, d.width, d.height);             g.drawString ("Enter Formulas here", 100, 100);         }*/     }       public void actionPerformed (ActionEvent evt)     {         if (evt.getSource () == bttn1)         {             Formulas = true;             repaint ();         }     } }   and this is the error i am getting:  java.lang.NullPointerException     at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)     at sun.java2d.pipe.DrawImage.copyImage(Unknown Source)     at sun.java2d.SunGraphics2D.drawImage(Unknown Source)     at sun.java2d.SunGraphics2D.drawImage(Unknown Source)     at Summative.paint(Summative.java:38)     at sun.awt.RepaintArea.paint(Unknown Source)     at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)     at java.awt.Component.dispatchEventImpl(Unknown Source)     at java.awt.Container.dispatchEventImpl(Unknown Source)     at java.awt.Component.dispatchEvent(Unknown Source)     at java.awt.EventQueue.dispatchEvent(Unknown Source)     at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)     at java.awt.EventDispatchThread.run(Unknown Source)   i thought null pointer exception was when you have a try and access something with a null value so i dont understand how i can have one in this program.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


It is common knowledge that not even light can escape black holes, but since the black hole is emitting gravitons, and the gravitons travel in the direction away from the black hole, and it is escaping successfully, are they faster than light?

My understanding is that light can not escape from within a black hole (within the event horizon).  I've also heard that information cannot propagate faster than the speed of light.  It would seem to me that the gravitational attraction caused by a black hole carries information about the amount of mass within the black hole.  So, how does this information escape?  Looking at it from a particle point of view: do the gravitons (should they exist) travel faster than the photons?


When searching a keyword like [botframework] on search box, if the spelling of the keyword is not correct like [botframewrok] (which o and r are misplaced in wrok) the search result would be empty:    Now, my suggestion is, if the specified tag is not in the tag space, try to map the tag into the near tag and show the result of the auto-corrected tag. It might be this mapping be using the minimum Levenshtein distance.

I often see misspelled words in titles and bodies of questions, only to see them spelled properly in the tags. I have to imagine that tags are always spelled right because it's hard to type arbitrary text into the tag box. I also have to imagine that sometimes autocorrect and spellcheck provided by browsers tend to turn programming terms and package names into English words. For example, see   Would it be possible to have some sort of spellchecker that compares text of titles (and maybe bodies) to known tags and offers some sort of correction (maybe red squiggles or something) when there's some statistical probability of a misspelling?  Since this would be using a site's tags, "magneto" would get corrected to "magento" on SO, while "magento" would get corrected to "magneto" on aviation.stackexchange.com.  In theory this could reduce a lot of stupid typos and prevent trivial edits just to fix the spelling of key words.  Note that this is not solving a problem that a user's browser can already solve because browsers ship with English dictionaries, not dictionaries of programming terms. In fact, it's potentially correcting a problem created by the browser (which might have already autocorrected "magento" to "magneto").


apt-cache dump returns all information of available packages. In order to get all versions of a certain package the following was tried:  ubuntu@ubuntu-xenial:~$ apt-cache dump | grep -A25 "python-bottle-doc" | grep Version  Version: 0.12.7-1+deb8u1build0.16.04.1  Version: 0.12.7-1   but this is not a stable solution as some packages possesses less details then others.

How can I check the version of the available package in the Ubuntu repositories without installing it?


I have been working on building a name generator based off of Markov Chains. So far, the code can find the probability of the next letter and place it nicely in the LinkedHashMap (Which I will refer to as LHM past this point) named states by using the generateProbabilities() function. The LHM stores the data so that the first key is the state, and the second is the transition letter.  However, this is where things start to get interesting. I have three output statements, one in the generate() function, and two in the WeightedRandom init. Here is my output:  EDITED SECTION:  Called from generate(): [0.13333333333333333, 0.13333333333333333, 0.13333333333333333, 0.06666666666666667, 0.13333333333333333, 0.06666666666666667, 0.06666666666666667, 0.13333333333333333, 0.06666666666666667, 0.06666666666666667] Called from WeightedRandom (Size): 10 Called from WeightedRandom (Values): [0.13333333333333333, 0.13333333333333333, 0.13333333333333333, 0.06666666666666667, 0.13333333333333333, 0.06666666666666667, 0.06666666666666667, 0.13333333333333333, 0.06666666666666667, 0.06666666666666667]  Exception in thread "main" java.lang.NullPointerException     at WeightedRandom.<init>(WeightedRandom.java:14)     at MarkovChain.generate(MarkovChain.java:102)     at Temp.main(Temp.java:7)   The weird part is that the NPE on line 14 is the second println statement in WeightedRandom, and it was thrown after it printed out the data. The third println prints without an error. So, it isn't like I forgot to initialize it, or didn't have the right key to get the NPE. The code is below:  MarkovChain.java  public class MarkovChain { public String filePath; public LinkedHashMap<String,LinkedHashMap<String,Double>> states = new LinkedHashMap<String,LinkedHashMap<String,Double>>();  public MarkovChain(String filePath){     this.filePath = filePath; } public void generateProbabilities(String delimiter){   //Creates a hashmap of probabilities for each letter. }  public String generate(int iterations){     Random rand = new Random();     LinkedHashMap<String,Double> currProbabilities = states.get("a"); // Placeholder for random start state;     String output = "";     WeightedRandom weightRand;      System.out.println("Called from generate(): " + currProbabilities.values());     for(int i = 0; i<iterations; i++){         weightRand = new WeightedRandom(currProbabilities);         String newState = weightRand.compute();         output+=newState;         currProbabilities = states.get(newState);     }      return output; } }   WeightedRandom.java  import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Random; import java.util.Set;  public class WeightedRandom { LinkedHashMap<String,Double> items; Random rand = new Random();  public WeightedRandom(LinkedHashMap<String,Double> items){ //Currently Single-Purpose.     this.items = items;     System.out.println("Called from WeightedRandom (Size): " + items.size());     System.out.println("Called from WeightedRandom (Values): " + items.values());  }  public String compute(){     items.values();     /*     Set s = items.entrySet();     Iterator i = s.iterator();     double randNum = rand.nextDouble();     double runningTotal = 0;     String output = null;     while(i.hasNext() && output == null){         Map.Entry entry = (Map.Entry)i.next();         if(randNum < runningTotal + (double)entry.getValue() && randNum > runningTotal){             output = (String)entry.getKey();         }     }     return output;     */     return null; } }


I have installed Ubuntu 17.04 Zesty Zepus on my computer. I have been unable to connect to any wireless network with 17.04, whether from using the live USB during installation or after it has been installed. I experienced.no problems on 16.04. Although Ubuntu can see my network in 17.04, it cannot connect and it says "Disconnected".  EDIT:  I have followed Jeremy31's commands. The Internet seems to work now, and it works quite well. I had problems installing Steam and Chrome from .deb files with the Ubuntu Software program, so that's why I thought the Internet was malfunctioning. Gdebi fixed that issue.  I have entered my wireless-info.txt file to the link below which I received by entering the commands   wget -N -t 5 -T 10 https://github.com/UbuntuForums/wireless-info/raw/master/wireless-info && \ chmod +x wireless-info && \ ./wireless-info     Output of lsusb:  ID 148f:3572 Ralink Technology, Corp. RT3572 Wireless Adapter

My Panda USB wi-fi adapter works just fine on 16.10, but when I try to connect to my wi-fi router in 17.04, GNOME network manager reports "Connection failed." I did some tinkering, and noticed that my MAC address for my wifi adapter, according to GNOME, is DIFFERENT every time I make it forget my wifi settings and try to reconnect. Any leads on a possible fix or work-around?   I'm running Ubuntu GNOME 17.04, kernel 4.10.0-19-generic, GNOME 3.24.0.


Dave has 10 poker chips, 6 of which are red and the other 4 of which are white. Dave likes to stack his chips and flip them over as he plays. How many different 10-chip stacks can Dave make if two stacks are not consider distinct if one can be flipped to appear identical to the other? So I know that the number of ways to arrange the poker chips is 10 choose 6. But what do I do after that to satisfy the second condition?


Just wondering if someone could clarify the reason as to why my flag was declined for an answer on  (I have added the link to the answer which has been deleted but anyone with moderator permissions on SO should be able to see the it).    I suspect that someone may have flagged the answer as spam in addition to my 'not an answer' flag as the answer was just randomly formatted text with a random comment from the person who submitted the answer under it also.  Is this the case (in which case the comment is misleading) or was there an error on my part here? :S

Sometimes a post has both valid flags and invalid flags. As far as I can tell, all the flags on the same post have to be dismissed with the same validity.  The scenario I encountered (on ):   A low-quality question is closed. The asker improves the question and flags for reopening. A moderator reopens the question, but doesn't dismiss the flag yet. Someone else flags the question as “off topic”.   Since I agree with the reopening, and I don't consider the question off-topic, I would like to dismiss the first flag as valid and the second flag as invalid. But there's only one set of buttons for both flags.  And just now, two flags on a closed question: one that says “delete it”, the other one that says “reopen it”. The correct course of action is neither (the ideal outcome would be for the question to be edited then reopened). I should provide different feedback to the two flaggers, but I can't.  Unless I've missed something, please allow multiple flags on the same post to be dismissed separately.


My answer to a question was recently deleted by Andrew Barber (20K+ member) and I am wondering why. It fundamentally answers the question (although it wasn't the accepted answer) and was also up-voted twice.   is the question.   is the answer in question.

I have often wondered at the practice on Stack Overflow, Server Fault, and the other sites where someone will ask a question and an answer will come in that says Look here: http://link elsewhere. Rarely will the link have exactly the answer necessary -- often it's an entire article -- yet these answers get voted up.  Why is that, exactly? I realize this is subjective, but my own thoughts are that one should try and give the answer (even if the answer is 'no, it can't be done' or 'no, I don't think it can be done' -- very different answers) and then if you have a link that explains it, go ahead and post it within the answer.  What does the community think about this?     For more information, see  in the .


I found a conflict between bm an etoolbox because later one redefines \@@end. It happens when it patches \enddocument command.  Code from etoolbox:  \patchcmd\enddocument   {\deadcycles}   {\let\AfterEndDocument\@firstofone    \@afterenddocumenthook    \deadcycles}   {}   {\let\etb@@end\@@end    \def\@@end{%      \let\AfterEndDocument\@firstofone      \@afterenddocumenthook      \etb@@end}}   bm package expects that \@@end will be from latex.ltx Shouldn't etoolbox redefine \@@end only on \enddocument (if \patch\enddocument failed)?  Example with the problem:  \documentclass{article} \makeatletter \let\saved@enddocument\enddocument \def\enddocument{\saved@enddocument} \makeatother  \usepackage{bm} \usepackage{etoolbox} \begin{document} $\boldsymbol{\sigma}$ \end{document}   Can it be fixed in TL1015?

I am trying to transition to using the etoolbox package, but seem to have run into some difficulties and they appear related to the hyperref and bm packages which to me seem totally unrelated.  The MWE example compiles since \RemoveEToolbox is defined and shows that there is no apparent problem before etoolbox was used.    Commenting out the \def\RemoveEToolbox{} line produces two problems:   With both the \renewcommand, and the usepackage{hyperref} commented, this results in "Runaway argument? Paragraph ended before \bm@test@token was complete". Including the usepackage{hyperref} (with \renewcommand commented) results in "Undefined control  sequence. \Call@AtVeryEndDocument ...cumentHook \@undefined"   But if uncomment the \renewcommand{\bm}{#1} line (effectively doing without any \bm), then this seems to compile.  I have been using this for a while now and things appeared to have been working fine, but now that I attempt to use etoolbox I seem to run into problems.  \documentclass{standalone} \def\RemoveEToolbox{}% Shows that this works fine without {etoolbox}  \usepackage{amsmath} \usepackage{xcolor} \usepackage{bm}  \ifdefined\RemoveEToolbox     \newcommand*{\iftoggle}[3]{#2}% Default to true value of "if" \else     \usepackage{etoolbox}     \newtoggle{paper}     \toggletrue{paper}      %\renewcommand{\bm}[1]{#1}% Why can't I have a normal \bm with {etoolbox}? \fi  % \usepackage{hyperref}  \begin{document}  This document is intended for  \iftoggle{paper}{paper}{electronic} distribution.  \bm{\textcolor{blue}{Solve $x^2-1=0$}}  \begin{align*}     a &= b\\     \iftoggle{paper}{         c &= d\\     }{}     e &= f\\ \end{align*} \end{document}


Can someone explain how to create fancy boxes like this in ConTeXt MKIV and probably with MetaFun?    According to @JairoADelRio link and MetaFun manual it is easy to change title text, to round and to change the background color of the title box.  However, any change I make only appears in title box. Why is that so? What do I miss? And how to round and to change the background color of the the content box?  Plus, how to get space between title and the box around it?

I am planning to move to Context, however, the fact that I'll miss some of LaTeX packages (especially tcolorbox) feels sad. That's why I asked such a question.


I am trying to do a simple script which runs a few commands N number of times, determined by the user's input. However, when it comes to run the commands (in a for loop) - The variable is ignored:  read -p "Please enter the number of times you wish to fail over: " num  ...    for run in {1..$num}    do echo "STOP: "    date    systemctl stop $broker    date    sleep $st    echo "START: "    date    systemctl start $broker    date    sleep $st   done fi + '[' y == n ']' + '[' y == N ']' + for run in '{1..$num}' + echo 'STOP: ' STOP: + date Tue Dec  4 16:14:11 GMT 2018   Can anyone explain why this is happening and what I need to do to rectify? Or does anyone have a better method for this?

I want to use $var in a shell brace expansion with a range, in bash. Simply putting {$var1..$var2} doesn't work, so I went "lateral"...   The following works, but it's a bit kludgey.    # remove the split files echo rm foo.{$ext0..$extN} rm-segments > rm-segments source rm-segments   Is there a more "normal" way?


I have a tiny script that simply fetches the current date, runs a PHP script and redirect the output (and errors) to a filename containing the current date.  DATE=$(date +"%Y%m%d") FILE="log/${DATE}.log" php -q script.php >> $FILE 2>&1   When I run this script on my local machine (Windows 7, Aptana IDE), the PHP script works fine and the logfile has the expected filename, e.g. 20140502.log.  But when I push that script via SFTP to my remote machine and execute that script, the filename looks like this:  20140502?.log?   What might be the problem? Is this an enconding error (e.g. encoding for SFTP uploads is ANSII, where UTF-8 is expected)? Or do I have to change anything in the script itself?  Information about system/shell:  [foo@bar path]$ sh --version GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)   Funny fact: If that script is called by a cronjob, the question marks don't occur. Only if I manually run the script.


I have an Object (aObject) contains datetime field, I want to get all data from aObject where datetime includes 12-29-2013 ignoring the time.  any idea ?

The  explains how to put a Datetime query in a SOQL query.    SELECT Id FROM Account WHERE CreatedDate > 2005-10-08T01:02:03Z   I need to just put in a date for this query. Something like:   SELECT Id FROM Account WHERE CreatedDate > 2005-10-08   But that throws an error. Any ideas?


I'm struggling to make my German and English abstract appear on the same page in my report document. Currently they appear on two separate pages, no matter how big the abstracts get. Can anybody help me out? :)  The solution provided in  does not work, probably because I use a report instead of an article:  Command \abstract already defined. {\par\bigskip}   This solution  doesn't work because I need the titlepage environment.  EDIT (SOLUTION): Changing \newenvironment{abstract} to \renewenvironment{abstract} as suggested by Marijn did the job! Many thanks :) Also thank you for the suggestion on loading german as the last option to babel - I did that as well :)  \documentclass[11pt,a4paper]{report}   % packages I use \usepackage[german, english]{babel}  \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{textcomp} \usepackage[hyphens]{url} \input{../setup/hyphenations} \usepackage{amssymb} \usepackage{emptypage} \usepackage{mathpazo} \usepackage[scaled=.95]{helvet} \usepackage{courier} \usepackage[paper=a4paper,width=14.2cm,left=36mm,height=22cm]{geometry} \usepackage{setspace} \linespread{1.15} \setlength{\parskip}{0.5em} \setlength{\parindent}{0em}  \begin{document}  \begin{abstract}  German Abstract \end{abstract}  \selectlanguage{english} \begin{abstract}  English Abstract \end{abstract} \selectlanguage{german}  % some chapters / table of contents ... \end{document}

I'd place in the same page two abstract section.One created using my own language and one in english language. If I tried this:  \selectlanguage{italian} \begin{abstract}     \lipsum[1] \end{abstract}  \selectlanguage{english} \begin{abstract}     \lipsum[1] \end{abstract}   but they are placed into two different pages  Edit:  this is my environment definition:  \newenvironment{abstract}{     \clearpage     \vspace*{\fill}     \begin{center}%         \bfseries\abstractname     \end{center}}%     {\vfill\clearpage}


Doing some experimentation I consumed two of the same item of food from my inventory and when I returned the game screen I only had the remaining time of a single item.  So eating two 'Meat' with a 10s vitality regen timer, you'll only get 10s of regen.  As the duration doesn't stack, is the effect of eating multiple food items cumulative? Will I get double the regen in the same amount of time? Or are extra food items just 'lost'.

Regenerating health on "Death March" difficulty can take a while if you have a rather big health pool and no perk to regenerate health (e.g. using Quen).  Apart from potions I use food to regenerate health. However, it can take quite a long time if I have to eat Dried Fruit And Nuts 5 times. I eat one, wait 5 seconds, open the inventory again (or use the quick slot) and wait 5 more seconds.  Therefore I'd like to know if vitality regeneration stacks by eating multiple foods.  For example (numbers not accurate):     I eat 1 "Dried Fruit and Nuts"   100 vitality restored over 5 seconds.  I eat 2 "Dried Fruit and Nuts" then leave the inventory screen. What is the outcome?   Regenerate 100 vitality over 5 seconds. Regenerate 200 vitality over 5 seconds.    Which way does it work? Assuming it works like 1. I would have to keep opening the menu, eating 1 piece of food, opening the menu again and eat the next. I don't like placing food in my two quick slots because I usually save those slots for my most important potions.    Edit 1:  After having a look at the question to which this question is flagged as a duplicate I concluded that there are contradictions on how the stacking works.  Two theories that need proof (proven in Edit 2):   Vitality regeneration does stack, no matter what you eat/drink. Vitality regeneration only stacks if the foods consumed are not of the same type (e.g. 2 x Nuts do not stack, but 1 x cow milk + 1 x nuts will stack).   I will test this when I get home looking at the numbers (vitality information on the inventory screen).  Right now, everything points to theory 2 since theory 1 would make you invincible for a short time if you stuff 20 roasted chickens down Geralt's throat.    Edit 2:  I can confirm theory 2.  Eating one raw meat regenerated 508 hp over 5 seconds.  Eating one raw meat and one cow's milk added two regeneration indicators to the UI and regenerating 1432 hp over 30 seconds. The timer for raw meat ran 5 seconds while the cow's milk timer ran 30 seconds.  This also confirms that different foods have different intensities of regeneration. While raw meat regenerates 508 hp over 5 seconds, cow's milk regenerated 924 hp over 30 seconds.  Oddly, drinking cow's milk without eating at the same time regenerated 931 hp.   Raw meat: 508 hp Cow's milk: 931 hp 1 x raw meat + 1 x cow's milk: 1432 hp (instead of predicted 508 + 931 = 1439 hp)   I did the tests at level 30.


I am on Mojave and I will not ever upgrade to Catalina because I have 32 bit stuff I am not planning to ditch.  Software Updates in System Preferences still shows that there is one 'update', i.e. a major OS upgrade (see pic).  This is annoying and I'd like not to have this notification.  How can I turn it off?

I keep the "System Preferences" app icon in my dock in Mojave. I recently checked for updates, and found one, but I'm not ready to install it just yet and the red notification dot over the settings app is really bothering my obsessive-compulsive self.  To make things worse, there's no way to disable the notification for the settings app, from the settings app.  How can I banish the notification icon until I'm ready to deal with doing updates?  (Note: this a the red notification badge/dot over the System Preferences app, not the App Store one. It is also not the big textual one that will appear in the upper right corner of the screen. And, unlike all the other questions I found while searching for this, I am in Mac OS rather than iOS.)  The closest thing I found was , which was about iCloud security problems rather than software updates. My question isn't why, but how to ignore a software update for a while.


How do we get to know the concept of mass in Newtonian Mechanics? Like, from Newton's Second Law of motion we get : $\frac{d\vec P}{dt} = \vec F$ from here, $m\frac{d\vec v}{dt} = F$, defining $\frac{d\vec v}{dt} = \vec a $, we define mass $m = \frac{\vec F}{\vec a}$. Once again for a constant $\vec F$, we get, $\frac{m_{1}}{m_{2}} = \frac {v_{1}}{v_{2}}$. Which one (or any other way of defining mass) is correct physical way to define the concept of mass in Newtonian Mechanics?

If you consider  as laws, then there must be independent definitions of  and  but I don't think there's such definitions.  If you consider them as definitions, then why are they still called laws?


I am developing a project that will have a table with a lot of content and I want to get the JSON content from an external file ("products.json") to have an better data organization.  Here is my Javascript file...  var domStructure = "";     jsonObj = {     "products": [     {         "ID": "01",         "Name": "John",         "Status": "Published"     },     {         "ID": "02",         "Name": "Paul",         "Status": "Published"     },     {         "ID": "03",         "Name": "Nick",         "Status": "Blacklist"     }], };  function getTableRow(id, name, status) {     return '\
\             ' + id + '	\             ' + name + '	\             ' + status + '	\
'; }  for(var key in jsonObj.products) {     domStructure += getTableRow(jsonObj.products[key].ID, jsonObj.products[key].Name, jsonObj.products[key].Status); }  document.getElementById('table').getElementsByTagName('tbody')[0].innerHTML = domStructure;

I need to do an  request in JavaScript. What's the best way to do that?  I need to do this in a Mac OS X dashcode widget.


So I have been messing around with this trying to make a simple calculator while also using methods. For some reason when checking if the string "func" is equal to "*" it skips and instead returns "Unknown" it also happens when imputing the other functions  package test; import java.util.Scanner;  public class test {      public static float num1;     public static String func;     public static float num2;     public static float awnser;  public static void main(String[] args) {      Scanner input = new Scanner(System.in);          System.out.println("Simple Calculator");             num1 = input.nextFloat();                 func = input.next();                 System.out.println(func); //Confirms func=="*"                     num2 = input.nextFloat();                         times();} public static void times() {      if(func=="*"){awnser=num1*num2;}      else if(func=="/"){awnser=num1/num2;System.out.println("The awnser is: "+awnser);}      else if(func=="+"){awnser=num1+num2;System.out.println("The awnser is: "+awnser);}      else if(func=="-"){awnser=num1-num2;System.out.println("The awnser is: "+awnser);}         else {System.out.println("Unknown");}}}   OUTPUT:   Simple Calculator 5 * * 5 Unknown

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


When flagging/voting to on-hold a question, I seem to have missed the option to simply flag as off-topic or belonging elsewhere on stack exchange.  I'm presented with the following list:   general hardware/software->Superuser non-specific programming->get more info bad question not understanding problem->checklist serverfault stuff to serverfault recommend a tool/library limited set of other sites   Which option should I use where a question is so blatantly off-topic that it can't even be remotely about programming or fit in one of the alternatives?  On Ask Ubuntu, my primary site, there's an option called "other" prompting me to type a reason, but on Stack Overflow, where I flag instead, there is no other option. Do I use the generic moderator request(thereby not allowing 20K users to see it, only elected moderators)? Will I get an "other" option at 3000 reputation? Am I missing the point entirely?  Can this "other" bullet be added for non-3K-users?

I really like the new option structure when flagging - I have in particular missed the "Minimal understanding" option. However, I think that one option is missing. If we look at , it has many issues. I ended up flagging it as too broad, but I would think that it is simply, well, just off-topic. So that's where I started. Hmm:  It isn't about general computing hardware/software. It certainly isn't about code problems. It could be about not demonstrating a minimal understanding of the problem - but suggesting this guy should elaborate on what he did to try to change his birthday doesn't seem right. It isn't about server and networking. It isn't really asking for recommendations. It certainly doesn't belong anywhere else on SE.  In this case, as mentioned, I flagged as too broad even though VLQ might also have been appropriate. However, if we assume that the question only contained the first sentence, and was actually well-formed, but totally off-topic such as:  How can I change my birthdate in Facebook? I looked in the FAQ and tried  but now it is locked and I cannot change it anymore.  Isn't that off-topic? Would “Minimal understanding” really be the proper selection here? As far as I can see, I can't just select “off-topic”, but have to select one of the above options. Or should those kind of posts go directly to mods every time? Edit:  of what I believe is just off-topic, but doesn't apply to any of the options given in the off-topic dialog, and which hence has to go by the mods. Edit 2:  - which I personally flagged not as OT, but as unclear. As official OT it is still a prime example where none of the generic options apply. The question (with the title included) says:  It is possible to play the DRM formatted song in Custom player like AVAudioPlayer and MPMoviePlayer [on hold] I have tried to play directly in the AVAudioPlayer or MPMoviePlayer, but the song isn't playing.  to which the SO official response is:  You may be able to get help on Super User.  Seriously? We really want him to ask this question at Super User? Edit 3: And  that I ended up flagging as unclear - although I'd say it is a prime, generic off-topic question. From Al Everetts comment below:


Let's say we have        if(Schema.SObjectType.PermissionSetAssignment.isCreateable()){             List<GroupMember> usersToInsert = new List<GroupMember>();             for(AggregateResult usr : [SELECT assigneeId                                         FROM PermissionSetAssignment                                         WHERE ((PermissionSet.IsOwnedByProfile = TRUE                                                     AND PermissionSet.profile.name IN :profileNames)                                                         OR PermissionSet.name IN :permissionSetNames)                                                     AND assigneeId NOT IN (SELECT UserOrGroupId                                                                             FROM GroupMember                                                                             WHERE Group.Name = :groupName)                                          WITH SECURITY_ENFORCED                                         GROUP BY assigneeId]){                 usersToInsert.add(new GroupMember(UserOrGroupId = (Id)usr.get('assigneeId'), GroupId = groupId));             }             insert usersToInsert;         }  why we face PDM issue? is it possible to avoid it? (Updated) it doesn't work if I even add WITH SECURITY_ENFORCED to SOQL query

Background   I am using the Apex PMD plugin for VS Code and it's giving me this problem:     Validate CRUD permission before SOQL/DML operation   For this line of code:  insert contentVersion;   Which is part of this method:  private void attachReport(Id recordId) {      ContentVersion contentVersion = new ContentVersion(         versionData = Blob.valueOf(buffer.toStr()),         title = 'Import Report',         pathOnClient =  StringUtils.format('/Import-Report-{0}.txt', DateTime.now().getTime()),         FirstPublishLocationId = recordId);      insert contentVersion; }   Questions    Why am I getting the problem? What should I do to not get the problem?     Reference


I have been looking at curry recipes on an American web site and it gives measurements in teaspoons and tablespoons.  I am not familiar with these measurements as we do not use them locally.  Does teaspoon/tablespoon refer to the size of the spoon or its purpose?  If I have spoons that measure only mL, how can I convert a teaspoon/tablespoon measurement to these?

I found a recipe that's using one or more measurements that I don't recognize. How can I convert it to a unit that I use locally?     Alternative question template: (to improve searchability): How can I convert an Imperial weight or volume measurement (tsp, tbsp, cups, ounces, pints, quarts, gallons, pounds) to an equivalent Metric measurement (g, kg, mL, L)?


I thought this is a pretty simple task, but apparently not.  Windows 10 Pro, standalone on a home network. There are several accounts on this system.  I am trying to find when a given user account has logged onto this system. I see tons of "logon" and "special logon" events (and I mean LOTS of them) around the time when I know the user login event has occurred. But there's no mention anywhere of the actual username. Or the event viewer claims that the account name is SYSTEM or the actual hostname of the machine. There's no mention of the one thing I need: the actual username that has performed the logon. These logs could not be less helpful this way.  What am I missing?

I'm required to log my start and finish times at work. Occasionally I forget to do this and had a bright idea that checking the Security events log would allow me to retrospectively ascertain my times.   Unfortunately, the logs are much bigger than I thought and take a while even to display in Event Viewer. Also, I tried filtering the logs by date and userid but so far this has yielded no results.  Assuming my idea is feasible, can anyone step-through what I'd need to do to retrieve the information I need?  UPDATE:  I followed @surfasb 's instructions and got the to point where I can see only the logins, however some of these are System-level (i.e. non-human) logins. I would like to see only my 'physical' logins (there would only be two or three such events on weekdays) and not all the other stuff.  I've tried putting my Windows username in the field as shown below using both domain\username and just username but this just filters out everything. Can you assist?


I have submitted a major revision to TVT (Transactions on Vehicular Technology). It has been 10 days with the Associate Editor. How much time does it usually take to receive a decision?

What steps does a manuscript typically go through from submission to publication (or rejection) in a typical journal? How are these steps referred to, in particular by editorial systems, and how long do they each typically take?  Note that this question is about the typical situation and hence not about:   Journals with an atypical workflow, e.g. those that allow for an instantaneous reviewer–author interaction. Exceptional steps or rare occurrences such as withdrawal or .   This is a canonical question on this topic as per . Due to its nature, it is rather broad and not exemplary for a regular question on this site. Please feel free to improve this question.


Is there any symbolic manner to represent the concatenation of matrices row or column-wise? Briefness is appreciated.  Best regards.

Trivial question: Is there any standard notation for the concatenation of two or more matrices?  Example:  $$A = \left(\begin{array}[c c]  - a_1 & a_2\\ a_3 & a_4  \end{array}\right),$$  $$B = \left(\begin{array}[c c]  - b_1 & b_2\\ b_3 & b_4  \end{array}\right),$$  Then the concatenation (by rows) of $A$ and $B$ is:  $$C = \left(\begin{array}[c c]  - a_1 & a_2\\ a_3 & a_4 \\  b_1 & b_2\\ b_3 & b_4  \end{array}\right).$$  I just want to know if there is a standard notation for this operation.


For reference, I'm using this equation for drag  $$d = c \times {\rho \times v^2 \over 2} \times a$$  And this one for finding terminal velocity  $$v = \sqrt{2 \times m \times g \over \rho \times a \times c}$$  For the purposes of this question, you can assume $c$, $\rho$, $a$, and $m$ are all $1$ and the object we are dealing with is a sphere. These two equations then simplify to  $$d = {v^2 \over 2}$$ $$v = \sqrt{2 \times g}$$  Now imagine $g=50$. The terminal velocity of the object in this environment would be $v = \sqrt{2 \times 50} = 10$. This object then has a velocity vector of $(0, -10)$. It's experiencing a downward force of $50$ units due to gravity, and drag is pushing it upwards by $d = {10^2\over 2} = 50$ units, perfectly cancelling out gravity, thus it is at its terminal velocity.  Now imagine a sideways force being applied. Its velocity vector now becomes $(4, -10)$. Calculating for drag, we can see the drag force has a magnitude of ${\sqrt{4^2 + (-10)^2}^2 \over 2} = 58$ units.  The unit vector in the direction of the velocity is given by  $$\theta = \text{atan2}(-10, 4)$$ $$U = (\cos \theta, \sin \theta)$$  And since drag is applied in the opposite direction of motion, we know the drag vector is $D = d \times -U$. And after actually crunching the numbers for the Y-component of $D$, we see that the object is experiencing an upwards force of $53.85...$ units, which is more than the downward force of gravity.  So, my question is, what's going on here? Does the sideways motion actually truly affect the vertical motion? Am I missing something in the calculations? Intuition would tell me that no matter how fast an object is moving sideways (ignoring things like lift, we're dealing with a sphere) its vertical motion will be unaffected. Is that intuition wrong?  Granted, my calculations are fundamentally 2D, but imagining similar situations in 3D gives the same result. The drag vector still has a stronger upwards component, which still raises the same questions.

In a world without air, I understand they definitely would. However, with drag taken into account, I think they wouldn't. Since the drag force varies proportional to the square of speed (ignoring the change in coefficient of drag with speed), wouldn't the total impulse due to drag on a bullet fired from a gun from a specific height horizontal to ground be higher than the total impulse on an identical bullet dropped from the same height with no horizontal velocity?  Also, when bullet spin is taken into account, the bullet fired from a gun should resist change in orientation; therefore, it should maintain a small but non-zero angle of attack, and also have a lift force, correct?


lists Worf's 'home town' where he grew up as Minsk,  states no such thing, and in fact he was from Gault (a farm world). The question is, has he ever been to Minsk?  Related question

I've just watched the last 20 minutes of an episode of Deep Space 9, and towards the end Worf is very insistent that O'Brien and his wife move to Minsk. Is there any in or out of universe reason for this?


I realized I don't understand a pretty basic thing about DNS. So, here's the flow  Assuming nothing is cached, When I open stackoverflow.com, the request goes to the root, then to the .com TLD registry, which in turn returns the name server (NS record) for the stackoverflow domain, i.e. cf-dns01.stackoverflow.com. Q1: Does the TLD only return only the NS records for the domain?  After that, the request goes to cf-dns01.stackoverflow.com., which has and returns the A record(s) (=IP(s)) of stackoverflow.com.  Q2: where is the IP address of cf-dns01.stackoverflow.com configured, i.e. how is the authoritative name server's IP resolved? Especially in this case, when the name server is a subdomain of the domain it has to resolve.

This is a  about DNS glue records.   What exactly (but briefly) is a DNS glue record?  Why are they needed and how do they work?


In the lecture, my proffesor stated that     Any $n$-th order ODE has $n$ arbitrary constants in its general   solution.   However, we have later seen that some ODEs have some singularities, so the so called "the general solution" is not so general at all in many cases, and this lead me to question that is there any execeptions to the rule that I have quoted.  For any ordinary DE, does the general solution of this ODE has to have $n$ arbitrary constants ? If so, how ? if not, can you provide an example ?  Edit:  As I have pointed out, I'm asking this question for ODEs, and not PDEs.

For smooth cases, we expect the solution of an $n$th-order ODE to have $n$ constants of integration.   Is there a name to the theorem which more precisely makes this claim? Is there an analogous theorem for PDEs?  That is, do we expect $n$ "integration functions" for an $n$th-order PDE?


Let $X$ denote $(0,\infty)\subseteq \mathbb{R}$, and let $d:X\times X\to \mathbb{R}$ be defined as $d(x,y)=|\ln x- \ln y|$. Show that $(X,d)$ is a complete metric space.   I am taking for granted here that $d$ actually defines a metric on $X$, since I have already showed this. However, I am quite stuck on how to show that this space is complete. My initial thought was to take an arbitrary Cauchy sequence in $X$, and show that it converges and that the limit is in $X$.   Now if we let $\{x_n\}_{n=1}^\infty$ be some such Cauchy sequence in $X$, we know that given any $\varepsilon>0$ we can find a corresponding $N\in\mathbb{N}$ such that $d(x_n,x_m)=|\ln x_n - \ln x_m|=|\ln(x_n/x_m)|<\varepsilon$ whenever $n,m>N$.  Now, since $\ln(x_n/x_m)$ should tend to zero, this would mean that $x_n$ and $x_m$ become arbitrarily close to each other as $N$ grows large. This in turn would imply that a limit exists, however I am not sure how to make these arguments rigorous and also how to show that such a limit lies in $X$.  Any hints on how to proceed would be greatly appreciated!

Given the metric space $(X,d)$ with $X := (0,\infty)$ and $d:=|\ln(x)-\ln(y)|$, how can I show that $(X,d)$ is complete?  I need to prove that any Cauchy sequence converges, so:  If $(x_n)$ is a Cauchy sequence in X, then it follows for all $\epsilon \gt 0$ that there exists an $n_0 \in \mathbb{R} : \forall n,m \leq n_0: d(x_n,x_m) \lt \epsilon$.  I couldn't find a direct way to prove this, I guess an indirect approach might go as follows:  Let $(x_n)$ be a Cauchy sequence in X and assume that it does not converge, then it follows that there exists an $\epsilon > 0$ such that for an arbitrary $x \in X : \forall n \in \mathbb{N}: d(x_n - x) \geq \epsilon$ and this would contradict the fact that $(x_n)$ is a cauchy sequence. I'm assuming that this is incorrect since I didn't even use the given metric and this proof would mean that no cauchy sequence converges.  So how can I prove that this metric space is complete? And in general is there a way how to approach these completeness proofs?


I use the following command in my preamble for highlighting. \newcommand{\zz}[1]{{\color{blue}\sffamily #1}} However, I'd like to add the functionality so that I can also include math in it. Currently, statements like \zz{Testing, $\mathcal{T}$, $4$, $5$}  will cause issues during compilation because something about sffamily not agreeing with math mode. It will still output the correct PDF, but since I'm getting that error, I feel like I'm doing something fundamentally wrong in the command definition. I tried looking at using conditionals, however the closest I got was \newcommand{\zz}[1]{ \ifthenelse{\relax\ifmmode} {\color{blue} #1} {\color{blue}\sffamily #1} }  which did not work. Any help is greatly appreciated!

I have a blurb of text in an external macro  \SomeText, which I want to typeset in sans serif. However, \sffamily\SomeText does not change the math font and \sffamily\mathsf{\SomeText} does not work, as I am not in math mode.  So how can I typeset material in sans serif, whether it does or does not include math stuff?  \documentclass{article} \usepackage{lmodern}  \newcommand{\SomeText}{This is some ($words \geq 5$) Text with math stuff in it: $a^2+b^2=c^2$}  \begin{document}   \begin{description}     \item[Roman:] \SomeText     \item[Sans:] {\sffamily \SomeText \\ (however, the math is still Roman)}  %    LaTeX Error: \mathsf allowed only in math mode %    \item[AllSans:] {\sffamily\mathsf \SomeText}   \end{description} \end{document}


This might be a duplicate of .  I had an interesting thought experiment: suppose that you have a disc of a 1 m radius, where a point P2 inside the disc travels at the speed of light. You have a point P2 on the edge of the disc, that should travel at the speed of light as well (given the fact that nothing can travel faster than the speed of light).    Applying the formulas of rotational speed, I get the following:    For P2: v2 = c d2 = Π t2 = Π/c    For P1: d1 = 2Π t1 = t2 v1 = d1 / t1 = 2c -> which is wrong    This seems to be quite a paradoxical concept: the distance is known, the speed of the points must be equal, but the time in which the distance traveled must also be the same. So it seems to me, that somehow either space or time must be altered, so that the formulas remain valid.  Is this in any way linked to spacetime or the theory of general relativity? Is this a valid thought experiment, or am I missing something?

Refer, "The classical theory of Fields" by Landau&Lifshitz (Chap 3). Consider a disk of radius R, then circumference is $2 \pi R$. Now, make this disk rotate at velocity of the order of c(speed of light). Since velocity is perpendicular to radius vector, Radius does not change according to the observer at rest. But the length vector at boundary of disk, parallel to velocity vector will experience length contraction . Thus, $\dfrac{\text{radius}}{\text{circumference}}>\dfrac{1}{2\pi}$ , when disc is rotating. But this violates rules of Euclidean geometry.   What is wrong here?


I'm curious about the offsets of C++ struct members when the members are of mixed types. For instance: #include <iostream> #include <cstddef> struct S {     char c0;     char carray[10];     char c1;     double d1; };  int main() {     std::cout         << "offset of char   c0 = " << offsetof(S, c0) << '\n'         << "offset of double carray = " << offsetof(S, carray) << '\n'         << "offset of double c1 = " << offsetof(S, c1) << '\n'         << "offset of double d1 = " << offsetof(S, d1) << '\n'; }  The output is the following: offset of char   c0 = 0                                                                                offset of double carray = 1                                                                                offset of double c1 = 11                                                                                offset of double d1 = 16   The offsets for c0, carray, and c1 are all easily understandable. I'm curious about d1. Why does it have an offset of 16 instead of the expected value of 12? It looks like it goes through some offset alignment.

Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?


public static void mystery(int[] arr) {     int[] tmp = new int[arr.length];     tmp[0] = arr[arr.length-1];     tmp[arr.length-1] = arr[0];     arr = tmp; }  int[] a = {2,3,4}; mystery(a);   When I run this, I get that even after calling mystery(a), the value of a is still  a = {2,3,4};   Java arrays are mutable, and all arguments are pass by reference. Since in the method arr points to the memory stored in tmp after the method, why is a unchanged?

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


So I would like to have a file that I can conditionally include as either code or a string.  Like this:   #define something #include "myfile.inc"   #undef something const char myfileasastring =  #include "myfile.inc"    myfile.inc would be simple code like this:  something // anything extra here is fine as long as it goes away in the code include case int myfunc() { return 23; }    Is this possible? I tried having #define something R("mystring and start myfile with it but that does not seem to work.   My specific use case for this is a GLSL shader that, when running under GL I need as a string to pass to the GL driver but when running it in software emulation I want to compile it as CPP code.   I would love to have the same file for both cases. I know many workarounds on the project/make/build level, and even just cut and paste is not terrible, but it would be neat to have a portable compiler level way of doing this.   Not a dupe as detected. I know how to include as one xor the other, but not as either or with the same file. Also I know how to do it using external tools, I am really just wondering if is wondering in just plain, portable c++11. It might not be possible. (try to remove dupe tag again.. please comment if you still think it is a dupe)

Is there a way to include an entire text file as a string in a C program at compile-time?  something like:   file.txt:  This is a little text file  main.c:  #include <stdio.h> int main(void) {    #blackmagicinclude("file.txt", content)    /*    equiv: char[] content = "This is\na little\ntext file";    */    printf("%s", content); }    obtaining a little program that prints on stdout "This is a little text file"  At the moment I used an hackish python script, but it's butt-ugly and limited to only one variable name, can you tell me another way to do it?