Do you wonder how to do vector operation in Delphi? No, of course, :).
We could go like this.
function tform1.adv(a,b:real):real; begin adv:=a+b; end;
The problem is the return is real, which is single value only. We want a and b as vector. Wait...
How we define vector in Delphi? I don't know. I used to treat a vector in Delphi as array. So I coded it like this
var a,b:array[0..1]of real;
So far I had no problem. Lately, I am going crazy with overuse functions in Delphi, and trying operating vectors using function too.
But if I write the code like this
function tform1.adv(a,b:array[0..1]of real):real; begin adv:=a[0]+b[0]; {a[1]+b[1]?} end;
It will only return one value. So I improvised by modify it
This code's updated version from flexible one (whic is by itself is updated version from this) :) .
It has added feature so we could reset the counter if it reach a certain denary (decimal, it is :) ) and preset it to certain denary.
To be able to do that we have to convert the denary to binary and distribute it among Q[0] to Q[n-1].
It's not flexible one.
Here we go...
I plan to coding it in a way that it has flexibility in term of function. So I create two variable ft and ff, represent time domain and frequency domain function as two dimensional array, with the first index as 'function name' so it can be (in future) ft[0,i] as rect(x), ft[1,i] as cos(x) and so on.
Updated version from before.
Pagi ini, saat berangkat ngampus, di pintu keluar Lembah Dieng ada penumpukan kendaraan karena ada yang pengendara sepeda motor menyeberang dengan cara eksotis, tidak tengok kiri-kanan.
Mungkin hal yang biasa bagi dia menyeberang seperti itu, dan dia beruntung masih hidup hingga kini. Tentu saja ada efeknya bagi kami, pengguna jalan lain. Sebuah Ayla kinclong mengerem secara mendadak dan, mungkin karena gugup atau memang baru belajar nyetir (Ayla baru :) ), mobil itu mati mendadak. Panik susah hidup dan macetlah jalan.
Nah, ada seorang bapak muda tanpa helm mengajak anaknya naik sepeda motor matic, umur sekitar satu setangah tahun, tanpa helm juga. Tentu saja terjebak kemacetan kecil itu, menyuruk mencari celah-celah sempit sehingga berakhir tepat disampingku, setengah meter lebih jauh dari tempat sebelumnya, :)