brew install gnatsd
[NATS)(https://www.nats.io/documentation/tutorials/gnatsd-install/)
-
Create Server 1 server1.conf
-
Create Server 2 server2.conf
public class Rotator { | |
public String rotate(String input, int maxRotations) { | |
int current = -1; | |
char[] letters = input.toCharArray(); | |
final String original = input; | |
int start = input.length() - maxRotations; | |
// | |
for (int i = 0; i < letters.length; i++) { |
brew install gnatsd
[NATS)(https://www.nats.io/documentation/tutorials/gnatsd-install/)
Create Server 1 server1.conf
Create Server 2 server2.conf
public class LinkedList { | |
private Node head; | |
private Node current; | |
private boolean isFirst = false; | |
private int length; | |
public LinkedList() { | |
} |
function findMedian(input1, input2) { | |
let resultList = sortLists(input1 || [], input2 || []); | |
if (resultList.length > 0) { | |
let medianIdx = Math.floor(resultList.length / 2); | |
if (resultList.length % 2 === 0) { | |
return (resultList[medianIdx - 1] + resultList[medianIdx]) / 2; | |
} else { | |
return resultList[medianIdx]; | |
} |
// _Channels_ are the pipes that connect concurrent | |
// goroutines. You can send values into channels from one | |
// goroutine and receive those values into another | |
// goroutine. | |
package main | |
import "bufio" | |
import "fmt" | |
import "net" |
Start Fresh: | |
Step 1: | |
docker pull ramesh1211/optimus:c453d919e443 | |
Step 2: //Stop any existing Docker Processees. | |
docker stop $(docker ps) | |
Step3: | |
docker run -d -p 8009:8080 f914f44dbcc2 |
import RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BOARD) | |
pin_to_circuit=7 | |
GPIO.setup(pin_to_circuit, GPIO.OUT) | |
public class TestSum { | |
public static void main(String[] args) { | |
List<Integer> inputNumbers = new ArrayList<Integer>(); | |
inputNumbers.add(3); | |
inputNumbers.add(4); | |
inputNumbers.add(6); | |
inputNumbers.add(2); | |
inputNumbers.add(5); |
'use strict'; | |
var input = 'cbabadcbbabbcbabaabccbabc'; | |
var match = 'abbc'; | |
var matches = []; | |
var weight = getWeight('abad'); | |
var result = []; | |
for (var i = 0; i < input.length; i++) { | |
if (getWeight(input.substr(i, match.length)) === weight) { |
'use strict'; | |
var input = 'this is a test string'; | |
input = 'aaaabbbcccdddcdbaaa'; | |
var match = 'tist'; //accb | |
match = 'abc'; | |
input = 'abcdefadfafaefd'; | |
match = 'ef'; | |
var matches = []; |