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;

Network Log using Overlook Fing

Log discovered devices:

fing -r 1 -o log,csv,c:\Log\Log.csv

Log discovered devices using session:

fing -r 1 --session c:\Log\session.txt -o log,csv,c:\Log\Log.csv

Install the script as Windows service: (Admin rights)

fing -n 192.168.1.54/24 --session c:\Log\session.txt -o log,csv,c:\Log\Log.csv --installservice MyFingService

Uninstall the service: (Admin rights)

fing --uninstallservice MyFingService
=== overlook fing 3.0 - www.overlooksoft.com ===

Command line options:
  -h [ --help ]            show this help message
  -v [ --version ]         show fing version
  -i [ --info ]            show network informations
  -n [ --netdiscover ] arg run network discovery
  -s [ --servicescan ] arg run service scan on host/network
  -o [ --output ] arg      use output setup for discovery/scan/ping
  -P [ --profile ] arg     use specific discovery/scan/ping profile
  -d [ --rdns ] arg        enable/disable reverse DNS lookups
  -r [ --rounds ] arg      number of rounds (network discovery)
  --session arg            use specific discovery session file
  --silent                 force to silent mode
  --interactive            start the interactive mode
  -p [ --ping ] arg        run icmp ping on the hosts
  --sentinel               run Fingbox Sentinel
  -w [ --wol ] arg         send wake on lan on targets