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
% creates an optimal code for probability vector P using huffman coding | |
% The codes are ordered according to the input probabilities. | |
% Alternatively, you could sort them descending, or add another column to the cell | |
% array containing the symbols (like the huffmandict function). This would require an | |
% additional input parameter. | |
% My measurements show this running faster than the huffmandict function. | |
function [c,h,w]=huffman(P) | |
% function [c,h,w]=huffman(P) |
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
// WASAPI Example to set application volumes | |
// 10.04.2019 | |
#include <iostream> | |
#include <limits> | |
#include <string> | |
#include <vector> | |
#define WIN32_LEAN_AND_MEAN | |
#define NOMINMAX |
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 "Calculator.hpp" | |
#include <fstream> | |
#include <iostream> | |
#include <sstream> | |
#include "mps/str_util.hpp" | |
#include "mps/clipboard.hpp" | |
#include "mps/console_util.hpp" |
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 unite(arr1, arr2, arr3) { | |
var unique = arr1.concat(arr2, arr3); | |
console.log("arr:"); | |
console.log(unique); | |
for (var i = 0; i != unique.length; ++i) { | |
unique.reduce(function(isDuplicate, item, index, arr) { | |
if (index != i && unique[i] === item) { | |
delete unique[index]; | |
} |