Free UML editor

I found free UML editor:

ArgoUML http://argouml.tigris.org/

It seems not bad



I have tried gliffy.com. It is online and paid.
www.lucidchart.com has free version but it seems not so convenient

How to open composition in viewer in Adobe After Effects using scripts

// Make a composition
var comp = app.project.items.addComp('MyComp', 1920, 1080, 1.0, 10, 25.0 );

// Open it in viewer
comp.openInViewer();

This solution works only in AAE CS 6.0

My version of some cross-platform code

function OpenInViewer( comp )
{
    var version = app.version.match(/(\d+\.\d+).*/)[1];

    if( version >= 11.0 )
        comp.openInViewer() ;
    else
    {
        var duration = comp.workAreaDuration;
        comp.workAreaDuration = 2*comp.frameDuration;
        comp.ramPreviewTest("",1,"");
        comp.workAreaDuration = duration;
    }

}

inspired by http://www.videocopilot.net/forum/viewtopic.php?f=5&t=116057#p348646

Convert all *.avi files in current directory to png sequences

Using python and ffmpeg:

#!/usr/bin/python
# -*- coding: cp1251 -*-

import glob
import os

t=glob.glob("*.avi" ) # search all AVI files

for v in t:
     vv = os.path.splitext(v)[0];
     os.makedirs( vv ) # make a directory for each input file
     pathDst = os.path.join( vv, "%05d.png" ) # deststination path

     os.system("ffmpeg -i {0} {1}".format( v, pathDst ) )

Print all commands that were entered in interactive mode in Python

import readline
readline.write_history_file( "log.py")

Десятка лучших консольных команд

Взято с хабра: http://habrahabr.ru/post/198482/


imageВ данном посте я расскажу о наиболее интересных командах, которые могут быть очень полезны при работе в консоли. Однозначных критериев определения какая команда лучше другой — нет, каждый сам для своих условий выбирает лучшее. Я решил построить список команд на основе наиболее рейтинговых приемов работы с консолью от commandlinefu.com, кладовой консольных команд. Результат выполнения одной из таких команд под Linux приведен на картинке. Если заинтересовало, прошу под кат.

Десятое место

Ввод последнего аргумента недавних команд. Удерживая ALT или ESC, с каждым нажатием на точку в строку ввода будут подставляться параметры предыдущих команд, начиная от недавно введенных к старым.
Комбинация 'ALT+.' или '<ESC> .'

Девятое место

Переинициализация терминала без завершения текущей сессии. Например, в случае когда в терминал были выведены двоичные данные и он перестал корректно работать.
reset

Восьмое место

Создает пустой файл. Уничтожает содержимое файла без его удаления.
> file.txt

Седьмое место

Запуск команды с пробелом перед ней не сохраняет ее в истории. Может пригодиться при передаче паролей программам в открытом виде.
<пробел>команда

OpenCV. Processing external byte buffer



We have such an example from openCV documentation:
Mat img(height, width, CV_8UC3, pixels, step);
GaussianBlur(img, img, Size(7,7), 1.5, 1.5);

What does it mean? 
Lets say I have an image img:
typedef unsigned char BYTE;
BYTE * img = new BYTE[ w * h ];
Lets assume the image is scanned line by line. So
img[ 10 * w + 3 ] is a 3-rd pixel in 10-line of image.
Then I import it in openCV is such a way:
Mat img(h, w, CV_8UC1, dmDst, w);

last argument is a pitch or stride.












Fast way of copying byte array in C/C++ (With measurements)

I have the following code for copying several buffers from one object to another:
// Copy several buffers (images)
for( int i = 0; i < MIN( conf_.size(), src.conf_.size() ); ++ i )
{
   // Copy one image per pixel
   for( int j = 0; j < MIN( sizeOfBuffer_, src.sizeOfBuffer_ ); ++ j )
   {
      conf_[i][j] = src.conf_[i][j];
   }
}


Array conf_ is defined as follows:
std::vector<BYTE*> conf_;

BYTE is unsigned char. That code is written with no doubt about software performance. It just works. When I do so I hope compiler make it better for me.
This fragment takes about 45 ms for copying of 2 images with ( 1980x1080 pixels ) x 3 planes = 6.2 MPixels.
I use Microsoft Visual Studio 2008 compiler on Intel Core i7 950 @ 3.07 GHz. The code is built for x64 platform. Disabled compiler option for buffer security check (GS-) and debug information has no effect on the productivity.

Slightly better solution:
// Copy several buffers (images)
for( int i = 0; i < MIN( conf_.size(), src.conf_.size() ); ++ i )
{
   int sizeOfArray = MIN( sizeOfBuffer_, src.sizeOfBuffer_ );

   // Copy one image per pixel
   for( int j = 0; j < sizeOfArray; ++ j )
   {
      conf_[i][j] = src.conf_[i][j];
   }
}
It takes about 35 ms per full copy.

Much better solution: