mvn -X archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId=com.hordine -DartifactId=hordineCmdTwitter
mvn eclipse:eclipse
mvn package
mvn clean install
mvn -X archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId=com.hordine -DartifactId=hordineCmdTwitter
mvn eclipse:eclipse
mvn package
mvn clean install
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class ShowActivity {
private final static String JSON_DATA =
"{"
+ " \"geodata\": ["
+ " {"
+ " \"id\": \"1\","
+ " \"name\": \"Julie Sherman\","
+ " \"gender\" : \"female\","
+ " \"latitude\" : \"37.33774833333334\","
+ " \"longitude\" : \"-121.88670166666667\""
+ " },"
+ " {"
+ " \"id\": \"2\","
+ " \"name\": \"Johnny Depp\","
+ " \"gender\" : \"male\","
+ " \"latitude\" : \"37.336453\","
+ " \"longitude\" : \"-121.884985\""
+ " }"
+ " ]"
+ "}";
public static void main(final String[] argv) throws JSONException {
final JSONObject obj = new JSONObject(JSON_DATA);
final JSONArray geodata = obj.getJSONArray("geodata");
final int n = geodata.length();
for (int i = 0; i < n; ++i) {
final JSONObject person = geodata.getJSONObject(i);
System.out.println(person.getInt("id"));
System.out.println(person.getString("name"));
System.out.println(person.getString("gender"));
System.out.println(person.getDouble("latitude"));
System.out.println(person.getDouble("longitude"));
}
}
}
Here's the output:C:\dev\scrap>java -cp json.jar;. ShowActivity
1
Julie Sherman
female
37.33774833333334
-121.88670166666667
2
Johnny Depp
male
37.336453
-121.884985
unzip file.zip
_blank
:<a href="#" target="_blank">Link</a>
Edit: for other examples, see here: http://www.w3schools.com/tags/att_a_target.aspblank
instead of _blank
because, if used, it'll open a new tab and then use the same tab if the
link is clicked again. However, this is only because, as GolezTrol
pointed out, it refers to the name a of a frame/window, which would be
set and used when the link is pressed again to open it in the same tab).com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 4,665,488 milliseconds ago.
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<property name="validationQuery" value="SELECT 1"/>
<property name="testOnBorrow" value="true"/>
</bean>
The above will test connections every time you borrow from the pool.Yesterday I got this error message during the last step of the MySQL Windows installer: “The security settings could not be applied to the database because the connection has failed with the following error”.
The issue can be solved issue this procedure from the MySQL website.
First, cancel the wizard and make sure that the MySQL service is stopped.
Then, create a text file using a SQL query that will reset the root password.
1 2 | UPDATE mysql.user SET Password=PASSWORD('admin') WHERE User='root'; FLUSH PRIVILEGES; |
Then, launch mySQL using the following command line:
1 | mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server 5.5\my.ini" --init-file="C:\mysql-init.txt" --console |
Note: it’s better to use the ”–console” option so that error messages are correctly displayed.
Finally, open a new DOS shell and execute the following command line to shutdown mySQL:
1 | mysqladmin -u root -p shutdown |
You can now restart the mySQL installer and choose the “Repair” option: