Skip to content

Instantly share code, notes, and snippets.

View lup-'s full-sized avatar

Александр Павлов lup-

View GitHub Profile

Keybase proof

I hereby claim:

  • I am lup- on github.
  • I am lup (https://keybase.io/lup) on keybase.
  • I have a public key whose fingerprint is 4F93 D5B1 EB4A 59C1 D482 21D7 DB9A D559 8396 B690

To claim this, I am signing this object:

var database = {};
database.query = function (query, callback) {...};
var calculator = {};
calculator.exec = function () {...тут расчеты калькулятора делаются...};
var databaseProcessor = (function()
{
var instance = {};
@lup-
lup- / freduction.matlab
Last active August 29, 2015 14:04
Factor reduction, сокращение факторов
xyz = [1 1 1 0.14;1 1 2 0.56;1 1 3 0.35;1 2 1 0.00;1 2 2 0.09;1 2 3 0.03;2 1 1 0.08;2 1 2 0.32;2 1 3 0.20;2 2 1 0.00;2 2 2 0.09;2 2 3 0.03]
xy=[]
x=unique(xyz(:,1))
y=unique(xyz(:,2))
for i=1:numel(x)
for j=1:numel(y)
p = sum( xyz( xyz(:,1)==x(i) & xyz(:,2)==y(j), 4) );
xy=[xy; x(i) y(j) p];
end
@lup-
lup- / fproduct.matlab
Last active August 29, 2015 14:04
Factor product, умножение факторов
xy=[1 1 0.7;1 2 0.1;2 1 0.4;2 2 0.1]
yz=[1 1 0.2;1 2 0.8;1 3 0.5;2 1 0.0;2 2 0.9;2 3 0.3]
xyz=[];
for i=1:size(xy,1)
yzf = yz( yz(:,1)==xy(i,2), : );
rmxy = repmat( xy(i,:),size(yzf, 1),1 );
xyz = [xyz; rmxy(:,1:2) yzf(:,2) rmxy(:,3).*yzf(:,3)];
end