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 kafka.producer._ | |
import kafka.utils._ | |
import java.util._ | |
import java.text._ | |
import java.util.concurrent.atomic._ | |
class KafkaPartitioner(props: VerifiableProperties = null) extends Partitioner { | |
val counter = new AtomicInteger(0) | |
val batch = new AtomicInteger(0) |
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
<script type="text/javascript"> | |
window.onload = function main() | |
{ | |
var script = document.createElement("script"); | |
script.src = "https://graph.facebook.com/platform/albums?callback=getalbum"; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} | |
function getalbum(facebook) { | |
var randomalbum = Math.floor(Math.random()*(facebook.data.length)); |
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
public static org.w3c.dom.Document loadXMLFromString(String xml) | |
throws org.xml.sax.SAXException, java.io.IOException { | |
return loadXMLFrom(new java.io.ByteArrayInputStream(xml.getBytes())); | |
} | |
public static org.w3c.dom.Document loadXMLFrom(java.io.InputStream is) | |
throws org.xml.sax.SAXException, java.io.IOException { | |
javax.xml.parsers.DocumentBuilderFactory factory = javax.xml.parsers.DocumentBuilderFactory | |
.newInstance(); | |
factory.setNamespaceAware(true); |
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
//file app/config/parameters.ini | |
[parameters] | |
memcached_host = 127.0.0.1 | |
memcached_port = 11211 | |
memcached_key_root = mykey | |
memcached_object_ttl = 60 | |
//file src/MyApp/MyBundle/Resources/config/services.yml | |
parameters: | |
memcached.servers: |
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 javax.jms.Connection; | |
import javax.jms.Destination; | |
import javax.jms.JMSException; | |
import javax.jms.Message; | |
import javax.jms.MessageListener; | |
import javax.jms.Session; | |
import org.apache.activemq.ActiveMQConnectionFactory; | |
import org.springframework.jms.core.JmsTemplate; | |
import org.springframework.jms.listener.SimpleMessageListenerContainer; |
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 java.util.Date; | |
import javax.jms.Connection; | |
import javax.jms.Destination; | |
import javax.jms.JMSException; | |
import javax.jms.Message; | |
import javax.jms.Session; | |
import javax.jms.TextMessage; | |
import org.apache.activemq.ActiveMQConnectionFactory; |