DockerFile should have JProfiler installation.
RUN wget <JProfiler file location> -P /tmp/ && \
tar -xzf /tmp/<JProfiler file> -C /usr/local && \
rm /tmp/<JProfiler file>
| /* | |
| * Copyright 2002-2012 the original author or authors. | |
| * | |
| * 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 |
| import java.net.URLDecoder | |
| def parseUrlParameters(url: String) = { | |
| url.split("&").map( v => { | |
| val m = v.split("=", 2).map(s => URLDecoder.decode(s, "UTF-8")) | |
| m(0) -> m(1) | |
| }).toMap | |
| } |
| import java.util | |
| import org.apache.kafka.clients.consumer.KafkaConsumer | |
| import scala.collection.JavaConverters._ | |
| object ConsumerExample extends App { | |
| import java.util.Properties |
| package com.caffinc.grex.core; | |
| /** | |
| * SPDX-License-Identifier: MIT | |
| * | |
| * Generates Load on the CPU by keeping it busy for the given load percentage | |
| * @author Sriram | |
| */ | |
| public class Load { | |
| /** |
| import scala.util.{Success, Failure} | |
| val seq=Seq(Success(1), Failure(new Exception("bang")), Success(2)) | |
| // all emit List(1, 2) | |
| seq.map(_.toOption).flatten | |
| seq.flatMap(_.toOption) | |
| seq.filter(_.isSuccess).map(_.get) | |
| seq.collect{case Success(x) => x} |
System: Debian/Ubuntu/Fedora. Might work for others as well.
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
| // Base64 encode | |
| val text = "This is plaintext." | |
| val bytesEncoded = java.util.Base64.getEncoder.encode(text.getBytes()) | |
| // Base64 decode | |
| val textDecoded = new String(java.util.Base64.getDecoder.decode(bytesEncoded)) | |
| println(textDecoded) |
| brew install coreutils | |
| sudo ln -s /usr/local/bin/gtimeout /usr/local/bin/timeout |