mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-02-03 20:16:36 +00:00
Minor refactoring
This commit is contained in:
@@ -2121,6 +2121,16 @@ def readXmlFile(xmlFile):
|
||||
|
||||
return retVal
|
||||
|
||||
def average(values):
|
||||
"""
|
||||
Computes the arithmetic mean of a list of numbers.
|
||||
|
||||
>>> average([0.9, 0.9, 0.9, 1.0, 0.8, 0.9])
|
||||
0.9
|
||||
"""
|
||||
|
||||
return (sum(values) / len(values)) if values else None
|
||||
|
||||
@cachedmethod
|
||||
def stdev(values):
|
||||
"""
|
||||
@@ -2135,19 +2145,9 @@ def stdev(values):
|
||||
return None
|
||||
else:
|
||||
avg = average(values)
|
||||
_ = reduce(lambda x, y: x + pow((y or 0) - avg, 2), values, 0.0)
|
||||
_ = 1.0 * sum(pow((_ or 0) - avg, 2) for _ in values)
|
||||
return sqrt(_ / (len(values) - 1))
|
||||
|
||||
def average(values):
|
||||
"""
|
||||
Computes the arithmetic mean of a list of numbers.
|
||||
|
||||
>>> average([0.9, 0.9, 0.9, 1.0, 0.8, 0.9])
|
||||
0.9
|
||||
"""
|
||||
|
||||
return (sum(values) / len(values)) if values else None
|
||||
|
||||
def calculateDeltaSeconds(start):
|
||||
"""
|
||||
Returns elapsed time from start till now
|
||||
|
||||
@@ -19,7 +19,7 @@ from lib.core.enums import DBMS_DIRECTORY_NAME
|
||||
from lib.core.enums import OS
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.2.12.42"
|
||||
VERSION = "1.2.12.43"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
||||
Reference in New Issue
Block a user