This file contains hidden or 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
int SafeDivision(int x, int y) | |
{ | |
try | |
{ | |
return (x / y); | |
} | |
catch (System.DivideByZeroException dbz) | |
{ | |
System.Console.WriteLine("Division by zero attempted!"); | |
return 0; |
This file contains hidden or 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 org.apache.commons.httpclient.HttpClient; | |
... | |
File csvFile = new File (this.getClass().getResource("/data.csv").getFile()); | |
PostMethod filePost = new PostMethod("http://localhost:8080/api/admin/uploadUsers"); | |
Part[] parts = {new FilePart("users", csvFile)}; | |
filePost.setRequestEntity(new MultipartRequestEntity(parts, filePost.getParams())); | |
filePost.addRequestHeader("Authorization", "Bearer " + IntTestAuthUtil.computeAuthorisationToken()); | |
HttpClient client = new HttpClient(); | |
int status = client.executeMethod(filePost); |
This file contains hidden or 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
@Resource(mappedName="jdbc:/OracleDefaultDS") DataSource datasource; |
This file contains hidden or 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
batch | |
# this file is only meant as an example | |
# it is not commented out completeley! | |
# Add System Property (must be verified if it works) | |
# /system-property=foo:add(value=bar) | |
# Add Extension | |
# /extension=org.jboss.as.messaging:add |
This file contains hidden or 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
<head> | |
<link rel="apple-touch-icon-precomposed" href="bla.png"> | |
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="bla4.png"> | |
<link rel="apple-touch-startup-image" href="startup.png"> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> | |
... | |
</head> |
This file contains hidden or 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
package com.axa.ch.apc.util; | |
import static org.junit.Assert.assertEquals; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" | |
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd | |
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"> | |
<include file="db/testdaten.sql" /> |
This file contains hidden or 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
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<version>2.16</version> | |
<executions> | |
<execution> | |
<id>default-test</id> | |
<configuration> | |
<excludes> | |
<exclude>**/*Rest*</exclude> |
This file contains hidden or 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 static Katalog extractKatalog(Workbook excel) { | |
// System.out.println(excel.getNumberOfSheets()); | |
Sheet sheet = excel.getSheetAt(0); | |
Katalog katalog = new Katalog("der erste Katalog"); | |
for (Row zeile : sheet) { | |
Cell zelle = zeile.getCell(4); | |
This file contains hidden or 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
private static void marshallToFile(Katalog katalog, File jsonFile) throws JAXBException, PropertyException { | |
// Marshalling... | |
JAXBContext context = JAXBContext.newInstance(PoGeVoKatalog.class); | |
Marshaller m = context.createMarshaller(); | |
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); | |
m.setProperty(Marshaller.JAXB_ENCODING, "utf-8"); | |
m.setProperty(MarshallerProperties.MEDIA_TYPE, "application/json"); | |
m.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, true); |