Skip to content

Instantly share code, notes, and snippets.

View latticetower's full-sized avatar

Tanya Malygina latticetower

View GitHub Profile

Timeline for "General quality assurance of biomedical applications inside Debian" - from May 23, 2016 to August 23, 2016.

The task is to do Quality Assurance on any Debian Med packages by verifying runtime tests and autopkgtests as well as checking for lintian issues, hardening options and code review.

Following table contains minimal possible timeline:

Week Packages sheduled
May 23 - May 29 Dssp, Profbval,(+Tm-align)
May 30 - June 5 Pdb2pqr, R-cran-bio3d
#!/usr/bin/env julia
# this file contains little bit of magic:
# I thought that function returning Expr formed by other expression and set of key/value pairs might be useful for my evil purposes.
# should work with julia 0.4
# I called it `withenv`, just like function from standard lib,
# because it does almost the same thing (variable substitution) - except it doesn't compute Expr in any way.
function withenv(expr :: Expr, kv :: Pair...)
v = [
begin
if isa(arg, Symbol) && (ind = findfirst(kvpair -> kvpair.first == arg, kv)) > 0 && arg == kv[ind].first
@latticetower
latticetower / lazy_bomb_test.scala
Last active January 8, 2016 13:38 — forked from zmactep/lazy_bomb_test.scala
Funny bomb test on scala lazy
sealed trait BombLike {
def power : Int
def name : String
}
case class Bomb(power : Int, name : String) extends BombLike {
println("Explosion!")
}
case object Clock extends BombLike {
# from file MASS/R/add.R
# dropterm method redefined
addterm2 <-
function(object, ...) UseMethod("addterm2")
addterm2.default <-
function(object, scope, scale = 0, test = c("none"),
k = 2, sorted = FALSE, trace = FALSE, ...)
{
if(missing(scope) || is.null(scope)) stop("no terms in scope")
@latticetower
latticetower / permutations.Rmd
Last active August 29, 2015 14:11
statistical learning project raw script fragment
```{r}
library(knitr)
library(lattice)
library(MASS)
library(latticeExtra)
library(rgl)
library(hash)
```
```{r}
type Profile{T}
raw_data :: Array{Char, 2}
data :: Array{Dict{Char, T}, 1}
size :: Int64
Profile(raw :: Array{Char, 2}) = get_pr(raw)
Profile(str :: String) = Profile{T}( reshape([ letter for letter in str ], length(str), 1) )
function get_pr(raw::Array{Char, 2})
raw_data = copy(raw)
@latticetower
latticetower / table.tex
Last active January 8, 2016 14:44
table with some aminoacids data
\documentclass[a4paper]{article}
\usepackage{graphicx} % needs this to use resizebox command
\begin{document}
%\resizebox*{\textheight}{!} {
\scalebox{0.6}{
\begin{tabular}{c*{6}{c}}
\hline
$P_\alpha$ & $P_\beta$ & $P_\gamma$ & $f_i$ & $f_{i+1}$ & $f_{i+2}$ & $f_{i+3}$ \\
\hline
@latticetower
latticetower / gist:8190545
Last active January 1, 2016 19:29
ht17 problem 6
#!~/bin/ruby
# ruby 1.9.3
# -----------
# MAIN CODE
# -----------
puts "Print permutation elements:"
a = [0] + gets.split.map{|x| x.to_f } # assume that input values are float
n = a.size - 1
@latticetower
latticetower / hometask1.rb
Created November 18, 2013 21:29
дз. скриптовые языки (декораторы, задание 1)
require 'ruby_decorators'
require './ruby_class_decorators.rb'
# http://stackoverflow.com/questions/4191214/callback-for-classes-defined-inside-a-module
#
class SingletonMachine < RubyClassDecorator
def call(this, *args, &block)
this.class_eval do
def self.new(*arg)
@@instance ||= super(*arg)
@latticetower
latticetower / example1.rb
Created November 18, 2013 21:28
д.з. скриптовые языки (декораторы, задание 2)
require 'ruby_decorators'
class TimeMachine < RubyDecorator
def call(this, *args, &blk)
start_time = Process.times
puts "#{'%.4f' % (start_time.stime + start_time.utime)}ms #{this.name}"
this.call(*args, &blk)
end_time = Process.times
puts " +#{ '%.9f' % (end_time.stime + end_time.utime - start_time.utime - start_time.stime).abs }ms"
end