Warung Bebas

Jumat, 29 Juni 2012

Trik mendapatkan $25 / Minggu dari SOCIPOLL, menggunakan BLOGSPOT








Sebenarnya trik ini ane ambil dari para BALCKHATer dalam mencari referral, eh ternyata bisa berhasil untuk situs lain dalam hal mencari referral, jadi intinya trik ini bisa agan pakai untuk mencari referral, yang asik disini :: LINK REFERRAL KITA SEMBUNYIKAN  MENGGUNAKAN TAMPILAN ASLINYA ^_^

OK, target kita kali ini situs  yang lagi naik daun,  SOCIPOLL

Tenang triknya bisa juga

Kamis, 14 Juni 2012

Bug or no bug - that is the question

Or with other words: when something is not what it looks to be - and you have no clue why.

Let me explain: Recently over on Nicks blog Márton mentioned that TRttiMethod.Invoke cannot handle var and out parameters. While I already created a runtime patch for the bug in the QC entry for 2010 and XE I was not sure about the handling of var and out parameters. I remembered I ran into some problem with calling the Invoke routine and Barry gave me the correct hint on how to handle passing values by reference. So I tried it:


program Project1;

{$APPTYPE CONSOLE}

uses
Rtti;

type
TTest = class
public
procedure CallVar(var i: Integer);
end;

procedure TTest.CallVar(var i: Integer);
begin
Inc(i);
end;

var
test: TTest;
ctx: TRttiContext;
t: TRttiType;
m: TRttiMethod;
i: Integer;
begin
test := TTest.Create;
t := ctx.GetType(TTest);
m := t.GetMethod('CallVar');
i := 42;
m.Invoke(test, [TValue.From<Integer>(i)]);
Writeln(i);
test.Free;
Readln;
end.

It showed 42. First thought: yes, he is right, it does not handle them correctly. Second thought: wait, TValue is not taking any kind of reference to i. It just takes the value and stores it. So I changed the program a bit to check what was in the passed TValue argument.


var
[...]
v: TValue;
begin
[...]
v := TValue.From<Integer>(i);
m.Invoke(test, [v]);
Writeln(v.AsInteger);
[...]
end.

Output remained 42. I messed around with passing the pointer to i inside the TValue but then the invoke method raised the EInvalidCast exception telling me: 'VAR and OUT arguments must match parameter type exactly'. I knew that this method checks this (not like the Invoke routine mentioned earlier) and passes them correctly. So what was going on? I changed it again:

var
[...]
v: TArray<TValue>;
begin
[...]
SetLength(v, 1);
v[0] := TValue.From<Integer>(i);
m.Invoke(test, v);
Writeln(v[0].AsInteger);
[...]
end.

Hooray, it showed the expected 43. What happened here? In the case where it did not work I used the open array constructor. The documentation says that it equivalent to passing a static array filled with the values passed to the open array constructor. Ok, I tested that:

var
[...]
v: array[0..0] of TValue;
begin
[...]
v[0] := TValue.From<Integer>(i);
m.Invoke(test, v);
Writeln(v[0].AsInteger);
[...]
end.

Guess what? It returns 43. Seems it is not equivalent. Could it be that the code the compiler creates for an open array constructor does not handle the nested record inside of TValue - TValueData where the actual value is stored in - correctly? I was staring at the assembler code but as you know I pretty much suck reading something out there. While I was glad that TRttiMethod.Invoke actually handles var and out parameters correctly I could make a fix for DSharp mocks. But I still have no clue why passing the value with the open array constructor does not keep the value. Any ideas?

Sabtu, 09 Juni 2012

Chanel TV RCTI specia Euro

Siaran Tv special RCTI.. Bagi teman-teman yang ingin menonton siaran sepak bola yang skarang ini di gemari beberapa pecinta sepak bola, nach kini saya berikan saran untuk nonton ON line agar lebih mudah dan lebih gampang.. Biasanya siaran TV di rumah anda kadang-kadang tidak memungkinkan untuk menonton siaran favorit kita di kaenakan siaran yang gangguan.. nach sekarang sudah ada yang namanya nonton Tv secara ON line... Silahkan saksikan...!!!

Channell TV Favorite

Nonton langsung siaran Tv faforit anda di sisni...
Anda bisa langsung nonton siaran TV dimana saja dan kpan saja yang kita mau secara Online..
Membuat kita ninton lebih asyik dan lebih nyaman...




Minggu, 03 Juni 2012

Weak interface references

We all know how painful it can be working with interfaces and reference counting when it comes to circular or cross references.

Vincent Parrett wrote about that a while ago and presented a nice solution.

The only disadvantage about his solution was the special class type (TWeakReferencedObject) you have to inherit from to use a weak reference to. What if you want to use a weak reference to something that already exists and that you cannot change?

That is where my idea comes in.

The Weak<T> type supports assignment from and to T and makes it usable as if you had a variable of T. It has the IsAlive property to check if the reference is still valid and not a dangling pointer. The Target property can be used if you want access to members of the reference.

Let's assume you have that typical parent child relationship where both have a reference to each other. Normally that would cause a memory leak because that cross references would keep both objects alive. Change the parent reference to be a weak reference and both objects get destroyed properly because the child is not keeping the parent alive.

type
TParent = class(TInterfacedObject, IParent)
private
FChild: IChild;
procedure AddChild(const AChild: IChild);
public
destructor Destroy; override;
end;

TChild = class(TInterfacedObject, IChild)
private
FParent: Weak<IParent>;
public
constructor Create(AParent: IParent);

function GetParent: IParent;
end;

So how to check if the object of the reference is still valid? That is done by hooking the TObject.FreeInstance method so every object destruction is noticed and if a weak reference for that object exists it gets removed from the internal list where all weak references are stored.

While it works I am aware that this is hacky approach and it might not work if someone overrides the FreeInstance method and does not call inherited. It also is not yet threadsafe. It also might have a small performance impact because of the dictionary access in every FreeInstance call.

But hey, nothing is for free, isn't it? ;)

Jumat, 01 Juni 2012

Kegunaan jaringan komputer

1. Pengertian Jaringan komputer merupakan penghubung dri suatu komputer ke komputer lain atau suatu komputer yang saling berhubungan dengan menggunakan protocol.Agar suatu komputer tidak boleh memiliki lebih dari satu (1) IP Address.

 2. Kegunaannya Jaringan komputer jika kita mau menjelaskan tentang kegunaan jaringan komputer,Banya sekali kegunaan jaringan komputer di antaranya yang saya jelaskan ini :

 Misalnya kita cuman punya satu modem,tapi kita punyak banyak teman yang ingin mengakses ke internet secarah bersamaan. Pusing mau gmna caranya,Nach di sini saya sedikit sharing-sharing tentang cara bagaimana supanya kita bisa mengakses internet secarah bersamaan dengan menggunakan 1 (satu) modem.

 # sebelumnya kita harus mempunyai wadah misalnya hub/switch,seperti gambar di bawah ini :

Dan beberapa kabel LAN untuk menghubungkan komputer server ke hub/switch. Diantaranya kabel UTP stright.
 # Kemudian nyalakan komputer dan hub > hubungkan ke komputer    lain yang ingin di hubungkan.

 # Kemudian Silahkan kasi Connect Modem anda.

 # Apabila sudah connect > setting terlebih dahulu IP Address and dengan cara :
      * klick logo LAN yang ada di bagian kanan Dasbhor komputer anda. * Klick open Network and     Sharing Center

 * kemudian Buka change adapter settings

 * Kemudian klik kanan LAN nya > propertise                  

* pilih internet protocol version 4 (TCP/IPv4)

 * Trus pilih Use the following IP address ( isi IP addressnya,subnet mask ) > ok

* setelah ini cek terlebih dahulu IP address clien jngan sampai IP addressnya tidak otomatis. * kemudian pilih sharing > pilih LAN > ok

 Inilah kegunaan adanya jaringan komputer yang bisa menghubungkan kita ke dunia maya. semoga ini bisa membantu..!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!selamat mencoba..!!!!!!!!!!!!!!!!!!!!!!!!!
 

Indah Hidup Copyright © 2012 Fast Loading -- Powered by Blogger