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
| // I don't know it makes any sense at all, it's just a random rant in code. | |
| import org.slf4j.Logger; | |
| import java.util.Arrays; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Executors; | |
| import java.util.function.BiConsumer; | |
| import java.util.function.Supplier; | |
| class FunctionalLogger { |
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
| Cache<String, Integer> cache = getCache(CACHE_ID); // wrapper around Hazelcast Map | |
| cache.put("one", 1); | |
| cache.put("two", 2); | |
| cache.put("three", 3); | |
| Map<String, Integer> map = cache.asMap(); // map representation of cache | |
| assertThat(map).hasSize(3).containsOnly( | |
| entry("one", 1), | |
| entry("two", 2), |
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
| I am using Cassandra since few years now and I went into few troubles till now which simply | |
| pushed me away from even trying to become part of "open source" Cassandra community. | |
| Since I worked with Apache projects ealier on I was looking forward to modernize way how | |
| cassandra was built. Project uses ant script and it's not problem that it was not modern | |
| enough, but it simply caused some troubles which hit me. I invested fair amount of time | |
| in collecting project dependencies and separating source roots (server/client etc), but | |
| project team simply refused this direction. Whole discussion started here: | |
| http://mail-archives.apache.org/mod_mbox/cassandra-dev/201503.mbox/%3C287F5EBC-3C2E-44FE-B652-D0A267646ABF@code-house.org%3E | |
| People who worked on project were rather defensing any changes in this area despite of |
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
| @Override | |
| public void bridgeHandlerInitialized(ThingHandler thingHandler, Bridge bridge) { | |
| if (thingHandler instanceof BacNetBridgeHandler) { | |
| this.client = ((BacNetBridgeHandler) thingHandler).getClient(); | |
| BacNetDeviceConfiguration configuration = getConfigAs(BacNetDeviceConfiguration.class); | |
| // hardcode network number temporary to 0 | |
| this.device = new Device(configuration.id, configuration.ip, configuration.port, 0); | |
| final List<Property> deviceProperties = client.getDeviceProperties(device); |
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
| final PipedInputStream stream = new PipedInputStream(); | |
| final Process start = Runtime.getRuntime().exec(this.command); | |
| new Thread(new Runnable() { | |
| @Override | |
| public void run() { | |
| try { | |
| InputStream inputStream = start.getInputStream(); | |
| PipedOutputStream output = new PipedOutputStream(stream); | |
| IOUtils.copy(inputStream, output); |
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
| [[inputs.win_perf_counters]] | |
| [[inputs.win_perf_counters.object]] | |
| ObjectName = "Processor" | |
| Instances = ["*"] | |
| Counters = ["% Idle Time", "% Interrupt Time", "% Privileged Time", "% User Time", "% Processor Time"] | |
| Measurement = "win_cpu" | |
| [[inputs.win_perf_counters.object]] | |
| ObjectName = "PhysicalDisk" | |
| Instances = ["*"] |
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 com.serotonin.bacnet4j.event.DeviceEventAdapter; | |
| import com.serotonin.bacnet4j.exception.BACnetException; | |
| import com.serotonin.bacnet4j.exception.ErrorAPDUException; | |
| import com.serotonin.bacnet4j.npdu.ip.IpNetwork; | |
| import com.serotonin.bacnet4j.service.acknowledgement.ReadPropertyAck; | |
| import com.serotonin.bacnet4j.service.acknowledgement.ReadPropertyMultipleAck; | |
| import com.serotonin.bacnet4j.service.confirmed.*; | |
| import com.serotonin.bacnet4j.service.unconfirmed.WhoIsRequest; | |
| import com.serotonin.bacnet4j.transport.DefaultTransport; |
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
| Counter failCounter = new Counter(); | |
| Counter successCounter = new Counter(); | |
| Timer timer = new Timer(); | |
| @Override | |
| public Y transform(X x) { | |
| Timer.Context time = timer.time(); | |
| try { | |
| Y transform = delegate.transform(x); |
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.hamcrest.Description; | |
| import org.mockito.ArgumentMatcher; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| import java.util.Map.Entry; | |
| public class MapMatcher extends ArgumentMatcher<Map> { |
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"?> | |
| <!-- | |
| Licensed to the Austrian Association for Software Tool Integration (AASTI) | |
| under one or more contributor license agreements. See the NOTICE file | |
| distributed with this work for additional information regarding copyright | |
| ownership. The AASTI licenses this file to you under the Apache License, | |
| Version 2.0 (the "License"); you may not use this file except in compliance | |
| with the License. You may obtain a copy of the License at |