This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servlet> | |
<servlet-name>Jersey</servlet-name> | |
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> | |
<init-param> | |
<param-name>com.sun.jersey.config.property.packages</param-name> | |
<param-value>com.vaporwarecorp.rest.server</param-value> | |
</init-param> | |
<load-on-startup>1</load-on-startup> | |
</servlet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ElementoQuimicoServicio | |
{ | |
private ElementoQuimicoDAO dao = new ElementoQuimicoDAO(); | |
public List<ElementoQuimico> encontrarTodos() | |
{ | |
return dao.encontrarTodos(); | |
} | |
public ElementoQuimico encontrarPorNumeroAtomico( @PathParam("id") int numeroAtomico ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Path("/elementos") | |
public class ElementoQuimicoServicio | |
{ | |
private ElementoQuimicoDAO dao = new ElementoQuimicoDAO(); | |
@GET | |
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) | |
public List<ElementoQuimico> encontrarTodos() | |
{ | |
return dao.encontrarTodos(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ElementoQuimico | |
{ | |
// ------------------------------ FIELDS ------------------------------ | |
private String nombre; | |
private int numeroAtomico; | |
private String simbolo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@XmlRootElement | |
public class ElementoQuimico | |
{ | |
// ------------------------------ FIELDS ------------------------------ | |
private String nombre; | |
private int numeroAtomico; | |
private String simbolo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ElementoQuimicoDAO | |
{ | |
// -------------------------- OTHER METHODS -------------------------- | |
public List<ElementoQuimico> encontrarTodos() | |
{ | |
List<ElementoQuimico> lista = new ArrayList<ElementoQuimico>(); | |
Connection c = null; | |
String sql = "SELECT * FROM elemento_quimicos ORDER BY numero_atomico"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class ThreadPoolExample | |
{ | |
// --------------------------- main() method --------------------------- | |
public static void main( String[] args ) | |
{ | |
final long start = System.currentTimeMillis(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.github.com/jreyes/5993810/raw/496a4991a528af1d56e9e984d5034cc8199f37fd/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
echo "*****************************************" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../google-map/google-map.html"> | |
<polymer-element name="my-element"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (BuildConfig.DEBUG) { | |
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() | |
.detectDiskReads() | |
.detectDiskWrites() | |
.detectAll() | |
.penaltyLog() | |
.build()); | |
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() | |
.detectLeakedSqlLiteObjects() | |
.detectLeakedClosableObjects() |
OlderNewer