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.time.Duration; | |
import java.time.Instant; | |
import java.time.LocalTime; | |
import java.util.*; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.atomic.AtomicBoolean; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import java.util.stream.Collectors; |
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 asyncio | |
import sys | |
import time | |
import re | |
cmd_regexp = re.compile('^([a-zA-Z0-9_-]+?)(\\((.*)\\))?$') | |
async def read_command(loop): | |
line = await loop.run_in_executor(None, sys.stdin.readline) | |
line = line.rstrip() # remove new line | |
cmd = None |
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 activemq.publisher; | |
import java.io.File; | |
import java.util.Arrays; | |
import java.util.stream.Collectors; | |
import javax.jms.ConnectionFactory; | |
import org.apache.activemq.ActiveMQConnectionFactory; | |
import org.apache.camel.CamelContext; |
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
'use strict'; | |
var fs = require('fs'); | |
/** | |
* Limits the number of concurrent file handlers. | |
* Use it as a wrapper over fs.open() and fs.close(). | |
* Example: | |
* var fdQueue = new FileDescriptorQueue(8); | |
* fdQueue.open(path, flags, (err, fd) =>{ |
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.io.ByteArrayInputStream; | |
import java.io.IOException; | |
import java.nio.charset.Charset; | |
import javax.xml.soap.MessageFactory; | |
import javax.xml.soap.MimeHeaders; | |
import javax.xml.soap.SOAPConnection; | |
import javax.xml.soap.SOAPConnectionFactory; | |
import javax.xml.soap.SOAPException; |
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 javax.jws.WebService; | |
import javax.xml.ws.Endpoint; | |
// http://localhost:8080/helloService?wsdl | |
// Credits: http://hofmanndavid.blogspot.ro/2008/11/easiest-way-to-publish-java-web.html | |
@WebService(targetNamespace="namespace") | |
public class StandaloneHelloSoapService { | |
public String hello(String name) { | |
return "Hello " + name + " !"; | |
} |
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.Matcher; | |
import java.util.regex.Pattern; | |
/** | |
* Http header byte range decoder. | |
* According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35 | |
*/ | |
public class ParseHeaderByteRange { | |
public static void main(final String[] args) { |