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
<enrich> | |
<source type="inline" clone="true"/> | |
<target action="child" xpath="//jsonObject" /> | |
</enrich> | |
<enrich> | |
<source clone="true" xpath="//jsonObject" /> | |
<target type="body" /> | |
</enrich> | |
<log level="full"/> |
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
-Dlog4j.configurationFile="$CARBON_HOME/repository/conf/log4j2.xml" \ | |
-Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector \ |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Configuration> | |
<Appenders> | |
<Kafka name="Kafka" topic="WSO2APIMTOPIC"> | |
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n"/> | |
<Property name="bootstrap.servers">localhost:9092</Property> | |
</Kafka> | |
<Async name="Async" bufferSize="1054" blocking="false"> | |
<AppenderRef ref="Kafka"/> | |
</Async> |
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.regex.Pattern; | |
import java.util.regex.Matcher; | |
public class RegexBasedTest { | |
private static final Pattern PASSWORD_PATTERN = Pattern.compile("[a-zA-z0-9]{3}"); | |
private static final String uuid = "b02fb649-797b-440b-9aa9-f3294ed0ce73"; | |
public static void main(String[] args) { | |
for (int i = 0; i < Integer.MAX_VALUE; ++i) { | |
String masked = replaceChar(uuid); | |
} |
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
int pintarray[] = {1,2,3,4,5,6,7,8,9,10}; | |
int counter =0; | |
int timer=1000; | |
int sensorPin =A0; | |
void setup() { | |
counter=0; | |
pinMode(sensorPin,INPUT); | |
while(counter<10){ |
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
# Copyright 2018 Vanji | |
# | |
# Licensed 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 | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
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
<api xmlns="http://ws.apache.org/ns/synapse" name="TcpConnectionAsAPI" context="/tcp"> | |
<resource methods="POST GET" url-mapping="/connection"> | |
<inSequence> | |
<script language="groovy">def myValue='value';def socket = new Socket('localhost', 4444); myValue = socket.withStreams { input, output -> buffer = input.newReader().readLine(); return buffer;}; mc.setProperty('ValueInGroovyScript',myValue);</script> | |
<log> | |
<property name="Value from TCP Server" expression="$ctx:ValueInGroovyScript" /> | |
</log> | |
<script language="js">var resp = String(mc.getProperty("ValueInGroovyScript")).split(','); var payloadXML = new XML(<response/>); var resp = String(mc.getProperty("ValueInGroovyScript")).split(','); payloadXML.appendChild(new XML(<resp>{resp[0]}</resp>)); payloadXML.appendChild(new XML(<company>{resp[1]}</company>)); payloadXML.appendChild(new XML(<itemnbr>{resp[2]}</i |
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
# Copyright 2017 Vanji | |
# | |
# Licensed 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 | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
<sequence name="_auth_failure_handler_" xmlns="http://ws.apache.org/ns/synapse"> | |
<switch source="$trp:Accept"> | |
<case regex="application/json"> | |
<property name="error_message_type" value="application/json"/> | |
</case> | |
<default> | |
<property name="error_message_type" value="application/xml"/> | |
</default> | |
</switch> | |
<sequence key="_build_"/> |
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
Verifying that +vanjikumaran is my blockchain ID. https://onename.com/vanjikumaran |
NewerOlder