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
public class Zipf { | |
public static void main(String args[]) { | |
long totalWords = 0; | |
for(int i=1; i<=900; i++) { | |
totalWords += 2520/i; | |
} | |
System.out.println("Total words in text: " + totalWords); |
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.math.BigDecimal; | |
public class R { | |
public static BigDecimal factorial(BigDecimal n) { | |
if (n.equals(BigDecimal.ONE)) { | |
return BigDecimal.ONE; | |
} | |
return n.multiply(factorial(n.subtract(BigDecimal.ONE))); |
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 com.medplus.etech; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.InputStream; | |
import java.security.InvalidKeyException; | |
import java.security.NoSuchAlgorithmException; | |
import javax.crypto.Cipher; |
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" standalone="no"?> | |
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-availability="mandatory"> | |
<bean id="connectionFactory" class="com.ibm.mq.jms.MQXAConnectionFactory"> | |
<property name="transportType" value="1"/> | |
<property name="hostName" value="192.168.56.4"/> | |
<property name="port" value="1414"/> | |
<property name="queueManager" value="jpoetker.poc.mqm"/> | |
<property name="channel" value="SYSTEM.DEF.SVRCONN"/> | |
</bean> |
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"?> | |
<features> | |
<feature name="wmq-jms" version="7.5.0.0"> | |
<bundle start-level="55"> | |
file:/opt/mqm/java/lib/OSGi/com.ibm.mq.osgi.directip_7.5.0.0.jar | |
</bundle> | |
<bundle start-level="55"> | |
file:/opt/mqm/java/lib/OSGi/com.ibm.mq.osgi.java_7.5.0.0.jar | |
</bundle> | |
<bundle start-level="55" start="false"> |
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" standalone="no"?> | |
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-availability="mandatory"> | |
<description>POC: Camel JMS Component for WMQ</description> | |
<reference id="connectionFactory" interface="javax.jms.ConnectionFactory" filter="(system=ESB)" availability="mandatory" /> | |
<bean id="jmsComponent" class="org.apache.camel.component.jms.JmsComponent"> | |
<property name="connectionFactory" ref="connectionFactory"/> | |
<!-- Cache Level should be none or auto for XA --> | |
<property name="cacheLevelName" value="CACHE_NONE"/> | |
<property name="transactionManager"> |
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
Exception in thread "JMSCCThreadPoolMaster" java.lang.IllegalThreadStateException | |
at java.lang.ThreadGroup.addUnstarted(ThreadGroup.java:859) | |
at java.lang.Thread.init(Thread.java:365) | |
at java.lang.Thread.<init>(Thread.java:493) | |
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.<init>(WorkQueueManagerImplementation.java:950) | |
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation.createNewThread(WorkQueueManagerImplementation.java:496) | |
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation.getWorkerThread(WorkQueueManagerImplementation.java:433) | |
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation.access$100(WorkQueueManagerImplementation.java:46) | |
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$WorkQueueManagerThread.run(WorkQueueManagerImplementation.java:848) |
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
From IBM @ http://www-01.ibm.com/support/docview.wss?uid=swg1PK30625 | |
**************************************************************** | |
* PROBLEM DESCRIPTION: When using WebSphere Application * | |
* Server Version 6.x with WebSphere MQ * | |
* Version 5.3 Fix Pack 12 (or later) * | |
* or WebSphere MQ Version 6.0 Refresh * | |
* Pack 1 (6.0.1.0) as the JMS provider, * | |
* the following error appears in the * | |
* application server's SystemOut.log * |
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
@Grapes([ | |
@Grab("org.codehaus.geb:geb-core:0.7.2"), | |
@Grab("org.seleniumhq.selenium:selenium-chrome-driver:2.28.0"), | |
@Grab("org.seleniumhq.selenium:selenium-support:2.28.0") | |
]) | |
import geb.Browser | |
import org.openqa.selenium.chrome.ChromeDriver | |
b = new Browser(driver: new ChromeDriver()) |
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
try (Connection con = DriverManager.getConnection(JDBC_URL, USER, PASSWORD)) { | |
try (PreparedStatement query = con.prepareStatement(SQL_SELECT)) { | |
query.setInt(1, Integer.valueOf(value)); | |
try (ResultSet rs = query.executeQuery()) { | |
while (rs.next()) { | |
System.out.println(rs.getString(1)); | |
} | |
} | |
} | |
} catch (SQLException e) { |
OlderNewer