Hey there I was wondering why the "return ask" here does not change the value of 'ask' when I print it out on my main method (it prints out 0 in the main but works in the Log method) and how I can fix it. Thanks in advance!  public static int Log(int ask){      int b=0;     int c =0;     c = scannerobj.nextInt();     b = scannerobj.nextInt();     ask = b*c;     System.out.println(ask);     return ask; }  public static void main(String [] args){     int ask=0;      Log(ask);      System.out.println(ask);  }

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


I want to show the following equations, assuming that $X$ is a non-negative random variable. $\lim_{n \to \infty} n E(\frac{1}{X}I_{\{X>n\}}) = 0$ $\lim_{n \to \infty} \frac{1}{n}E(\frac{1}{X}I_{\{X > \frac{1}{n}\}}) = 0$ I think they may be related to the monotone convergence theorem, but I have no clue how to approach them. Any hints?

Suppose $X$ is a non-negative random variable satisfying  \begin{align*} P[0 \le X < \infty ]=1. \end{align*} Show   a)  \begin{align*} \lim_{n \to \infty} n E \left( \frac{1}{X}1_{[X>n]} \right) =0 \end{align*} b)  \begin{align*} \lim_{n \to \infty} n^{-1} E \left( \frac{1}{X}1_{[X>n^{-1}]} \right) =0 \end{align*}  What I did  I showed part a) already here is the proof:  \begin{align*} n E \left( \frac{1}{X}1_{[X>n]} \right) \le n E \left( \frac{1}{n}1_{[X>n]} \right)=n\cdot\frac{1}{n}P[X>n]=P[X>n] \end{align*} So $\lim_{n \to \infty} n E \left( \frac{1}{X}1_{[X>n]} \right) \le \lim_{n \to \infty} P[X>n]=0$.  What about part b)? The same techniques no longer works.  I was thinking that  \begin{align*} \lim_{n \to \infty} n E \left( \frac{1}{X}1_{[X>n]} \right) \le \lim_{n \to \infty} n E \left( \frac{1}{X} \right) \le 0 \end{align*} but I am not sure that $E \left( \frac{1}{X} \right) < \infty$


Hi guys I accidentally did an autoremove and somehow my gnome desktop was completely wiped out leaving me with just the shell access to my ubuntu 18.04 - I'm trying to reinstall the ubuntu desktop but it doesn't work and keeps giving me an error.  $ sudo apt-get install ubuntu-desktop Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  ubuntu-desktop : Depends: ubuntu-session but it is not going to be installed                   Recommends: gnome-software-plugin-snap but it is not going to be installed                   Recommends: libreoffice-pdfimport but it is not going to be installed                   Recommends: ubuntu-software but it is not going to be installed E: Unable to correct problems, you have held broken packages.   I've tried using taskel - just about anything but it gives the same error. I've managed to install kubuntu-desktop using the same command but whats wrong here. I really would want to get my original desktop back. Please help.

After upgrading from 10.04 to 12.04 I am trying to install different packages.  For instance ia32-libs and skype (4.0).  When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message.   Output of commands:  sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   After running this:  sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


Problem: prove that for each $n \in \mathbb{N}$ : $(n,n+1) \cap \mathbb{N} = \varnothing $ attempt: Indeed, let $S(n)$ be the statement $\{ n : (n,n+1) \cap \mathbb{N} = \varnothing \}$. Clearly, $(1,2) \cap \mathbb{N} = \varnothing$, thus $1 \in S(n)$. Assume now that $S(n)$ is true. Then, $$ (n+1,n+2) \cap \mathbb{N} =  (n,n+1) \cap (\mathbb{N} \setminus [n+1,n+2) ) \cap \mathbb{N} = (n,n+1) \cap \mathbb{N} \cap ( \mathbb{N} \setminus [n+1,n+2) ) = \varnothing $$ and the claim follows by the principle of mathematical induction. Is this correct proof?

Use an induction argument to prove that for any natural number $n$, the interval $(n,n+1)$ does not contain any natural number.    I don't know where I could go with an induction argument. I was thinking of proving that if $s\in (n,n+1)$, where $s$ is a natural number, then $s-n$ is a natural number which lies in $(0,1)$, which is impossible as all natural numbers are bounded below by $1$.   However, this assumes that natural numbers are closed under addition. Also, this does not use induction.   Any pointers for this question?


Is there a way to show R2(s + 1, t + 1) > s · t ? The only way I know finding ramsey numbers to by graphing. But to prove the above inequality, what would be the best method?

I was thinking if I could prove this relation by arranging the $(s − 1)(t − 1)$ in an $(s − 1) × (t − 1)$ 2-D grid and coloring an edge by color-1 if the two endpoints of the edge are in the same row and by color-2 if the two endpoints of the edge are in the same column. I'm not sure if this method will work, but any other approach would be really helpful.


We migrated our old URL (www.nyc-officespace-leader)  to a new domain (https://www.metro-manhattan.com) on April 5th, 2018. The new domain has been registered to us since 2013.    Within 5 days web traffic feel about 90%. At about 21 days, web traffic increased to about 75% of it's previous daily traffic. It has been stable in the last week.   Is this normal? Should traffic recover? I have read it can take up to about 2 months. A feedback or advice would be greatly appreciated! We followed the below procedures for the switch:   Create "splash" page with h1 and text Remove redirection SSL for www.metro-manhattan.com      Verify the domain metro-manhattan.com on Google search console Create two subdomians to "simulate" the redirection/migration and test redirection    move the reduced website from subdomain 2 to www.metro-manhattan.com Apply the partial redirection on production   Submit a sitemap on google webmaster tools for www.metro-manhattan.com Apply complete redirection from nyc-officespace-leader.com to www.metro-manhattan.com

About a week ago I made the switch to https on one of my sites. I'm positive I did everything right. Properly setup 301 redirects from http to https versions. Added and verified https version in Webmaster Tools. Updated all internal links. Submitted new sitemap.  Despite that, many of my pages (about 40%) lost their rankings almost immediately. Those that dropped went from page 1 to nowhere. I can still see them indexed if I search for the URL, but otherwise it's like Google doesn't know they exist.  SSL Labs shows an "A" when I run their test and I have no manual actions showing in Webmaster Tools.  This is really frustrating. I don't actually need SSL, but Google finally scared me into it. Now I'm regretting the switch and contemplating going back to non-secured URLs.  Anything else I could have missed?


Does Emma Roberts say "not so much on the nose" at time code: 6:28 to 6:34  If it is right, so what does it mean?

What does "too on the nose" mean, especially as applied to art?   I use the expression but struggle to explicitly articulate what I mean. My best attempt is that I use it to refer to film, music, etc. that lacks subtlety and nuance, for example cheaply getting emotional heft from very directly stating cliched and unsubtle emotions.   :        In addition; also   More than enough; excessively   To a regrettable degree - AHDEL/TFD      Obviously, I'm using too in the sense of #2 or #3.  And the idiom :     Exactly, precisely; ...This term... may come from boxing, where the opponent's nose is a highly desired target. - AHDI/TFD   I haven't been able to find reliable definitions for too on the nose online (they're swamped by definition of 'on the nose', which is apparently often a positive phrase meaning exact or precise).  You can't be "too on the nose" in boxing. Can it have a negative meaning or is this a misuse of the phrase?


Minecraft gives me this message in the crash report:  ---- Minecraft Crash Report ---- // Sorry :(  Time: 23/1/15 8:28 PM Description: Initializing game  org.lwjgl.LWJGLException: Pixel format not accelerated     at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)     at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)     at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:252)     at org.lwjgl.opengl.Display.createWindow(Display.java:306)     at org.lwjgl.opengl.Display.create(Display.java:848)     at org.lwjgl.opengl.Display.create(Display.java:757)     at org.lwjgl.opengl.Display.create(Display.java:739)     at bss.an(SourceFile:526)     at bss.ak(SourceFile:355)     at bss.a(SourceFile:302)     at net.minecraft.client.main.Main.main(SourceFile:124)   A detailed walkthrough of the error, its code path and all known details is as follows: ---------------------------------------------------------------------------------------  -- Head -- Stacktrace:     at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)     at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)     at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:252)     at org.lwjgl.opengl.Display.createWindow(Display.java:306)     at org.lwjgl.opengl.Display.create(Display.java:848)     at org.lwjgl.opengl.Display.create(Display.java:757)     at org.lwjgl.opengl.Display.create(Display.java:739)     at bss.an(SourceFile:526)     at bss.ak(SourceFile:355)  -- Initialization -- Details: Stacktrace:     at bss.a(SourceFile:302)     at net.minecraft.client.main.Main.main(SourceFile:124)  -- System Details -- Details:     Minecraft Version: 1.8.1     Operating System: Windows 7 (x86) version 6.1     Java Version: 1.8.0_31, Oracle Corporation     Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation     Memory: 52381136 bytes (49 MB) / 101867520 bytes (97 MB) up to 518979584 bytes (494 MB)     JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx512M     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     Launched Version: 1.8.1     LWJGL: 2.9.1     OpenGL: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.     GL Caps:      Using VBOs: No     Is Modded: Probably not. Jar signature remains and client brand is untouched.     Type: Client (map_client.txt)     Resource Packs: []     Current Language: ~~ERROR~~ NullPointerException: null     Profiler Position: N/A (disabled)

Similar to  on the bugs in Minecraft, I would like a complete list of what error codes exist in Minecraft and how they occur, as well as how they can be resolved.


In connection with  about computing integrals of the form $$\mathcal{I}_n=\int_0^\infty f_n(x)\,\mathrm{d}x=\int_0^\infty \frac{\mathrm{d}x}{e^x+x^n}$$ I noticed an interesting trend while plotting the integrand for $n\to\pm\infty$.  On the left, the blue curve is a plot of the integrand with $n=-1000$; on the right, $n=1000$. The orange dashed curve is $e^{-x}$.    I would think $$\lim_{n\to-\infty}\mathcal{I}_n=\int_0^\infty e^{-x}\,\mathrm{d}x=1\\ \lim_{n\to\infty}\mathcal{I}_n=\int_0^\infty 0\,\mathrm{d}x=0$$ yet the plots suggest otherwise; namely, that $$\lim_{n\to-\infty}f_n(x)=e^{-x}\theta(x-1)\\ \lim_{n\to\infty}f_n(x)=e^{-x}\theta(1-x)$$ where $\theta(x)$ is the , which in turns suggests $$\lim_{n\to-\infty}\mathcal{I}_n=\frac{1}{e}\\ \lim_{n\to\infty}\mathcal{I}_n=1-\frac{1}{e}$$ If I had to guess, my "intuition" of interchanging the limit and integration fails, but what's the precise reason as to why?

After coming across this question: , I have the following question:     When taking the limit of an integral, is it valid to move the limit inside the integral, providing the limit does not affect the limits of integration?   For instance in the question, the OP is trying to determine that:  $$\lim_{n\to\infty}\int_{0}^{1}{\frac{dx}{(1+\frac{x}{n})^{n}}}=1-\rm{e}^{-1}$$  The answers to the question involve evaluating the integral and then taking the limit to prove the result; but I was wondering if it would be valid to move the integral inside the limit, that is:  $$\lim_{n\to\infty}{\int_{0}^{1}{\frac{dx}{(1+\frac{x}{n})^{n}}}}=\int_{0}^{1}{\lim_{n\to\infty}\frac{dx}{(1+\frac{x}{n})^{n}}}=\int_{0}^{1}{\frac{dx}{\rm{e}^{x}}}=\rm{e}^{0}-\rm{e}^{-1}=1-\rm{e}^{-1}$$  As required. So is this a valid technique, or is it just coincidental that this works?


Prove that: $(\sum_{i=1}^n i)^2$ = $\sum_{i=1}^n i^3$  I can use the fact that $\sum_{i=1}^n i$ = n(n+1)/2 after the inductive hypothesis is invoked. I'm not sure where to start, I would usually break down one side but there isn't usually two sums, so I'm not sure.

Prove the following statement $S(n)$ for $n\ge1$:  $$\sum_{i=1}^ni^3=\frac{n^2(n+1)^2}{4}$$  To prove the basis, I substitute $1$ for $n$ in $S(n)$:  $$\sum_{i=1}^11^3=1=\frac{1^2(2)^2}{4}$$  Great. For the inductive step, I assume $S(n)$ to be true and prove $S(n+1)$:  $$\sum_{i=1}^{n+1}i^3=\frac{(n+1)^2(n+2)^2}{4}$$  Considering the sum on the left side:  $$\sum_{i=1}^{n+1}i^3=\sum_{i=1}^ni^3+(n+1)^3$$  I make use of $S(n)$ by substituting its right side for $\sum_{i=1}^ni^3$:  $$\sum_{i=1}^{n+1}i^3=\frac{n^2(n+1)^2}{4}+(n+1)^3$$  This is where I get a little lost. I think I expand the equation to be  $$=\frac{(n^4+2n^3+n^2)}{4}+(n+1)^3$$  but I'm not totally confident about that. Can anyone provide some guidance?


I need to extract some values from a file in bash, on my CentOS system. In myfile.txt I have a list of objects called Info_region in which each object is identified with a code (eg. BARD1_region_005 or BIRC2_region_002 etc.) Moreover there are some others columns in which are reported some numerical variable. The same object (same code name) can be repeated several times in my file. I also have a file that contains a completed list with all object codes without duplicates. I would like to obtain an output.txt file in which each object (code name) is reported only once as in my list-file.txt and I would like to associate to this the maximum possible values associated with that code name in myfile.txt. myfile.txt: (columns are separated by tab) Info_region Lig_score   Lig_prevista    Lig_prevista_+1 Int_score   Expo_score  Protac_score BARD1_region_005    0   3   3   0   1   1 BARD1_region_006    0   1   1   0   1   1 BIRC2_region_001    1   6   7   0   1   2 BIRC2_region_001    1   7   8   0   1   2 BIRC2_region_001    0   2   2   0   0   0 BIRC2_region_001    0   12  12  0   1   1 BIRC2_region_001    1   10  11  -1  1   1 BIRC2_region_001    1   2   3   0   1   2 BIRC2_region_001    1   0   1   0   1   2 BIRC2_region_001    1   6   7   0   1   2 BIRC2_region_002    0   0   0   0   1   1 BIRC2_region_002    1   0   0   -1  0.5 0.5 BIRC2_region_003    0   0   0   0   1   1 BIRC2_region_004    0   1   1   0   1   1 UHRF1_region_004    0   0   0   1   1   2 UHRF1_region_004    0   0   0   1   1   2 UHRF1_region_004    1   0   1   0   0.5 1.5 UHRF1_region_004    0   0   0   1   1   2 UHRF1_region_005    0   3   3   1   1   2 UHRF1_region_005    1   0   0   -1  1   1  file-list.txt: Info_region BARD1_region_005 BARD1_region_006 BIRC2_region_001 BIRC2_region_002 BIRC2_region_003 BIRC2_region_004 UHRF1_region_004 UHRF1_region_005  output.txt: Info_region Lig_score   Lig_prevista    Lig_prevista_+1 Int_score   Expo_score  Protac_score BARD1_region_005    0   3   3   0   1   1 BARD1_region_006    0   1   1   0   1   1 BIRC2_region_001    1   12  12  0   1   2 BIRC2_region_002    1   0   0   0   1   1 BIRC2_region_003    0   0   0   0   1   1 BIRC2_region_004    0   1   1   0   1   1 UHRF1_region_004    1   0   1   1   1   2 UHRF1_region_005    1   3   3   1   1   2  Could someone help me please? Thank you!

I have some data which looks like:  sampleA    ATGC    10   100 sampleA    ATGC    120  230 sampleA    ATGC    200  110   I want to print the min and max using the values in both column 3 and 4. So my output should look like:  sampleA   10  230   Thanks in advance


Prove combinatorically, that for $n \geq m$:   $$\sum_{k=0}^m \dbinom{n}{k} \dbinom{n-k}{m-k}= 2^m \dbinom{n}{m}$$   The right hand side tells that us the number of ways we can pick either white or black $m$ balls from a total of $n$ balls. But I'm not sure what the connection between that and the left hand side is.

Give an algebraic and a combinatorial proof for the following identity:       $$ \sum _{k=0} ^m \binom nk \binom{n-k}{m-k} = 2^m \binom {n}{m}.$$      For the combinatorial argument, use the analogy of $n$ party guests, where $m$ of them describe themselves as either vegetarian or vegan (but not both).   After proving the identity using algebraic transformations, I'm unable to find a combinatorial argument for it. For the right hand side, if we multiply $\binom nm $ by $2^n$, we get the Pascal-triangle but with each row multiplied by $2^n$, but here we're multiplying by $2^m$. What does this mean? How does the analogy with the party guests work? Any help would be much appreciated.


I'm working through an abstract algebra book that mentioned something but made me want to understand something semi unrelated that I wasn't sure of. If we have a prime number $p$ we know that by Wilson's theorem that $(p-1)! \equiv -1$ mod $p$. Is there a way to apply this and make it work for any $n \in \mathbb{N}$ such that $n$ is less than $p$? For instance is there a way to get a "formula" for $(p-n)!$ Would $(p-n)! \equiv - n$ mod $p$ work?

Suppose that $p$ is a prime. Suppose further that $h$ and $k$ are non-negative integers such that $h + k = p − 1$.   I want to prove that $h!k! + (−1)^h \equiv 0 \pmod{p}$  My first thought is that by Wilson's theorem, $(p-1)! \equiv -1 \pmod{p}$, and $h!k!$ divides $(p-1)!$ (definition of a binomial). Where would I go from here?


$sql = "SELECT * FROM users ORDER BY RAND() LIMIT 100"; $xml = new SimpleXMLElement('<xml/>'); $result = $conn->query($sql);  if ($result->num_rows > 0) {     while ($row = $result->fetch_array()) {         $users = $xml->addChild('users');         $users->addChild('Id',$row['sno']);         $users->addChild('lat',$row['lat']);         $users->addChild('long',$row['lng']);         $users->addChild('address',$row['address']);         } $conn->close();    //Create the XML file     $fp = fopen("users100r.xml","wb"); //Write the XML nodes     fwrite($fp,$xml->asXML());     fclose($fp);     echo $xml->saveXML(); ?>   I want to create an XML file using the above code, but the problem is that it did not generate a required structure, which I actually needed.  I need an XML file with following structure. How can I generate it?  <users> <point id="1" lat="24.24707031" lng="68.16540527" address="Pakistan"/> <point id="2" lat="34.24707031" lng="63.16540527" address="Lahore"/> <point id="3" lat="28.24707031" lng="55.16540527" address="Karachi"/> </users>

Is it possible to use PHP's SimpleXML functions to create an XML object from scratch?  Looking through the function list, there's ways to import an existing XML string into an object that you can then manipulate, but if I just want to generate an XML object programmatically from scratch, what's the best way to do that?  I figured out that you can use simplexml_load_string() and pass in the root string that you want, and then you've got an object you can manipulate by adding children... although this seems like kind of a hack, since I have to actually hardcode some XML into the string before it can be loaded.  I've done it using the , although it's a little confusing because I'm not sure what the DOM has to do with creating a pure XML document... so maybe it's just badly named :-)


If arcgis is automatically coverting string values to numeric variables in a text document generated by stata, how do you change those variables back into string? I tried opening up the fields under properties in arccatalog and it says I cannot change them because the tables are not empty

Related to  I have a CSV file which contains a mixture of numeric and text fields: ID,Txt,Int,Dbl 12345,abc,45,56.78 12346,9,65,23.12 12347,10,66,23.13  According to this  if the top 8 rows contain a text value, the field will be classified as text, yet I am finding that the second field is classified as Long. This means that the value "abc" is omitted:  How can I force ArcMap to recognise this as a text field, while maintaining the data in CSV format? A workaround will be to create a geodatabase table, define the field as text, and Load the data, but I'm hoping to keep the table in CSV (it's the output of another process).


In Knuth's book "The Art Of Computer Programming Vol.1" there is a description about Euclid's algorithm to find the greatest common divisor of m and n.   And there is a phrase.     $m = qn+r$.  If $r = 0$, then $m$ is a multiple of $n$, and clearly in such a case $n$ is the greatest common divisor of $m$ and $n$. If $r \neq 0$, note that any number which divides both $m$ and $n$ must divide $m -qn =r$ , and any number which divides both $n$ and $r$ must divide $qn+r =m$.   I don't understand why any divisor of $m$ and $n$ must divide $m-qn =r$.


In the following code, the activeinfo.getTypeName() returns mobile even when connected to wifi. I read somewhere that wifi will not be detected on emulator so I even tried it on my device. But it still returns either mobile - when connected to wifi or mobile data (I even tried turning off the mobile data and just using the wifi instead of turning on both)- and "not connected" when i turn off both the wifi and mobile data.  ConnectivityManager conmgr = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);     NetworkInfo activeinfo = conmgr.getActiveNetworkInfo();     WifiManager wifi=(WifiManager) getSystemService(Context.WIFI_SERVICE);     Log.e("sometag", activeinfo.getTypeName());     String ssid;      if(activeinfo!=null && activeinfo.isConnected())     { //eventhough the following comparison is wrong, the next else should return "wifi" right? well, it doesn't.          if(activeinfo.getTypeName()=="WIFI")            {              WifiInfo w=wifi.getConnectionInfo();             ssid= w.getSSID();           }         else         {             ssid = activeinfo.getTypeName();         }     }     else         ssid= "not connected";

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?


I receive the "java.lang.NullPointerException" error in the following line:  miIdioma=miDao.find(Idioma.class, "playa");   miIdioma is an object from de class "Idioma" which is composed by the atrributes "palabra" and "idioma"  The Dao file is called IIdiomaDao.java and I would like to use its method:  public <T> T find(Class<T> clazz, Serializable id) {         return entityManager.find(clazz, id);     }   To gain access to this method I declared the variable miDao in the original file  private IIdiomaDao miDao;   Finally, I am using this method to gain access   miIdioma=miDao.find(Idioma.class, "playa");   I understood that this error is shown when a variable is not initialized, but I connected the database to my projects and the database data is supposed to be uploaded. To performed the unitary testing I followed these steps:   I connected the database  public class IdiomaDaoTest {    private static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";   private static final String JDBC_URL = "jdbc:mysql://localhost:3306/diccionario";   private static final String USER = "root";   private static final String PASSWORD = "mypassword";   } I imported and red data      Blockquote   public void importDataSet() throws Exception {       IDataSet dataSet = readDataSet();       cleanlyInsert(dataSet);   }    private IDataSet readDataSet() throws Exception {       return new FlatXmlDataSetBuilder().build(new File("/home/inta/workspace/JPAconPruebasUnitarias/src/test/sources/FlatXmlDataSet.xml"));   }    private void cleanlyInsert(IDataSet dataSet){       IDatabaseTester databaseTester;     try {         databaseTester = new JdbcDatabaseTester(JDBC_DRIVER, JDBC_URL, USER, PASSWORD);         databaseTester.setSetUpOperation(DatabaseOperation.CLEAN_INSERT);         databaseTester.setDataSet(dataSet);         databaseTester.onSetup();     } catch (Exception e) {         // TODO Auto-generated catch block         e.printStackTrace();     }    }   Note1: Here, I suppose that the database has been uploaded and therefore initialized it.  My question is: Why miDao is pointing Null? What am I doing wrong?  Note2: my dataset is:  <!DOCTYPE dataset SYSTEM "my-dataset.dtd" > <dataset>     <idioma palabra="playa" idioma="español"/>     <idioma palabra="beach" idioma="ingles"/>     <idioma palabra="platja" idioma="catalan"/> </dataset>   Thank you very much, this community rocks!

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?


I would really resent him doing this project. I would really resent his doing this project.  What I suspect is that the difference between in these sentences is that the emphasis is put upon the action of "doing this project" in the first sentence and the emphasis is put upon  the subject of "doing this project.Am I right? Secondly, how can we know in which part the emphasis is put when we come across a sentence in which a pronoun is not used?

I assume that the following sentences are grammatically correct:   He resents your being more popular than he is. Most of the members paid their dues without my asking them. They objected to the youngest girl's being given the command position. What do you think about his buying such an expensive car? We were all sorry about Jane's losing her parents like that.   I'm still getting used to this possessive gerund structure. It sounded so weird to me at first. Is the structure used in both formal and informal contexts? Are there any alternative structures that result in the same meaning and are more frequently used? (Examples taken from )


Geordi's VISOR images, as seen in "The Mind's Eye" and a couple other episodes, are not the clearest pictures in the world. Individuals are fuzzy, for example, which leads me to ask: How does Geordi read? While working at his Engineering station, how does he see and deal with small numbers and figures on the console? Wouldn't the words and numbers be illegible?

Geordi La Forge's visor can be used to see different electromagnetic fields. This lets him see people as glowing fields, as well as other fields. How can he see monitors and other interfaces? A screen would have to have variance in its field in order to differentiate the separate icons so that his visor could pick it up but they don't do this (or at least real screens don't). Is there any in-universe explanation?


I have a model of a gear that should be in the millimeters but when I scale it to that size it becomes so small that I can't zoom in to see it. Right now the grid is in metric and each grid is 1m x 1m x 1m. But I want to change the grid so each square in the grid is 10mm x 10mm x 10mm.

When starting the blender, there is always a cube on the floor. The floor is actually a grid. My question is how to make this grid bigger so that we can measure big stuff?


I have this (simplified) scenario:  @Test public void testSameThread() throws InterruptedException {     ReentrantReadWriteLock rwlock = new ReentrantReadWriteLock();     rwlock.readLock().lock();     {         if (rwlock.writeLock().tryLock(50, TimeUnit.MILLISECONDS)) {             // long-running op             Thread.sleep(100);             rwlock.writeLock().unlock();         } else {             fail();         }     }     rwlock.readLock().unlock(); }   First, I acquire a read lock, then on the SAME thread I try to acquire the write lock. My assumption is that as I am on the same thread, the write lock should be acquired.  First, what is wrong with my assumption? Then, what pattern (standard Java locking mechanism) can be used to allow arbitrary nested read/write locks for the same thread?

I am using in my code at the moment a  to synchronize access over a tree-like structure.  This structure is large, and read by many threads at once with occasional modifications to small parts of it - so it seems to fit the read-write idiom well.  I understand that with this particular class, one cannot elevate a read lock to a write lock, so as per the Javadocs one must release the read lock before obtaining the write lock.  I've used this pattern successfully in non-reentrant contexts before.  What I'm finding however is that I cannot reliably acquire the write lock without blocking forever.  Since the read lock is reentrant and I am actually using it as such, the simple code  lock.getReadLock().unlock(); lock.getWriteLock().lock()  can block if I have acquired the readlock reentrantly.  Each call to unlock just reduces the hold count, and the lock is only actually released when the hold count hits zero.    EDIT to clarify this, as I don't think I explained it too well initially - I am aware that there is no built-in lock escalation in this class, and that I have to simply release the read lock and obtain the write lock.  My problem is/was that regardless of what other threads are doing, calling getReadLock().unlock() may not actually release this thread's hold on the lock if it acquired it reentrantly, in which case the call to getWriteLock().lock() will block forever as this thread still has a hold on the read lock and thus blocks itself.  For example, this code snippet will never reach the println statement, even when run singlethreaded with no other threads accessing the lock:  final ReadWriteLock lock = new ReentrantReadWriteLock(); lock.getReadLock().lock();  // In real code we would go call other methods that end up calling back and // thus locking again lock.getReadLock().lock();  // Now we do some stuff and realise we need to write so try to escalate the // lock as per the Javadocs and the above description lock.getReadLock().unlock(); // Does not actually release the lock lock.getWriteLock().lock();  // Blocks as some thread (this one!) holds read lock  System.out.println("Will never get here");   So I ask, is there a nice idiom to handle this situation?  Specifically, when a thread that holds a read lock (possibly reentrantly) discovers that it needs to do some writing, and thus wants to "suspend" its own read lock in order to pick up the write lock (blocking as required on other threads to release their holds on the read lock), and then "pick up" its hold on the read lock in the same state afterwards?  Since this ReadWriteLock implementation was specifically designed to be reentrant, surely there is some sensible way to elevate a read lock to a write lock when the locks may be acquired reentrantly?  This is the critical part that means the naive approach does not work.


for command   sudo usermod  -R root.xamppusers /opt/lampp/htdocs   ....it shows  usermod: invalid chroot path 'root.xamppusers'

How can I use the chown command to change the ownership of all a folder's subfolders and files?


For countable nouns you add 's' for non single quantity e.g. 1 hour, 2 hours, -1 degree, -2 degrees  What about 0 hour(s)? 0.5 hour(s)? 1.5 hour(s)?

I was surprised when I heard zero is plural, and even 1.00001 is plural.  Then, what about following numbers ?  (1) 1.00  which means the value measured  between 0.995-1.004, having possibility that it was exactly 1.  (2) 0.99999.....  which is mathematically equal to 1. Also, are others that are mathemattically equal to 1 than this, treated completely same as 1?  (3) -1  Is this singular? Or negative numbers are generally plural?  (4) i = square root of -1  I know it's weird to count things with imaginary numbers, nonetheless, if you were to count, which form, plural or singular, would you be to use?  That's it.


I went through the previous answer like , but it gives me the following error : You can't specify target table 'table_name' for update in FROM clause. I have a table with say 3 columns (id -> auto increment primary id) :  id, roll_no and attendance  And for selected roll numbers having many entries each, except the first entry I want to update all entry attendance field as P. The query which I wrote is following : UPDATE tbl_class_attendance     set attendance = 'P'   where id NOT IN     (Select min(id)        from tbl_class_attendance       WHERE roll_no IN ('25', '45', '55')       GROUP         BY roll_no;  But it gives me the above error. I also went through other answers asking to use two select queries but there the answer I didn't find completely easy to understand as well as difficulty in executing for my selected list of roll numbers. So, is there a way to update? EDIT : Answer given below

I have a table story_category in my database with corrupt entries. The next query returns the corrupt entries:  SELECT *  FROM  story_category  WHERE category_id NOT IN (     SELECT DISTINCT category.id      FROM category INNER JOIN         story_category ON category_id=category.id);   I tried to delete them executing:  DELETE FROM story_category  WHERE category_id NOT IN (     SELECT DISTINCT category.id      FROM category        INNER JOIN story_category ON category_id=category.id);   But I get the next error:      #1093 - You can't specify target table 'story_category' for update in FROM clause    How can I overcome this?


Let $a,$ $b,$ $c,$ $d$ be distinct real numbers such that $ac = bd$ and $$\frac{a}{b} + \frac{b}{c} + \frac{c}{d} + \frac{d}{a} = 4.$$Find the maximum value of $\frac{a}{c} + \frac{b}{d} + \frac{c}{a} + \frac{d}{b}.$ I assumed that the equality case was at $a=b=c=d=1$, but that clearly doesn't work. How do you solve this? I also this the equation is homogenous, but I do not think that helps.

Let $a$,$b$,$c$ and $d$ be non-zero, pairwise different real numbers such that $ \frac{a}{b} +\frac{b}{c} +\frac{c}{d} + \frac{d}{a}=4$ and   $ac=bd$  . Show that $\frac{a}{c} + \frac{b}{d} +\frac{c}{a} + \frac{d}{b}\le-12$ and that $-12$ is the maximum.  I simplified the inequality to prove: $a^2+b^2+c^2+d^2\le -12ac$  But I am not sure what to do next. Hints and solutions would be appreciated.   Taken from the 2018 Pan African Math Olympiad


Hi, I would like to animate my world color but not sure how i can do it. In the first keyframe, I would like my world color to be pitch black. However, in the 40th keyframe I would like my world color to be a light grey. How do I do that? Thanks!

Can anybody help me with changing colors of a mesh in animation? When I change the color and set the keyframe, the last modified color of the mesh is applied on all previous keyframes.  When I press i to set keyframe, which keyframe should I choose from the rolling list?


I want to develop a good intuition of concepts in Physics, and I've heard that the Feynman Lectures on Physics are very good for this. However, I've also heard that the Mathematics is very complicated. I was just wondering, just how much Math do I need to know? I love Physics, and I'm willing to put in the work. How much time do you guys reckon this will take? Thank you :)

The Feynman lectures are universally admired, it seems, but also a half-century old. Taking them as a source for self-study, what compensation for their age, if any, should today's reader undertake?  I'm interested both in pointers to particular topics where the physics itself is out-of-date, or topics where the pedagogical approach now admits attestable improvements.


I have created a room in an arch viz project.  It has no windows.  Currently I'm using a studio light HDRI setup for lighting.   I'm rendering out what I will call backplates and then separately rendering out some animations of forground characters and objects, and then compositing them together with the backplate.  Here is my problem.   One of the objects I am rendering separately is all chrome, so it is now reflecting only the studio lights of the current HDRI. But I need it to reflect my actual room.  So I would like to create a quick and dirty HDRI equiangular map of my actual room.  -The backplate renders is 1280 x 720px. -I am using Cycles  Can anyone provide me a detailed workflow on how to properly create my HDRI map within Blender? Please also tell me what size it should be.

Is there a way to create an HDR map from a rendered scene in blender?  I'm asking because I'm working to optimize an indoor scene that will be used multiple times for rendering scenes in a comic, and it has open windows which look out to a cityscape.  I would like to cut the cityscape out and replace it with an HDR version of it, so that it doesn't have to calculate as many bounces and (by extension) renders faster.


Here is log.  W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ppa.launchpad.net trusty Release: The following signatures were invalid: BADSIG D530E028F59EAE4D Launchpad PPA for NoobsLab W: Failed to fetch ppa.launchpad.net/noobslab/apps/ubuntu/dists/trusty/Release   W: Failed to fetch us.archive.ubuntu.com/ubuntu/dists/precise-updates/main/source/Sources  Hash Sum mismatch W: Failed to fetch ppa.launchpad.net/noobslab/apps-dependencies/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found W: Failed to fetch ppa.launchpad.net/noobslab/apps-dependencies/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found W: Some index files failed to download. They have been ignored, or old ones used instead.

PPA seems to be constantly offline. Whenever I use sudo apt-get update, this error is shown:  W: Failed to fetch http://ppa.launchpad.net/ 404  Not Found   How do I fix these errors?


So the rules of Monopoly state that you can't buy a house if there are no houses left for sale. You can't even pay all at once and buy a Hotel if there aren't enough houses to place 4 on the property first. But, what happens if you have a hotel in a property, all the houses are gone, and you want to (or are forced to) sell your hotel? I'm guessing that you are forced to go ahead and sell the hotel and all 4 houses at once?

Strictly following the rules of Monopoly will show that just because you have the cash to out-right buy hotels for your properties, you cannot if there are not enough houses in the bank to support an even build (ie, there are less than 12 in the bank for a 3 property street).  Likewise, when tearing-down hotels, there need to be an appropriate number of houses available to support the even tear-down (at least four houses to remove one hotel, and 8 more if you want to remove all of the improvements on a 3 property street).  What happens if you cannot tear-down your hotels because there are fewer than four houses in the bank (or fewer than 12 for the whole street)?   The scenario is not that far-fetched - a property group has been fully improved, some large rent is now due, and the player needs to recoup the sunk cost of their improvements to pay the rent due.  If they cannot tear-down the hotels, they cannot pay the rent. But property cannot be traded between players if improvements are on it.  What is the appropriate resolution to this case?


The iOS app crashes when I attempt to add a comment. There's a brief hesitation, then the app dies.  To clarify: this was not when responding to a deleted posted or deleted comment; it happens when I try to add a comment to an existing post, period. That said, it seems to be a problem with longer comment threads; I haven't had problems yet in cases where there are zero to a couple of comments.

The SE iOS app crashes when adding comments to certain posts.  It was discovered to be if the "Add an Answer" button was visible, not just responding to a deleted comment.  Edited to match answer. Previous steps were not the only use case, and this error keeps getting re-reported in different ways.


When someone say:     You can do something. You could do something. You may do something. You might do something.   It sounds like each of them can be expressing possibility or suggestion. I know there must be some differences between them. But what the differences exactly are?  Thank you!

The following parts are taken from PEU:1     122.2  common or typical      We often use can to say what is common or typical.            Scotland can be very warm in September.           Ann can really get on your nerves sometimes.          345.2 'general' possibility: can/could,  not may/might      We normally use can/could to say that things are possible in general:    people are able to do them, the situation makes them possible, or there is    nothing to stop them. May/might are not used in this way.            These roses can grow anywhere.  (NOT  ••• These roses may grow anywhere.)           Can gases freeze?  (NOT  ••• May gases freeze?)           In those days, everybody could find a job.  (NOT  ••• In those days, everybody might find a job.)          339.10  another use of may/might: typical occurrences      In scientific and academic language, may is  often used to talk about typical    occurrences - things that can happen in certain situations.            A female crocodile may lay 30-40 eggs.           The flowers may have five or six petals, pink or red in colour.           Children of divorced parents may have difficulty with relationships.          With this meaning, might can be used to talk about the past.            In those days, a man might be hanged for stealing a sheep.       These explanations made me puzzled. Since they can both relate to typical occurrences, is it possible to substitute can/could for may/might in PEU 339.10 if the context is not written in scientific and academic language?  1. PEU = Michael Swan's, Practical English Usage.


I purchased a big roast and accidentially left it out for 3+ hours from the refrigerator. It was still cool in the wrapped package. Is this okay or should I toss?

If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more?


I'm currently evaluating ML on some flight related data.  One of the feature in my dataset is an airport IATA code.  Upon the whole evaluation dataset this feature is what I call finite (all the values are known in advance) which is pretty nice for its encoding and for the training phase.  Example :  Currently know values ['JFK', 'ARN', 'CDG', 'ZRH'] Representation of CDG [-1,-1,1,-1]   Now once the model is trained and used with production data, some new airport codes might show up which will result in a new category which is unknown to the trained model and will be represented in my feature array as a new column.  What is the usual way to deal with those cases ? Should the whole model be retrained including the new value ?  Thanks for your help

I originally posted this in stackoverflow (as given ) but was told to try here since it might be more relevant here. I am very new to statistics and R in general so my question might be a bit dumb, but since I cannot find my solutions online I thought I should try ask it here.  I have a data frame dataset of a whole lot of different variables very similar to as follows:   Item | Size   | Value    | Town ---------------------------------- A     |  10    |   800   | 1 B     |  11    |   100   | 2 A     |  17    |   900   | 2 D     |  13    |   200   | 3 B     |  15    |   500   | 1 C     |  12    |   250   | 3 E     |  14    |    NA   | 2 A     |        |   800   | 1 C     |        |   800   | 2   Basically, I have to try and 'guess' the Size based on the type of Item, it's Value, and the Town it was sold in, so I think a regression method would be a good idea.  I now use a regression as follows:  lm(Size ~ factor(Item) + factor(Town) + Value,...)  The problem however, occurs when I try and predict the Size using this model. I have the following lines of code:  pmodel <- lm(Size ~ factor(Item) + factor(Town) + Value,...) prediction <- predict(pmodel, dataset2)   (where dataset2 is a subset of dataset which has all the empty "Size" values which I want to predict)  But this now comes up with the error:  Error in model.frame.default(Terms, newdata, na.action=na.action, xlev = object$xlevels): factor factor(Town) has new levels   Is there any way around this, or is there any way I can get the model to make prediction based on the other values if it encounters a 'level' which is not in the original dataset?


Let's say I traveled for 6 hours and 40 min. How should I write that?      6 hours and 40 min   or     6.40 hours   or     6.40 min   or     6h.40 min

I'm a bit confused in describing 1.5hrs in words.   Is writing one and a half an hour correct or should it be one and half hour?  E.g:     I'll see you there in one and a half an hour.     OR       I'll see you there in one and half hour.   Or is there any other correct way of writing this?


I have an /etc/apt/sources.list.d file with the line  deb https://download.01.org/gfx/ubuntu/16.04/main wily main #Intel Graphics drivers   Now, when I try to apt-get upgrade, I get a message saying:  W: GPG error: https://download.01.org/gfx/ubuntu/16.04/main wily InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 2CC2A1B90A3B3268   Why is the repository not signed? What can I do about it?

I'am getting this kind of message while updating my ubuntu 16.04 LTS:  W: http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg: Signature by key 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991 uses weak digest algorithm (SHA1) W: http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg: Signature by key 3B068FB4789ABE4AEFA3BB491397BC53640DB551 uses weak digest algorithm (SHA1)   Can anyone help me?


I need to mine a lot, and I mean A LOT of diamonds. What is the most efficient way to do so?

When I'm not exploring fresh caves or lands in minecraft, I'm busy trying to find deposits of diamond, gold and iron deep in the earth. So far I've just been digging around just above bedrock on a whim to look for these rare minerals but I've started thinking that I should be taking a more controlled, efficient approach to mining.  What is the optimal mining strategy that yields the most rare minerals while minimizing blocks removed and time spent digging and traveling?  Edit: The existing answers are great for mining, but no one has addressed travel time to and from the mine which is usually ~60 blocks downward and incredibly tedious. Solutions?


I tried to answer someone's question about a URL format with an example:  http://mysite.com/service.asmx?blah=something   I got an error saying I can't save an answer with http in it. How can I get around this?  Here is the question:

Why is  and  blocked from the post content on the main site? I tried to make a sample URL and I had to use  instead.


I am trying to select data from mySQL database, I execute the following code:     <?php $_SESSION["dog_park"] = $_GET['keyword'] ?>

<?php echo $_SESSION["dog_park"]; ?>

             Park Name	             Street	             Suburb	             Dog Park Area (m2)

     <?php          $result = $conn->prepare("SELECT * FROM dog_parks.items where suburb = '$_SESSION[dog_park]'");         $result->execute();         for($i=0; $row = $result->fetch(); $i++){     ?>
             <?php echo $row['Park_Name']; ?>	             <?php echo $row['Street']; ?>	             <?php echo $row['Suburb']; ?>	             <?php echo $row['Dog_Park_Area_(m2)']; ?>
         <?php } ?>

   When that script executes it displays the following error:   It has something to do with the session variable, if i enter a static value for    the mySQL query it will display table data correctly, but fail when the $_SESSION variable is present.

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?


I found a way to write an apex class that attaches my quote which is generated by an vf page as a pdf to my quote object.  Writing the test class is even a bigger problem for me. I get to 36% coverage and hop you guys can help me with it to get it working.  here's my class      public class quotePDFExtension {     ApexPages.StandardController controller;     public Quote quote {get;set;}     public PageReference rtn;     public quotePDFExtension(ApexPages.StandardController c){         quote = (Quote)c.getRecord();         rtn = c.view();     }     public PageReference attachQuotePDF() {         /* Get the page definition */         PageReference pdfPage = Page.angebot;         pdfPage.getParameters().put('id',quote.id);         /* generate the pdf blob */         Blob pdfBlob = pdfPage.getContent();         /* create the attachment against the offer */         Attachment a = new Attachment(parentId = quote.id, name=quote.Angebot_Nr__c + '.pdf', body = pdfBlob);         /* insert the attachment */         insert a;         /* send the user back to the offer detail page */         return rtn;     }   }   and here is my test class      @isTest  public class attachQuoteTestClass  {  static testMethod void testMethod1()   {  Quote testQuote = new Quote(OpportunityId = '0061x00000AN92q', Gutachtennummer__c = '999195041551', Gutachten_Datum__c = Date.today(), Angebotsdatum__c = Date.today());  testQuote.Name='Test Quote record' ;  insert testQuote;  /*   Attachment attach = new Attachment();  attach.Name='Unit Test Attachment';   Blob bodyBlob = Blob.valueOf('Unit Test Attachment Body');  attach.body=bodyBlob;  attach.parentId = testQuote.Id;  insert attach;   List<Attachment> attachments=[select id, name from Attachment where parent.id=:testQuote.id];  System.assertEquals(1, attachments.size());   ApexPages.StandardController sc = new ApexPages.StandardController(testQuote);  quotePDFExtension ctr = new quotePDFExtension(sc); */   Test.StartTest();    ApexPages.StandardController sc = new ApexPages.StandardController(testQuote);   quotePDFExtension testQuotePlan = new quotePDFExtension(sc);    PageReference pageRef = Page.angebot;   pageRef.getParameters().put('id', String.valueOf(testQuote.Id));   Test.setCurrentPage(pageRef);    Blob b = blob.valueof('error');   Try { b = pageRef.getContent();}   Catch(Exception e)   {Attachment a = new Attachment(parentId = testQuote.id, name=testQuote.Angebot_Nr__c + '.pdf', body = b);   insert a;}   Test.StopTest();  } }   Thanks a lot Thomas

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How do I start writing my first unit test?  How do I unit test this code?  I need help writing this unit test.   Salesforce Stack Exchange looks for detailed, specific questions that the community can help you with, and can't write tests on your behalf. We feel that working with the resources below can help you get started, and we encourage you to make an attempt to write your test and return to SFSE with your specific questions when you encounter challenges you can't resolve.


I want to put (1) a box around 1 equation inside an align environment, and also (2) a box around all equations in align environment. I'm already using tcolorbox and would like to use that. I have tried boxing all equations with tcolorbox but the problem is that it goes page-wide which I don't like, and also leaves a visible margin above the first equation. I want to keep equation numbers out of the box as well. Any suggestions?  Edit: Thanks for pointing me to a solution. The problem, however, is that all the solutions use another math environment (either within tcolorbox or empheq package). I am using a very specialized align environment and hence have to have a box without tcolorbox or empheq equation style.  So I want a box around align equations without leaving \begin{align} and \end{align} environment.  Edit2: Here is the MWE code.  \documentclass{article}  \usepackage{amsmath}   \begin{document}  \begin{flalign}        \begin{gathered}          A \quad  \vphantom{\sum \limits _{n=0} ^{N-1}} \\          B \quad ~~ \vphantom{\sum \limits _{n=0} ^{N-1}}        \end{gathered}        &&        \begin{aligned}\label{equationAB}          A\: &= \sum \limits _{n=0} ^{N-1} a[n]\\          B &= \sum \limits _{n=0} ^{N-1} b[n]        \end{aligned}        &&      \end{flalign}  \end{document}

My minimum working example:  \documentclass{report}  \usepackage{amsmath}  \begin{document}  \begin{center} \boxed{K_{k+1}=P_ka_{k+1}^T(a_{k+1}P_ka_{k+1}^T+I_N)^{-1}} \end{center}  \end{document}   The result:    Now how can I number this equation?


Want to run Ubuntu from a bootable USB Flash drive, without having to select (or not) the Install Ubuntu option. How may I do that?

Is there any way to create a bootable Ubuntu USB flash drive from the terminal without using any third-party applications like , , ,  etc.  I tried to create a bootable Ubuntu flash drive with dd method,  sudo umount /dev/sdb sudo dd if=/path/to/ubuntu.iso of=/dev/sdb bs=1M   It creates files on the USB disk, but when I try to boot the USB disk it shows an Operating System Not Found error.


I'm just reviewing the questions I couldn't answer in an exam I gave for my Topology course, one of the questions asked me the following:  To give an example of two compact connected surfaces $S_1, S_2$, possibly with boundary, such that $S_1$ is not homeomorphic to $S_2$, but $S_1 \times [0,1]$ is homeomorphic to $S_2 \times [0,1]$.  I would be grateful if someone could give me an answer, or even an approach to this problem, because I'm drawing a complete blank

I'm trying to find two compact, nonhomeomorphic subsets of the plane, say $X$ and $Y$, such that $X \times [0,1]$ is homeomorphic to $Y \times [0,1]$. I can not think of how a homeomorphism arises when you product with the interval.


I am just curious, why are all the planets, rocks etc in motion? Would they fall into objects with larger gravity if they were not in motion? What is stopping the earth from falling into the sun or moon from falling into earth? Is motion the reason why air crafts can remain in air? what are the mechanics behind this? Or perhaps I am mixing up too many things?

The force of gravity is constantly being applied to an orbiting object.  And therefore the object is constantly accelerating.  Why doesn't gravity eventually "win" over the object's momentum, like a force such as friction eventually slows down a car that runs out of gas?  I understand (I think) how relativity explains it, but how does Newtonian mechanics explain it?


In Ubuntu 13.04 it was possible to disable the Caps Lock Key. It was also possible to make the key sequence Ctrl - Alt - Backspace to kill the X-server.  That was all done using System Settings -> Keyboard Layout -> Options.   Keyboard Layout in 13.04 is called Text Entry in 13.10. But the options are no longer available. Where have they gone?

In 13.04 or below I only needed to access the keyboard layout and then click on the Options button as seen in the image below:    In 13.10 the Options button is missing as seen in the following image:    So what is the new method to access any and all Keyboard Layout Options. In my case I wish to activate 3 of them, from killing X, to some custom keys.


Due to the advent of social networking and dating sites, it is now possible for almost anyone to find a potential mate. Therefore, there is not as much of a pressure based on physical characteristics or even intelligence anymore. Society does not present the same pressures as was historically present in nature to find food and avoid being killed by predators and potential mating rivals. Almost all alleles regardless of their characteristics are passed on to the next generation through someone or another and attractive traits are no longer chosen above deficient ones. The only exception often being conditions such as dwarfism, Down Syndrome or Parkinson's Disease where the recipients of disadvantageous alleles choose to remove themselves from the gene pool.  Therefore, does this mean that human evolution has been halted due to an absence of natural selection?  My question differs from "Has human medicine stopped humans evolving?" because my post focuses on societal and cultural changes as opposed to medical changes.

We can cure many diseases nowadays, and thus the natural selection is very limited. Plus, mankind spent the whole beginning of its existence in almost the same hostile environment, and that's where he evolved the most, whereas our environment is changing very quickly. So, can we say that mankind froze, if not stopped, its own evolution ?


I'm trying to made a graphical window to add entry to a database in javafx. No problem to display the 'add entry' window, however impossible to add the entry and then refresh my database. I get a NullPointerException on getPers and CreatePerson  I tried a lot of things to initialize these variables without success. How can I do that?  Here is my class 'addPers'  public class addPers {      @FXML     private TextField nameField;      @FXML     private TextField ageField;      @FXML     private Button Cancel;      @FXML     private Button CreatePerson;       private Stage dialogStage;     private Pers pers;      private boolean okClicked = false;     private MainApp mainApp;     private PersManager persManager;     private AnchorPane databaseLayout;     private Object databaseLayoutController;     private Object rootLayout;      @FXML     private void initialize() {     }       public void setDialogStage(Stage dialogStage) {         this.dialogStage = dialogStage;     }      public void setPers(Pers pers) {         this.pers = pers;          nameField.setText(pers.getName());         ageField.setText(Integer.toString(pers.getAge()));      }       @FXML     private void Cancel() {         dialogStage.close();     }      @FXML     public void CreatePerson(ActionEvent event) throws Exception{          // Check Form Validation;         Alert alert = new Alert(AlertType.ERROR);         alert.setTitle("Please input carefully");         alert.setHeaderText(null);          if(nameField.getText().equals("")){             alert.setContentText("no valid name");             alert.showAndWait();         }         else if(ageField.getText().equals("")){             alert.setContentText("no valid age");             alert.showAndWait();         }          else{              getPers();             // Display Dialogue;             alert.setAlertType(AlertType.INFORMATION);;             alert.setContentText("Person entry created successfully");             alert.showAndWait();         }              // Change scene;             Stage stage = (Stage) CreatePerson.getScene().getWindow();             Scene scene = CreatePerson.getScene();             FXMLLoader loader = new FXMLLoader(getClass().getResource("../views/Database.fxml"));             scene.setRoot(loader.load());             stage.setScene(scene);             stage.setTitle("alt database");             stage.show();          }          public ArrayList<Pers> getPers() throws SQLException {             ArrayList<Pers> ListPers = new ArrayList<Pers>();             String query = "name, age FROM PERSONS_DB ORDER BY name;";              try {                 ((MainApp) this.mainApp).getDatabase().connect();                 ResultSet rslt = ((MainApp) this.mainApp).getDatabase().getResultOf(query);                 while (rslt.next()) {                     ListPers.add(new Pers                            (rslt.getString("name"),                             rslt.getInt("age")                             ));                 }                 rslt.close();                 try {                     mainApp.showDatabaseDialog();                   FXMLLoader loader = new FXMLLoader();                   AnchorPane databaseEditDialog = (AnchorPane) loader.load();                  DatabaseEditController controller = loader.getController();                  Stage dialogStage = new Stage();                  dialogStage.setTitle("database");                  dialogStage.initModality(Modality.WINDOW_MODAL);                  Window primaryStage = null;                 dialogStage.initOwner(primaryStage);                  Parent page = null;                 Scene scene = new Scene(page);                  dialogStage.setScene(scene);                  dialogStage.show();               } catch (IOException e) {                  e.printStackTrace();              }         } finally {         }     return ListPers;          }          public void setMainApp(MainApp mainApp) {             this.mainApp = mainApp;          }  }

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?


My Epson WF-2540 continuously cycles on and off, it runs a scan check while on. I have no Google cloud services turned on, no firmware updates have been made. Wireless can't be shut off. I have uninstalled it from the PC and re-installed using USB instead of wireless.

When I press the power button on my Epson WorkForce WF-3520 printer, it starts up normally, but shuts down within 30 seconds. Ten seconds later, it starts itself and the stop/start cycle is repeated again and again. This has only started happening today (6th December 2016).


I'm interested in the case of cliff jumping. It is dangerous because if you are jumping from a height the water resistance will stop you like concrete. However, you mitigate this by jumping in a streamlined position, including pointed toes, locked knees, arms straight vertical, etc.  But I am curious that if you are going to be killed by hitting the bottom at a high speed, even if you survived the initial impact. For example, I hit the bottom of a 3.7-metre deep pool fast even I just walked into it at the edge of the pool. Let's assume the following dimension:   The jump is done vertically in the most streamlined way possible. The jumping man has a neutral buoyancy on the surface of water. The jumping man keeps the streamlined position even after entering the water, until the deceleration due to water resistance stops.   If the man jumps from x m height, how I can calculate   The terminal speed after entering water. How deep in water he will attain the terminal speed.

I am a platform diver. I am trying to figure out how deep in the water I go depending on which platform I dive from.  The platforms are 1m, 3m, 5m, 7.5m and 10m above the water surface.  By ignoring air resistance (we assume that I do not do any tricks) I can easily compute the energy that my 90 kg body has when it is hitting the water:  E = mgh = 0.5mv^2   My problem is to find the deceleration in water and thus how deep my feet will go into the water before coming to a halt. We can assume that I stand straight and fall straight down and have a height of 190cm.  How do I compute that?


I often see research papers reporting lower or upper bounds. :     Patients treated with the splint regained mobility significantly more quickly (p less than 0.001) and preferred the splint to the plaster cast. The range of dorsiflexion at the ankle improved more rapidly after treatment in the splint (p less than 0.001), and patients were able to return to normal activities sooner.   What are the advantages of doing so instead of reporting the actual value (rounded if necessary)?

For some tests in R, there is a lower limit on the  calculations of $2.22 \cdot 10^{-16}$. I'm not sure why it's this number, if there is a good reason for it or if it's just arbitrary. A lot of other stats packages just go to 0.0001, so this is a much higher level of precision. But I haven't seen too many papers reporting $p < 2.22\cdot 10^{-16}$ or $p = 2.22\cdot 10^{-16}$.   Is it a common/best practice to report this computed value or is it more typical to report something else (like p < 0.000000000000001)?


I know that in $ZFC$ the continuum hypothesis (CH) is equivalent to the statement: "a subset $A\subset\mathbb R$ is either finite, infinite countable or $A$ has the same cardinality of $\mathbb R$, i.e. $|A|=|\mathbb R|$". We can call this statement $CH(\mathbb R)$, but what's going on if we work in $ZF$? Clearly $CH\Rightarrow CH(\mathbb R)$, but does the other implication hold? What I want to know is if there is a model of $ZF$ in which $CH(\mathbb R)$ is true but $CH$ not.

Please correct me if I'm wrong but here is what I understand from the theory of cardinal numbers :  1) The definition of $\aleph_1$ makes sense even without choice as $\aleph_1$ is an ordinal number (whose construction doesnt depend on the axiom of choice) with some minimal property. With or without choice, there is no cardinal number $\mathfrak{a}$ such that $\aleph_0 < \mathfrak{a} < \aleph_1$.  2) In ZFC, all cardinal numbers are $\aleph$ and are comparable (by the trichotomic property of the ordinals). The continuum hypothesis states that $\aleph_1 = 2^{\aleph_0}$.  3) In ZF, $2^{\aleph_0}$ need not be an $\aleph$. However, I don't know if talking about  $2^{\aleph_0}$ in ZFC makes sense or not.  Does it make sense in ZF to define CH to be the statement that if a set is larger than the natural numbers, then it must contain a copy of the reals (up to a relabeling of the elements) no matter what the cardinality of the reals is ?


I'd like to have multi FTP accounts:   ftp.domain1.com  binding to port 21 ftp.domain2.com  binding to port 21  ftp.domain3.com  binding to port 21   IIS 7.5 always show "This ftp site cannot be started. Another ftp site may be using the same port"  Is it not possible to use the default port 21 for all ftp sites?   Thanks.

When using the ssh or ftp commands from the Bash shell, does the server that I am connecting to learn of the domain name used? I understand that the domain name is locally translated into an IP address via DNS. In HTTP, after that happens, the server is told the original domain name as well in order to serve the correct page, or to present the correct TLS cert (SNI).  host serverfault.com GET /   Does a similar phenomenon happen when connecting to ssh or ftp?  I ask because I am  trying to ssh into a server (GoDaddy webhosting) which expects a domain name, but is not letting me in when I try to connect via user@IPaddress as the DNS is not yet moved to the GoDaddy IP address.


I am rather new to Latex and I am using it to build my Resume. I encountered two problems: the first one concerns the dates that overflow in the margins, while the second one is I think an embedded comma after the Master that I don't know how to remove. Do you have any idea how can I fix these two problems? Code : \documentclass[11pt,a4paper,sans]{moderncv}         % modern themes \moderncvstyle{banking}                             % character encoding \usepackage[utf8]{inputenc}                         % adjust the page margins \usepackage[scale=0.94]{geometry} \usepackage{import} % personal data \name{John Doe}{} \phone[mobile]{123456789}                    \email{whatever@gmail.com}                                 \begin{document} \makecvtitle \section{Education}  \vspace{0pt}  \begin{itemize} \setlength\itemsep{3pt}  \item{\cventry{}{Master in Whatever}{Random University | \normalfont Random place}{\normalfont 09/2021 - 03/2023}{\textit{}}{}} \textbf{Coursework:} Random Courses   \vspace{4pt} \end{itemize} \end{document}

I try to adjust the right margin of a cventry for the ModernCV template to match with the overall right margin but it is always broader (see screenshot). I tried geometry package and minipage but both have not solved the problem. Here is example code: \documentclass[11pt,a4paper,sans]{moderncv}  \moderncvstyle{banking}  \moderncvcolor{black}  \usepackage[utf8]{inputenc}  \usepackage{enumitem}  \usepackage[official]{eurosym}   \name{David}{Doe} \usepackage[scale=0.9]{geometry} \begin{document} \section{Employment} \begin{itemize} \item{ \cventry{11/2019 - current}{Hello}{Hello}{Hello}{}{\vspace{0pt} \begin{itemize}[label=$\bullet$]  \item{XXX} \end{itemize}} }  \end{itemize}  \end{document}


Cauchy-Schwarz on real vector space: $| \langle u, v \rangle | = \| u \| \cdot \| v \| \iff u =\frac {\langle u, v \rangle} {\langle v, v \rangle} v$    Proving that $u =\frac {\langle u, v \rangle} {\langle v, v \rangle} v$ imply equality is easy by substitution of $u$.  However, I cannot prove that equality holds imply $u =\frac {\langle u, v \rangle} {\langle v, v \rangle} v$.  Can someone help me out ?

How many proofs of the Cauchy-Schwarz inequality are there? Is there some kind of reference that lists all of these proofs?


What happens if I add a infinite sheet of a perfect conductor in a constant applied magnetic field perpendicular to the surface? e.g. I have a sheet in the x-y plane and I apply $B_0 \hat{\mathbf{z}}$. What will the scalar potential become apart from the $-B_0 z$ term?

I am studying for my quals and came across an old question that reads like the following:      There are two regions in space separated by an infinite conducting plane. Region 1 has a magnetic dipole of moment $\vec{\mu}$ located a distance $d$ from the plane. What is the magnetic field $\vec{B}$ everywhere in region 1?   I know that for a perfect conductor (superconductor), the normal component of $\vec{B}$ is zero–although I don't exactly know why–but I don't know if that is the case when the problem involves a "conductor" (not explicitly a perfect conductor).  TL;DR: Can anybody give me some insight about the magnetic boundary conditions of a stationary magnetic field in the presence of a conductor?  Thanks!


I'm writing a test script that is supposed to cd from the current directory into a new one if that path is confirmed to exist and be a directory  serial_number = input("Enter serial number: ") directory = "/etc/bin/foo" if os.path.exists(directory) and os.path.isdir(directory):    #cd into directory?    subprocess.call(['cd ..' + directory])   My dilemma is that I don't know how to properly pass a variable into a subprocess command, or whether or not I should use call or Popen. When I try the above code, it comes back with an error saying that No such file or directory "cd ../etc/bin/". I need is to travel back one directory from the current directory so then I can enter /etc and read some files in there. Any advice?

cd is the shell command to change the working directory. How do I change the current working directory in Python?


I am using Regular expression in the validation while I am trying to match the string with giving pattern, the result is not as expected  Pattern: (?:[0-9])*21([a-zA-Z0-9-]{1,15})  Expected result: I do not want to capture the letters or number until it matches 21, which  means  Example: I have a string, In this string, I do not want to capture the number and letter which is before 21 i.e I don't want to capture Aabcde12345 and the expected result should be 345621822 But, the result what I am getting is just 822 because in the number 345621822 21 will reoccur and gives me the result 822 which is wrong   can someone please help me   Note: Also Please help me to update start over Question according to it `    const text = "Aabcde1234521345621822"; const regex = "(?:[0-9])*21([a-zA-Z0-9-]{1,15})"; const result = text.match(regex);  console.log(result);  // expected output: Array [""1234521345621822"", "345621822"]     `

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


My advisor helped me with my year-long research project. Should I list him as an author or under ”contributor” and do you have a link to a format for how I should do this?

I understand that in a lot of big-lab fields it is common for the principal investigator to append their name to a paper even if they did not write the paper, design the experiment, or collect data since they spend energy securing funding, and managing the whole lab. What about for small labs?  What are the requirements for a supervisor to be included as an author on a paper, as opposed to just appearing in the acknowledgements? If you are working on your own projects independently of your supervisor, but using funding provided by your supervisor (how does this change when the funding provides resources versus just your salary), are you suppose to add them as authors or just acknowledge the source of funding?


Why is light absorbed by black holes while it is massless as theory of gravitation works only for masses?

Light is clearly affected by gravity, just think about a black hole, but light supposedly has no mass and gravity only affects objects with mass.  On the other hand, if light does have mass then doesn't mass become infinitely larger the closer to the speed of light an object travels. So this would result in light have an infinite mass which is impossible.  Any explanations?


I can say "My bag contains an apple", using "contain" as a transitive verb that takes the container as its subject and the thing contained as its direct object.   My question is, is there a verb such that I could describe exactly the same situation by saying "An apple VERBS my bag"? This verb, if it exists, would take the thing contained as its subject and the container as its direct object.  I can think of several multi-word phrases to express this idea, for instance, "An apple is inside my bag", "An apple can be found within my bag", or, using the passive of "contain",  "An apple is contained by my bag". But no single verb.   The nearest I can think of is the verb "to fill". But "An apple fills my bag" implies both that there is no other item in the bag and there is no space left in the bag. I'm looking for a verb that does not imply anything about what else the bag may or not contain or about whether any empty space is left in the bag, just that the apple is in the bag.  I feel as if there is some obvious word on the tip of my tongue, but it just won't come to me!

Consider the simple phrase “This bottle contains a bee”, is there a single word that would fit the formulation of “This bee [someword] a bottle”?  This is for a taxonomy of edges in a graph where a node might mention another node and that mention can be classed as a particular type. For “contains” the mention could occur at either end of the edge (e.g. “France contains Paris”, or “Paris [someword] France”).  This is subtly different from equivalence establishing mentions where the edge classification means the same in both directions. For example: “France is Bacon” implies “Bacon is France” (as well as an ignorance of late 16th C history).  Some examples to work from:   This bottle contains the bee; The bee ____ this bottle. Europe contains France; France _____ Europe. France contains Paris; Paris _____ France. The forest contains the temple; the temple _____ the forest.


I have a members only website. I want to place a price tag for "Members Price" is that correct or Member Price. It refers to the price a member pays.

I’ve been looking over what has been posted regarding the use of ’s.   I used to be a Technical Writer (years ago). The title of one of our training documents was Users’ Guide.  Once, a coworker said every time he saw that title he expected users to start coming.    Never made any sense to me, but I have to admit that the majority of us didn't understand the use of s’ in place of ’s.  What is the difference?


I created a page implementing the hook_menu, and I want to apply a theme for only this specific page. I know that I need to use something like page--node--nodeid.tpl.php, my question is does a page created implementing the hook_menu() have the nodeid, and if the answer is yes, how can I figure it out ?

I'm trying to define a custom template file for a specific node, using the node ID. I read a lot of topics saying to create a node--X.tpl.php file in the templates folder.  That's what I did; unfortunately, even after flushing the theme cache many times, nothing changes.  Is there anything more I have to do?  I am using Drupal 7.


I tried to run a Java Applet in my new computer, but I need to install the Java runtime environment, the Terminal window says:    jan@ideapad-100-15IBY:~/Bureaublad$ java -jar pressin.jar   Het programma ‘java’ kan gevonden worden in de volgende pakketten:     * default-jre     * gcj-5-jre-headless     * openjdk-8-jre-headless     * gcj-4.8-jre-headless     * gcj-4.9-jre-headless     * openjdk-9-jre-headless    Probeer: sudo apt install <geselecteerd pakket>     My question is: which of these options should I use, what are the differences? And what is the meaning of "headless" ?

When running the --help switch, I got this.      andy7_~$ /usr/lib/libreoffice/program/swriter     javaldx: Could not find a Java Runtime Environment!     Please ensure that a JVM and the package libreoffice-java-common     is installed.   I did a search for jvm and java but Package manager has many picks with java in the name. What do I need?


I made a webpage "items.php" to which I added a hidden <p> element that has the contents of the URL GET parameter passed to the page. Then I made it so on document.ready I call a setup() function immediately. (This is in items.js which is added in a script tag at the bottom of items.php)  This setup function reads the contents of this hidden <p> element  and makes an ajax call and the data echoed in the php is added in the made container (<div>) of the page. (Requests to the databases are made and checkboxes are made based on this hidden <p> and other input data is generated as well).  Now here is the problem:  From a visual standpoint everything is on point (I made some color checkboxes of my own, div elements) ALMOST. My jQuery UI range sliders aren't there.  Also, events to the created markup I cannot catch in my items.js. I am supposed to have a toggle happen on a click on my colored checkboxes I created. Now, all this worked when data wasn't dynamically generated, but now it does not. I even added the listeners after the setup function like so, for example:  $(document).ready(function() {   setup();   $(".colorbox" ).click(function(){     $(this).children().toggle();   });     });   This is my javascript. I cannot get the custom event to trigger:  function setup() {     var determinant = $("#cat").text();     $.post('../phpdatabase/setup.php', {         categorija: determinant     }, function(data) {         $('#content').empty();         $('#content').append(data);     }); };    $(document).ready(function() {     setup();     $('body').on('click', '.colorbox', function() {         $(this).children().toggle();     });     $('body').on('myCustomEvent', '#slider-range2', function() {     alert("hye!");      });     $('body').trigger('myCustomEvent');  });   myCustomEvent isn't being triggered. Without the second argument, in the handler, it is triggered.

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


When I was running Windows 7 on my Lenovo machine there was a pre-installed Lenovo utility which would make it so that anyone trying to see what my webcam sees would instead see a still image of a camera with a cross over it. And thus preventing applications and hackers without root privileges from seeing out of my webcam. I say root privileges because root privileges were required in order to change the settings of the program in order to allow programs to actually use my webcam and get what it sees rather than the still image.  This was a very useful utility for privacy and security reasons, however on Ubuntu I have been unable to find a similar utility which has the ability to do the same. Is there such a utility or is there any way of achieving what I have described?  I am running Ubuntu GNOME 16.04 with GNOME 3.20.

I have an integrated webcam in my laptop. I know that it works and that ubuntu recognized it because at installation it asked if I wanted a photo taken for some kind of image associated with my account. When I look in system settings, I do not see any webcam in the hardware section. I would like to disable the webcam like you can do in Windows, but as I can't find it in my hardware section, how can I disable it? I cannot even unplug it as it is integrated into the monitor. Am I looking in the wrong place?? I am using 12.04


I work for a government utility company. Our maps are broken down into 500x500 square meter grids. We have scanned images (TIFF) of these maps that we need to overlay and digize. The maps and the scans are saved in different folders with corresponding map and scan being named for example 5049.dwg and 5049.Tiff respectively. In the past we have been Georeferencing in AutoCAD but we migrated to GIS for better accuracy. Each of these scans are the same size but have different coordinates as they are building blocks of a bigger map,  like a jigsaw of sorts. Is there a way to automate the batch Georeferencing of these scans using either python or model builder?. The question was marked a duplicate, in this case the coordinates of each image is different.

I have a few digital images that are not georeferenced. E.g.:  Img01.tif   Img02.tif   ... Img99.tif     On the other hand, I have a text file, which contains georeferencing information for these images. E.g., I have a file c:\tfws\list.txt which contains the following information:  Img01.tfw 0.25 0 0 - 0.25 456258,125 4569852,125   Img02.tfw 0.25 0 0 - 0.25 456586,125 4570001,125    Img03.tfw 0.25 0 0 - 0.25 456952,125 4570300,125   ... Img99.tfw 0.25 0 0 - 0.25 458412,125 4575123,125     I need to generate a TFW file for each image in the text file. E.g. create a file named C:\tfws\img??.tfw containing the following information:  0.25   0   0   -0.25   456258,125   4569852,125     Does anyone know of a tool able to generate these TFW files automatically?


So the other day i was debuging some code and the $_GET parameter names were send with dots like for example those:  ?user.name=test&user.age=20   When i wanted to use them i saw they were renamed with underscores like so  $_GET['user_name'] $_GET['user_age']   So my question is, why is this happening?

If I pass PHP variables with . in their names via $_GET PHP auto-replaces them with _ characters. For example:  <?php echo "url is ".$_SERVER['REQUEST_URI']."<p>"; echo "x.y is ".$_GET['x.y'].".<p>"; echo "x_y is ".$_GET['x_y'].".<p>";   ... outputs the following:  url is /SpShipTool/php/testGetUrl.php?x.y=a.b x.y is . x_y is a.b.   ... my question is this: is there any way I can get this to stop? Cannot for the life of me figure out what I've done to deserve this  PHP version I'm running with is 5.2.4-2ubuntu5.3.


Just out of curiosity, can this be done? For the euclidian topology.

Let $A \subset \mathbb{R}$ be a countable set.  It is easy to see that $A$ has Hausdorff dimension $\dim_H(A) = 0$.  Do there exist uncountable sets $A \subset \mathbb{R}$ with $\dim_H(A) = 0$?


I have a feeling no such uncountable set exists but have no idea how I could formulate a proof to show this. If such an uncountable set did exist I could try and use a form of the diagonalization method to show this, but haven't been able to find one so far... If someone could just start me off and give me an idea where to go with this question that would be great.

Can a countable set contain uncountably many infinite subsets such that the intersection of any two such distinct subsets is finite?


Ok so I'm building a photo frame designer. On it I want it so that when a pattern is clicked it fills the text with the pattern. I have achieved this using .addClass. Problem being that my .addClass stops my .css from working. Also I can't reclick it. To see what im talking about see   Here is my code      $("#pattern1").click (function() {         $('.text').addClass('background1');     });      $('#purple').click (function() {             $(".border").css("fill", "#a077a6");     });   Please don't ask for a js fiddle. Just use the website.

I have some HTML menus, which I show completely when a user clicks on the head of these menus. I would like to hide these elements when the user clicks outside the menus' area.  Is something like this possible with jQuery?  $("#menuscontainer").clickOutsideThisElement(function() {     // Hide the menus });


I am building a platform that will have a similar structure to Twitter and I am tirelessly looking for something that could replace the terms for connections between users.   On Twitter the terms "Follower" and "Following" are used to describe such relationships, however, those terms were established in the Twitter ecosystem and I feel like it might not immediately be clear to users what those terms refer to. Do you have any suggestions/synonyms for terms that convey the meaning of the aforementioned words ?   In Twitter's ecosystem the term "Following" describes a unidirectional relationship between user A and user B, where A is interested in events of user B, but not necessarily the other way around.   The term "Follower" describes the inverse relationship, where user B is interested in events by user A, and not necessarily vice versa.   Bonus question: Can you name a term that depicts a bi-directional relationship between user A and B, where both A and B are interested in each other's events ? (Bi-directional connection).   I tried to come up with terms that seem quite... obvious ... but they might not be semantically correct.   Followers: Connecters/Connected [users]  Following: Connectees (not an official english word)/Connected to  Bi-directional relationship: Connections  While very abstract, do you think these terms would convey the intended meaning ? I ask this because English is my second language and I cannot afford to gamble on those essential terms.

I'm developing a social network which has a feature similar to twitter's follow/following setup. At the moment I have the following (hehe) terminology on the site:  follower - someone who follows you followers - group of people who follow you  I'm also using following at the moment to describe a group of people you are following. However, this also has the meaning of a group people who follow you.  So what is the correct terminology for:   a group of people you follow on social media? a person you follow? and how can you refer to the photos uploaded by the group of people you follow?   The only thing I can find so far is 'who you follow' which is a bit wordy.


The game goes this way:  There are 6 players, numbered 1 to 6.  Player 1 starts the game, he rolls a die with six faces. If the result ($x$) of rolling the die is 1 then Player 1 wins. Else the player number $x$ starts his turn. The game goes on and the Player $x$ rolls the die, if the result ($y$) is equal to $x$ then Player $x$ win, else it's the turn of Player $y$. And so on.  What is the probability of the Player 1 to win?  Thanks.

There are 6 players numbered 1 to 6, 1 Player, Player 2, ..., Player 6.  Player 1 rolls a die , if he gets a 1 wins and the game ends, otherwise the die passes to the player whose number matches the number that presents the die and the player makes a second pitch, if is obtained the number of the player who has thrown, he wins and the game ends, otherwise the given passes to the player whose number matches the number rolled, the player rolls the die, if is obtained the number of the player who has thrown, he wins and the game ends, otherwise the die passes to the player whose number matches the number that presents the die in this third release, and so on.  Calculate the probability that player 1 wins.


set $ n, n \in \mathbb{N}$ and prove that   $\prod_{d/n} d = n^{\frac{\tau(n)}{2}}$  ¨I have tried this¨  If $n > 1$ then  $n = p_{1}^{\alpha_{1}}\cdot p_{2}^{\alpha_{2}}\cdots p_{k}^{\alpha_{k}}$  so   $n^{\frac{\tau(n)}{2}}=(p_{1}^{\alpha_{1}}\cdot p_{2}^{\alpha_{2}}\cdots p_{k}^{\alpha_{k}})^{\frac{(\alpha_{1}+1)\cdot(\alpha_{2}+1)\cdots(\alpha_{k}+1)}{2}}$  but i dont know how stablish a relation with $\prod_{d/n} d$

how to prove:   $$ \prod_{d|n} d= n^{\frac{\tau (n)}{2}}$$   $\prod_{d|n} d$ is product of all of distinct positive divisor of $n$,  $\tau (n)$ is number (count)of all of positive divisor of $n$


In Rails Models, I've seen what I'm assuming are called class methods defined either by   def methodName    #do something end   and   def self.methodName    #do something end   I can't seem to find anywhere that gives a description of the differences between these two, and when you should use one vs the other.   Also not sure if this is specific to Ruby, Rails or other languages as well.  Thanks

I've been coding in Ruby for sometime now, but I don't understand when to use:  def self.METHOD_NAME end   or just:  def METHOD_NAME end   In any Rails model. Is "self" a modifier like private in Java? When should I use it and when not?. Thanks a ton.


Prove that for odd $n > 1$ , $3^{n} + 1$ is not divisible by $n$.  There's a hint but I can't find any use for that.  hint: If $a$ and $b$ are coprime with $m$ and $a^{x} \equiv b^{x}$ (mod $m$) and $a^{y} \equiv b^{y}$ (mod $m$) then $a^{\gcd(x,y)} \equiv b^{\gcd(x,y)}$ (mod $m$).  I don't know if you can find any use for this but this is my thoughts : $3$ and $n-1$ are coprime with $n$ and $3^{n} \equiv (n-1)^{n} \equiv -1$ (mod $n$).

Prove: if $n\mid 7^n+6^n$ and $n>1$, then $13\mid n$  Let $p$ be the least prime number such that $p\mid n$.   And I want to show that $p=13$  Let $d$ be the least number such that: $14^d\equiv 0 \pmod {p}$  And by Fermat's little theorem I have: $14^{p-1}\equiv 0 \pmod{p}$  Here I'm stuck


How the expansion of the universe doesn't violate the principle of the conservation of energy?  If we would put a spring between two objects, the distance would get bigger between them, so would the potential of the spring. And with objects with mass, the same goes for the gravitational potential energy between them...  What am I missing here? Where does this energy come from?

In popular science books and articles, I keep running into the claim that the total energy of the Universe is zero, "because the positive energy of matter is cancelled out by the negative energy of the gravitational field".  But I can't find anything concrete to substantiate this claim. As a first check, I did a calculation to compute the gravitational potential energy of a sphere of uniform density of radius $R$ using Newton's Laws and threw in $E=mc^2$ for energy of the sphere, and it was by no means obvious that the answer is zero!  So, my questions:   What is the basis for the claim – does one require General Relativity, or can one get it from Newtonian gravity? What conditions do you require in the model, in order for this to work? Could someone please refer me to a good paper about this?


Far as I can tell eevee will always render any shape with a volumetric material applied as a cube or rectangle, as opposed to say a sphere or something a bit more complex. Is this a hard limitation? Or something that might change later.

So I was in the middle of making a ball-shaped smoke, but the volumetric effect didn't work following the basic shape. It remains cube in Eevee Blender 2.8; while in Cycle it works, but in Cycle it takes thousands of years for Render.


I need to look for &amount in a file but it throws error -   [1] 25950 amount: Command not found. Usage: grep [OPTION]... PATTERN [FILE]...   What is the right way to search for it?

Running a kornshell and trying to traverse a directory tree. Want to cd to a sub-directory named as follows:   -3ab_&_-3dc.img   My question is HOW do I need to escape the ampersand in this name? I've tried different combinations of double-quotes and backslashes without success.


Search resulted in two files of the same name, and same named folder, but they are physically two different folders & files.  One is shared, the other is private. I can only access the private file/folder by using search. Can't see/access it during regular traverse of the Google Drive folder (only access the shared one).

Assume someone shares a folder with me, he remains the owner of the folder. Then I put some (many) files into this folder, of which I am and remain the owner. Then that someone revokes my access to said folder.  Now, where can I access these files in a useful way? I know that I can still access the file from the "Quota" list, but only the large ones can be accessed in a useful way, the smaller ones are somewhere much further down and mixed into all other files.


If we are installing Ubuntu by flash drive can we generate the flashdrive with poweriso in another laptop?

This is the third time I've tried to install Ubuntu Server 14.04.03 64-bit on the same laptop, and each time it caused different problems.  Each time I wrote the same iso image to a USB flash drive by using a different application and OS.   Universal USB Installer (pendrivelinux.com) from Windows WinImage writer from Windows built-in image writer from Linux Mint 17.2    The iso image is the same in all three cases, the USB flash drive is the same, and the laptop is the same. However each time the installation of Ubuntu gave me different installation options. For example, the last time I installed Ubuntu, it didn't show all the packages to choose while installing (Basic Ubuntu server, etc.).


Similar to , I am trying to match a string with *two optional values, both of with are surrounded by parentheses and are of unknown length. Examples of the string in question are: 4 4(2(3)) 4(2(3)(1)) 4(2(3)(1))(6(5)) 1(2(3(4(5(6(7(8))))))) -4(2(3)(1))(6(5))  There is always a digit that may be negative, and at most 2 items in parenthesis. I would like to capture them in groups, so for the last item, the groups would be: group 1: -4  group 2: 2(3)(1)  group 3: 6(5)   Adding another optional group to the regex seems to break down: (-?\d+)(?:\((.*)?\))?(?:\((.*)?\))?     ^        ^             ^    group 1  group 2     group 3

I need a regular expression to select all the text between two outer brackets.  Example: some text(text here(possible text)text(possible text(more text)))end text  Result: (text here(possible text)text(possible text(more text)))


Read this novel years ago. Starts off with a one manned space flight to another solar system to do the final testing of a wormhole generator. The test was one way trip. The humans did not realize aliens lived in the system and the test wiped them out. As they died they sent a psychic message out to universe telling all aliens the humans had killed them.  Earth was dying from ecological disaster and they built ships and as they left the solar system they wiped out this system. I remember that the rest of book deals with generations of humans trying to find habitable worlds and colonizing them. But every time they grew large enough to be noticed by aliens they would be wiped out. I remember that a lot of the rituals in the training of humans in space was done through song. And every few years the humans would have an enclave and the ships would all join together in space to share. Any ideas as to title. Thank you.

I remember reading this book years ago, but I'm unable to remember the title. I'm hoping someone else has read it and remembers the title. Here is a quick synopsis from what I remember:  Humans, while testing their first FTL drive, travel to the closest star and destroy it. However, there was an unknown, inhabited world around the star. The world was populated by telepaths; when the telepaths realized what was going on, they 'screamed' out into the universe with their last dying breath, asking all the other telepathic aliens to kill these other aliens (humans) in revenge. It tells the story through generational gaps, as humans attempt to survive the ensuing genocide committed against them.  If anyone could give me the title for this book, I would love to re-read it!


I am almost dead trying to sort this out.. Can someone help... please?  Below is the code:  import java.io.*; import java.lang.Runtime; import java.util.*;  public class WORKBRO {        public static void main(String args[])     {         try         {                 String target = new String("/home/dhirendra.panwar/Desktop/test.sh");             Runtime rt = Runtime.getRuntime();             Process proc = rt.exec(target);          } catch (Throwable t)         {             t.printStackTrace();         }     } }

It is quite simple to run a Unix command from Java.   Runtime.getRuntime().exec(myCommand);   But is it possible to run a Unix shell script from Java code? If yes, would it be a good practice to run a shell script from within Java code?