I'm using a method getTableContent that fetch some values from the db and returns as String array. The methods goes as follows,   public static String[][] getTableContent(Connection con){      ResultSet rs = null;     Statement st = null;             String [][] data = null;      String sql = "select COF_NAME, SUP_ID, PRICE, SALES, TOTAL from COFFEES";      try {          st = myConn.createStatement();         rs =  st.executeQuery(sql);          if(rs.last()){              data = new String[rs.getRow()][5];             rs.beforeFirst();         }          int count =0;          while ( rs != null &amp;&amp; rs.next() ){              data[count][0] =rs.getString(1);             data[count][1] =rs.getString(2);             data[count][2] =rs.getString(3);             data[count][3] =rs.getString(4);             data[count][4] =rs.getString(5);           }     }       catch (SQLException e) {          e.printStackTrace();     }      return data;         }   I get the table values in another array and trying to print as following,   String [][] myData =  getTableContent(conn);      for ( int i =0; i &lt; myData.length; i++ ){          for (  int j =0; j &lt; myData.length; j++ ){              System.out.print( (myData[j]) + " ");         }          System.out.println();     }   All I'm getting some machine values provided below as sample ,      [Ljava.lang.String;@314e4baf [Ljava.lang.String;@4cb71983    I used myData[j]).toString() but that doesn't help me. How can I improve the code ? There are no error in the program.
In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]
Flex: Database driven DataGrid: arrows disappearing Why "grand theft auto", not "grand auto theft"? There is a video game series called "Grand Theft Auto".  According to its :     The name of the series references the term used in the US for motor   vehicle theft.      [...]      Motor vehicle theft or, grand theft auto, is the criminal act of   stealing or attempting to steal a car (or any other motor vehicle).   I always wondered why this term sounds so strange.   Shouldn't it be "grand auto theft" or maybe "grand theft of auto" instead? Are there any other terms with strange words order and/or missing prepositions like this? Fermi's golden rule and infinite probablity? I am slightly confused about the application of . Which during standard derivations indicates a probability of transitioning from the state $|i \rangle$ to the state $|f\rangle$ of: $$P=\frac{2\pi t}{\hbar^2} | \langle f | \hat V | i \rangle|^2 \delta(E_f-E_i-\hbar \omega)$$ This holds for large values of $t$ but for arbitrarily large values of $t$: $$P&gt;1$$ Which (to me anyway) makes no physical sense since there can't be a probability greater then 1 of been in the final state. If my interpretation is right then how is this problem resolved/allowable? and if it is wrong what part of what I have said is wrong? Synchronizing on String objects in Java I have a large array in C (not C++ if that makes a difference). I want to initialize all members of the same value.  I could swear I once knew a simple way to do this. I could use memset() in my case, but isn't there a way to do this that is built right into the C syntax? What is the best way of defining white noise process so it is intuitive and easy to understand? Where did the "play on realms" option go? My Minecraft app now only has the option of "play" and there is no "play on realms" to be found!  I downloaded - and paid for - the multiplayer app, but there doesn't seem to be a way to get to any realms on that app either. $6^{(n+2)} + 7^{(2n+1)}$ is divisible by $43$ for $n \ge 1$ Purchasing a Switch - AC vs DC Current Specifications? I'm trying to purchase several switches for a DC system with moderately low current (a few amps at 12V). When browsing for switches in parts catalogs (e.g.  and ) there are always separate voltage ratings for AC and DC applications. I understand that AC switches are less expensive because the switching time does not need to be as fast and arcing is less of a concern. There is only one current rating listed and I am not sure if it applies to AC switching, DC switching, or both.  Does this current rating apply to both the rated AC and DC voltages? Is there a good rule-of-thumb for converting between AC and DC voltage/current ratings? What is the highest current I could reasonably expect from a DC switch before moving to a relay? In how many ways can a number be expressed as a sum of consecutive numbers? possessive apostrophe for two things or persons What is the difference between the two sentences below? Are they the same or different in meaning?     Jack and Laura's new house is almost ready.      Jack's and Laura's new house is almost ready.   To my perception, the first says two of them have one house and the second says each one has a (different) house (which is almost ready). Is my perception correct?  EDIT: If I don't use "houses" instead of "house" (for my second interpretation), does it mean the sentence is wrong? A particular big Delta I would like to insert the below mathematical symbol, it looks like a big Delta but different. Is there command to obtain a similar shape? I met a guy on a sugar daddy dating site and we talked, I told him my situation and he said he would help.   He asked for my bank account information and I told him you can use cash app or PayPal to go through. He said his account manager deals with his finances. So I set up an account with a bank that I don’t use so that my primary account isn’t used.  Eventually he was in the process of sending me money and we had agreed on a amount that wasn't crazy. But then he asked for my address and I asked why and he said just wondering. Then said he wanted to send me a surprise for being his baby. Which I didn’t give.  Then later on he sent the money and said he sent me a bonus and that I was supposed to use that to pay his mothers caregiver, which he didn’t mention until after.  I kept questioning him and he was saying that he works in construction and he’s trusting me to carry out the errand. Then he said don’t let him down and I asked him if he was threatening me and he kept saying I need this done but didn’t really answer my question.  Am I being scammed? I’m about to change my password but is this a scam? Calculating the Fourier transform of $f(t)=Ae^{-i\omega_0 t}$ I am trying to calculate the Fourier transform of $f(t)=Ae^{-i\omega_0 t}$  I'm getting an infinity which is giving me problems. Here are my steps:  $$F(\omega)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty f(t)e^{i\omega t}dt$$ $$=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^\infty Ae^{-i\omega_0 t}e^{i\omega t}dt$$  $$=\frac{A}{\sqrt{2\pi}}\int_{-\infty}^\infty e^{t(i\omega - i\omega_0)}dt$$ $$=\frac{A}{\sqrt{2\pi}(i\omega - i\omega_0)} |e^{t(i\omega - i\omega_0)}|_{-\infty}^{\infty}$$ $$=\frac{A}{\sqrt{2\pi}(i\omega - i\omega_0)}(\infty - 0)$$  Where am I going wrong? Thanks. Is black a color or absence of color? How do I loop through a MySQL query via PDO in PHP? I'm slowly moving all of my LAMP websites from mysql_ functions to PDO functions and I've hit my first brick wall.  I don't know how to loop through results with a parameter.  I am fine with the following:  foreach ($database-&gt;query("SELECT * FROM widgets") as $results) {    echo $results["widget_name"]; }   However if I want to do something like this:  foreach ($database-&gt;query("SELECT * FROM widgets WHERE something='something else'") as $results) {    echo $results["widget_name"]; }   Obviously the 'something else' will be dynamic. I have a dozen or so image files on my iMac's desktop.  Most of the time, after booting up my computer, it displays a thumbnail of each image (as it should).  But sometimes, the thumbnails won't show up (see screenshot below).    It appears to happen randomly.  I estimate that it happens about 20% of the time.  Why is this, and how can I prevent it from happening?  I am running OS X 10.9.4.  Thanks. Is selenium webdriver capable of database testing? After reading so many answers and forums it makes me confused. Some people say: Selenium webdriver is a browser automation tool and it has nothing to do with the database. And some other showing JARs and code that how we can connect selenium to the database and we can test database using selenium webdriver. So I would really like to know if we can do database testing using selenium? If yes then which databases tool it supports like Mysql, SQL server, Oracle... And if selenium is not suitable for database testing then please recommend to me the best tool for database testing. Trying to keep track of the updates to all the great, user-developed add-ons is fairly frustrating (at least for me). Is there currently a centralized resource where all these amazing add-ons are kept and updated in one location?  If there isn't such a resource, would it be possible to have blender query the collection of installed add-ins and then iterate through on-line references looking at version #'s for add-ins?  Since, as far as I know, it hasn't been done...I have to ask if there are any major flaws in the concept. Of course, in my dream scenario, there would be a "voting" front-end that would allow users to see what the most popular and useful add-ons are and where you don't have to read pages (and pages) of threads. Sole minimal element: Why not also the minimum? A minimal element (any number thereof) of a partially ordered set $S$ is an element that is not greater than any other element in $S$.  The minimum (at most one) of a partially ordered set $S$ is an element that is less than or equal to any other element of $S$.    Let's consider the power set $\mathcal P (\{x,y,z\})$ together with the binary relation $\subseteq$.  The Hasse diagram shows what element(s) we're looking for:    It's easy to see that:   $\emptyset$ is a minimal element $\emptyset$ is the minimum   Now if we remove $\emptyset$ and consider $\mathcal P (\{x,y,z\})\setminus \emptyset$ instead, we get the following:   $\{x\}$, $\{y\}$ and $\{z\}$ are minimal elements there is no minimum   (1) We know that a minimum is unique and it is always the only minimal element.  (2) And from the example above, it seems that, if a sole minimal element exists, it is always the minimum.  But I read that (2) is false. Why?