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
<dependency> | |
<groupId>com.ibm.mq</groupId> | |
<artifactId>com.ibm.mq.allclient</artifactId> | |
<version>${com.ibm.mq.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.ibm.mq</groupId> | |
<artifactId>jms</artifactId> |
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
/** | |
* To run the Scala compiler programatically, we need to provide it with a | |
* classpath, as we would if we invoked it from the command line. We need | |
* to introspect our classloader (accounting for differences between execution | |
* environments like IntelliJ, SBT, or WebStart), and find the paths to JAR | |
* files on disk. | |
*/ | |
final class ReplClassloader(parent: ClassLoader) extends ClassLoader(parent) with razie.Logging { | |
override def getResource(name: String): URL = { | |
// Rather pass `settings.usejavacp.value = true` (which doesn't work |
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
grep LF.STOP.PAGE logs/log.log | grep -v "/ping" | sed 's/.*LF.STOP.PAGE .* \(.*\) took \([0-9]*\)ms.*/\2 \1/g' | sort -n -r --key=1 | sort -r --key=2 | uniq --skip-fields=1 | sort -b -n -r | head -20 |
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
object Sample2 { | |
val notificationStream : Stream[(String,String)] = Stream.empty | |
object db { | |
def findOrder(id:String) : Stream[{def accountId:String}] = Stream.empty | |
def findAccount(id:String) : Stream[{def email:String}] = Stream.empty | |
def updateAccount(id:Any) : Stream[Boolean] = Stream.empty | |
def updateOrder(id:Any) : Stream[Boolean] = Stream.empty | |
} | |
object email { | |
def send(id:String,n:String) : Stream[Boolean] = Stream.empty |
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 akka.actor.{Actor, Props} | |
import play.libs.Akka | |
object Sample { | |
case class MsgNotify() | |
case class MsgFindOrder(orderId: String) | |
case class MsgOrderFound(order: {def accountId: String}) | |
case class MsgFindAccount(accountId: String) | |
case class MsgAccountFound(account: {def email:String}) |
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
nohup java $* $_JAVA_OPTIONS -Dlogger.file=$APP/dist/conf/logback.prod.xml -Drk.properties=$RKPROPERTIES -cp $classpath play.core.server.NettyServer $DIST & |
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
@volatile var x = 5 | |
(0 to 10 toList).par foreach { t => | |
var i:Int = 0; while (i < 100) { | |
x += 1 | |
i += 1 | |
} | |
} | |
x |
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 razie.actionables; | |
/** | |
* result is false 69978 vs 100000 | |
* | |
* @author razvanc | |
* | |
*/ | |
public class TestVol { | |
volatile Long i = 0L; |
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
/** customize some global handling errors */ | |
object Global extends WithFilters(LoggingFilter) { | |
// EMAIL BACKOFF stuff | |
val ERR_DELTA1 = 5 * 60 * 1000 // 5 min | |
val ERR_DELTA2 = 6 * 60 * 60 * 1000 // 6 hours | |
val ERR_EMAILS = 5 // per DELTA2 | |
var errEmails = 0 // sent per DELTA2 | |
var lastErrorTime = System.currentTimeMillis - ERR_DELTA1 // time last error email went out - just one every 5 min, eh | |
var firstErrorTime = System.currentTimeMillis - ERR_DELTA2 // time first error email went out - just one every 5 min, eh | |
var lastErrorCount = 0 // time last error email went out - just one every 5 min, eh |
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
def ping-me() = Action { implicit request => | |
Ok(osusage) | |
} | |
def osusage = { | |
var s = "" | |
val osm: OperatingSystemMXBean = ManagementFactory.getOperatingSystemMXBean(); | |
for (method <- osm.getClass().getDeclaredMethods()) { | |
method.setAccessible(true); |
NewerOlder