.:: Jasa Membuat Aplikasi Website,Desktop,Android Order Now..!! | | Order Now..!! Jasa Membuat Project Arduino,Robotic,Print 3D ::.

The multiplication of loops is the trap of programming

0 komentar


بِسْــــــــــــــــمِ اﷲِالرَّحْمَنِ اارَّحِيم
bismillaahirrahmaanirrahiim

السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
Assalamu'alaikum warahmatullahi wabarakatuh

The multiplication of loops is the trap of programming


In the previous article, we have made ??a password generator essentially consists of numbers based on two different approaches: hard-coding consists of many lines of code proved to be the fastest way. Code with recursion is made with fewer lines of code, but has been slower in the final. Although one may think that the hard coding is faster in terms of performance, it is actually the least flexible. Look more closely at the following piece of code. Go directly to the end of the computer code for an explanation.The multiplication of loops is the trap of programming




    Private Function CheckLetter1()
        Dim index1 As Integer
        Dim index2 As Integer
        Dim index3 As Integer
        Dim index4 As Integer
        Dim index5 As Integer
        Dim index6 As Integer
        Dim found As Boolean
        Dim date1 As Date
        Dim date2 As Date
        Dim checker As String
        date1 = DateTime.Now
        found = False

        If NumericUpDown1.Value >= 1 Then
            'look for first draw
            For index1 = 0 To 25 Step 1 'a - z
                checker = Microsoft.VisualBasic.ChrW(97 + index1)
                ListBox1.Items.Add(checker)
                If TextBox1.Text = checker Then
                    TextBox2.Text = checker
                    found = True
                End If
            Next
            For index1 = 0 To 9 Step 1 '0 - 9
                checker = Microsoft.VisualBasic.ChrW(48 + index1)
                ListBox1.Items.Add(checker)
                If TextBox1.Text = checker Then
                    TextBox2.Text = checker
                    found = True
                End If
            Next

            For index1 = 0 To 25 Step 1 'A - Z
                checker = Microsoft.VisualBasic.ChrW(65 + index1)
                ListBox1.Items.Add(checker)
                If TextBox1.Text = checker Then
                    TextBox2.Text = checker
                    found = True
                End If
            Next
        End If


        If NumericUpDown1.Value >= 2 Then
            'look for numbers 2nd level
            For index1 = 0 To 9 Step 1 ' 0 - 9
                '''
                For index2 = 0 To 25 Step 1 'a - z
                    checker = Microsoft.VisualBasic.ChrW(48 + index1) & Microsoft.VisualBasic.ChrW(97 + index2)
                    ListBox1.Items.Add(checker)
                    If TextBox1.Text = checker Then
                        TextBox2.Text = checker
                        found = True
                    End If
                Next
                For index2 = 0 To 9 Step 1 '0 - 9
                    checker = Microsoft.VisualBasic.ChrW(48 + index1) & Microsoft.VisualBasic.ChrW(48 + index2)
                    ListBox1.Items.Add(checker)
                    If TextBox1.Text = checker Then
                        TextBox2.Text = checker
                        found = True
                    End If
                Next

                For index2 = 0 To 25 Step 1 'A - Z
                    checker = Microsoft.VisualBasic.ChrW(48 + index1) & Microsoft.VisualBasic.ChrW(65 + index2)
                    ListBox1.Items.Add(checker)
                    If TextBox1.Text = checker Then
                        TextBox2.Text = checker
                        found = True
                    End If
                Next
                ''''

            Next
            For index1 = 0 To 25 Step 1 ' 0 - 9
                '''
                For index2 = 0 To 25 Step 1 'a - z
                    checker = Microsoft.VisualBasic.ChrW(97 + index1) & Microsoft.VisualBasic.ChrW(97 + index2)
                    ListBox1.Items.Add(checker)
                    If TextBox1.Text = checker Then
                        TextBox2.Text = checker
                        found = True
                    End If
                Next
                For index2 = 0 To 9 Step 1 '0 - 9
                    checker = Microsoft.VisualBasic.ChrW(97 + index1) & Microsoft.VisualBasic.ChrW(48 + index2)
                    ListBox1.Items.Add(checker)
                    If TextBox1.Text = checker Then
                        TextBox2.Text = checker
                        found = True
                    End If
                Next

                For index2 = 0 To 25 Step 1 'A - Z
                    checker = Microsoft.VisualBasic.ChrW(97 + index1) & Microsoft.VisualBasic.ChrW(65 + index2)
                    ListBox1.Items.Add(checker)
                    If TextBox1.Text = checker Then
                        TextBox2.Text = checker
                        found = True
                    End If
                Next
                ''''

            Next
            For index1 = 0 To 25 Step 1 ' 0 - 9
                '''
                For index2 = 0 To 25 Step 1 'a - z
                    checker = Microsoft.VisualBasic.ChrW(65 + index1) & Microsoft.VisualBasic.ChrW(97 + index2)
                    ListBox1.Items.Add(checker)
                    If TextBox1.Text = checker Then
                        TextBox2.Text = checker
                        found = True
                    End If
                Next
                For index2 = 0 To 9 Step 1 '0 - 9
                    checker = Microsoft.VisualBasic.ChrW(65 + index1) & Microsoft.VisualBasic.ChrW(48 + index2)
                    ListBox1.Items.Add(checker)
                    If TextBox1.Text = checker Then
                        TextBox2.Text = checker
                        found = True
                    End If
                Next

                For index2 = 0 To 25 Step 1 'A - Z
                    checker = Microsoft.VisualBasic.ChrW(65 + index1) & Microsoft.VisualBasic.ChrW(65 + index2)
                    ListBox1.Items.Add(checker)
                    If TextBox1.Text = checker Then
                        TextBox2.Text = checker
                        found = True
                    End If
                Next
                ''''

            Next
        End If

   date2 = DateTime.Now
        '        date2.Subtract(date1).ToString
        ToolStripStatusLabel1.Text = "Finished. " & date2.Subtract(date1).ToString & " and ListBox1 Count: " & ListBox1.Items.Count
        Return 0
    End Function




Function to generate the possible combinations of 0-9 and the letters of the alphabet in upper and lower case. After the function product with the same principle combinations along a length of password of two characters. We note that the first part of the code correctly produce the 62 possible combinations. We also note that the second part of the code also produces all possible combinations of passwords to two characters, but with an impressive amount of computer code. We guess pretty quickly that the complexity becomes ultra impressive when it comes time to encode a password to 3 characters long.
So what should we learn from this approach? Hard-coding the code for calculations of this type is very heavy and the final few ingenious. It is unthinkable not to use the power of the computer to get the desired result.

Read the previous article in the series of this article: Basic recursivity for password
Read the first series of this item : Password programming for beginners
Dans le prochain article : N/A
Download the sample project  : : PasswordGame.zip



Update Contact :
No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email : Fajarudinsidik@gmail.com
NB :: Bila Sobat tertarik Ingin membuat software, membeli software, membeli source code, membeli hardware elektronika untuk kepentingan Perusahaan maupun Tugas Akhir (TA/SKRIPSI), Insyaallah Saya siap membantu, untuk Respon Cepat dapat menghubungi kami, melalui :

No Wa/Telepon (puat) : 085267792168
No Wa/Telepon (fajar) : 085369237896
Email: Fajarudinsidik@gmail.com


atau Kirimkan Private messanger melalui email dengan klik tombol order dibawah ini :

ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَٰلَمِين
Alhamdulilah hirobil alamin

وَ السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ
wassalamualaikum warahmatullahi wabarakatuh


Artikel The multiplication of loops is the trap of programming, Diterbitkan oleh scodeaplikasi pada Selasa, 19 Februari 2013. Semoga artikel ini dapat menambah wawasan Anda. Website ini dipost dari beberapa sumber, bisa cek disini sumber, Sobat diperbolehkan mengcopy paste / menyebar luaskan artikel ini, karena segala yang dipost di public adalah milik public. Bila Sobat tertarik Ingin membuat software, membeli software, membeli source code ,Dengan Cara menghubungi saya Ke Email: Fajarudinsidik@gmail.com, atau No Hp/WA : (fajar) : 085369237896, (puat) : 085267792168.

Tawk.to