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 primes; | |
import java.time.Duration; | |
import java.time.Instant; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.ForkJoinPool; | |
import java.util.concurrent.RecursiveTask; | |
import java.util.concurrent.ThreadLocalRandom; | |
import java.util.function.Function; |
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.example.demo_jms; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.jms.annotation.JmsListener; | |
import org.springframework.jms.core.JmsMessagingTemplate; | |
import org.springframework.jms.core.JmsTemplate; | |
import org.springframework.messaging.handler.annotation.Payload; | |
import org.springframework.web.bind.annotation.PostMapping; |
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
#!/bin/bash | |
NTP_SERVICE="/etc/init.d/ntp" | |
URL="timeapi.io" | |
ENDPOINT="/api/TimeZone/zone?timeZone=Europe/Berlin" | |
DNS="8.8.8.8" | |
IP=$(nslookup $URL $DNS | egrep -o "([0-9]{1,3}\.){1,3}[0-9]{1,3}" | tail -n 1) | |
echo "server ip seems to be $IP" |
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
#!/bin/bash | |
# Copyright 2022 ndrscodes (Andreas Schmidt) | |
# | |
# 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 | |
# |
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
/// <summary> | |
/// Highly performant method for parsing strings using the GoLang TimeSpan format (e.g. 23h59m59s) | |
/// If no time unit is specified, seconds will be assumed. | |
/// </summary> | |
/// <param name="str">the string to parse</param> | |
/// <returns>a TimeSpan representing the parsed value</returns> | |
public static TimeSpan ParseTimeSpan(string str) | |
{ | |
if (str == null || string.IsNullOrWhiteSpace(str)) | |
throw new ParseException("input may not be empty"); |