Boris Nagaev · Home page | About | Contact | Github | Code | FBB files

NPG-explorer 0.5.1 and 0.5.2 released

NPG-explorer is a new tool for nucleotide pangenome construction and analysis of closely related prokaryotic genomes.

Version 0.5.1 was released on Oct 30, 2015.

Version 0.5.2 was released on Nov 08, 2015.

Version 0.5.1 has a focus on bug fixes and a few new developments. Version 0.5.2 fixes bugs of the Windows version.

Read more

Speeding up byte substitution

Let us speed up the following program:

char translate[256] = {substituion table};
const char* input = "input string";
int len = length of input string;
char* output = malloc(len);
for (int i = 0; i < len; ++i) {
    output[i] = translate[input[i]];
}

This code solves many practical problems:

Read more

NPG-explorer 0.5.0 released

NPG-explorer is a new tool for nucleotide pangenome construction and analysis of closely related prokaryotic genomes.

Version 0.5.0 was released on Jul 16, 2015.

This release has a focus on bug fixes and a few new developments.

Read more

NPG-explorer 0.4.0 released

NPG-explorer is a new tool for nucleotide pangenome construction and analysis of closely related prokaryotic genomes.

Version 0.4.0 was released on Jun 12, 2015.

This release has a focus on new developments and a few bug fixes.

Read more

Brainfuck to C translator written in Lua

Lua code translating Brainfuck to C:

local brainfuckToC_map = {
    ['>'] = '++ptr;',
    ['<'] = '--ptr;',
    ['+'] = '++*ptr;',
    ['-'] = '--*ptr;',
    ['.'] = 'putchar(*ptr);',
    [','] = '*ptr=getchar();',
    ['['] = 'while (*ptr) {',
    [']'] = '}',
}

local function brainfuckToC(bf_code)
    local c_code = bf_code:gsub('.', function(op)
        return brainfuckToC_map[op] or ''
    end)
    return c_code
end

local PROLOGUE = [[
#include <stdio.h>
int main() {
    #define TAPE_SIZE 30000
    char array[TAPE_SIZE] = {0};
    char *ptr=array;
]]

local EPILOGUE = [[
    return 0;
}
]]

print(PROLOGUE)
for line in io.lines() do
    print(brainfuckToC(line))
end
print(EPILOGUE)

This script reads Brainfuck code from stdin and writes corresponding C code to stdout.

Read more