I am trying to find if the process is running based on process id. The code is as follows based on one of the post on the forum. I cannot consider process name as there are more than one process running with the same name.   def findProcess( processId ):     ps= subprocess.Popen("ps -ef | grep "+processId, shell=True, stdout=subprocess.PIPE)     output = ps.stdout.read()     ps.stdout.close()     ps.wait()     return output def isProcessRunning( processId):     output = findProcess( processId )     if re.search(processId, output) is None:         return true     else:         return False   Output :  1111 72312 72311   0   0:00.00 ttys000    0:00.00 /bin/sh -c ps -ef | grep 71676 1111 72314 72312   0   0:00.00 ttys000    0:00.00 grep 71676   It always return true as it can find the process id in the output string.   Any suggestions? Thanks for any help.

Is there a way to check to see if a pid corresponds to a valid process? I'm getting a pid from a different source other than from os.getpid() and I need to check to see if a process with that pid doesn't exist on the machine.   I need it to be available in Unix and Windows. I'm also checking to see if the PID is NOT in use.


I am using Ubuntu 12.04 with gnome-classic (no effects) instead of Unity. But I admit that the Dash launcher is useful sometimes. Is there an equivalent launcher that we could use with gnome-classic?

Is there any way I can run the Unity dashboard (or something similar, like Bolt for Gnome 3) in Gnome Fallback?


I have done some looking around for a solution. However, I have come to the conclusion that the solution to my problem is just not on the internet. I am unable to update Ubuntu and download apps from the Software Center due to an error on line 53. Here is what is on line 53.   sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key   Is this line scripted correctly? If not, what should be on this line?

Every once in a while I see users having issues to update due to errors like this:  E:Type 'ain' is not known on line 1 in source list /etc/apt/sources.list.d/some-ppa.list'   with varying types/line numbers/source list files (often after removing a PPA).  How can such an error be fixed?


Let $\mathbb{R}_{\geq 0}$ be the set of nonnegative numbers and $\mathbb{R}_{>0}$ the set of positive numbers, that is $$ \mathbb{R}_{\geq 0} = \{\,x \geq 0 \mid x \in \mathbb{R} \,\} $$ and $$ \mathbb{R}_{> 0} = \{\,x > 0 \mid x \in \mathbb{R} \,\} $$ Is it possible to define a bijection $f$ between these two sets?

How to define a bijection between $(0,1)$ and $(0,1]$?   Or any other open and closed intervals?   If the intervals are both open like $(-1,2)\text{ and }(-5,4)$ I do a cheap trick (don't know if that's how you're supposed to do it): I make a function $f : (-1, 2)\rightarrow (-5, 4)$ of the form $f(x)=mx+b$ by \begin{align*} -5 = f(-1) &= m(-1)+b \\ 4 = f(2) &= m(2) + b \end{align*} Solving for $m$ and $b$ I find $m=3\text{ and }b=-2$ so then $f(x)=3x-2.$  Then I show that $f$ is a bijection by showing that it is injective and surjective.


I'm working on a text adventure game written in Python and I am at the point where I need to implement procedural generation for the map. As the user moves around, spots are generated, so the entire map is not generated at once but rather it's generated as the user gets closer. For example, the user begins at the position (0, 0) and so the spots generated in the beginning of the game are the eight spots/squares surrounding (0, 0) and of course (0, 0) itself.  I'm have trouble finding a simple way to decide if a "spot" or square is plains, forest, beach, ocean, mountains, etc. I don't want it to be totally random, I want there to be some cogency.  Any help would be appreciated. Thank you.

I need a way to generate a world realistically. I want to generate worlds similar to dwarf fortress.  My current code for world generation is this:       worldTiles = ['^',',','.','.']     def generateWorld(self, x=40, y=20):         world = []          for i in range(y):             row = []             for z in range(x):                 row.append(random.choice(self.worldTiles))              world.append(row)         return world   with the worlds it generates being this:     The world is ok, however what I want is biomes, not just completly random generation.  In case it helps, heres how the current generation works:  A variable called worldTiles has alls the tiles the world can have. This is used by the function. The function, creates an array, and appends a row to it. The row is then added to the world, as another array.  A example world might be:     [     ['^', ',', '^'],     ['^', ',', '.'],     ['^', ''., '.']   ]


Is $A^2-A=A(A-I)$ in matrices?  Thanks !

If $A,B,C$ are matrices I am thinking how to show that $$ A(B + C) = AB + AC$$  Is possible to show without sums like $\sum_i a_i, ..., \sum_j b_j$? It seems if I do the proof with many indexes then is tedious and I don't learn much from it.


I'm trying to understand Linux file system, and one of the question is:  1- Why there are multiple folders for executable files: /usr/bin, /usr/sbin/ and /usr/local/bin? Is there any differences between them ?  2- If I have an executable file and I want to add it to my system, which of the third latter locations is the best for me ?

Why are there so many places to put a binary in Linux? There are at least these five:   /bin/ /sbin/ /usr/bin/ /usr/local/bin/ /usr/local/sbin/   And on my office box, I do not have write permissions to some of these.  What type of binary goes into which of these bins?


I need a good book to study abstract algebra (group,ring, field) from basic.I have artin's , rotman's and dummit and Foote in my mind. But Artin's book is somewhat hard for me to understand. Please suggest me which of the above books explain group theory   from basic.   But please be specific...I am already confused.. please help me.

Which textbook is good for introductory group theory?


I have a large text file with lines and I just want to keep the lines that have the word "cat" in it. Is there anyway to achieve this with regex? I'm using VS code for the editing. Any help you can provide would be greatly appreciated.  To clarify it further, I'm trying to remove the lines that doesn't contain the word "cat" like below.  my text document looks like this (example)  cat 1 dog 2 cat 3 dog 4 fish 1

I know it's possible to match a word and then reverse the matches using other tools (e.g. grep -v). However, is it possible to match lines that do not contain a specific word, e.g. hede, using a regular expression?   Input:  hoho hihi haha hede   Code:  grep "<Regex for 'doesn't contain hede'>" input   Desired output:  hoho hihi haha


Consider this example \documentclass{report} \usepackage{graphicx} \usepackage{caption} \usepackage{longtable} \usepackage{lipsum}  \begin{document}  \begin{figure}[htbp]   \centering   \includegraphics[width=0.6\textwidth]{example-image-a}   \caption{Caption.} \end{figure}  \lipsum[1]   \begin{figure}[htbp]   \centering   \includegraphics[width=0.8\textwidth]{example-image-b}   \caption{Another caption.} \end{figure}  \lipsum[1-3]  \begin{longtable}{rrc}         A & B & C\\         A & B & C\\         A & B & C\\         A & B & C\\         A & B & C\\         A & B & C\\         A & B & C\\ \end{longtable} %% \begin{table}                                                                                %% \begin{tabular}{rrc}                                                                                %%         A & B & C\\                                                                                %%         A & B & C\\                                                                                %%         A & B & C\\                                                                                %%         A & B & C\\                                                                                %%         A & B & C\\                                                                                %%         A & B & C\\                                                                                %%         A & B & C\\                                                                                %% \end{tabular}                                                                                %% \end{table}                                                                                \lipsum[1] \end{document}  In the output at the end of document text is forced out of margin, as seen by the text being forced onto the page number:  Curiously, the problem disappears if a tabular is used in place of longtable or if I comment out the captions of the figures. What is wrong?

I have been searching for a while now without any luck, so I hope you can help me. The problem is that when I insert a figure/longtabu on my page, the text below is running out of the page, like this image shows:    Do you know what the problem is here?  I have uploaded some sample code here:


I have a problem in my programm, I want the user of my programm to write the file he wants to use and then with loops, depending on the word he typed, a file will be used. Butmy programm never enters in one loop and I don't know where the problem comes from.  Here is my code:          System.out.println("Nom du test case à lancer ? : ");     Scanner saisieUtilisateur = new Scanner(System.in);      //on rentre l'adresse du fichier texte :     String str = saisieUtilisateur.next();     System.out.println(str);     //Integer val = saisieUtilisateur.nextInt();     //System.out.println(val);     String chaine = "";     String File="";     int i=1;      //Choix du fichier a prendre en compte suivant le choix de l'utilisateur     if (str == "hello"){         File = "C:\\exempleANT\\helloWordTexte.txt";         System.out.println("dans la boucle 1");     }     else if(str == "bye"){         System.out.println("dans la boucle 2");         File =  "C:\\exempleANT\\FichiersTestExempleHelloWord\\bye.txt";     }     else if(str == "fake"){         System.out.println("dans la boucle 3");         File =  "C:\\exempleANT\\FichiersTestExempleHelloWord\\helloWordTexteFake.txt";     }     else  {         System.out.println("ErreurTexte!");         System.out.println("dans la boucle 4");      }   And here is the result in the console when I run the programm and I type hello.  hello hello ErreurTexte! dans la boucle 4

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?


which is better href="#" or href="javascript:void();" in terms of all aspects  like user experience, speed etc  is it necessary to put a 0 inside void when using href="javascript:void();" .like this href="javascript:void(0);"

The following are two methods of building a link that has the sole purpose of running JavaScript code. Which is better, in terms of functionality, page load speed, validation purposes, etc.?    function myJsFunc() {     alert("myJsFunc"); } Run JavaScript Code     or    function myJsFunc() {     alert("myJsFunc"); }  Run JavaScript Code


I am quite interested in learning topology from the basics, I would like to find a book that is quite detailed and has a large number of examples. What are the best books to easily understand topology? Thanks.

I am a graduate student of math right now but I was not able to get a topology subject in my undergrad... I just would like to know if you guys know the best one..


Show that the complex limit $\lim_{z\to 1}\frac{\log z}{z-1}$ exists.   There is no other information given, so I am not sure what method I can use. I wanted to use L'Hopital's rule to show the limit is $1$, but is there anything I need to show before I can do this method? Possibly continuity? Any advice is appreciated!

I have a question about something I'm wondering about. I've read somewhere that L'Hopitals rule can also be applied to complex functions, when they are analytic. So if have for instance:  $$ \lim_{z \rightarrow 0} \frac{\log(1+z)}{z} \stackrel{?}{=} \lim_{z \rightarrow 0} \frac{1}{(1+z)} = 1 $$  Now i'm wondering if this is correct? Also if we take $|z|<1$, is it then correct?  Thanks,


$$2^5 \times 9^2 =2592$$ I am trying to find any other number in this pattern.  That is find natural numbers $a$ , $b$ , $c$ and $d$ such that  $$a^b \times c^d = \overline{abcd} $$  We have  $$a^b \times c^d = \overline{cd} + 100\overline{ab} $$   So $$a^b \times c^d - \overline{cd} = 100\overline{ab} $$  LHS is a multiple of $100$ .Any help from here will be greatly appreciated

I am finding a 4-digit number $abcd$ (in base-10 representation) satisfying the following property.  $$abcd=a^b c^d$$  I have been running my mind around this problem since a long time, but got no success.  I wrote a python program for a number with this property, and got the answer to be $2592$ since   $$2592=2^5\times 9^2$$  But I am looking for a purely mathematical way to solve this problem.   Thanks!


Can anyone please explain what is the difference between PUT and POST request.Also I want to know about PATCH request.

They both seem to be sending data to the server inside the body, so what makes them different?


I have trouble following the derivation of equation $(2)$ in .  The authors define the Laplace transform of a real-valued function $f(t)$ of a positive real variable $t$ as  \begin{equation} \hat{f}(s) = \int_{0}^\infty \mathrm{e}^{-st} f(t) \, \mathrm{d}t. \end{equation}  To invert the Laplace transform, the Bromwich integral is used, with $i^2 = -1$,  \begin{equation} f(t) = \frac{1}{2\pi i} \lim_{T \to \infty} \int_{a - iT}^{a + iT} \mathrm{e}^{st} \hat{f}(s) \, \mathrm{d}s. \tag{$*$} \end{equation}  In deriving a simplification of $(*)$, some steps are unclear to me. Is the integral in blue equal to zero because $f(t)$ is real-valued? How does one arrive at the result in red?  \begin{align} f(t) &= \frac{\mathrm{e}^{at}}{2\pi} \int_{-\infty}^{\infty} \bigl( \cos(ut) + i \sin(ut) \bigr) \hat{f}(a + iu) \, \mathrm{d}u \\ &= \frac{\mathrm{e}^{at}}{2\pi} \int_{-\infty}^{\infty} \bigl( \cos(ut) + i \sin(ut) \bigr) \bigl( \operatorname{Re}(\hat{f}(a + iu)) + i \operatorname{Im}(\hat{f}(a + iu)) \bigr) \, \mathrm{d}u \\ &= \frac{\mathrm{e}^{at}}{2\pi} \int_{-\infty}^{\infty} \bigl( \operatorname{Re}(\hat{f}(a + iu)) \cos(ut) - \operatorname{Im}(\hat{f}(a + iu)) \sin(ut) \bigr) \, \mathrm{d}u \\ &\quad + i\frac{\mathrm{e}^{at}}{2\pi} \color{blue}{\int_{-\infty}^{\infty} \bigl( \operatorname{Im}(\hat{f}(a + iu)) \cos(ut) + \operatorname{Re}(\hat{f}(a + iu)) \sin(ut) \bigr) \, \mathrm{d}u} \\ &= \frac{\mathrm{e}^{at}}{2\pi} \int_{-\infty}^{\infty} \bigl( \operatorname{Re}(\hat{f}(a + iu)) \cos(ut) - \operatorname{Im}(\hat{f}(a + iu)) \sin(ut) \bigr) \, \mathrm{d}u \\ &= \color{red}{\frac{2\mathrm{e}^{at}}{\pi} \int_{0}^{\infty} \operatorname{Re}(\hat{f}(a + iu)) \cos(ut) \, \mathrm{d}u} \end{align}  Edit Using Dr.MV's comments:  \begin{align} &\frac{\mathrm{e}^{at}}{2\pi} \int_{-\infty}^{\infty} \bigl( \operatorname{Re}(\hat{f}(a + iu)) \cos(ut) - \operatorname{Im}(\hat{f}(a + iu)) \sin(ut) \bigr) \, \mathrm{d}u \\ &= \frac{\mathrm{e}^{at}}{2\pi} \Bigl( \int_{0}^{\infty} \bigl( \operatorname{Re}(\hat{f}(a + iu)) \cos(ut) - \operatorname{Im}(\hat{f}(a + iu)) \sin(ut) \bigr) \, \mathrm{d}u \\ &\qquad\quad + \int_{-\infty}^{0} \bigl( \operatorname{Re}(\hat{f}(a + iu)) \cos(ut) - \operatorname{Im}(\hat{f}(a + iu)) \sin(ut) \bigr) \, \mathrm{d}u \Bigr) \\ &= \frac{\mathrm{e}^{at}}{2\pi} \Bigl( \int_{0}^{\infty} \bigl( \operatorname{Re}(\hat{f}(a + iu)) \cos(ut) - \operatorname{Im}(\hat{f}(a + iu)) \sin(ut) \bigr) \, \mathrm{d}u \\ &\qquad\quad - \int_{\infty}^{0} \bigl( \operatorname{Re}(\hat{f}(a - iv)) \cos(-vt) - \operatorname{Im}(\hat{f}(a - iv)) \sin(-vt) \bigr) \, \mathrm{d}v \Bigr) \\ &= \frac{\mathrm{e}^{at}}{2\pi} \int_{0}^{\infty} \Bigl( \cos(ut)\bigl( \operatorname{Re}(\hat{f}(a - iu)) + \operatorname{Re}(\hat{f}(a + iu)) \bigr) \\ &\hspace{4.5em}+ \sin(ut)\bigl( \operatorname{Im}(\hat{f}(a - iu)) - \operatorname{Im}(\hat{f}(a + iu)) \bigr) \Bigr) \, \mathrm{d}u. \end{align}  I do not see how this equals the part in red. Especially, the factor $\frac{2\mathrm{e}^{at}}{\pi}$ I cannot explain.

I do not understand how the last equality is derived from the previous. Apparently the first term in the integral (involving cos) is equivalent to the second (involving sin)!! How so??  I DO understand how the integral range is halved (since F(s)* =F(s*);where F(s) is the Laplace transform of f(t), and *=complex conjugate.  And the imaginary part must equal zero, and is dropped in the last 2 lines...OK. Any help would be appreciated since this form is used often in numerical inverse Laplace transform algorithms. Thanks... M D Mill  [Note:f"hat"(s)= the Laplace transform of f(t), s=(a+iu)  [Note: This question has been asked before but not answered adequately, and I     have added some new specificity.]  \begin{align} f(t) &= \frac{\mathrm{e}^{at}}{2\pi j} \int_{-\infty}^{\infty} \bigl( \cos(ut) + i \sin(ut) \bigr) \hat{f}(a + iu) \, j\mathrm{d}u \\ &= \frac{\mathrm{e}^{at}}{2\pi} \int_{-\infty}^{\infty} \bigl( \cos(ut) + i \sin(ut) \bigr) \bigl( \operatorname{Re}(\hat{f}(a + iu)) + i \operatorname{Im}(\hat{f}(a + iu)) \bigr) \, \mathrm{d}u \\ &= \frac{\mathrm{e}^{at}}{2\pi} \int_{-\infty}^{\infty} \bigl( \operatorname{Re}(\hat{f}(a + iu)) \cos(ut) - \operatorname{Im}(\hat{f}(a + iu)) \sin(ut) \bigr) \, \mathrm{d}u \\ &\quad + i\frac{\mathrm{e}^{at}}{2\pi} \color{blue}{\int_{-\infty}^{\infty} \bigl( \operatorname{Im}(\hat{f}(a + iu)) \cos(ut) + \operatorname{Re}(\hat{f}(a + iu)) \sin(ut) \bigr) \, \mathrm{d}u} \\ &= \frac{\mathrm{e}^{at}}{2\pi} \int_{-\infty}^{\infty} \bigl( \operatorname{Re}(\hat{f}(a + iu)) \cos(ut) - \operatorname{Im}(\hat{f}(a + iu)) \sin(ut) \bigr) \, \mathrm{d}u \\ &= \color{red}{\frac{2\mathrm{e}^{at}}{\pi} \int_{0}^{\infty} \operatorname{Re}(\hat{f}(a + iu)) \cos(ut) \, \mathrm{d}u} \end{align}  These equations are from the web source:Abate and Whitt, 1995


I am expecting obj1 and obj2 will have different deck.cards,  why they are the same, how do I make them 2 instance?  class deck:     cards ={}     def __init__(self, key, value):         self.cards[key]=value         return >>> obj1 = deck("a", "1") >>> obj2 = deck("b", "2") >>> print (obj1.cards, obj2.cards) {'a': '1', 'b': '2'} {'a': '1', 'b': '2'}

Is there any meaningful distinction between:  class A(object):     foo = 5   # some default value   vs.  class B(object):     def __init__(self, foo=5):         self.foo = foo   If you're creating a lot of instances, is there any difference in performance or space requirements for the two styles? When you read the code, do you consider the meaning of the two styles to be significantly different?


excuse me...! my english is not very good! until last week i'm use "www.000webhost.com" webhost and i had no problem!!! But today I bought a new server and use old file like before... I dont know the problem is from php files or database?  Please show me the solution  this my php code      <?php      //Creating a connection     $con = mysqli_connect("___","___","___","___");      if (mysqli_connect_errno())     {        echo "Failed to connect to MySQL: " . mysqli_connect_error();     }     /*Get the id of the last visible item in the RecyclerView from the request and store it in a variable. For            the first request id will be zero.*/       $id = $_GET["id"];      $sql= "Select * from db_app where id between ($id+1) and ($id+10)";      $result = mysqli_query($con ,$sql);      while ($row = mysqli_fetch_assoc($result)) {          $array[] = $row;      }     header('Content-Type:Application/json');      echo json_encode($array);      mysqli_free_result($result);      mysqli_close($con);   ?>   this my database code      CREATE DATABASE `android_db`;  USE `android_db`;   CREATE TABLE IF NOT EXISTS `db_app` (   `id` int(15) NOT NULL AUTO_INCREMENT,   `movie_name` varchar(45) NOT NULL,   `movie_image` varchar(10000) NOT NULL,   `movie_genre` varchar(40) NOT NULL,   PRIMARY KEY (`id`) );

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


While running this code I get "JAVA error"  And in the console I see         Connection to db   Connection suceeded   Select * from project.user   1   java.lang.NullPointerException   ...   ...   ...   java.lang.NullPointerException      public void showuser(){   System.out.println("Connection to db");     try {             Connection con = DriverManager.getConnection(url, "", "");             System.out.println("Connection suceeded");             String sql = "Select * from project.user";             System.out.println(sql);             Statement st = con.createStatement();             ResultSet rs= st.executeQuery(sql);             String title[]={"ID","Name","Status","Nomber","Balance","Login","Password"};             DefaultTableModel aModel = new DefaultTableModel();             aModel.setColumnIdentifiers(title);             int i=0;             while (rs.next())             {   Object objects[]= new Object[7];                 i=0;                 while(i<7)                 {                 objects[i]=rs.getObject(i+1);                 System.out.println(objects[i].toString());                 i++;                 }                 aModel.addRow(objects);            }            jTable1.setModel(aModel);            con.close();     }         catch (SQLException ex)         {            while(ex!= null)            {              ex=ex.getNextException();            }            JFrame f1= new JFrame();            JOptionPane.showMessageDialog(f1,"SQL error");                             System.out.println(ex);         }     catch (java.lang.Exception ex)         {             ex.printStackTrace();             JFrame f1= new JFrame();             JOptionPane.showMessageDialog(f1,"JAVA error");                                             System.out.println(ex);         } }

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?


The plan of Palpatine for Clone Army was to make it accepted by The Galactic Republic. Couldn't a Bounty Hunter's gene make it difficult? Also, what was the benefits of using Jango Fett's gene? Why didn't he pick any random guy instead of Jango Fett?

This is a question that always bugged me: Why did they (the Sith, actually) choose to use Jango Fett as the single template for the entire clone army?  OK, in the EU it is explained that there was a kind of casting procedure initiated by Lord Tyrannus which yielded Jango as an extremely talented fighter (). I'm sure he had certain qualities, but isn't it quite a risk to base an army of millions of men on one single individual?  I think there were real practical alternatives: Obviously, the Kaminoans were quite a high-tech people. It should have been easy for them to create a clone that combines the strength of different individuals, maybe even of different species, or even create a new species of uber-soldiers. And there would be some quite good reasons to do so:  First of all, Jango is a Mandalorian, and as such sort of human, and even though humans have some good battle qualities (agile, versatile), there also are some downsides (fragile, no single "super-power"). It would have been a good idea to combine the DNA of at least multiple indiviuals, or even of multiple species. Or why not clone a jedi? Imagine an army of 1'000 Mace Windus. At least, they could have used different species for special tasks which need e.g. special stealth / resistance ability. Finally, it is quite a risk to base that army on such a small gene pool. It would be easy for the Separatists to come up with a virus that would just kill them all. They would also better have taken a DNA donor that is already dead so they at least knew its life expectancy.  Is there any canonical explanation for this?


"Your Mac restarted due to a problem."  System.log showed boot time as 17:19 and the last message before was 17:13 but things had been working in the five minutes before the restart.  Six log files had file dates after 17:13, but five of them had NO messages before the reboot.  (The other has timestamps only in raw integer format)  So how do I look for clues to what happened between 17:13 and 17:19 ?  It's a Macbook Pro 2012 refurb still under warranty (purchased January) but the RAM and SSD were transferred from an older machine.

Console prints:     default  17:16:18.554342 -0700   ReportCrash Saved crash report for APP_NAME[50432] version 1.2.3 (4) to APP_NAME_2020-03-17-171618_MacBook-Pro.crash   I would like to ask you, where could I find my crash logs?


Consider the numbers of the form $$ a_n=\lfloor\pi\times 10^{n-1}  \rfloor, $$ for $n\in\mathbb{N}$. In other words, $\{a_n\}_{n\in\mathbb{N}}$ is the sequence composed of integers built from the first $n$ digits of $\pi$, so that $$ a_1=3,\,\,\,a_2=31,\,\,\,a_3=314,\,\,\,a_4=3141,\,\,\,a_5=31415,\,\,\,... $$ My question is: for which values of $n$ is $a_n$ a prime number?  I wrote a small code to find primes for $1\leq n\leq 10^4$, and I've only found primes for $n\in\{1,2,6,38\}$, which are, respectively, \begin{align} a_1&=3\\ a_2&=31\\ a_6&=314159\\ a_{38}&=31415926535897932384626433832795028841 \end{align} I found this result rather intriguing, since I'd expect to find more primes up to numbers with $10^4$ digits. Are there any more primes in this sequence? Is there an explanation for the lack of primes between $a_{38}$ and $a_{10^4}$?

Let $f(n)$ be the first $n$ digits of $\pi$ . How many times is $f(n)$ prime on the interval $[1, k]$ ? Are there infinitely many prime $f(n)$'s on $[1, \infty)$?  I know this is probably be a very hard question and most likely an open problem, but I am just curious.


I am create upload form by fwrite function php. My code is here  <?php $file = fopen("C:/xampp/htdocs/eibak/sss.php","w");  echo fwrite($file,"<?php  if (isset($_POST['submit'])) {      $file = $_FILES['file']['name'];      $temp = $_FILES['file']['tmp_name'];     $dir = '';     echo $dir;     if (move_uploaded_file($temp, $dir.$file)) {          $link = $dir.$file;      ?>     <?php } } ?>     <form action='' method='POST' enctype='multipart/form-data'>         <input type='file' name='file'/>         <input type='submit' name='submit' value='Submit'/>     </form>"); fclose($file); ?>    But Parse error: syntax error,      unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier   (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in   C:\xampp\htdocs\exploit\ff.php on line 5 error show.   How to create upload form with file write php.

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


Could you please tell me the arrival time of flight VY8783 to Barcelona–El Prat Airport from Liverpool John Lennon Airport on June 3, 2016?  We feel the delay was longer than is being stated by the airline.

The question  only deals with flights in the US sourced from the  . Is there some similar source for EU, Asia etc?


I am trying to make my images to shuffle using the following code using jQuery, but I got stuck. const $images = [     { name: "dinosaurs", image: "../Images/dinosaurs.jpg"},     { name: "friends", image: "../Images/Friends.jpg" },     { name: "badguys", image: "../Images/bad_pack.jpg"} ];   const $random = () => {     for(let character of $images) {         console.log(character);         const $square = $("#draw-square");         $square.css("background", $images[Math.floor(Math.random() * 3)].image              )} }  Any suggestions, thanks

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


How should i do to undo this? I tried running fsck to solve my "Read only filesystem" before but it didn't help me much. It only solve the situation for a while and then it comes back again. So, i did this after reading a post.  Meanwhile, i am getting thousands of lines like this:  chown: changing group of '/usr/share/doc/distro-info-data': Read-only file system chown: changing group of '/usr/share/doc/software-properties-common/copyright': Read-only file system chown: changing group of '/usr/share/doc/software-properties-common/changelog.gz': Read-only file system chown: changing group of '/usr/share/doc/software-properties-common': Read-only file system chown: changing group of '/usr/share/doc/nmap/3rd-party-licenses.txt.gz': Read-only file system chown: changing group of '/usr/share/doc/nmap/leet-nmap-ascii-art.txt': Read-only file system chown: changing group of '/usr/share/doc/nmap/nmap.usage.txt.gz': Read-only file system chown: changing group of '/usr/share/doc/nmap/device-types.txt.gz': Read-only file system chown: changing group of '/usr/share/doc/nmap/committers.txt.gz': Read-only file system chown: changing group of '/usr/share/doc/nmap/nmap_gpgkeys.txt.gz': Read-only file system chown: changing group of '/usr/share/doc/nmap/style/lua-format.lua.gz': Read-only file system chown: changing group of '/usr/share/doc/nmap/style/README': Read-only file system

I accidently ran  sudo chmod 755 -R /   instead of  sudo chmod 755 -R ./   I stopped it after few seconds, but now there is some problems such as  sudo: must be setuid root   How can I revert permissions back?


I was about to post an answer to a PPCG question when I got this error:    It's an -compressed string that reads Hello, World!. I see no reason as to why this character is blocked, as it's just some random Unicode character. Hopefully it's not some emoticon of some illegal cupcake that doesn't show up on my Windows XP machine...

I can't create a post with the .  There are errors for both the Japanese and Chinese characters.  Here is the post in question . It is peculiar that it supports 59 languages besides Japanese and Chinese.


I have some rules as follows:  RewriteCond %{HTTP_HOST} ^domain.com RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L]   I would like to make the rewrite condition match ANY domain OTHER than the domain www.domain.com . How can I do this without explicitly make a RewriteCond for each case?

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


I have been making a donut (with blender guru on YouTube) and something happened and I have no idea what it is. I think it has something to do with the subdivision surface modifier because when I applied it changed (still not good). I noticed it also was always the same in the layout area (but not in sculpting and others). Here are some pictures: in layout (is the same for after the modifier was applied)  in sculpting (before modifiers were applied)  in sculpting after modifiers were applied)  I also noticed that when I pressed 'command z’ it looked like the one in layout but took all of the tools away. please help if you can - thanks (:

I'm currently making a donut using blender gurus tutorial. I have no idea why, but there are holes in my icing. Does anyone know what could be causing it? Thanks for any help.


I watched a few tutorials for wireless hacking and everywhere they have network interfaces called wlan0, eth0, ... but my interface is called wlp4s0. Does that mean, I have to use another tutorial, because simply replacing wlan0 with wlp4s0 does not seem to work?  oussema@super-computer:~$ sudo airmon-ng start wlp4s0   Found 2 processes that could cause trouble. If airodump-ng, aireplay-ng or airtun-ng stops working after a short period of time, you may want to kill (some of) them!  PID     Name 2463    avahi-daemon 2470    avahi-daemon   Interface   Chipset     Driver  wlp4s0      Broadcom    wl - [phy0]mon0: ERREUR en récupérant les signaux de l'interface: Aucun périphérique de ce type (translated from french to english: ERROR when retrieving the signals from the interface: No device of this type)              (monitor mode enabled on mon0)

I'm trying to set up apache2 server on Debian 9. I'm using an laptop with Ralink network-card, witch was able to use eth0, at Debian 8, with looks more familiar for me. Since I update my system to 9 my network interface has changed and looks something like this:  Iface      MTU    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg enp37s0   1500        0      0      0 0             0      0      0      0 BMU lo       65536      612      0      0 0           612      0      0      0 LRU wlo1      1500    36736      0      1 0         20492      0      0      0 BMRU   and  in the /etc/interfaces.d/setup file it's defined like:  auto lo iface lo inet loopback  auto eth0 iface eth0 inet dhcp   What is the enp37s0? And why am I connected to the router with wlo1, not eth0?   My routing table:  Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 0.0.0.0         10.63.16.1      0.0.0.0         UG    600    0        0 wlo1 10.63.16.0      0.0.0.0         255.255.255.0   U     600    0        0 wlo1 169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlo1   Is that a proper configuration?


I don't know which Stack Exchange site I should use... These are some examples of the question type I want to share:  Is it possible to become a software developer in two years? Why don't the well-known applications in Windows use  or  technologies? Should I learn the  that I'll never use?  and the like.

Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com.


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

I have a problem where I have TWO NON-rotated rectangles (given as two point tuples {x1 x2 y1 y2}) and I like to calculate their intersect area. I have seen  more general  to this question, e.g. more rectangles or even rotated ones, and I was wondering whether there is a much simpler solution as I only have two non-rotated rectangles.   What I imagine should be achievable is an algorithm that only uses addition, subtraction and multiplication, possibly abs() as well. What certainly should not be used are min/max, equal, greater/smaller and so on, which would make the question obsolete.  Thank you!  EDIT 2: okay, it's become too easy using min/max or abs(). Can somebody show or disprove the case only using add/sub/mul?  EDIT: let's relax it a little bit, only conditional expressions (e.g. if, case) are prohibited!  PS: I have been thinking about it for a half hour, without success, maybe I am now too old for this :)


I got the “C” category multiple-entry visa for Portugal. I want to visit several Schengen countries during 15 days. Can I visit other countries before Portugal? e.g. go to Portugal in 10th day or so.  This is because arriving from my country directly to Portugal is way more expensive than other countries.

In case, if I get a multiple-entry Schengen visa in one of the embassies in Ukraine, Kyiv - should my first trip be to the country which issued the visa?  Any there any requirements of this sort? Does this condition vary depending on embassy which issued the visa?  What are the possible consequences on not visiting that country first? Does it somehow depend on country where the embassy is (i.e. non-Schengen and not EU members)?


My problem is simple I want my line between node(A) and node (B) to be complete (on the top right between the two capacitors). I can't find a clean solution. For info, I'm very new to circuitikz :D  Thank you for your help !  \documentclass{standalone}  \usepackage{tikz}  \usepackage[europeanresistors,americaninductors]{circuitikz}  \begin{document}   \begin{circuitikz}[american, voltage shift =0.5]    \draw (0,0) node[ground](gnd){} to[R=$50\ \Omega$](0,3) --++ (1,0)node[hemt,anchor=G](H){};    \draw (H.S)  to[R=$3\ k\Omega$](gnd -| H.S) node[ground]{};    \draw (H.D) to[R=$30\ k\Omega$]($(H.D)+(0,3)$) --++ (2,0)node(A){} to[pC,invert,name=Pc]++(0,-1) --++ (1,0)node[ground]{} to[C,    name=C]++(0,1)node(B){} --++ (1,0)to[C]++(0,-1) --++(-1,0);    \draw (A) -- (B);  \end{circuitikz} \end{document}

I've been trying to use relative coordinates to make my drawings more precise but it seems I don't know how the command \node works since I've been having this problem while connecting a circuit element to another:    I'm trying to eliminate the blank between the two wires.  This is the minimal code:  \documentclass{book} \usepackage[siunitx,RPvoltages]{circuitikz} %Circuit Schematics/Diagram \usetikzlibrary{arrows,shapes,calc,positioning} \begin{document}     \begin{circuitikz}             \path (0,0) coordinate (C);             % Comparatore             \path (C) + (0,-1) + (1,0) coordinate (com) node[above]{};             \path (com) + (1.5,-1) node[op amp] (comp) {};             % Collegamenti Comparatore             \node (G1) at ([shift=({-1.3cm,0cm})]comp.-) {};             \draw (G1) -- (comp.-);             \node (G2) at ([shift=({-1.3cm,0cm})]comp.+) {};             \draw (G2) -- (comp.+);             \draw (C) -- (G1); % Collegamento Rettificatore - Comparatore         \end{circuitikz} \end{document}   Thanks for any help!


I am writing a console application. UI would be like this.  Please input :  to learn java to learn VB.NET to quit   if user enters 1 it will go for java learning, if enters 2 it will go for VB learning, if enters 3 program will quit. For all other inputs the program will show the above message again. I implemented this in below way : import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader;  public class DriverTest {  public static void main(String[] args) {     new DriverTest().takeOver(); }  public void takeOver() {     BufferedReader inputScanner = new BufferedReader(new InputStreamReader(System.in));     System.out.println("Please enter:");     System.out.println("1. to learn JAVA");     System.out.println("2. to learn VB");     System.out.println("3. to quit");      try {         int actionKey = Integer.parseInt(inputScanner.readLine());         switch (actionKey) {         case 1:             System.out.println("Welcome to JAVA learning");             break;         case 2:             System.out.println("Welcome to VB learning");             break;         case 3:             System.exit(0);             break;         default:             System.out.println("Please select a proper action :");             takeOver();         }     } catch (NumberFormatException | IOException e) {         System.out.println("Some error occured please try again. :(");         takeOver();     } }  }  Now if user continuously provide invalid input, it will result eventually into StackOverflow error.(You can test it, copy the class in folder.complie it : javac DriverTest.java, create one text file input.txt and write anything except 1,2 and 3. e.g. hgsad, now run java DriverTest < input.txt) Please suggest, if there is any better solution of the problem.

What is a StackOverflowError, what causes it, and how should I deal with them?


Somebody payed me with a cashier check from WELL FARGO BANK and it got deposited on my account at BANK OF AMERICA. The total amount is already available since 5 days.   As I do not trust the person and there are so many strange stories about cashier checks I am afraid that the person could ask the money back !! Is it possible that the person could tell any lie to the bank WELL FARGO and ask the money back ?  I also read something like there are some fraudulent checks !!   Please if anybody could tell me if there is no more danger to the money I got from this CASHIER CHECK ??? I contacted my oficial at BANK OF AMERICA but I got no answer at all !! ....

There are plenty of warnings around about forged cashier's cheques, and that if you deposit a forged one your bank will "hold you responsible".   What does it mean that the bank will "hold you responsible"? Clearly the money won't be credited. Will you be charged a fee like an NSF cheque? Will they try to prosecute you? Is there any way to confirm whether a cashiers cheque is forged? Could you for example tell your bank that you were uncertain of the origin, and ask them to confirm it? Can you call the issuer and verify (from the serial number) that they did in fact issue a cheque for that amount with you as the payee?


I read somewhere that for $\mathbb{R}$, the number of topologies is indeed the same as the obvious upper bound, namely $2^{2^{|\mathbb{R}|}}$. Does the same hold for all infinite sets $X$, i.e. is the cardinality of the set of topologies on $X$ equal to $2^{2^{|X|}}$? How would one prove it?

This was  on Quora. I thought about it a little bit but didn't make much progress beyond some obvious upper and lower bounds. The answer probably depends on AC and perhaps also GCH or other axioms. A quick search also failed to provide answers.


Prove that for every $k \in \mathbb{N}$ there exists $n\in \mathbb{N}$ such that $(1+\sqrt{2})^k= \sqrt{n}+\sqrt{n-1}$   I tried to prove it using induction, but I could not move to the next step after assuming the result hold for some $k=m$.

I was asked to show that $\forall n\in \mathbb N$ there exist a $p\in \mathbb N^\ast$ such that $$(1+\sqrt{2})^n = \sqrt{p} + \sqrt{p-1}$$   I used induction but it wasn't fruitful, so I tried to use the binomial expansion of $(1+\sqrt{2})^n$ but it seems I lack some insight to go further.   Any hint is welcomed.


the cursor is at world origin, and I want to rotate, move, scale an object, but when I press the rotate/move/scale/ button, the rotate/move/scale center is at the world origin, the object I want to move is far away from world origin, how to set the rotate/move/scale center to be at the center of the object????  blender 2.81

How can I change the local origin of an object, without changing the object location in the world space.  This is the object located at position (0,0,0) in the world space    This is the same object located at position (0,1,0) in the world space, but with its local origin offset so that the object is in the same place    Is there a way to do this in a single step?


If W1 and W2 are the subspace of W, prove that (a): The Intersection of W1 and W2 is a subspace of W (b): The community of W1 and W2 may not necessarily be subspace W

$W$ and $U$ are subspaces of vector space $V$. Show that $U\cup W$ is not necessarily a subspace of $V$.   I know that one counter-example is enough to show that. What example could fit here?


When you download photos using google takeout, it puts them in a ton of folders (606 for me). I want to get all of the 2000-ish photos from all of those folders and just put them in a single folder so I can then sort them myself into month-albums.   So my question is, how do I get rid of all the sub folders from a folder but keep the files?

Firstly, I'm aware there are tons of similar questions, and I know because I must have tried adapting at least 5 of them, but I'm still here asking because my crappy grasp of CMD (which I actually thought I was getting good at up until this point) is frustrating me with generic, unhelpful errors, and I can't understand what part of the syntax is wrong. This is likely due to the fact that other questions deal with the folder/filename structures of their respective OPs, and when I try to adapt the code to my own folder/file structure it refuses to work. Therefore, I'm here asking for a CMD for loop solution that'll actually work for my own file and folder structure.  I have a parent folder which contains many other folders, in which there are files:  Parent Folder      Subfolder            File1            File2      Subfolder            File1            File2      Subfolder            File1            File2   ...and so on.  I'm wanting to use a CMD for loop in combination with the move command to extract all the files in the subfolders to the parent folder, leaving each subfolder empty.  When giving the CMD for loop please break down what each part of the command is doing, as this'll help make sure I understand the code and hopefully minimise the trouble I have getting it to work for myself.


I have two A.C adapter chargers giving an output of 5V DC 350mA and the other one with 5V DC 450mA. Is it possible that I could use a 5V DC 350mA to recharge a phone  which came out with 5V DC 450mA charger and vice-versa?  I have searched the google and found that using a lower amperage supply charger for the phone that came out with or requiring higher amperage charger could be damaged by it.   How much does this matter with 350mA and 450mA or what is the difference between them?

Power supplies are available in a wide range of voltage and current ratings.  If I have a device that has specific voltage and current ratings, how do those relate to the power ratings I need to specify?  What if I don't know the device's specs, but am replacing a previous power supply with particular ratings?  Is it OK to go lower voltage, or should it always be higher?  What about current?  I don't want a 10 A supply to damage my 1 A device.


In the Star Wars the Old Republic MMO, can two new subscribers "refer" each other so they both get the referral rewards?

I don't understand how the referral program works even after reading everything about it. Do I only get the 500 CC if the referred person subscribes within 14 days, or if I just refer the person? And do I get 500 CC for every month that referred person subscribes, or is it just one time?


If you add red light (~440 THz) and green light (~560 THz), you get what we perceive as yellow light (~520 THz). But I assume what you really get is a mixed waveform that we perceive as yellow? Suppose the red is a perfect sine wave, and so is the green, the mix of both will not be a perfect sine wave but a wobbly composite thing - right? Which is different than a perfect sine wave of ~520 THz. But we call both things "pure" yellow. Is that correct?  If so, are there animals that can discern composite pure yellow from singular pure yellow, like we can discern the mixture of multiple audio sine waves as a chord? Or is there machinery that can do that?  See also:

In music, when two or more pitches are played together at the same time, they form a chord. If each pitch has a corresponding wave frequency (a pure, or fundamental, tone), the pitches played together make a , which is obtained by simple addition. This wave is no longer a pure sinusoidal wave.  For example, when you play a low note and a high note on a piano, the resulting sound has a wave that is the mathematical sum of the waves of each note. The same is true for light: when you shine a 500nm wavelength (green light) and a 700nm wavelength (red light) at the same spot on a white surface, the reflection will be a superposition waveform that is the sum of green and red.  My question is about our perception of these combinations. When we hear a chord on a piano, we’re able to discern the pitches that comprise that chord. We’re able to “pick out” that there are two (or three, etc) notes in the chord, and some of us who are musically inclined are even able to sing back each note, and even name it. It could be said that we’re able to decompose a Fourier Series of sound.  But it seems we cannot do this with light. When you shine green and red light together, the reflection appears to be yellow, a “pure hue” of 600nm, rather than an overlay of red and green. We can’t “pick out” the individual colors that were combined. Why is this?  Why can’t we see two hues of light in the same way we’re able to hear two pitches of sound? Is this a characteristic of human psychology? Animal physiology? Or is this due to a fundamental characteristic of electromagnetism?


This is one of those generic questions whose only correct answer is ``it depends''.   What are the criteria?     What is monitored?     Reachability, availability? e.g. is a link up/down, does host respond to ICMP, etc. Services?  e.g. is something listening at the right port, is a named service running, etc. Resources?  CPU usage? e.g. % of total possible, cumulative time, total or per proceess. disk usage?  network usage?  e.g. bytes or packets moved in or out.  Services?  e.g. is something listening at the right port, is a named service running, etc. Service or application specific metrics?  e.g. DB transactions per second, SMTP messages send or received, etc.  How are monitored elements discovered/added/setup/configured?  Is there auto discovery?  Manual setup?   How are particular elements monitored?   a local agent? e.g. to do periodic "df" or "ps" or "ping" SNMP?  JMX? windows performance counters?   How is notification done?  e.g. console, email, pager, SMS, IM, etc.   How are elements and notifications grouped and prioritized?    e.g. will a link failure set off notifications for all the service or reachability elements behind that link?   Or a just one?  Or is it configurable?  e.g. will a host failure set off notifications for all the services or applications hosted there and for lack of resource monitoring data?  is there automatic case/ticket/issue creation in tracking system?   How is tracking to SLA metrics done?

This is a  about Monitoring Software. Also Related:   I need to monitor my servers; what do I need to consider when deciding on a monitoring solution?


A simple graph $G$ with $n$ vertices has at least $n+4$ edges. Prove that it has two cycles having no common edge.   It is enought to prove the statement if graph has exactly $n+4$ edges. It is clearly if some vertex has degree $1$ then we can remove that vertex and we can proccede with induction. So we can assume that all vertices have degree at least $2$. Also we can assume that graph is connected, else it has at least two component and since all vertex has degree at least $2$ we have a cycle in each and thus a conclusion. By Handshake lemma we can see that at least $n-8$ vertices (if $n\geq 8$) has degee exactly $2$, so we have at most $8$ vertices with degree at least $3$.  Also, we see that $n\geq 5$ since ${n\choose 2} \geq n+4$. That is all I can find.

Assume that $G$ is a graph which ${\lvert{E(G)}\rvert}>{\lvert{V(G)}\rvert}+3$. Prove $G$ has two disjoint cycles.  Answer: I tried to prove it when $G$ is connected. consider the smallest cycle of length $k$. It exists because ${\lvert{E(G)}\rvert}>{\lvert{V(G)}\rvert}-1$. Now, I divided vertices into $2$ groups. Group $A$ consists of $k$ vertices in the smallest cycle and group $B$ consists of the other $n-k$ vertices. Now, between  $n-k$ vertices are exactly $n-k-1$ edges. Because, If it is more then we have another cycle (the proof is done) and if it is less then $G$ is disconnected (contradiction). So there are at least $5$ edges between group $A$ and $B$. Now, what should I do? should I write every possibility to prove it? Are there any easy ways to continue the proof? What about if $G$ is disconnected? I think we should do it in each component. Am I right? Thank you so much for your answers.


I need some help on this one.  I use a test server which is Debian 10 with Docker's containers (all these inside a XCP-NG server).  # df -h Sys. de fichiers      Taille Utilisé Dispo Uti% Monté sur /dev/xvda11              32G     15G   15G  51% /data //localnetwork/Download   8,2T    4,8T  3,5T  59% /data/downloaded   My issue is about these 15G used in /data. Sub-folders into /data are /data/torrent and 2 others directories I never used.  du -xca into these folders show them empty  I messed up at the begining because :   /data/downloaded was, at first, part of my /data partition. After that I tried to mount my NAS with NFS but uid were to complicated to do as users were already in use both side Since then, I use cifs   While I was playing with nfs, 2 files finished and probably got in pending state as it was impossible to move to /data/downloaded because of permissions.  Now the setup is working fine, except I have these 15 GB in /data I don't see no matter what I try : du -xca & ls -alh return empty folders  After some googling, I tried   # lsof +L1   &  # lsof +L | grep torrent lsof: WARNING: can't stat() fuse.sshfs file system /tmp/.x2go-az/spool/C-az-50-1590501658_stDMATE_dp32       Output information may be incomplete. bash       33859                             media  cwd       DIR             202,11      4096     2    1177345 /data/torrents   Hence I decided to do it easy mode, just reboot (well it's not a prod server after all) The line disappeared but df still showing 15 Gb. I checked /data/lost+found folder but it's empty too.  I'm out of idea so if you have any, your are more than welcome :)

I have a SCSI disk in a server (hardware Raid 1), 32G, ext3 filesytem. df tells me that the disk is 100% full. If I delete 1G this is correctly shown.  However, if I run a du -h -x / then du tells me that only 12G are used (I use -x because of some Samba mounts).  So my question is not about subtle differences between the du and df commands but about how I can find out what causes this huge difference?  I rebooted the machine for a fsck that went w/out errors. Should I run badblocks? lsof shows me no open deleted files, lost+found is empty and there is no obvious warn/err/fail statement in the messages file.  Feel free to ask for further details of the setup.


I was reviewing some edits when I came across this edit by Community (you know, this 1 reputation moderator NPC acccount). It seems to be spam:    P.S.: I tagged this 'support' because I didn't think any of the mandatory tags were a good fit. Feel free to retag and remove this P.S.

I recently received this rather amusing message while reviewing a user's first post:  Congratulations! This was only a test, designed to make sure you were paying attention. This post has already been removed, but thanks for taking time to leave feedback for the author.   What is the purpose of this test? How does the audit work? What happens if I fail? Why was the system expecting me to negatively review a good post, or positively review a bad post? A review is obviously an audit. Should I report it? Do review audits count toward the Reviewer badge? Do robo-reviewers dream of electric sheep?


I have inherited all of the 4th ed hardcover books from one of my brothers-in-law. I am currently reading and trying to familiarize myself with the new 5th edition and I am really liking it. I had asked  and I got some very good answers. My new question is about 4th ed. Can 4th ed be played without using tiles and graphs? I realize its centered around this, but I am old school (AD&D in junior high & high school (1980's)) and I like being able to make my own maps & using my & my players' creativity & make our own environments. I'm contemplating selling these books because they aren't really of use to me, but I was hoping to use some of them as source material for 5th ed. Thanks again everyone.

I am DMing a new 4e group, and I am interested in approaching the game as a "theater of the mind" style combat rather than the traditional grid format.  We are locked into doing D&D 4e because of the resources my players have available, but I believe they will be open to an approach that follows the spirit, rather than the letter, of the combat rules.  What can I, as a DM, do to make theater of the mind combat engaging and reasonably consistent with the 4e rules set? I am open to suggestions and techniques from other systems as long as I can put them into a D&D game without breaking the core mechanic of dice roll + bonuses vs. check number.


I have this problem, what to do?  E: Malformed entry 4 in list file /etc/apt/sources.list.d/google-chrome.list (Component)  E: The list of sources could not be read.

I have unistalled and reinstalled the Ubuntu Software Center as per info I found in a similar thread and I got the same response about line 91 or something like that.  I just tried to upload a screen shot but since I'm new it won't allow me to.  I also can not figure out how to cut and paste anything so I have to hand type what the error screen says, both when I attempt to open the software center and nothing happens, when I try to enter commands into the terminal to uninstall, reinstall, whatever I get the same following:  COULD NOT INTITIALIZE THE PACKAGE INFORMATION An unresolvable problem occured while initializing the package information Please report t:his bug against the 'update-manager' package and include the following error message: 'E: Malformed line 91 in source list/etc/apt/sources.list (dist parse)  E: The list of sources could not be read.,  E: The package list of status file could not be parsed or opened.   How do I report bugs?  What can be done about this.  I have searched and everything everyone says to do leads me back to the same line error message.  So, I don't know how to get to line 91 in the source list; to tell you what it says. Sorry, I'm really new to this. That is what I need is to find out how to get there and fix what it says. I would really like to NOT have to re partition my hard drive and start from scratch, so I'm really looking forward to getting this problem solved. I need to be able to install new software.


Since disk space is allocated in blocks, is it a more accurate representation of the actual space consumed by a directory to report it in blocks vs bytes?  If a file of size 1,025 bytes resides on a file system where space on the file system is doled out in units of 1,024 byte blocks, that file consumes two whole blocks.  That seems more accurate than to say that this file consumes 1,025 bytes of space.  Edit: File system in question is ext4, no dedupe, no compression, fwiw.  This is my attempt:  def getDirUsage(filepath, block_size=1024):  # block_size as reported by os.statvfs()     '''     return the number of blocks consumed by a directory     '''     total_size = int(math.ceil(os.path.getsize(filepath)/block_size))  # debatable whether this should be included in the size     allfiles = os.listdir(filepath)     for f in allfiles:         p = os.path.join(filepath,f)         if os.path.isdir(p):             total_size += getDirUsage(p,block_size)         else:             total_size += int(math.ceil(os.stat(p).st_size/block_size))     return total_size

When I sum up the sizes of my files, I get one figure. If I run du, I get another figure. If I run du on all the files on my partition, it doesn't match what df claims is used. Why are there so many different figures for the total size of my files? Can't computers add?  Speaking of adding: when I add the “Used” and “Available” columns of df, I don't get the total figure. And that total figure is smaller than the size of my partition. And if I add up my partition sizes I don't get my disk size! What gives?


Let $U \subset \Bbb R^n$ and $f: U \to \Bbb R$ be a harmonic function. I wanna show that the partial derivatives of a harmonic function are harmonic. So for $g= \frac{\partial f}{\partial x_j}$, I wanna show that $\sum_i \frac{\partial^2 g}{\partial x_i^2}=0$. ( $j \in \{1, \dots , n\}$) I know that f is a function of class $C^2$ but than?   Thanks for your help.

I've tried manipulating some expressions but still can't quite get my head around why the partial derivatives of $u(x,y)$, a harmonic function, are also harmonic.


I am using the  \documentclass[conference]{IEEEtran} and I want to insert images on full width. For that I am using: \begin{figure}[!htbp] \centering \includegraphics[width=\textwidth]{artworks/pearson-single-dendrogram.png} \caption{Single Linkage Agglomerative Clustering} \label{single-linkage-dendrogram} \end{figure}  But if I print the bibgliography underneath afterwards using \newpage \printbibliography . it appears on top of the figures, rather than from the new page. Does anyone know how this can be fixed?

If I just try to set the figure's size to 0.9\textwidth my figure will just end up on the right column, sized to be two-columns wide.  Has anyone done this before?


I try to install Win 8.1 to my new computer with both SSD and HDD. I want to boot it from SSD but keep the all related files in HDD. Is it possible to choose such a scheme for the installation ?  If you know Linux, then what I want is pretty similar to create /boot partition at SSD and keep all /root /home partitions at HDD. However, in the installation process of Win 8.1, I cannot see any advance partition tool to define such detail schema.

Is it possible to install the Windows system files on a small SSD and have all important folders (C:\Program Files, C:\Users) on a 2TB data drive?  I assume this is how one would use an SSD to achieve higher performance


So I came across this question sometime ago and couldn't figure out the question for it, but it left me wondering as to why it works. I don't have the question in front of me, but I'll try my best to repeat it from memory.  Why are the outputs of these two pieces of code the exact same in C? One of them is obviously wrong.  Code 1:  int main() {    int a;    int b[] = {1,2,3,4};    for(a = 0; a<4; a++)       printf("%i\n",b[a]);    return; }   Code 2:  int main() {    int a;    int b[] = {1,2,3,4};    for(a = 0; a<4; a++)       printf("%i\n",a[b]);    return; }   The output of both pieces of code is:  1 2 3 4   Someone told me it has something to do with a stack and memory locations, but the explanation wasn't clear enough. Can anyone help explain this more clearly?

As Joel points out in , in  (aka: K & R), there is mention of this property of arrays in C: a[5] == 5[a]  Joel says that it's because of pointer arithmetic but I still don't understand. Why does a[5] == 5[a]?


I have a bunch of images of cars and for each image, I have the top, left, width and height of a box in pixels over the image that is outlining the car.  const rectStyle = {     position: "absolute",     top: rect[0],     left: rect[1],     width: rect[2],     height: rect[3],     border: "3px solid red",     backgroundColor: "transparent",   };    return (     <>

     </>   );  My issue right now is when I try to resize the photos to fit a , the boxes are no longer in the right position. How can I fix this?

I want to overlay one image with another using CSS. An example of this is the first image (the background if you like) will be a thumbnail link of a product, with the link opening a lightbox / popup showing a larger version of the image.   On top of this linked image I would like an image of a magnifying glass, to show people that the image can be clicked to enlarge it (apparently this isn't obvious without the magnifying glass).


I am writing biographies for some of my doctors.  I have asked several people and have received several different answers.  Here are a couple examples:  Lee is a 2005 graduate of the University of Pittsburgh or should it read Lee is a 2005 graduate of University of Pittsburgh.  The latter sounds wrong to me.  I have several of these to write and would love to do it correct the first time.  Then should "the" be capitalized?

Is the always used before the name of a school, college, or university?


I have the game Sudoku. how many combinations can be made by random entering of numbers on the whole such that it makes unique combination in $3\times 3$ grid and $9\times 9$ also.

The answer: 6, 670, 903, 752, 021, 072, 936, 960, according to this site:  I have tried to get this number using direct methods but basically I have found the question too hard. There are too many possibilities, but I am likely missing some strategic ways to solve the problem. Any help would be greatly appreciated, thanks.


Whenever I try and label an equation in the following format  \begin{equation}\label{eq:blah} blah \end{equation}   and then reference this equation  By \eqref{eq:blah}   I get the usual (??) of an ill-defined labeling. It only happens with equation environments though.  I've tried removing almost everything I can think of in my preamble to make it work, but to no avail.   Consequently, I am posting a MWE which is not very minimal—apologies!  Any help is greatly appreciated!  \documentclass{book}   \usepackage{amsfonts,amssymb,latexsym,verbatim,url,color,mathrsfs,tikz,extarrows,enumerate,lipsum,mathtools} \usepackage[nameinlink]{cleveref} \usepackage{enumerate,fancyhdr,verbatim,comment}  \usepackage{dsfont}   \usetikzlibrary{matrix,arrows}   \usepackage[colorlinks = true,             linkcolor = blue,             urlcolor  = blue,             citecolor = blue,             anchorcolor = blue]{hyperref}     \usepackage[amsmath,thmmarks]{ntheorem}  \newcounter{dummy}  \numberwithin{dummy}{chapter}    \theoremprework{\setlength \theorempreskipamount{10 pt}\setlength\theorempostskipamount{10 pt}}  \theoremstyle{plain} \theorembodyfont{\upshape} \theoremsymbol{} \theoremseparator{:} \newtheorem{example}[dummy]{Example}    \begin{document}  \begin{equation}\label{eq:example} \int_a^b f(x)\, dx=F(b)-F(a) \end{equation}  By Equation \eqref{eq:example}  \end{document}   New MWE:  \documentclass{book}   \usepackage{amsfonts,amsmath,amssymb,latexsym,verbatim,url,color,mathrsfs,tikz,extarrows,enumerate,lipsum,mathtools}  \usepackage{enumerate,fancyhdr,verbatim,comment}  \usepackage{dsfont}   \usepackage[margin=1 in]{geometry}   \usetikzlibrary{matrix,arrows}  \usepackage[amsmath,thmmarks]{ntheorem}  \usepackage[colorlinks = true,             linkcolor = blue,             urlcolor  = blue,             citecolor = blue,             anchorcolor = blue]{hyperref}  \usepackage[nameinlink]{cleveref}  \newcounter{dummy}      \numberwithin{dummy}{chapter}        \theoremprework{\setlength     \theorempreskipamount{10 pt}\setlength\theorempostskipamount{10 pt}}      \theoremstyle{plain}     \theorembodyfont{\upshape}     \theoremsymbol{}     \theoremseparator{:}     \newtheorem{example}[dummy]{Example}        \begin{document}      \begin{equation}\label{eq:example}     \int_a^b f(x)\, dx=F(b)-F(a)     \end{equation}      By Equation \eqref{eq:example}      \end{document}

The hyperref documentation says: "Make sure it comes last of your loaded packages". The reason is that it redefines many LaTeX commands. It's a rule of thumb that helps to avoid errors.  However, there are exceptions, for instance the amsrefs user's guide notes that amsrefs has to be loaded after hyperref.  To avoid problems when adding hypertext functionality: do you know further such exceptions?


What's this font? And how can I add package for this?

Is it possible to identify the font used in a specific document/picture?  Answers to this question should identify:   Possible methods to do this (perhaps one answer per method) and adequately describe how to use it (as opposed to merely stating it); Ways of finding the identified fonts, if possible (free or not); and Any prerequisites associated with the method used, if required (for example, "In order to use method X, your document has to be in format Y").   This question is meant as an FAQ, based on an . Its aim is to facilitate the community with the general procedures involved in font identification. Similar cases are solved on a per-usage basis on 's  tag.


Prove that a square matrix over an algebraic closed field is nilpotent if and only if all their eigenvalues are zero.  A nilpotent matrix is that $A^k = 0  $ for some k.  Some idea?

In a finite dimensional vector space, if $0$ is an eigenvalue and the only eigenvalue of a linear operator, is that operator nilpotent?  There is this post which shows the other direction.    I would think the question would be posed as "iff" to the extent the answer to my question is affirmative.   To the extent that is not the case, I would please appreciate an example to that effect.  Thanks


I have a stream network dataset and am attempting to do a distance analysis between paired points located in two different layers. Ex. I have 500 points in layer A with given coordinates, and then 500 points with different coordinates in layer B. I plan to base the distance-pairing on a shared ID. Having looked at other questions related to this, I have often seen the OD Cost Matrix suggested as a solution, or tools that give linear distance. I don't think the OD Cost Matrix will work for me- I want the stream network distance between the points that share an ID, not the distance between Point A and all other points.

I need to find the distance between points in separate layers along a stream network. I have source sites for macro-invertebrates and sites where they are lacking. I need to find the distance between the source sites and the sites where they are not through the stream network.   I tried the linear referencing toolbox but the locate features along route tool can only use one layer of points and has not way to differentiate between sources and not source sites.  Any ideas?  I am using ArcMap 10.3?


I'll get straight to the point. I recently set up a FileZilla server to get all my files anywhere to watch or access. I have already set up the user and directory I want to access, as well as picking the port. The problem is my NAT router. I have put exceptions in my firewall on both machines for the port I used (7780) and I have set my passive mode to get my external IP from the filezilla site, which I heard is supposed to help me, but I can't connect to the machine using my external or internal IP's (both connected to LAN). I have tried to forward the port to that IP, but I think in doing so I lose the ability to connect within the network because all traffic even going from the machine forwards back to it. Here's What I need to know:    How does the passive mode work? How do I configure the ports to forward to that machine while still being able to connect to my server within my household)?   LOGS:      [  What I see on client computer:

I am trying to set up a local FTP server in my house. Whenever I connect to the account on the computer that hosts the server, everything works, but when I try connecting on another computer, the directory listing fails even though the account connection is successful. I have allowed port 21 TCP and UDP through the host's firewall and have added FileZilla Server to the list of programs allowed to communicate. How can I solve this?


Running a program gives some error messages such as these “ERROR File 'DATA/vgg16.npy' not found. I know this exact sentence should appear in one or more files under a given directory, which may have multiple subdirectories. Which linux command can help me identify the files as well as locations (line number) where that sentence is located.

I'd like to find all the Java files containing keyword File.createTempFile with the line number. Here's what I did:  $ find . -name "*.java" | xargs grep -n "File.createTempFile" ./nuxeo-studio-test/src/test/java/com/nuxeo/studio/web/StudioServletTest.java:162:            File tmpFile = File.createTempFile(jarEntryName, null, Environment.getDefault().getTemp()); ./nuxeo-studio-ui/src/main/java/com/nuxeo/studio/core/builders/WorkflowFeatureBuilder.java:421:            tmp = File.createTempFile(".workflow-to-zip", ".tmp", workspace.getRoot()); ./nuxeo-studio-ui/src/test/java/com/nuxeo/studio/core/backup/TestS3Backup.java:101:        File tempFile = File.createTempFile(RandomStringUtils.randomAlphabetic(5), ".tmp"); ./nuxeo-studio-ui/target/classes/com/nuxeo/studio/core/builders/WorkflowFeatureBuilder.java:421:            tmp = File.createTempFile(".workflow-to-zip", ".tmp", workspace.getRoot()); ./nuxeo-studio-web/src/main/java/com/nuxeo/studio/web/v1/ProjectResource.java:191:            File zip = File.createTempFile(filename + "-", ".zip", tempRepo);   However, I found this result too long to read. I'd like to keep only the file path and the line number. Here's expected result:  ./nuxeo-studio-test/src/test/java/com/nuxeo/studio/web/StudioServletTest.java:162 ./nuxeo-studio-ui/src/main/java/com/nuxeo/studio/core/builders/WorkflowFeatureBuilder.java:421 ./nuxeo-studio-ui/src/test/java/com/nuxeo/studio/core/backup/TestS3Backup.java:101 ./nuxeo-studio-ui/target/classes/com/nuxeo/studio/core/builders/WorkflowFeatureBuilder.java:421 ./nuxeo-studio-web/src/main/java/com/nuxeo/studio/web/v1/ProjectResource.java:191   Could somebody teach me how to do so?


As digitally is to digital, is analogously or analogically to analog(ue)?

In electronics, we can solve a problem digitally or analoguely ?  That doesn't sound right, but surely there must be a word I can use?    Update: some definitions:  digitally: Relating to or being a service that provides information expressed in discrete numerical form.  analoguely: Relating to or being a service that provides information expressed in continuous, non-discrete form. (This is my made up definition of a word I made up).  analogously: Similar or alike in such a way as to permit the drawing of an analogy.  As you can see, the word analogously doesn't mean the opposite of digitally, it means something else.


Okay, so I've been wondering and this is a simple question and I cannot find an answer anywhere. Would a blackhole the size of the Moon (event horizon) black out the Sun in a "Lunar eclipse"?  My theory is that the light from the son would bend around the black hole and still hit the earth one way or another.  Any ideas?

Why can't we see the shadow of a black hole cast on Earth. Shouldn't the black hole block some light from a star or a galaxy far behind as they line up?


I have an old piece of video processing software that is no longer updated for the last couple of years.  The Macbook I have it installed on is running 10.11 Yosemeite.  My new Macbook Pro has 10.14 Mojave.  When I go to install it on this new computer it says that "Mac OS X 10.6 or Later Required."  The software includes drivers for the video capture card, so I certainly don't know for 100% that this software will even work with 10.14, but obviously it was just not in the installers listed of supported OS's yet, so it won't try.  So, I'm wondering if anyone knows a way to create a virtual environment or run in a compatibility mode or flat out lie to the installer about the version that I have installed to get it to try to install.  Thanks for any insight!

After reading articles about the state of Truecrypt in February 2015, I decided to download the last stable version of Truecrypt that allows full usage of Truecrypt: that is, version 7.1a     7.2 version that can only be used to view, but no longer to create new, TrueCrypt volumes.   see   I then proceeded to install this on my Mac, running on Yosemite 10.10  But I got the error message "truecrypt 7.1a requires  Mac OS X 10.4 or later", see below.    I guess it's simply a schoolboy error from a developer of the Truecrypt team, as it considers 10.4 being above 10.10, or maybe it's rather Apple who messed up & should have consistantly used 2 digits after the dot (i.e. use 10.04 rather than 10.4).  In any case, I find myself unable to install Truecrypt. Anyone found a solution for this?


Evaluate $$\lim_{n\to\infty}\prod_{k=1}^n\cos{\dfrac{a}{p^k}}, p\in\mathbb{N}$$I can use double angle formulae to evaluate $$\lim_{n\to\infty}\prod_{k=1}^n\cos{\dfrac{a}{2^k}}=\dfrac{\sin a}{a}$$ But I wonder the evaluation when $p=3,4,5\cdots$  $$$$The question might be complex-analysis-related.

It is well known and somewhat easy to show that $\prod\limits_{j=1}^n \cos\frac{x}{2^j} = 2^{-n}\frac{\sin x}{\sin\frac{x}{2^n}}$.   The "2-ness" of $2$ (in $\cos\frac{x}{2^j}$) is really important to deriving this identity. I was wondering if there was anything nice known about products of the form $\prod\limits_{j=1}^n \cos\frac{x}{k^j}$ where $k$ is a positive integer $\ge 3$.


I recently upgraded my MacBook Pro to High Sierra and found out that it started working very slowly. As Activity Monitor says, the process YaraScanService is the one to blame. It's eating about 10GB of memory or even more. When I stop that process forcely, my computer start working as a charm. I also tried to reset SMC and NVRAM, but it did not bring to any result (maybe it just started to start up a little bit faster but stil). I heard that the process is supposed to do its work and then deletes itself, but I waited for some time, and it did not remove. What do I do to solve this problem?

Recently on MacOS 10.13.6 I have noticed high CPU usage and identified the process YaraScanService as consuming close to 90% CPU.  The Activity Monitor lists it under:  /System/Library/CoreServices/MRT.app/Contents/XPCServices/YaraScanService.xpc/Contents/MacOS/YaraScanService  as part of the MRT.app.  According to  thread and  it appears to be some kind of Apple's built-in antivirus that is doing its scanning yet there doesn't seem to be a way to disable or remove it apart from killing it from the Activity Monitor or with pkill.  Any pointers on how to control it or stop/disable it?  I would assume that if you have dozens of gigabytes of zip, tar, bzip, rar, jar archives then yarascan will unpack them all to memory or disc in order to scan them, and there is absolutely no way to whitelist or exclude them.  The MRT.app is timestamped on 10-Aug-2018 along with a bunch of other folders (apparently the date when I accepted an Apple update). Most files inside the folder are timestamped 4-Jul-2018 and 8-Jul-2018, supposedly when the app was released by Apple.


I read in the book that partial derivative of the wave function, $y(x,t)$ with respect to $x$ (here $x$ is the position of the particle on the $x$-axis) corresponds to studying the shape of the string at one instant. The first partial derivative $\partial y/\partial x$ is the slope of the string and the second partial derivative $\partial ^2x/\partial y^2$ is the curvature of the string (in case of a transverse wave). But what does the slope and curvature of the string actually mean? What do they represent? A diagrammatic explanation would be better.

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


I am trying to format the data from a select query from different tables, the query, i have gets me this:  Column1     Column2     Column3 123         Mark        INV001 123         Mark        INV002 456         Smith       INV003   Expected result:  Column1     Column2     Column3  123          Mark       INV001,INV002 456          Smith      INV003   I tried this query, but doesn't yield the expected result, any help would be appreciated.  WITH myCTE (                  SELECT column1,column2,column3 FROM table1;                 )                 SELECT column1, column2, STUFF((SELECT ', ' + CAST(column3 AS VARCHAR(50)) [text()]                         FROM myCTE                          FOR XML PATH(''), TYPE)                         .value('.','NVARCHAR(MAX)'),1,2,' ') column3                         FROM myCTE;

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life).  In the original app, we used almost entirely ANSI-SQL compliant statements, with one significant exception -- we used MySQL's group_concat function fairly frequently.  group_concat, by the way, does this: given a table of, say, employee names and projects...  SELECT empName, projID FROM project_members;   returns:  ANDY   |  A100 ANDY   |  B391 ANDY   |  X010 TOM    |  A100 TOM    |  A510   ... and here's what you get with group_concat:  SELECT      empName, group_concat(projID SEPARATOR ' / ')  FROM      project_members  GROUP BY      empName;   returns:  ANDY   |  A100 / B391 / X010 TOM    |  A100 / A510   So what I'd like to know is: Is it possible to write, say, a user-defined function in SQL Server which emulates the functionality of group_concat?   I have almost no experience using UDFs, stored procedures, or anything like that, just straight-up SQL, so please err on the side of too much explanation :)


I am trying to achieve a reversed link list. The new fresh list  must be created recursively.  I am creating the first node in the reversed list and I am trying to create a sublist Next which has the next element as next.next and finally to assign this sublist as next to the node. The issue is that the next node remains NIL although I recreated it in the for loop.  Edit:  The function must not change (add arguments) because some tests are running upon it.  class Node {     private Object item;     private Node next,current;      public Node(Object o, Node n) {         this.item = o;         this.next = n;     }       public Node(Node n) {     }      public static final Node NIL = new Node(Node.NIL, Node.NIL);      public Object getItem() {         return this.item;     }      public Node getNext() {         return this.next;     }      public void setItem(Object o) {         this.item = o;     }      public void setNext(Node n) {         this.next = n;     }      // this method returns the item with index number i     public Object nthItem(int i) {         Node p = this;         while (p!=null){             for (int k=1;k<=i;k++){                 p=p.next;              }             return p.item;         }         return null;       }      // this method returns the the next item of the node     public Node nthNext(int i) {         Node p = this;         while (p!=null){             for (int k=1;k<=i;k++){                 p=p.next;              }             return p.getNext();         }         return null;     }      public Node nthNode(int i) {         Node p = this;         while (p!=null){             for (int k=1;k<=i;k++){                 p=p.next;              }             return p;         }         return NIL;       }      public int length(){         if (this == NIL) return 0;         else return 1 + next.length();     }      public Node remove(Object o){         Node p = this;         if (p == NIL) return NIL;         else if(p.item == o) {             p = p.next;             return p.remove(o);         }          else return new Node(p.item, p.next.remove(o));      }      public Node reverse() {         int i = this.length()-1;         if(this == NIL) return NIL;          Node node = new Node(Node.NIL, Node.NIL);          Node next = NIL;          //create the first node in the reversed list         if(i >= 1) node = new Node(nthItem(i), next);         else node = new Node(nthItem(i), Node.NIL);          //iterate through the original list and create a next node         if (i>0) {             for (int k=i; k>=0; k--){                 if (k<=0)  {                     next = NIL;                 }                 else {                     next = new Node(nthItem(k-1),next);                 }                            }         }          //debugging in console         System.out.println("final node = " + next.item+" ");         return node;     } }  class Test{      public static void main(String[] string){         Node n = new Node(1, Node.NIL);         Node nn = new Node(2, n);          Node r = nn.reverse();          System.out.println("\t item " + r.getItem()+ " " + r.getNext().getItem() + " length " + r.length());     } }

I have been working on a Java project for a class for a while now. It is an implementation of a linked list (here called AddressList, containing simple nodes called ListNode). The catch is that everything would have to be done with recursive algorithms. I was able to do everything fine sans one method: public AddressList reverse()      ListNode:    public class ListNode{   public String data;   public ListNode next; }   Right now my reverse function just calls a helper function that takes an argument to allow recursion.  public AddressList reverse(){   return new AddressList(this.reverse(this.head)); }   With my helper function having the signature of private ListNode reverse(ListNode current).  At the moment, I have it working iteratively using a stack, but this is not what the specification requires. I had found an algorithm in C that recursively reversed and converted it to Java code by hand, and it worked, but I had no understanding of it.  Edit: Nevermind, I figured it out in the meantime.  private AddressList reverse(ListNode current, AddressList reversedList){   if(current == null)        return reversedList;   reversedList.addToFront(current.getData());   return this.reverse(current.getNext(), reversedList); }   While I'm here, does anyone see any problems with this route?


I wrote user type as below  class Item {    int first;    int second;     public boolean equals(Item p) {        if(first == p.first && second == p.second )             return true;        else if(first == p.second && second == p.first)            return true;        else            return false;    }    public int hashcode() {        return Objects.hash(first, second);    }    public void set(Object first, Object second) {        this.first = Integer.parseInt(first.toString());        this.second = Integer.parseInt(second.toString());    }   }  However, It doesn't work at all. Did I design the duplicate test incorrectly?

I ran into an interesting (and very frustrating) issue with the equals() method today which caused what I thought to be a well tested class to crash and cause a bug that took me a very long time to track down.   Just for completeness, I wasn't using an IDE or debugger - just good old fashioned text editor and System.out's. Time was very limited and it was a school project.  Anyhow -   I was developing a basic shopping cart which could contain an ArrayList of Book objects. In order to implement the addBook(), removeBook(), and hasBook() methods of the Cart, I wanted to check if the Book already existed in the Cart. So off I go -  public boolean equals(Book b) {     ... // More code here - null checks     if (b.getID() == this.getID()) return true;     else return false; }   All works fine in testing. I create 6 objects and fill them with data. Do many adds, removes, has() operations on the Cart and everything works fine. I read that you can either have equals(TYPE var) or equals(Object o) { (CAST) var } but assumed that since it was working, it didn't matter too much.  Then I ran into a problem - I needed to create a Book object with only the ID in it from within the Book class. No other data would be entered into it. Basically the following:  public boolean hasBook(int i) {     Book b = new Book(i);     return hasBook(b); }  public boolean hasBook(Book b) {     // .. more code here     return this.books.contains(b); }   All of a sudden, the equals(Book b) method no longer works. This took a VERY long time to track down without a good debugger and assuming the Cart class was properly tested and correct. After swaapping the equals() method to the following:  public boolean equals(Object o) {     Book b = (Book) o;     ... // The rest goes here    }   Everything began to work again. Is there a reason the method decided not to take the Book parameter even though it clearly  was  a Book object? The only difference seemed to be it was instantiated from within the same class, and only filled with one data member. I'm very very confused. Please, shed some light?


In most scripts (but mainly bash) it's commonplace to see some arguments that are configured like so:  bash-4.3:$ command --longer-argument -la  Where did this originate from? I'm mainly just curious as to why this became effectively a unanimous standard. Is it mainly for readability?  Also, why not use something like  bash-4.3:$ command -longer-argument, where all CLI arguments are specified by only one dash?

I've read several question about double dash:      However I remember about a teacher 4 years ago telling me that -- was the posix way of dealing with long switches like --help or --color=. Today, I'm using a lot of command where this rule is not respected at all and the best example I can came up with is find where no long switches takes a double-dash even with the very annoying AIX find.    Was my teacher wrong? or does the rule changes since (which seems unlikely)? And finally, is there any posix rules about the length of option and - or -- ?


In a commutative ring with unit every maximal ideal is prime. Under what conditions does the converse occur?

Suppose $R$ is a ring and every prime ideal of $R$ is also a maximal ideal of $R$. Then what can we say about the ring $R$?


I have a problem with the number page of Index  in ToC: is the same as the bibliography.    How can I fix it? The actual page number of Index must be 365, not 363 because in the page 363 is the bibliography.  Thanks for your help.

I add the "Reference" section into my table of content using the following command:  \addcontentsline{toc}{chapter}{References}  However, the page number of Reference shown in table of content is incorrect, and is 1 less than the real page number.  For example, if in the table of content, it shows: References          114 Then Reference actually starts from page 115.  How should I fix this error? Thank you.


I have an input field, that only allows numbers and one point.     $('.number').keypress(function(event) {     var $this = $(this);     if ((event.which != 46 || $this.val().indexOf('.') != -1) &&        ((event.which < 48 || event.which > 57) &&        (event.which != 0 && event.which != 8))) {            event.preventDefault();     }      var text = $(this).val();     if ((event.which == 46) && (text.indexOf('.') == -1)) {         setTimeout(function() {             if ($this.val().substring($this.val().indexOf('.')).length > 3) {                 $this.val($this.val().substring(0, $this.val().indexOf('.') + 3));             }         }, 1);     }      if ((text.indexOf('.') != -1) &&         (text.substring(text.indexOf('.')).length > 2) &&         (event.which != 0 && event.which != 8) &&         ($(this)[0].selectionStart >= text.length - 2)) {             event.preventDefault();     }       }); .number {     padding: 5px 10px;     font-size: 16px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="text" class="number" />     I want to use this for currency so instead of the point I need to have a comma. So I replaced every point into the function with a comma. But it is not working.    $('.number').keypress(function(event) {     var $this = $(this);     if ((event.which != 46 || $this.val().indexOf(',') != -1) &&        ((event.which < 48 || event.which > 57) &&        (event.which != 0 && event.which != 8))) {            event.preventDefault();     }      var text = $(this).val();     if ((event.which == 46) && (text.indexOf(',') == -1)) {         setTimeout(function() {             if ($this.val().substring($this.val().indexOf(',')).length > 3) {                 $this.val($this.val().substring(0, $this.val().indexOf(',') + 3));             }         }, 1);     }      if ((text.indexOf(',') != -1) &&         (text.substring(text.indexOf(',')).length > 2) &&         (event.which != 0 && event.which != 8) &&         ($(this)[0].selectionStart >= text.length - 2)) {             event.preventDefault();     }       }); .number {   padding: 5px 10px;   font-size: 16px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="text" class="number" />

What's the cleanest, most effective way to validate decimal numbers in JavaScript?  Bonus points for:   Clarity. Solution should be clean and simple. Cross-platform.   Test cases:  01. IsNumeric('-1')      => true 02. IsNumeric('-1.5')    => true 03. IsNumeric('0')       => true 04. IsNumeric('0.42')    => true 05. IsNumeric('.42')     => true 06. IsNumeric('99,999')  => false 07. IsNumeric('0x89f')   => false 08. IsNumeric('#abcdef') => false 09. IsNumeric('1.2.3')   => false 10. IsNumeric('')        => false 11. IsNumeric('blah')    => false


I forgot my sudo password, which is always asked for when I carry out any download in terminal. So I am unable to download any software.  Though I reset in recovery mode, again it's showing 'wrong password'. Please help me to solve this.

I'm working on a Ubuntu system, and my client has completely forgotten his administrative password. He doesn't even remember entering one; however it is there.  I've tried the suggestions on the website, and I have been unsuccessful in deleting the password so that I can download applets required for running some files. Is there a solution?


I just watched Cold Blood. Poor Rory was erased. But how was the Doctor able to reach into the light, into the crack, without himself getting unwritten? Because in the Flesh and Stone, he mentioned that he would be an excellent thing to feed to the Crack.  I've only watched up to Cold Blood, so no spoilers, please.

During the  story arc, the cracks in the universe absorb a number of creatures, erasing them completely from time:   Amy Pond's mother and father. The military clerics Phillip, Crispin, Pedro, and Marco in . The  in . Rory's corpse in . Also, apparently, . ;)   However, there are 5 characters/species that are able to be close to the cracks, in some cases for long periods of time, without getting erased from time:   Amy Pond, who had a crack in her room for years but never got absorbed by it, even though her parents did. The Doctor, who reached into a crack to pull out a piece of the exploding TARDIS in . , who was able to escape prison by fleeing into Amy's house through the crack in her wall. An , who was peering at the Doctor and Amy through the crack in her wall in . The , who fled their damaged world for Earth through a crack in .   Are there any potential in-universe explanations for why the cracks in the universe are not lethal to these few characters?


Is there a clever way to show that  $$|x| - |y| \leq |x-y|$$  I believe I can think of a way to solve this using cases, but the book I'm working out of said that "A very short proof is possible if you write things in the right way" which has motivated me to figure out this quick way, but I've failed thus far and any help would be appreciated

I've seen the full proof of the Triangle Inequality  \begin{equation*} |x+y|\le|x|+|y|.  \end{equation*} However, I haven't seen the proof of the reverse triangle inequality:  \begin{equation*} ||x|-|y||\le|x-y|. \end{equation*} Would you please prove this using only the Triangle Inequality above?  Thank you very much.


I was working with the date structure of set implemented in python. I can define a set as: set_1 = set([1, 2]) and also as set_2 = {1, 2}. if I run set_1 == set_2 it evaluate to True but if I run set_1 is set_2 it evaluate to False. So what are the difference between this two implementations?

My  has failed me.  In Python, are the following two tests for equality equivalent?  n = 5 # Test one. if n == 5:     print 'Yay!'  # Test two. if n is 5:     print 'Yay!'   Does this hold true for objects where you would be comparing instances (a list say)?  Okay, so this kind of answers my question:  L = [] L.append(1) if L == [1]:     print 'Yay!' # Holds true, but...  if L is [1]:     print 'Yay!' # Doesn't.   So == tests value where is tests to see if they are the same object?