def __init__(self):
        BinaryUnit.__init__(self, self.__class__.__name__)

        self.BYTE_SIZE = 256

        self.fileName = None
        self.result = None
Beispiel #2
0
    def __init__(self):
        BinaryUnit.__init__(self, self.__class__.__name__)

        self.DIVIDE_SIZE = 256
        self.BYTE_SIZE = 256

        self.STEP_SIZE = 1
        self.WINDOW_SIZE = 2

        self.fileName = None
        self.result = None
    def saveResult(self):
        BinaryUnit.saveResult(self)  #if result is None, throw Exception
        resultPath = os.path.join(self.resDir, self.fileName)

        fd = open(resultPath + '.' + self.symbol, 'w')
        resContents = [self.fileName]

        for i in range(len(self.result)):
            resContents.append('%d:%d' % (i + 1, self.result[i]))

        fd.write(' '.join(resContents))
        fd.close()
Beispiel #4
0
    def __init__(self):
        BinaryUnit.__init__(self, self.__class__.__name__)

        self.BYTE_SIZE = 256
        self.STEP_SIZE = 1024
        self.WINDOW_SIZE = 2048
        self.HIST_SIZE = 8
        self.ROW_CUT = np.round(float(8.1) / self.HIST_SIZE, 4)

        self.byte_range = range(self.BYTE_SIZE)

        self.fileName = None
        self.result = None
Beispiel #5
0
    def __init__(self):
        BinaryUnit.__init__(self, self.__class__.__name__)

        self.BYTE_SIZE = 256
        self.STEP_SIZE = 256
        self.WINDOW_SIZE = 1024
        self.HIST_SIZE = 16

        self.fileName = None
        self.result = None

        self.ROW_CUT = np.round(float(0.5) / self.HIST_SIZE, 4)
        self.COL_CUT = np.ceil(float(self.BYTE_SIZE) / self.HIST_SIZE)
Beispiel #6
0
    def saveResult(self):
        BinaryUnit.saveResult(self)  #if result is None, throw Exception
        resultPath = os.path.join(self.resDir, self.fileName)

        res = self.result
        res = res.reshape(1, -1).flatten()

        fd = open(resultPath + ',' + self.symbol, 'w')
        resContents = [self.fileName]

        for i in range(len(res)):
            resContents.append('%d:%f' % (i + 1, res[i]))

        fd.write(' '.join(resContents))
        fd.close()