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
################################################################################ | |
# | |
# tpm2-tss-engine | |
# | |
################################################################################ | |
TPM2_TSS_ENGINE_VERSION = 1.0.1 | |
TPM2_TSS_ENGINE_SOURCE = tpm2-tss-engine-$(TPM2_TSS_ENGINE_VERSION).tar.gz | |
TPM2_TSS_ENGINE_SITE = https://github.com/tpm2-software/tpm2-tss-engine/releases/download/v$(TPM2_TSS_ENGINE_VERSION) | |
TPM2_TSS_ENGINE_LICENSE = BSD-2-Clause |
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
package mc; | |
import com.hazelcast.client.HazelcastClient; | |
import com.hazelcast.core.HazelcastInstance; | |
import com.hazelcast.core.IMap; | |
import com.hazelcast.core.ITopic; | |
import java.util.UUID; | |
public class MCDemo { |
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
person=336 | |
going=313 | |
country=222 | |
great=168 | |
american=147 | |
job=111 | |
good=100 | |
america=95 | |
thing=93 | |
time=88 |
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
people=314 | |
going=313 | |
country=177 | |
great=168 | |
american=117 | |
good=99 | |
america=89 | |
time=75 | |
jobs=73 | |
united=66 |
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
Dictionary [ | |
ByteString{ historyId }=UInt{ 5060033 }, | |
ByteString{ id }=ByteString{ 14dc2de0074cc817 }, | |
ByteString{ internalDate }=UInt{ 1433493436000 }, | |
ByteString{ labelIds }=Sequence [ | |
ByteString{ INBOX }, | |
ByteString{ IMPORTANT }, | |
ByteString{ CATEGORY_FORUMS } | |
], | |
ByteString{ payload }=Dictionary [ |
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
Parser parser = Parser.newBuilder().build(); | |
// extracts id into mid, internalDate into date, payload/headers into headers, returns the new object | |
// Query query = "(mid: #{'id'}, date: #{'internalDate'}, headers: #{'payload'}{'headers'})"; | |
// alternative version to define it | |
Query query = parser.newQueryBuilder().asDictionary() | |
.putEntry("mid").stream(0).dictionary("id").endEntry() | |
.putEntry("date").stream(0).dictionary("internalDate").endEntry() | |
.putEntry("headers").stream(0).dictionary("payload").dictionary("headers").endEntry() |
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
java: | |
import io.vertx.core.*; | |
import io.vertx.core.http.*; | |
import io.vertx.core.shareddata.AsyncMap; | |
import io.vertx.core.spi.cluster.ClusterManager; | |
import io.vertx.spi.cluster.hazelcast.HazelcastClusterManager; | |
import java.util.Optional; | |
import java.util.function.Consumer; |
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
// Found this awesome way in Java code once and had | |
// the strong feeling I need to port it to Javascript | |
// for the sake of all NodeJS developers! | |
var EvenOrOdd = function() { | |
function EvenOrOdd() {} | |
EvenOrOdd.prototype.isEven = function(value) { | |
var even = "02468"; | |
var v = String(value); | |
var w = v.charAt(v.length - 1); | |
return even.indexOf(w) != -1; |
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
@Test | |
public void test_exception_flow_control() { | |
Calendar calendar = Calendar.getInstance(); | |
calendar.set(2003, 11, 13, 18, 30, 02); | |
calendar.setTimeZone(TimeZone.getTimeZone("UTC")); | |
calendar.set(Calendar.MILLISECOND, 250); | |
Instant expected = calendar.toInstant(); | |
ZoneId UTC = ZoneId.of("UTC"); | |
DateTimeFormatter fractionFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.US); |
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
StreamWriter streamWriter = StreamWriter.newBuilder().build(); | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
StreamGraphBuilder graphBuilder = streamWriter.newStreamGraphBuilder(Output.toOutputStream(baos)); | |
graphBuilder.putNumber(100).putNumber(101).putNumber(102).putNumber(103).putNumber(104).finishStream(); | |
Parser parser = Parser.newBuilder().build(); | |
Input input = Input.fromByteArray(baos.toByteArray()); | |
// Dictionary, inner dictionary, inner sequence |
NewerOlder