Skip to content

Instantly share code, notes, and snippets.

View AlexDenisov's full-sized avatar
🇺🇦
Talking to Machines

AlexDenisov AlexDenisov

🇺🇦
Talking to Machines
View GitHub Profile
@AlexDenisov
AlexDenisov / splitpdf.py
Created July 26, 2020 08:28
Splits a PDF file for manual double-side printing
#!/usr/bin/env python3
import sys, os
from PyPDF2 import PdfFileReader, PdfFileWriter
inputname = sys.argv[1]
pdf = PdfFileReader(inputname)
numpages = pdf.getNumPages()
if numpages % 2 == 1:
numpages = numpages - 1
@AlexDenisov
AlexDenisov / index.js
Created August 9, 2017 15:32
Promise/Monk bug
var monk = require('monk');
var promise = require('promise');
function connect() {
return new promise( function (resolve, reject) {
monk('mongodb://localhost:27017/monk', function (error, db) {
if (error) {
console.log('about to reject');
reject(error);
} else {
//
// main.c
// processes
//
// Created by AlexDenisov on 14.06.17.
// Copyright © 2017 Low Level Bits. All rights reserved.
//
#include <assert.h>
#include <signal.h>
alex@alex-VirtualBox ~/P/m/BuildNinja> lldb-3.9 ./tools/driver/mull-driver ~/Projects/CryptoSwift/config.yaml
(lldb) target create "./tools/driver/mull-driver"
Current executable set to './tools/driver/mull-driver' (x86_64).
(lldb) settings set -- target.run-args "/home/alex/Projects/CryptoSwift/config.yaml"
(lldb) r
Process 21754 launched: './tools/driver/mull-driver' (x86_64)
Config>
project_name:
test_framework: XCTest
distance: 128
; ModuleID = '/home/alex/Projects/CryptoSwift/.build/debug/CryptoSwiftPackageTests.xctest.ll'
source_filename = "/home/alex/Projects/CryptoSwift/.build/debug/CryptoSwiftPackageTests.xctest.ll"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%Vs5Int32 = type <{ i32 }>
%Sp = type <{ i8* }>
%struct._SwiftEmptyArrayStorage = type { %struct.HeapObject, %struct._SwiftArrayBodyStorage }
%struct.HeapObject = type { %struct.HeapMetadata*, %struct.StrongRefCount, %struct.WeakRefCount }
%struct.HeapMetadata = type opaque
mbj [10:59 PM]
@alexdenisov Just a quick write down on mutation operators, conceptually I see the biggest separation into the following four classes that have different usefulness / roles for a mutation testing tool:
* Sematic reductions - These are almost always guaranteed to be "good" mutations the user definitively wants to kill as they expose unused semantics. Most trivial exampe is `a; b` (where both perform a not dependent side effect) to: `b`. Simple line and branch coverage would in case side effect `b` is measured give a 100% covered result, where the mutation would expose `a` is not covered in case the mutation is alive. Note that semantic reductions come in various alternative forms, many of them are language / intermediate specific. The thing to IMO recall on these is: They will as they expose untested semantics almost never equivalents as: If the semantics are unneded, they should be removed, and if they are untested a test should be added. Another good canonical example for semantic reduction
diff --git a/1.ll b/1.ll
index 1932029..81d3e51 100644
--- a/1.ll
+++ b/1.ll
@@ -35,10 +35,7 @@ if.end: ; preds = %if.then, %entry
sw.bb: ; preds = %if.end
%call = call zeroext i1 @_ZNK4llvm7APFloat10isNegativeEv(%"class.llvm::APFloat"* %this1),
- br i1 %call, label %if.end3, label %if.then2,
-
; ModuleID = 'main.m'
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
%0 = type opaque
%struct._class_t = type { %struct._class_t*, %struct._class_t*, %struct._objc_cache*, i8* (i8*, i8*)**, %struct._class_ro_t* }
%struct._objc_cache = type opaque
%struct._class_ro_t = type { i32, i32, i32, i8*, i8*, %struct.__method_list_t*, %struct._objc_protocol_list*, %struct._ivar_list_t*, i8*, %struct._prop_list_t* }
%struct.__method_list_t = type { i32, i32, [0 x %struct._objc_method] }
%struct._objc_method = type { i8*, i8*, i8* }