This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static LinkedList<LinkedList<Integer>> findSum(int t, LinkedList<Integer> input, LinkedList<Integer> used) { | |
LinkedList<LinkedList<Integer>> inner, out = new LinkedList<LinkedList<Integer>>(); | |
Integer sum = 0, temp; | |
LinkedList<Integer> usedBk, inputBk = (LinkedList<Integer>) input.clone(); | |
while ( !inputBk.isEmpty() ) { | |
temp = inputBk.poll(); | |
if ( temp == sum ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
long change(const int sum, const int coins[], const int size) { | |
if ( sum == 0 ) return 0; | |
if ( coins == NULL || size == 0 ) return 0; | |
long * out = new long[sum + 1]; | |
out[0] = 1; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [treshold, direction] = classificationTreshold(D1, D2) | |
meA=D1.Mean; | |
siA=D1.Sigma; | |
meC=D2.Mean; | |
siC=D2.Sigma; | |
hlavni = (siC^2-siA^2); | |
funA = [ | |
hlavni |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function y = my_parzen(x, X, sigma, method) | |
if ( ~exist('method', 'var') ), | |
method = 'method'; | |
end; | |
n = length(X); | |
y = zeros(length(x), 1); | |
switch method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
covGen = (0.5:0.001:2.5) * 10e2; | |
for s=1:size(covGen,2), | |
L(s) = sum(log(normpdf(measurmentX1, Model.Mean, covGen(s)))); | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [ model ] = perceptron( data, options ) | |
%PERCEPTRON | |
% | |
% INPUT: | |
% data : struct [ 1xn ] data for training the classifier | |
% .X | |
% .y | |
% limit : int [ 1x1 ] maximum number of iteration | |
% options : struc [ --- ] | |
% .limit : int [ 1x1 ] maximum number of iteration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIColor+HashParser.h | |
// | |
// Created by Vojtech Micka on 11/19/12. | |
// Copyright (c) 2012 All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIColor (HexParser) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function montage(images, varargin) | |
%MONTAGE Display multiple images as grid | |
% | |
% Synopsis: | |
% MYMONTAGE(images) | |
% MYMONTAGE(...,PARAM1,VAL1,PARAM2,VAL2,...) displays the image, specifying | |
% parameters and corresponding values that control various aspects of the | |
% image display. Parameter names can be abbreviated, and case does not matter. | |
% | |
% Parameters include: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inline unsigned calcStates () { | |
unsigned numStates = (unsigned) substrings[0].size() + 1; | |
Word str1, str2; | |
for ( vector<Word>::iterator str = substrings.begin(); (str+1) != substrings.end(); ) { | |
str1 = *str; | |
str2 = *(++str); | |
unsigned i = 0; | |
while (str1[i] == str2[i] && i < str1.size()) i++; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% ------------------------------------------------------------------------- | |
% ( 9 ) Inference & missing values | |
% ------------------------------------------------------------------------- | |
% Create inference engine | |
engine = jtree_inf_engine ( bnet ); | |
% Sort brokenData to right order | |
brokenDataSorted = brokenData ( bnet.ordering, : )'; |
OlderNewer