Skip to content

Instantly share code, notes, and snippets.

@szymonk92
szymonk92 / ExportToPowerPoint
Last active May 11, 2021 08:22
insert image to PPTX
final XSLFSlide graphSlide = slideShow.createSlide(layoutMap.get(graphLayout).get(0));
PictureData.PictureType graphpictype = PictureData.PictureType.PNG;
XSLFPictureData graphidx = null;
try {
final byte[] graphPictureData;
try (InputStream is = new FileInputStream(graphpict)) {
graphPictureData = IOUtils.toByteArray(is);
}
graphidx = slideShow.addPicture(graphPictureData, graphpictype);
} catch (Exception e) {
[DEBUG] Configuring mojo org.wildfly.plugins:wildfly-maven-plugin:2.0.1.Final:execute-commands from plugin realm ClassRealm[plugin>org.wildfly.plugins:wildfly-maven-plugin:2.0.1.Final, parent: sun.misc.Launcher$AppClassLoader@18b4aac2]
[DEBUG] Configuring mojo 'org.wildfly.plugins:wildfly-maven-plugin:2.0.1.Final:execute-commands' with basic configurator -->
[DEBUG] (f) batch = false
[DEBUG] (f) buildDir = ...\xp-distribution\target
[DEBUG] (f) commands = [embed-server, module add --name=org.postgresql
--dependencies=javax.api,javax.transaction.api
--resources=...\target\lib\postgresql-42.2.6.jar, /subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgresql", driver-class-name="org.postgresql.Driver"), data-source add
--name=xpDS
--driver-name=postgres
--connection-url=jdbc:postgresql://localhost:5432/xp_test
WITH lvl1 AS
(SELECT dir_id , 1 AS Lvl
FROM t_directory AS tart1
WHERE tart1.parentDirectory = 201
)
,
lvl2 AS
(
SELECT dir_id, 2 AS Lvl
FROM t_directory AS tart2
WITH RECURSIVE ancestors(id, name) AS (
SELECT entity.id, entity.name
FROM t_directory as entity
WHERE entity.parentDirectory = '201'
UNION ALL
SELECT next.id, next.name
FROM t_directory as next, ancestors
WHERE next.parentDirectory = ancestors.id
)
SELECT * FROM ancestors
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.prop.prop.server.AaaCase
Scanning for needed Thorntail fractions with mode: when_missing
Detected fractions: cdi:2.3.0.Final, ejb-remote:2.3.0.Final, jpa:2.3.0.Final
Adding fractions: bean-validation:2.3.0.Final, cdi-config:2.3.0.Final, cdi:2.3.0.Final, ejb-remote:2.3.0.Final, infinispan:2.3.0.Final, jpa:2.3.0.Final, messaging:2.3.0.Final, remoting:2.3.0.Final, undertow:2.3.0.Final
Resolving 0 out of 733 artifacts
Thu Jan 31 13:42:19 CET 2019 INFO [org.wildfly.swarm.bootstrap] (main) Dependencies not bundled; resolving from M2REPO.
2019-01-31 13:43:16,845 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: Datasources - STABLE io.thorntail:datasources:2.3.0.Final
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.prop.prop.server.AaaCase
Scanning for needed Thorntail fractions with mode: when_missing
Detected fractions: cdi:2.3.0.Final, ejb-remote:2.3.0.Final, jpa:2.3.0.Final
Adding fractions: bean-validation:2.3.0.Final, cdi-config:2.3.0.Final, cdi:2.3.0.Final, ejb-remote:2.3.0.Final, infinispan:2.3.0.Final, jpa:2.3.0.Final, messaging:2.3.0.Final, remoting:2.3.0.Final, undertow:2.3.0.Final
Resolving 0 out of 733 artifacts
Fri Jan 25 22:50:51 CET 2019 INFO [org.wildfly.swarm.bootstrap] (main) Dependencies not bundled; resolving from M2REPO.
2019-01-25 22:51:20,864 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: Datasources - STABLE io.thorntail:datasources:2.3.0.Final
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.prop.xp.server.AaaCase
Scanning for needed Thorntail fractions with mode: when_missing
Detected fractions: cdi:2.3.0.Final, undertow:2.3.0.Final
Adding fractions: bean-validation:2.3.0.Final, cdi-config:2.3.0.Final, cdi:2.3.0.Final, io:2.3.0.Final, request-controller:2.3.0.Final, undertow:2.3.0.Final
Resolving 0 out of 705 artifacts
Fri Jan 25 22:41:46 CET 2019 INFO [org.wildfly.swarm.bootstrap] (main) Dependencies not bundled; resolving from M2REPO.
2019-01-25 22:42:04,588 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: Datasources - STABLE io.thorntail:datasources:2.3.0.Final
$documents_path = '.'
$word_app = New-Object -ComObject Word.Application
# This filter will find .doc as well as .docx documents
Get-ChildItem -Path $documents_path -Filter *.doc? | ForEach-Object {
$document = $word_app.Documents.Open($_.FullName)
$pdf_filename = "$($_.DirectoryName)\$($_.BaseName).pdf"
X, X_test, y, y_test = get_data()
batch_size = 32
num_classes = 2
epochs = 400
data_augmentation = False
# Convert class vectors to binary class matrices.
y_train = keras.utils.to_categorical(y, num_classes)
y_test = keras.utils.to_categorical(y_test, num_classes)
# VGG16
modelVGG = Sequential([
Conv2D(64, (3, 3), activation='relu', padding='same', name='block1_conv1', input_shape=X[1, :].shape),
Conv2D(64, (3, 3), activation='relu', padding='same', name='block1_conv2'),
MaxPooling2D((2, 2), strides=(2, 2), name='block1_pool'),
Conv2D(128, (3, 3), activation='relu', padding='same', name='block2_conv1'),
Conv2D(128, (3, 3), activation='relu', padding='same', name='block2_conv2'),
MaxPooling2D((2, 2), strides=(2, 2), name='block2_pool'),