Monday, January 19, 2009
Encrypt Store Procedure & Trigger di SQL Server
Ini tutorial sederhana banget. gunanya biar orang lain yg bisa buka databasenya tidak bisa melihat isi sintaks T-SQL di Store procedure dan Trigger, biarpun sudah diencrypt T-SQLnya tetap bisa di exec kok :) , have fun :p
create proc [Namastoreprocedure]
--tamabahin ini
with encryption
--------------
as
--perintahnya yg mau di encrypt, misalkan :
select * from msfilm
-------------------------------------------
--untuk exec store procedurenya
exec [Namastoreprocedure]
Tuesday, January 6, 2009
Fibonacci Sequence [Iterative & Recursive]
Fibonacci Sequence / Deret Fibonacci adalah suatu deret matematika yang berasal dari penjumlahan dua bilangan sebelumnya, Algoritma ini ditemukan oleh Leonardo Pissano FibonacciDi bawah ini adalah algoritma berikut sintaksnya untuk Fibonacci sequence versi iterative dan recursive di VB.Net / Visual Basic 2008 :
Public Class FibonacciSequence
Dim angka() As Long
Private Sub tombolfibonacci_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tombolfibonacci.Click
Dim n As Integer
ReDim angka(Val(TextBox1.Text) - 1)
'Aktifkan salah satu fungsi yang ingin dipakai
'=====================================
'Iteratif_fibonacci()
'rekursif_fibonacci(0)
'=====================================
End Sub
'Versi Iterative Fibonacci
Function Iteratif_fibonacci()
Dim i As Integer
For i = 0 To angka.Length - 1 Step +1
If (i = 0 Or i = 1) Then
angka(i) = i
Else
angka(i) = angka(i - 1) + angka(i - 2)
End If
Next i
For i = 0 To angka.Length - 1 Step +1
TextBox2.Text = TextBox2.Text & angka(i) & " , "
Next i
End Function
'Versi Recursive Fibonacci
Function rekursif_fibonacci(ByVal i As Integer)
If i < angka.Length Then
If (i = 0 Or i = 1) Then
angka(i) = i
Else
angka(i) = angka(i - 1) + angka(i - 2)
End If
TextBox2.Text = TextBox2.Text & angka(i) & " , "
i = i + 1
rekursif_fibonacci(i)
Else
Exit Function
End If
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox1.Focus()
End Sub
End Class
Friday, January 2, 2009
Animasi Teks Berjalan 1
Bahan yang diperlukan, -:p
1. form
2. label
properties label bisa di custom sesuai selera ex font & font colour
3. timer
properties timer
4. coding, dibawah ini adalah contoh source code untuk membuat animasi teks berjalan di VB.Net/ Visual Basic 2008 :
Public Class Form1
'Sesuaikan array dengan banyaknya pesan !!'
Dim tulisan(3) As String
Dim i, j As Integer
'code ini diletakkan ditimer1 event tick'
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If i.Equals(tulisan(j).Length) Then
Me.Label1.Text = ""
If j < tulisan.Length - 1 Then
j = j + 1
Me.Label1.Text = tulisan(j)
Else
j = 0
End If
i = 0
End If
Label1.Text = tulisan(j).Substring(0, i)
i = i + 1
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Masukkan pesan yang ingin ditampilkan disini
tulisan(0) = " Welcome to www.indofreak.blogspot.com "
tulisan(1) = " Thank's for coming and please come back any time "
tulisan(2) = " Happy Coding !!! ... "
tulisan(3) = " Waktu menunjukkan pukul : " & TimeValue(Date.Now) & " "
Label1.Text = tulisan(j)
End Sub
End Class
Subscribe to:
Posts (Atom)