Skip to content

Instantly share code, notes, and snippets.

% Define parameters
len = 10000; % Length of binary data stream
% Have two binary sources, one 50/50 and the other 90/10 in terms of ones
% and zeros
bin1 = round(rand(1,len)); % 50/50 binary
bin2 = round(0.5*rand(1,len)+0.45); %90/10 binary
% Encode strings of ones in terms of the length of these strings
enc_bin1 = [];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sending binary data via sinusoidal signal manipulation
% Parameters
sig_len = 1000; % Signal length (in samples)
sampl_per_bin = 100; % Samples per binary representation
bin_data_len = sig_len/sampl_per_bin; %length of binary stream is a multiple of signal length
bin_data = round(rand(1,bin_data_len));
sig_carrier_base = sin(2*pi*(0:(1/sampl_per_bin):(1-(1/sampl_per_bin)))); % Baseline carrier
function result = isFactorionNumber(number)
result=0;
numberArray = num2str(number);
sum=0;
for i=1:1:length(numberArray)
sum=sum+factorial(str2num(numberArray(i)));
end
if isequal(number,sum)
result=1;
end
function result = isKaprekarNumber(number)
result=0;
lenOfNumber = length(num2str(number));
numberArray = num2str(number);
sqOfNumber = number.^2;
sqNumberArray = num2str(sqOfNumber);
sqHead= sqNumberArray(1:lenOfNumber);
@unalfaruk
unalfaruk / alfresco-global.properties
Last active April 12, 2020 14:14
Active directory integration configuration for Alfresco Community 5.1 (with comments line by line)
###############################
## Common Alfresco Properties #
###############################
dir.root=/opt/alfresco-community/alf_data
alfresco.context=alfresco
alfresco.host=127.0.0.1
alfresco.port=8080
alfresco.protocol=http