Windows File Permissions

Take ownership of the files. Start a Command Prompt (cmd) as an administrator, and enter:

takeown /f file
takeown /f directory /r

 

Give yourself full rights on the file:

cacls file /G username:F
cacls directory /T /G username:F
Advertisements

Discrete Cosine Transform

1D DCT:

dct1

Inverse 1D DCT:

dct2

2D DCT:

dct3

Inverse 2D DCT:

dct4

RGB = imread('lena.tif');
I = rgb2gray(RGB);
J = dct2(I);
figure, imshow(log(abs(J)),[]), colormap(jet(64)), colorbar
J(abs(J) < 10) = 0; %filter
K = idct2(J);
figure, imshow(I)
figure, imshow(K,[0 255])

Relationship between DCT and FFT

  • DCT (Discrete Cosine Transform) is actually a cut-down version of the Fourier Transform or the Fast Fourier Transform (FFT):
  • Only the real part of FFT
  • Computationally simpler than FFT
  • DCT — Effective for Multimedia Compression
  • DCT MUCH more commonly used (than FFT) in Multimedia Image/Video Compression
  • Cheap MPEG Audio Variant

Dial Phone using Delphi

You can dial your modem using RS-232 on Delphi:

var
hCommFile : THandle;

procedure TForm1.Button1Click(Sender: TObject);
var
PhoneNumber : string;
CommPort : string;
NumberWritten : LongInt;
begin
PhoneNumber := 'ATDT 1-555-555-1212' + #13 + #10;
CommPort := 'COM2';
{Open the comm port}
hCommFile := CreateFile(PChar(CommPort),
GENERIC_WRITE,
0,
nil,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
0);
if hCommFile=INVALID_HANDLE_VALUE then
begin
ShowMessage('Unable to open '+ CommPort);
exit;
end;

{Dial the phone}
NumberWritten:=0;
if WriteFile(hCommFile,
PChar(PhoneNumber)^,
Length(PhoneNumber),
NumberWritten,
nil) = false then begin
ShowMessage('Unable to write to ' + CommPort);
end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
{Close the port}
CloseHandle(hCommFile);
end;