RED MY CLOUDY
PLEASE, USE YOUR BRAIN IF YOU GOT SOMETHING
Read On 0 comments
Read On 0 comments
Read On 0 comments
Read On 0 comments

`EasyRiders 2006`

Wednesday, November 18, 2009
EasyRiders - 2006-01
Read On 0 comments
Read On 0 comments

Visual Basics 2008 `1 Hello World in 3 Diffrent Ways'

Tuesday, November 17, 2009
1 Hello World in 3 Diffrent Ways


2 Naming App


3 Custom Buttons


4 Web Searcher


5 Login System Part 1


6 Login System Part 2


7 Creating Hot-keys


8 Viewing The Source of Pages


9 Viewing your Local IP
Read On 0 comments

Visual Basic `Calculator Tutorial`

Tuesday, November 17, 2009
Read On 0 comments

Apakah di VB atau XAML?

Tuesday, November 17, 2009
Apa yang salah dengan kode WPF berikut?

Class Window1 Kelas Window1

Sub OK_Click(sender As Object , e As RoutedEventArgs) Handles OK.Click Sub OK_Click (sender As Object, e As RoutedEventArgs) Menangani OK.Click

MsgBox( "Button Clicked" ) MsgBox ( "Button diklik")

End Sub End Sub

End Class Akhir Kelas

< Window x : Class ="Window1"
xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns : x ="http://schemas.microsoft.com/winfx/2006/xaml" xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml"

Title ="Window1" Height ="300" Width ="300"> Title = "Window1" Height = "300" Width = "300">

< Grid >

< Button Name ="OK" Click ="OK_Click"> OK
Read On 0 comments

The Key to using Anonymous Types (Kunci untuk menggunakan Jenis Anonymous)

Tuesday, November 17, 2009
Katakanlah Anda ingin daftar semua pelanggan dari sebuah meja di sebuah ComboBox, dan memperbarui UI berdasarkan mana yang dipilih. To do this we'll need to bring back two fields from the database – the customer's name and the customer's ID. Untuk melakukan hal ini kita harus membawa kembali dua field dari database - nama pelanggan dan ID pelanggan. When a customer is selected we want the ComboBox's SelectedValue property to equal the customer's ID. Ketika seorang pelanggan dipilih kita ingin ComboBox's SelectedValue properti untuk sama dengan ID pelanggan.



Here's some quick code that gets us up and running (using Northwind and LINQ to SQL): Berikut adalah beberapa kode yang cepat membuat kita bangun dan berjalan (menggunakan Northwind dan LINQ to SQL):



Dim db As New NorthwindDataContext Dim db As New NorthwindDataContext

Dim query = From row In db.Customers _ Dim query = Dari deretan Dalam db.Customers _

Select row.CompanyName, row.CustomerID Pilih row.CompanyName, row.CustomerID

ComboBox1.DataSource = query.ToList() ComboBox1.DataSource = query.ToList ()

ComboBox1.DisplayMember = "CompanyName" ComboBox1.DisplayMember = "companyname"

ComboBox1.ValueMember = "CustomerID" ComboBox1.ValueMember = "Pelanggan"

But now let's say your boss looks at the app and says “I want you to add an 'All Customers' option as the first item in the list.” Tapi sekarang katakanlah bos Anda melihat pada app dan berkata "Aku ingin Anda untuk menambahkan 'Semua Pelanggan' pilihan sebagai item pertama dalam daftar." How would you do that? Bagaimana Anda melakukannya? You'd need to insert an anonymous type into an existing sequence of anonymous types, which is tricky given that you can never actually use the type's name. Anda akan perlu untuk memasukkan jenis anonim ke urutan yang sudah ada jenis anonim, yang sulit mengingat bahwa Anda tidak pernah benar-benar menggunakan nama jenis.



Thankfully there's a trick that uses generic parameter inference that allows us to do this (it relies on the fact that the compiler will share (or “unify”) the definition of multiple anonymous types when they have the same number of members, in the same order, of the same type, with the same names, and the same mutability): Untungnya ada trik yang menggunakan parameter generik kesimpulan yang memungkinkan kita untuk melakukan hal ini (hal itu bergantung pada fakta bahwa kompiler akan membagi (atau "menyatukan") definisi dari beberapa jenis anonim ketika mereka memiliki jumlah anggota yang sama, sama ketertiban, dari jenis yang sama, dengan nama yang sama, dan hal berubah-ubah yang sama):



Dim db As New NorthwindDataContext Dim db As New NorthwindDataContext

Dim query = From row In db.Customers _ Dim query = Dari deretan Dalam db.Customers _

Select row.CompanyName, row.CustomerID Pilih row.CompanyName, row.CustomerID

Dim allOption = New With {.CompanyName = "All Customers" , _ Dim allOption = Baru Dengan (. Companyname = "Semua Pelanggan", _

.CustomerID = "-1" } . Pelanggan = "-1")

ComboBox1.DataSource = AddOptionForAll(query, allOption).ToList() ComboBox1.DataSource = AddOptionForAll (query, allOption). ToList ()

ComboBox1.DisplayMember = "CompanyName" ComboBox1.DisplayMember = "companyname"

ComboBox1.ValueMember = "CustomerID" ComboBox1.ValueMember = "Pelanggan"



... ...

Function AddOptionForAll( Of T)( ByVal sequence As IEnumerable( Of T), _ Fungsi AddOptionForAll (Of T) (ByVal urutan Seperti IEnumerable (Of T), _

ByVal allOption As T) As IEnumerable( Of T) AllOption Seperti ByVal T) Sebagai IEnumerable (Of T)

'wrap individual element in an array and then union the two sequences 'membungkus individu elemen dalam array dan kemudian persatuan dua sekuens

Return ( New T() {allOption}).Union(sequence) Return (New T () (allOption)). Union (urutan)

End Function End Function



As long as we have an anonymous type that's compatible with the anonymous type that the query generated, the compiler will determine that sequence and allOption are actually the same type and this should work fine. Selama kita memiliki tipe anonim yang kompatibel dengan tipe anonim yang dihasilkan query, compiler akan menentukan urutan dan allOption sebenarnya tipe yang sama dan hal ini harus dapat bekerja baik.



Ok so let's get to the bug – well in this case spotting it is pretty simple (it doesn't compile J ), but fixing it is tricky (though I've already given two pretty big hints). Ok jadi mari kita pergi ke bug - baik dalam kasus ini bercak itu sangat mudah (hal ini tidak dapat dikompilasi J), tetapi memperbaiki itu sulit (walaupun saya sudah cukup besar diberi dua petunjuk). Here's the text of the compiler error (it's on the line that calls AddOptionForAll): Berikut teks dari kesalahan kompilator (ini ada di baris yang panggilan AddOptionForAll):



Data type(s) of the type parameter(s) in method 'Public Function AddOptionForAll(Of T)(sequence As System.Collections.Generic.IEnumerable(Of T), allOption As T) As System.Collections.Generic.IEnumerable(Of T)' cannot be inferred from these arguments because they do not convert to the same type. Jenis data (s) dari jenis parameter (s) dalam metode 'Public Function AddOptionForAll (Of T) (urutan Sebagai System.Collections.Generic.IEnumerable (Of T), allOption Sebagai T) Sebagai System.Collections.Generic.IEnumerable ( T) 'tidak dapat disimpulkan dari argumen ini karena mereka tidak dikonversi ke tipe yang sama. Specifying the data type(s) explicitly might correct this error. Menentukan tipe data (s) secara eksplisit mungkin benar kesalahan ini.



What's wrong and how do we fix it? Apa yang salah dan bagaimana kita memperbaikinya?

. .



. .



. .



. .



. .



Answer: Jawaban: We actually told the compiler to generate two different anonymous type definitions, and thus it can't unify them because the types really are different. Kami benar-benar mengatakan kepada kompiler untuk menghasilkan dua jenis anonim definisi yang berbeda, dan dengan demikian tidak dapat menyatukan mereka karena sebenarnya jenis berbeda.



From earlier: “…the compiler will share (or “unify”) the definition of multiple anonymous types when they have the same number of members, in the same order, with the same names, and the same mutability ” Dari sebelumnya: "... kompilator akan membagi (atau" menyatukan ") definisi dari beberapa jenis anonim ketika mereka memiliki jumlah anggota yang sama, dalam urutan yang sama, dengan nama yang sama, dan hal berubah-ubah yang sama"



The anonymous type that the query generates will have ReadOnly properties, whereas the anonymous type that we generated (allOption) will have Read/Write properties. Jenis anonim menghasilkan bahwa permintaan akan memiliki sifat readonly, sedangkan tipe anonim yang kita dihasilkan (allOption) akan memiliki Baca / Tulis properti. The fix is to allOption immutable so that its structure will match the result of the query: Cara mengatasinya adalah kekal allOption sehingga strukturnya akan cocok dengan hasil dari query:



Dim allOption = New With { Key .CompanyName = "All Customers" , _ Dim allOption = Baru Dengan (Key. Companyname = "Semua Pelanggan", _

Key .CustomerID = "-1" } Key. Pelanggan = "-1")

The “Key” modifier tells the compiler to make those properties ReadOnly and to override Equals and GetHashCode such that they only consider “Key” properties when deciding if two instances of the same anonymous type are equal. The "Key" pengubah memberitahu compiler untuk membuat properti-properti readonly dan untuk menimpa Setara dan GetHashCode sehingga mereka hanya mempertimbangkan "Key" sifat ketika memutuskan apakah dua contoh anonim dari jenis yang sama adalah sama. (the other hint was in the title J ). (yang lainnya adalah petunjuk dalam judul J). For the query above, the compiler automatically inserts the “Key” modifier - ie what we wrote is exactly equivalent to this: Untuk pertanyaan di atas, compiler secara otomatis memasukkan "Kunci" pengubah - yaitu apa yang kita menulis adalah persis sama dengan ini:



Dim query = From row In db.Customers _ Dim query = Dari deretan Dalam db.Customers _

Select New With { Key row.CompanyName, Key row.CustomerID} Pilih Baru Dengan (Key row.CompanyName, Key row.CustomerID)



So with a simple fix to the allOption line we're now using the same anonymous type definition and everything works fine. Jadi dengan memperbaiki sederhana ke garis allOption kita sekarang menggunakan jenis anonim yang sama definisi dan semuanya bekerja dengan baik.



VB's anonymous type syntax is very flexible and provides three different options: immutable, fully mutable, or partially mutable (ie some fields are ReadOnly while others are not). VB's anonim sintaks jenis ini sangat fleksibel dan memberikan tiga pilihan: tidak berubah, sepenuhnya bisa berubah, atau sebagian bisa berubah (yaitu beberapa field yang readonly sementara yang lain tidak). Even for a simple scenario like adding an option to a list, the better you understand how things work under the covers the easier it'll be to debug problems later J . Bahkan untuk skenario sederhana seperti menambahkan opsi untuk daftar, semakin baik Anda memahami bagaimana hal-hal bekerja di bawah selimut semakin mudah untuk debug akan masalah di kemudian J.
Read On 0 comments

" Sangat Beda Kita Dengan Dia "

Monday, November 09, 2009


Lagi Demam GANYANG MALAYSIA / MALINGSIA / MALINGSHIT / MALING ASIA, pas iseng jalan2 ke blog tetangga eh… namu juga puluhan website malay yg di deface hacker indonesia
Read On 0 comments

Shadowing in Visual Basic (englis)

Monday, November 09, 2009
When two programming elements share the same name, one of them can hide, or shadow, the other one. In such a situation, the shadowed element is not available for reference; instead, when your code uses the element name, the Visual Basic compiler resolves it to the shadowing element.
Purpose

The main purpose of shadowing is to protect the definition of your class members. The base class might undergo a change that creates an element with the same name as one you have already defined. If this happens, the Shadows modifier forces references through your class to be resolved to the member you defined, instead of to the new base class element.
Types of Shadowing

An element can shadow another element in two different ways. The shadowing element can be declared inside a subregion of the region containing the shadowed element, in which case the shadowing is accomplished through scope. Or a deriving class can redefine a member of a base class, in which case the shadowing is done through inheritance.
Shadowing Through Scope

It is possible for programming elements in the same module, class, or structure to have the same name but different scope. When two elements are declared in this manner and the code refers to the name they share, the element with the narrower scope shadows the other element (block scope is the narrowest).

For example, a module can define a Public variable named temp, and a procedure within the module can declare a local variable also named temp. References to temp from within the procedure access the local variable, while references to temp from outside the procedure access the Public variable. In this case, the procedure variable temp shadows the module variable temp.

The following illustration shows two variables, both named temp. The local variable temp shadows the member variable temp when accessed from within its own procedure p. However, the MyClass keyword bypasses the shadowing and accesses the member variable.
Shadowing through scope

Graphic diagram of shadowing through scope

For an example of shadowing through scope, see How to: Hide a Variable with the Same Name as Your Variable.
Shadowing Through Inheritance

If a derived class redefines a programming element inherited from a base class, the redefining element shadows the original element. You can shadow any type of declared element, or set of overloaded elements, with any other type. For example, an Integer variable can shadow a Function procedure. If you shadow a procedure with another procedure, you can use a different parameter list and a different return type.

The following illustration shows a base class b and a derived class d that inherits from b. The base class defines a procedure named proc, and the derived class shadows it with another procedure of the same name. The first Call statement accesses the shadowing proc in the derived class. However, the MyBase keyword bypasses the shadowing and accesses the shadowed procedure in the base class.
Shadowing through inheritance

Graphic diagram of shadowing through inheritance

For an example of shadowing through inheritance, see How to: Hide a Variable with the Same Name as Your Variable and How to: Hide an Inherited Variable.
Shadowing and Access Level

The shadowing element is not always accessible from the code using the derived class. For example, it might be declared Private. In such a case, shadowing is defeated and the compiler resolves any reference to the same element it would have if there had been no shadowing. This element is the accessible element the fewest derivational steps backward from the shadowing class. If the shadowed element is a procedure, the resolution is to the closest accessible version with the same name, parameter list, and return type.

The following example shows an inheritance hierarchy of three classes. Each class defines a Sub procedure display, and each derived class shadows the display procedure in its base class.

Public Class firstClass
Public Sub display()
MsgBox("This is firstClass")
End Sub
End Class
Public Class secondClass
Inherits firstClass
Private Shadows Sub display()
MsgBox("This is secondClass")
End Sub
End Class
Public Class thirdClass
Inherits secondClass
Public Shadows Sub display()
MsgBox("This is thirdClass")
End Sub
End Class
Module callDisplay
Dim first As New firstClass
Dim second As New secondClass
Dim third As New thirdClass
Public Sub callDisplayProcedures()
' The following statement displays "This is firstClass".
first.display()
' The following statement displays "This is firstClass".
second.display()
' The following statement displays "This is thirdClass".
third.display()
End Sub
End Module

In the preceding example, the derived class secondClass shadows display with a Private procedure. When module callDisplay calls display in secondClass, the calling code is outside secondClass and therefore cannot access the private display procedure. Shadowing is defeated, and the compiler resolves the reference to the base class display procedure.

However, the further derived class thirdClass declares display as Public, so the code in callDisplay can access it.
Shadowing and Overriding

Do not confuse shadowing with overriding. Both are used when a derived class inherits from a base class, and both redefine one declared element with another. But there are significant differences between the two. For a comparison, see Differences Between Shadowing and Overriding.
Shadowing and Overloading

If you shadow the same base class element with more than one element in your derived class, the shadowing elements become overloaded versions of that element. For more information, see Procedure Overloading.
Accessing a Shadowed Element

When you access an element from a derived class, you normally do so through the current instance of that derived class, by qualifying the element name with the Me keyword. If your derived class shadows the element in the base class, you can access the base class element by qualifying it with the MyBase keyword.

For an example of accessing a shadowed element, see How to: Access a Variable Hidden by a Derived Class.
Declaration of the Object Variable

How you create the object variable can also affect whether the derived class accesses a shadowing element or the shadowed element. The following example creates two objects from a derived class, but one object is declared as the base class and the other as the derived class.

Public Class baseCls
' The following statement declares the element that is to be shadowed.
Public z As Integer = 100
End Class
Public Class dervCls
Inherits baseCls
' The following statement declares the shadowing element.
Public Shadows z As String = "*"
End Class
Public Class useClasses
' The following statement creates the object declared as the base class.
Dim basObj As baseCls = New dervCls()
' Note that dervCls widens to its base class baseCls.
' The following statement creates the object declared as the derived class.
Dim derObj As dervCls = New dervCls()
Public Sub showZ()
' The following statement outputs 100 (the shadowed element).
MsgBox("Accessed through base class: " & basObj.z)
' The following statement outputs "*" (the shadowing element).
MsgBox("Accessed through derived class: " & derObj.z)
End Sub
End Class
Read On 0 comments

Shadowing in Visual Basic (Indonesia)

Monday, November 09, 2009
Bayangan dalam Visual Basic

When two programming elements share the same name, one of them can hide, or shadow , the other one. Ketika dua elemen pemrograman berbagi nama yang sama, salah satu dari mereka dapat menyembunyikan, atau bayangan, yang lain. In such a situation, the shadowed element is not available for reference; instead, when your code uses the element name, the Visual Basic compiler resolves it to the shadowing element. Dalam situasi demikian, elemen yang gelap tidak tersedia untuk referensi, sebaliknya, ketika kode Anda menggunakan nama elemen, kompiler Visual Basic resolve ke elemen bayangan.
Purpose Tujuan

The main purpose of shadowing is to protect the definition of your class members. Tujuan utama adalah untuk melindungi membayangi definisi dari anggota kelas Anda. The base class might undergo a change that creates an element with the same name as one you have already defined. Kelas dasar mungkin akan mengalami perubahan yang menciptakan suatu elemen dengan nama yang sama sebagai salah satu telah ditetapkan. If this happens, the Shadows modifier forces references through your class to be resolved to the member you defined, instead of to the new base class element. Jika ini terjadi, kekuatan pengubah Shadows referensi melalui kelas Anda harus diselesaikan ke anggota Anda ditetapkan, bukannya yang baru kelas dasar elemen.
Types of Shadowing Jenis bayangan

An element can shadow another element in two different ways. Bayangan dapat unsur unsur lain dalam dua cara yang berbeda. The shadowing element can be declared inside a subregion of the region containing the shadowed element, in which case the shadowing is accomplished through scope . Bayangan elemen yang dapat dideklarasikan di dalam daerah subregion berisi elemen gelap, dalam hal ini membayangi dicapai melalui cakupan. Or a deriving class can redefine a member of a base class, in which case the shadowing is done through inheritance . Atau berasal kelas dapat mendefinisikan kembali anggota kelas dasar, dalam hal ini membayangi dilakukan melalui warisan.
Shadowing Through Scope Melalui bayangan Lingkup

It is possible for programming elements in the same module, class, or structure to have the same name but different scope. Hal ini dimungkinkan untuk elemen pemrograman dalam modul yang sama, kelas, atau struktur untuk memiliki nama yang sama tetapi berbeda ruang lingkup. When two elements are declared in this manner and the code refers to the name they share, the element with the narrower scope shadows the other element (block scope is the narrowest). Ketika dua elemen dinyatakan dengan cara ini dan kode mengacu pada nama mereka berbagi, unsur dengan bayang-bayang lingkup sempit unsur lain (blok cakupannya sempit).

For example, a module can define a Public variable named temp , and a procedure within the module can declare a local variable also named temp . Sebagai contoh, sebuah modul dapat mendefinisikan sebuah variabel Publik bernama temp, dan prosedur dalam modul dapat mendeklarasikan variabel lokal juga bernama temp. References to temp from within the procedure access the local variable, while references to temp from outside the procedure access the Public variable. Referensi untuk temp dari dalam prosedur mengakses variabel lokal, sedangkan referensi untuk temp dari luar prosedur mengakses variabel Publik. In this case, the procedure variable temp shadows the module variable temp . Dalam kasus ini, variabel prosedur bayangan temp variabel modul temp.

The following illustration shows two variables, both named temp . Ilustrasi berikut menunjukkan dua variabel, keduanya bernama temp. The local variable temp shadows the member variable temp when accessed from within its own procedure p . Variabel lokal bayangan temp temp variabel anggota ketika diakses dari dalam prosedur sendiri p. However, the MyClass keyword bypasses the shadowing and accesses the member variable. Namun, MyClass bypasses kata kunci yang membayangi dan mengakses variabel anggota.
Shadowing through scope Pembayangan melalui cakupan

Diagram graphic membayangi melalui cakupan

For an example of shadowing through scope, see How to: Hide a Variable with the Same Name as Your Variable . Untuk contoh membayangi melalui cakupan, lihat Cara: Sembunyikan Variabel dengan Nama yang Sama sebagai Variabel Anda.
Shadowing Through Inheritance Melalui bayangan Warisan

If a derived class redefines a programming element inherited from a base class, the redefining element shadows the original element. Jika sebuah kelas turunan mengubah elemen pemrograman diwariskan dari kelas dasar, yang mendefinisikan ulang bayangan elemen elemen asli. You can shadow any type of declared element, or set of overloaded elements, with any other type. Anda dapat bayangan menyatakan setiap jenis elemen, atau seperangkat unsur-unsur kelebihan beban, dengan jenis lain. For example, an Integer variable can shadow a Function procedure. Sebagai contoh, sebuah variabel integer dapat bayangan Fungsi prosedur. If you shadow a procedure with another procedure, you can use a different parameter list and a different return type. Jika Anda bayangan sebuah prosedur dengan prosedur lain, Anda dapat menggunakan daftar parameter yang berbeda dan jenis yang berbeda kembali.

The following illustration shows a base class b and a derived class d that inherits from b . Ilustrasi berikut menunjukkan kelas dasar b dan kelas turunan d yang mewarisi dari b. The base class defines a procedure named proc , and the derived class shadows it with another procedure of the same name. Kelas dasar mendefinisikan prosedur bernama proc, dan kelas turunan bayang-bayang itu dengan prosedur lain dengan nama yang sama. The first Call statement accesses the shadowing proc in the derived class. Pernyataan Panggilan pertama mengakses membayangi proc di kelas turunan. However, the MyBase keyword bypasses the shadowing and accesses the shadowed procedure in the base class. Namun, kata kunci MyBase bypasses yang membayangi dan mengakses prosedur gelap di kelas dasar.
Shadowing through inheritance Pembayangan melalui warisan

Diagram graphic membayangi melalui warisan

For an example of shadowing through inheritance, see How to: Hide a Variable with the Same Name as Your Variable and How to: Hide an Inherited Variable . Untuk contoh membayangi melalui warisan, lihat Cara: Sembunyikan Variabel dengan Nama yang Sama seperti Anda Variabel dan Cara: Sembunyikan sebuah warisan Variabel.
Shadowing and Access Level Bayangan dan Level Akses

The shadowing element is not always accessible from the code using the derived class. Bayangan elemen yang tidak selalu dapat diakses dari kode menggunakan kelas turunan. For example, it might be declared Private . Sebagai contoh, mungkin akan menyatakan Pribadi. In such a case, shadowing is defeated and the compiler resolves any reference to the same element it would have if there had been no shadowing. Dalam kasus seperti itu, membayangi adalah kompilator dikalahkan dan menyelesaikan setiap referensi untuk elemen yang sama akan ada jika tidak ada bayangan. This element is the accessible element the fewest derivational steps backward from the shadowing class. Elemen ini adalah elemen diakses derivasional paling sedikit langkah mundur dari kelas bayangan. If the shadowed element is a procedure, the resolution is to the closest accessible version with the same name, parameter list, and return type. Jika elemen gelap adalah prosedur, resolusi adalah versi yang paling dekat yang dapat diakses dengan nama yang sama, daftar parameter, dan kembali mengetik.

The following example shows an inheritance hierarchy of three classes. Contoh berikut menunjukkan hirarki warisan tiga kelas. Each class defines a Sub procedure display , and each derived class shadows the display procedure in its base class. Setiap kelas mendefinisikan sebuah prosedur Kecamatan layar, dan masing-masing kelas yang diturunkan dari bayang-bayang layar prosedur dalam kelas dasar.

Public Class firstClass Kelas publik firstClass
Public Sub display() Public Sub display ()
MsgBox("This is firstClass") MsgBox ( "Ini firstClass")
End Sub End Sub
End Class Akhir Kelas
Public Class secondClass Kelas publik secondClass
Inherits firstClass Mewarisi firstClass
Private Shadows Sub display() Shadows Private Sub display ()
MsgBox("This is secondClass") MsgBox ( "Ini secondClass")
End Sub End Sub
End Class Akhir Kelas
Public Class thirdClass Kelas publik thirdClass
Inherits secondClass Mewarisi secondClass
Public Shadows Sub display() Public Shadows Sub display ()
MsgBox("This is thirdClass") MsgBox ( "Ini thirdClass")
End Sub End Sub
End Class Akhir Kelas
Module callDisplay Modul callDisplay
Dim first As New firstClass Dim pertama As New firstClass
Dim second As New secondClass Dim detik As New secondClass
Dim third As New thirdClass Dim ketiga As New thirdClass
Public Sub callDisplayProcedures() Public Sub callDisplayProcedures ()
' The following statement displays "This is firstClass". 'Pernyataan berikut akan menampilkan "Ini firstClass".
first.display() first.display ()
' The following statement displays "This is firstClass". 'Pernyataan berikut akan menampilkan "Ini firstClass".
second.display() second.display ()
' The following statement displays "This is thirdClass". 'Pernyataan berikut akan menampilkan "Ini thirdClass".
third.display() third.display ()
End Sub End Sub
End Module Akhir Modul

In the preceding example, the derived class secondClass shadows display with a Private procedure. Dalam contoh sebelumnya, kelas turunan bayangan secondClass layar dengan prosedur Swasta. When module callDisplay calls display in secondClass , the calling code is outside secondClass and therefore cannot access the private display procedure. Ketika panggilan callDisplay modul ditampilkan dalam secondClass, kode pemanggilan di luar secondClass dan karena itu tidak dapat mengakses prosedur layar pribadi. Shadowing is defeated, and the compiler resolves the reference to the base class display procedure. Bayangan dikalahkan, dan kompilator menyelesaikan referensi untuk kelas dasar prosedur layar.

However, the further derived class thirdClass declares display as Public , so the code in callDisplay can access it. Namun, lebih lanjut menyatakan thirdClass kelas turunan ditampilkan sebagai publik, sehingga kode di callDisplay dapat mengaksesnya.
Shadowing and Overriding Membayangi dan dikesampingkan

Do not confuse shadowing with overriding. Jangan bingung bayangan dengan meng-override. Both are used when a derived class inherits from a base class, and both redefine one declared element with another. Keduanya digunakan ketika kelas turunan mewarisi dari kelas dasar, dan keduanya mendefinisikan kembali satu elemen dinyatakan dengan yang lain. But there are significant differences between the two. Tetapi ada perbedaan yang signifikan antara keduanya. For a comparison, see Differences Between Shadowing and Overriding . Untuk perbandingan, lihat Perbedaan Antara bayangan dan meng-override.
Shadowing and Overloading Membayangi dan Overloading

If you shadow the same base class element with more than one element in your derived class, the shadowing elements become overloaded versions of that element. Jika Anda bayangan kelas dasar yang sama elemen dengan lebih dari satu unsur dalam kelas turunan, unsur-unsur yang membayangi jadi kelebihan muatan versi elemen. For more information, see Procedure Overloading . Untuk informasi lebih lanjut, lihat Prosedur Overloading.
Accessing a Shadowed Element Unsur mengakses shadow

When you access an element from a derived class, you normally do so through the current instance of that derived class, by qualifying the element name with the Me keyword. Ketika Anda mengakses sebuah elemen dari kelas turunan, biasanya Anda melakukannya melalui contoh saat ini yang berasal kelas, dengan kualifikasi unsur nama dengan Me kata kunci. If your derived class shadows the element in the base class, you can access the base class element by qualifying it with the MyBase keyword. Jika bayangan kelas turunan elemen di kelas dasar, Anda dapat mengakses kelas dasar elemen dengan kualifikasi dengan MyBase kata kunci.

For an example of accessing a shadowed element, see How to: Access a Variable Hidden by a Derived Class . Untuk contoh mengakses elemen gelap, lihat Cara: Mengakses Variable Tersembunyi oleh Derived Class.
Declaration of the Object Variable Deklarasi Variabel Objek

How you create the object variable can also affect whether the derived class accesses a shadowing element or the shadowed element. Bagaimana Anda membuat variabel objek juga dapat mempengaruhi apakah mengakses kelas turunan yang membayangi elemen atau unsur yang gelap. The following example creates two objects from a derived class, but one object is declared as the base class and the other as the derived class. Contoh berikut membuat dua objek dari kelas turunan, tetapi satu objek dinyatakan sebagai kelas dasar dan yang lain sebagai kelas turunan.

Public Class baseCls Kelas publik baseCls
' The following statement declares the element that is to be shadowed. 'Pernyataan berikut menyatakan elemen yang menjadi gelap.
Public z As Integer = 100 Publik z As Integer = 100
End Class Akhir Kelas
Public Class dervCls Kelas publik dervCls
Inherits baseCls Mewarisi baseCls
' The following statement declares the shadowing element. 'Pernyataan berikut menyatakan elemen bayangan.
Public Shadows z As String = "*" Shadows publik z As String = "*"
End Class Akhir Kelas
Public Class useClasses Kelas publik useClasses
' The following statement creates the object declared as the base class. 'Pernyataan berikut menciptakan objek dinyatakan sebagai kelas dasar.
Dim basObj As baseCls = New dervCls() Dim basObj Seperti baseCls = New dervCls ()
' Note that dervCls widens to its base class baseCls. 'Perhatikan bahwa dervCls melebar ke baseCls kelas basis.
' The following statement creates the object declared as the derived class. 'Pernyataan berikut menciptakan objek dinyatakan sebagai kelas turunan.
Dim derObj As dervCls = New dervCls() Dim derObj Seperti dervCls = New dervCls ()
Public Sub showZ() Public Sub showZ ()
' The following statement outputs 100 (the shadowed element). 'Pernyataan berikut output 100 (elemen yang gelap).
MsgBox("Accessed through base class: " & basObj.z) MsgBox ( "Diakses melalui kelas dasar:" & basObj.z)
' The following statement outputs "*" (the shadowing element). 'Pernyataan berikut output "*" (dalam bayangan elemen).
MsgBox("Accessed through derived class: " & derObj.z) MsgBox ( "Diakses melalui kelas turunan:" & derObj.z)
End Sub End Sub
End Class Akhir Kelas
Read On 0 comments

Beberapa Pengertian Tentang Data Flow Diagram (DFD)

Monday, November 02, 2009
Data Flow Diagram (DFD) merupakan alat yang digunakan untuk menggambarkan suatu sistem yang telah ada atau sistem baru yang akan dikembangkan secara logika tanpa mempertimbangkan lingkungan fisik dimana data tersebut mengalir ataupun lingkungan fisik dimana data tersebut akan disimpan (Jogiyanto, HM, 2005 :700).


Kesatuan Luar

Merupakan kesatuan lingkungan di luar sistem yang dapat berupa orang, organisasi atau sistem lainnya yang berada di lingkungan luarnya yang akan memberikan input atau menerima output dari sistem.

Arus Data
Arus data ini mengalir diantara proses, simpanan data dan kesatuan luar. Arus data ini menunjukkan arus dari data yang dapat berupa masukan untuk sistem atau hasil dari proses sistem. Arus data ini ditunjukkan dengan simbol panah.

Proses
Suatu proses adalah kegiatan atau kerja yang dilakukan oleh orang, mesin atau komputer dari hasil suatu arus data yang masuk ke dalam proses untuk menghasilkan arus data yang akan keluar dari proses.

Simpan Data
Simpanan data merupakan simpanan dari data yang dapat berupa:
a. Suatu file atau database di sistem komputer
b. Suatu arsip atau catatan manual
c. Suatu kotak tempat data di meja seseorang
d. Suatu tabel acuan manual
e. Suatu agenda atau buku


Aturan Main DFD
1. tidak boleh mengubungkan external entity dangan external entiti secara langsung.
2. tidak boleh menghubungkan data store dengan data store secara langsung
3. tidak boleh menghubungkan entity dengan data store secara langsung
4. setiap proses harus ada data flow yang masuk dan data flow yang keluar.

Cara Membuat DFD
umum ------> detail ( TOP DOWN ANALYS )
Jabarkan proses sedetail mengkin
pelihara konsistensi antar proses
berikan label yang bermakna

Tahap Pembuatan DFD
1. diagram context : menggambarkan sistem secara global
2, diagram nol : penjabaran terperinci dari diagram context
3. diagram detail : menggambarkan proses secara terperinci dari diagram nol
Read On 0 comments
Follow Gilang_UT on Twitter
Instagram