elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Estamos en la red social de Mastodon


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  [SRC] cFrogContest.cls [by Mr. Frog ©]
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] 2 Ir Abajo Respuesta Imprimir
Autor Tema: [SRC] cFrogContest.cls [by Mr. Frog ©]  (Leído 6,526 veces)
Psyke1
Wiki

Desconectado Desconectado

Mensajes: 1.089



Ver Perfil WWW
[SRC] cFrogContest.cls [by Mr. Frog ©]
« en: 7 Febrero 2011, 17:11 pm »

Hola chicos, aqui os dejo uno de mis últimos inventos: cFrogContest.cls. :D
Consiste en una clase cuya finalidad es facilitar los test realizados en los retos que últimamente están tan de moda en la sección. :rolleyes: :xD

Consta de las siguientes carácterísticas:
  • Únicamente una clase, no depende de ningún módulo ni nada más
  • Muestra las funciones con llamadas erroneas
  • Muestra las funciones con resultados erroneos
  • Consta si fue compilado o no para hacer los test
  • Las funciones deben ser públicas
  • Basado en CTiming (con variantes)

Bueno aqui os dejo la clase:
Código
  1. Option Explicit
  2. Option Base 0
  3. '======================================================================
  4. ' º Class      : cFrogContest.cls
  5. ' º Version    : 1.1
  6. ' º Author     : Mr.Frog ©
  7. ' º Country    : Spain
  8. ' º Mail       : vbpsyke1@mixmail.com
  9. ' º Date       : 03/02/2011
  10. ' º Last mod   : 12/02/2011
  11. ' º Twitter    : http://twitter.com/#!/PsYkE1
  12. ' º Dedicated  : Karcrack, BlackZer0x & Raul338
  13. ' º References :
  14. '       http://www.xbeat.net/vbspeed/download/CTiming.zip
  15. '       http://www.devx.com/tips/Tip/15422
  16. ' º Recommended Websites :
  17. '       http://foro.h-sec.org
  18. '       http://visual-coders.com.ar
  19. '       http://InfrAngeluX.Sytes.Net
  20. '======================================================================
  21.  
  22. '@oleaut32.dll
  23. Private Declare Function SafeArrayGetDim Lib "oleaut32" (ByRef vArray() As Any) As Long
  24. '@shlwapi.dll
  25. Private Declare Function PathIsDirectoryA Lib "shlwapi" (ByVal pszPath As String) As Long
  26. '@kernel32.dll
  27. Private Declare Sub RtlMoveMemory Lib "kernel32" (Destination As Any, Source As Any, ByVal Length As Long)
  28. Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As LARGE_INTEGER) As Long
  29. Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As LARGE_INTEGER) As Long
  30. '@shell32.dll
  31. Private Declare Function ShellExecute Lib "shell32" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  32. Private Declare Function SHGetPathFromIDListA Lib "shell32" (ByVal pidl As Long, ByVal szPath As String) As Long
  33. Private Declare Function SHGetSpecialFolderLocation Lib "shell32" (ByVal hwndOwner As Long, ByVal nFolder As Integer, ppidl As Long) As Long
  34.  
  35. '// Types
  36. Private Type TEST_FUNCTION
  37.    Name        As String
  38.    Duration    As Double
  39. End Type
  40.  
  41. Private Type LARGE_INTEGER
  42.    LowPart     As Long
  43.    HighPart    As Long
  44. End Type
  45.  
  46. '// Constants
  47. Private Const MAX_PATH                              As Long = &H100
  48. Private Const SW_MAXIMIZE                           As Long = &H3
  49. Private Const OVERHEAD_TEST                         As Long = &HC8
  50. Private Const CSIDL_DESKTOP                         As Long = &H0
  51.  
  52. '// Variables
  53. Private myFunction()                                As TEST_FUNCTION
  54. Private dblOverHead                                 As Double
  55. Private curTimeFreq                                 As Currency
  56.  
  57. Private oTLI                                        As Object
  58. Private myObj                                       As Object
  59.  
  60. Private bolRet                                      As Boolean
  61. Private bolArgs                                     As Boolean
  62. Private bolError                                    As Boolean
  63. Private bolReplace                                  As Boolean
  64. Private bolNotCompiled                              As Boolean
  65.  
  66. Private lngUBRet                                    As Long
  67. Private lngUBound                                   As Long
  68. Private lngNumberLoops                              As Long
  69.  
  70. Private strLine                                     As String
  71. Private strLine2                                    As String
  72. Private strArguments                                As String
  73. Private strFunction()                               As String
  74. Private strDirSaveTest                              As String
  75. Private strContestName                              As String
  76. Private srtExplanation                              As String
  77.  
  78. Private varRet                                      As Variant
  79. Private varResult                                   As Variant
  80. Private varRevArgs()                                As Variant
  81.  
  82. Private liStop                                      As LARGE_INTEGER
  83. Private liStart                                     As LARGE_INTEGER
  84. Private liFrequency                                 As LARGE_INTEGER
  85.  
  86. '                                         ~~~~~~~> Public Properties <~~~~~~~
  87.  
  88. Friend Property Let ContestName(ByRef ContestName As String)
  89.    strContestName = ContestName
  90. End Property
  91.  
  92. Friend Property Let Explanation(ByRef Explanation As String)
  93.    srtExplanation = Explanation
  94. End Property
  95.  
  96. Friend Sub SetObject(OneObject As Object)
  97.    Set myObj = OneObject
  98. End Sub
  99.  
  100. Friend Sub Functions(ByRef Functions As String, Optional ByRef Delimiter As String = ",")
  101. '------------------------------------------------
  102. ' * Important : All the functions must be public.
  103. '------------------------------------------------
  104.    strFunction = Split(Functions, Delimiter)
  105.    lngUBound = UBound(strFunction)
  106. End Sub
  107.  
  108. Friend Sub Arguments(ParamArray Arguments() As Variant)
  109. Dim lngTotalItems                                   As Long
  110. Dim Q                                               As Long
  111.  
  112.    If Not IsMissing(Arguments) Then
  113.        lngTotalItems = UBound(Arguments)
  114.        strArguments = Join$(Arguments, ", ")
  115.  
  116.        ReDim varRevArgs(lngTotalItems) As Variant
  117.        For Q = 0 To lngTotalItems
  118.            varRevArgs(Q) = Arguments(lngTotalItems - Q)
  119.        Next Q
  120.  
  121.        bolArgs = True
  122.    End If
  123. End Sub
  124.  
  125. Friend Property Let ReplaceFile(ByVal ReplaceIt As Boolean)
  126.    bolReplace = ReplaceIt
  127. End Property
  128.  
  129. Friend Property Let NumberOfLoops(ByVal Times As Long)
  130.    lngNumberLoops = Times
  131. End Property
  132.  
  133. Friend Property Let Result(ByRef Result As Variant)
  134. '---------------------------------------------------------------------
  135. ' * Important : It doesn't support multidimensional arrays or objects.
  136. '---------------------------------------------------------------------
  137. Dim lngLBound                                       As Long
  138. Dim Q                                               As Long
  139.  
  140.    Select Case VarType(Result)
  141.        Case vbDataObject, vbEmpty, vbNull, vbObject, vbUserDefinedType
  142.            Exit Property
  143.        Case Else
  144.            If IsArray(Result) Then
  145.                lngUBRet = UBound(Result)
  146.  
  147.                If VarType(Result) = vbArray + vbString Then
  148.                    varResult = Join$(Result)
  149.                Else
  150.                    lngLBound = LBound(Result)
  151.                    If lngLBound Then
  152.                        lngUBRet = lngUBRet - lngLBound
  153.                        ReDim varResult(lngUBRet) As Variant
  154.  
  155.                        For Q = 0 To lngUBRet
  156.                            varResult(Q) = Result(Q + lngLBound)
  157.                        Next Q
  158.                    Else
  159.                        varResult = Result
  160.                    End If
  161.                End If
  162.            Else
  163.                varResult = Result
  164.            End If
  165.    End Select
  166.  
  167.    bolRet = True
  168. End Property
  169.  
  170. Friend Property Let SaveDirectory(ByRef DirPath As String)
  171.    If PathIsDirectoryA(DirPath) Then
  172.        strDirSaveTest = DirPath
  173.    Else
  174.        strDirSaveTest = GetDesktopPath
  175.    End If
  176.  
  177.    If Not (Right$(strDirSaveTest, 1) = "\") Then
  178.        strDirSaveTest = strDirSaveTest & "\"
  179.    End If
  180. End Property
  181.  
  182. '                                   ~~~~~~~> Public Functions & Procedures <~~~~~~~
  183.  
  184. Friend Sub TestIt()
  185. Dim dblTmpDuration                                  As Double
  186. Dim colError                                        As New Collection
  187. Dim colErrCall                                      As New Collection
  188. Dim strFName                                        As String
  189. Dim bolWrong                                        As Boolean
  190. Dim ff                                              As Integer
  191. Dim Q                                               As Long
  192. Dim C                                               As Long
  193.  
  194.    If SafeArrayGetDim(strFunction) And Not (myObj Is Nothing) Then
  195.        If LenB(strContestName) = 0 Then strContestName = "Test"
  196.        If LenB(srtExplanation) = 0 Then srtExplanation = "-"
  197.        If lngNumberLoops < 1 Then lngNumberLoops = 1
  198.  
  199.        For Q = 0 To lngUBound
  200.            strFName = strFunction(Q)
  201.  
  202.            ResetTimer
  203.            varRet = CallByNameEx(strFName)
  204.            dblTmpDuration = GetTiming
  205.  
  206.            If bolRet Then
  207.                bolWrong = IsWrongResult
  208.            End If
  209.  
  210.            If bolWrong Or bolError Then
  211.                If bolError Or (bolWrong And bolError) Then
  212.                    bolError = False
  213.                    colErrCall.Add strFName
  214.                    Debug.Print "Error Call :", strFName
  215.                ElseIf bolWrong Then
  216.                    colError.Add strFName
  217.                    Debug.Print "Error result :", strFName
  218.                End If
  219.  
  220.                lngUBound = lngUBound - 1
  221.                If lngUBound = -1 Then GoTo JumpSpeedTest
  222.            Else
  223.                ReDim Preserve myFunction(C) As TEST_FUNCTION
  224.  
  225.                With myFunction(C)
  226.                    .Name = strFName
  227.                    .Duration = dblTmpDuration
  228.                End With
  229.  
  230.                C = C + 1
  231.            End If
  232.        Next Q
  233.  
  234.        If lngNumberLoops > 1 Then
  235.            For Q = 0 To lngUBound
  236.                With myFunction(Q)
  237.                    ResetTimer
  238.                    For C = 2 To lngNumberLoops
  239.                        CallByNameEx .Name
  240.                    Next C
  241.                    .Duration = GetTiming + .Duration
  242.                End With
  243.            Next Q
  244.        End If
  245.  
  246.        Call BubbleSort
  247.  
  248. JumpSpeedTest:
  249.  
  250.        strDirSaveTest = Left$(strDirSaveTest, InStrRev(strDirSaveTest, "\"))
  251.        strDirSaveTest = strDirSaveTest & strContestName & ".txt"
  252.        ff = FreeFile
  253.  
  254.        If bolReplace Then
  255.            Open strDirSaveTest For Output As #ff
  256.        Else
  257.            Open strDirSaveTest For Append As #ff
  258.        End If
  259.  
  260.            Print #ff, strLine
  261.            Print #ff, "º Contest Name : "; strContestName
  262.            Print #ff, "º Explanation  : "; srtExplanation
  263.            Print #ff, "º Arguments    : "; strArguments
  264.            Print #ff, "º Loops        : "; CStr(lngNumberLoops)
  265.            Print #ff, "º Date & Hour  : "; Date$; " <-> "; Time$
  266.            Print #ff, strLine
  267.  
  268.            If lngUBound > -1 Then
  269.                Print #ff, "Results "; IIf(bolNotCompiled, "[not ", "["); "compiled] :"
  270.                Print #ff, strLine2
  271.  
  272.                For Q = 0 To lngUBound
  273.                    With myFunction(Q)
  274.                        Print #ff, CStr(Q + 1); ".- "; .Name, , , "-> "; Format$(.Duration * 1000, "#0.000000"); " msec"
  275.                    End With
  276.                Next Q
  277.            End If
  278.  
  279.            With colErrCall
  280.                If .Count Then
  281.                    Print #ff, strLine
  282.                    Print #ff, "º The following calls are wrong :"
  283.                    Print #ff, strLine2
  284.  
  285.                    For Q = 1 To .Count
  286.                        Print #ff, CStr(Q); ".- "; .Item(Q)
  287.                    Next Q
  288.                End If
  289.            End With
  290.  
  291.            With colError
  292.                If bolRet And .Count Then
  293.                    Print #ff, strLine
  294.                    Print #ff, "º The following functions returns incorrect results :"
  295.                    Print #ff, strLine2
  296.  
  297.                    For Q = 1 To .Count
  298.                        Print #ff, CStr(Q); ".- "; .Item(Q)
  299.                    Next Q
  300.                End If
  301.            End With
  302.  
  303.            Print #ff, strLine
  304.            Print #ff, ">>> Test made by cFrogContest.cls <-> Visit foro.elhacker.net <<<"
  305.            Print #ff, strLine; vbCrLf
  306.        Close #ff
  307.    End If
  308. End Sub
  309.  
  310. Friend Function ShowTest() As Long
  311.    ShowTest = ShellExecute(0, "Open", strDirSaveTest, vbNullString, vbNullString, SW_MAXIMIZE)
  312. End Function
  313.  
  314. '                                 ~~~~~~~> Private Functions & Procedures <~~~~~~~
  315.  
  316. Private Function CallByNameEx(ByRef strProcName As String) As Variant
  317. Dim ProcID                                          As Long
  318.  
  319.    On Error GoTo Error_
  320.    ProcID = oTLI.InvokeID(myObj, strProcName)
  321.    If bolArgs Then
  322.        CallByNameEx = oTLI.InvokeHookArray(myObj, ProcID, VbMethod, varRevArgs)
  323.    Else
  324.        CallByNameEx = oTLI.InvokeHook(myObj, ProcID, VbMethod)
  325.    End If
  326. Exit Function
  327.  
  328. Error_:
  329.    bolError = True
  330. End Function
  331.  
  332. Private Function IsWrongResult() As Boolean
  333. Dim lngLBound                                       As Long
  334. Dim Q                                               As Long
  335.  
  336.    If VarType(varRet) And vbArray Then
  337.        lngLBound = LBound(varRet)
  338.        If UBound(varRet) - lngLBound = lngUBRet Then
  339.            If VarType(varRet) = vbArray + vbString Then
  340.                IsWrongResult = (varResult = Join$(varRet))
  341.            Else
  342.                For Q = 0 To lngUBRet
  343.                    IsWrongResult = (varRet(Q + lngLBound) = varResult(Q))
  344.                    If IsWrongResult Then Exit Function
  345.                Next Q
  346.            End If
  347.        End If
  348.    Else
  349.        IsWrongResult = (varResult = varRet)
  350.    End If
  351.  
  352.    IsWrongResult = Not IsWrongResult
  353. End Function
  354.  
  355. Private Sub BubbleSort()
  356. Dim SwapItem                                        As TEST_FUNCTION
  357. Dim lngLimit                                        As Long
  358. Dim Q                                               As Long
  359. Dim C                                               As Long
  360.  
  361.    lngLimit = lngUBound - 1
  362.    For Q = 0 To lngLimit
  363.        For C = 0 To lngLimit
  364.            If myFunction(C).Duration > myFunction(C + 1).Duration Then
  365.                SwapItem = myFunction(C)
  366.                myFunction(C) = myFunction(C + 1)
  367.                myFunction(C + 1) = SwapItem
  368.            End If
  369.        Next C
  370.    Next Q
  371. End Sub
  372.  
  373. Private Function GetDesktopPath() As String
  374. Dim lPidl                                           As Long
  375.  
  376.    GetDesktopPath = String$(MAX_PATH, vbNullChar)
  377.    SHGetSpecialFolderLocation &H0, CSIDL_DESKTOP, lPidl
  378.    SHGetPathFromIDListA lPidl, GetDesktopPath
  379.    GetDesktopPath = Left$(GetDesktopPath, InStrB(GetDesktopPath, vbNullChar) \ 2)
  380. End Function
  381.  
  382. Private Sub ResetTimer()
  383.    QueryPerformanceCounter liStart
  384. End Sub
  385.  
  386. Private Function GetTiming() As Double
  387.    QueryPerformanceCounter liStop
  388.    GetTiming = (LrgIntToCur(liStop) - LrgIntToCur(liStart) - dblOverHead) / curTimeFreq
  389. End Function
  390.  
  391. Private Function LrgIntToCur(liInput As LARGE_INTEGER) As Currency
  392.    RtlMoveMemory LrgIntToCur, liInput, LenB(liInput)
  393. End Function
  394.  
  395. Private Sub Class_Initialize()
  396. Dim Q                                               As Long
  397.  
  398.    bolNotCompiled = (App.LogMode = 0)
  399.    If QueryPerformanceFrequency(liFrequency) = 0 Then
  400.        MsgBox "This PC doesn't support high-res timers", vbCritical, "Fatal Error"
  401.        End
  402.    ElseIf bolNotCompiled Then
  403.        MsgBox "Compile it to get real results!", vbCritical, "Advice"
  404.    End If
  405.  
  406.    ResetTimer
  407.    For Q = 1 To OVERHEAD_TEST
  408.        QueryPerformanceCounter liStop
  409.    Next Q
  410.    dblOverHead = (LrgIntToCur(liStop) - LrgIntToCur(liStart)) / OVERHEAD_TEST
  411.  
  412.    Set oTLI = CreateObject("TLI.TLIApplication")
  413.    strLine = String$(80, "=")
  414.    strLine2 = String$(80, "~")
  415.    curTimeFreq = LrgIntToCur(liFrequency)
  416.  
  417.    Debug.Print ">>> Class cFrogContest.cls initiated at " & Time$ & " <<<"
  418. End Sub


Aqui os dejo un ejemplo de uso, usando todas las propiedades y funciones:
Código
  1. Option Explicit
  2.  
  3. '@kernel32
  4. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
  5.  
  6. Private cFC                     As New cFrogContest '// Class declaration.
  7.  
  8. '~~~~~~~> Functions to test.
  9. Public Function VerySlow(ByVal lngArg1 As Long, ByVal strArg2 As String) As Long
  10.    Sleep 4
  11.    VerySlow = 2
  12. End Function
  13.  
  14. Public Function Slow(ByVal lngArg1 As Long, ByVal strArg2 As String) As Long
  15.    Sleep 2
  16.    Slow = 2
  17. End Function
  18.  
  19. Public Function Quick(ByVal lngArg1 As Long, ByVal strArg2 As String) As Long
  20.    Sleep 1
  21.    Quick = 2
  22. End Function
  23.  
  24. Public Function VeryQuick(ByVal lngArg1 As Long, ByVal strArg2 As String) As Long
  25.    VeryQuick = 3                                   '// I put a different result on purpose. xP
  26. End Function
  27.  
  28. '~~~~~~~> Example of use.
  29. Private Sub Form_Load()
  30.    With cFC
  31.        .ContestName = "Test1"                      '// The constest name.
  32.        .Explanation = "It's only a simple test..." '// Little explanation.
  33.        .SaveDirectory = "c:\"                      '// Directory where you saved the test.
  34.        .ReplaceFile = False                        '// To overwrite the file.
  35.        .Functions "VerySlow,VeryQuick,Slow,Quick"  '// Name of the functions.
  36.        .Arguments 20, "Long life to Frogs!"        '// Arguments of functions (must be the same in all functions).
  37.        .NumberOfLoops = 100                        '// Number of Loop to call them.
  38.        .Result = 2                                 '// This result should give functions.
  39.        .SetObject Me                               '// Object (needed to make the calls).
  40.        .TestIt                                     '// Execute the test and save it.
  41.        .ShowTest                                   '// Shows the txt file.
  42.    End With
  43.  
  44.    End                                             '// Exit.
  45. End Sub

Este es el resultado que aparece en el txt:
Código:
================================================================================
º Contest Name : Test1
º Explanation  : It's only a simple test...
º Arguments    : 20, Long life to Frogs!
º Loops        : 100
º Date & Hour  : 02-12-2011 <-> 22:25:05
================================================================================
Results [not compiled] :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.- Quick                                 -> 193,846610 msec
2.- Slow                                  -> 292,967082 msec
3.- VerySlow                              -> 490,423567 msec
================================================================================
º The following functions returns incorrect results :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1.- VeryQuick
================================================================================
>>> Test made by cFrogContest.cls <-> Visit foro.elhacker.net <<<
================================================================================

También se podría hacer esto:
Código
  1. '...
  2. '~~~~~~~> Example of use.
  3. Private Sub Form_Load()
  4.    With cFC
  5.        .ContestName = "Test1"                      '// The constest name.
  6.        .Explanation = "It's only a simple test..." '// Little explanation.
  7.        .SaveDirectory = "c:\"                      '// Directory where you saved the test.
  8.        .ReplaceFile = False                        '// To overwrite the file.
  9.        .Functions "VerySlow,VeryQuick,Slow,Quick"  '// Name of the functions.
  10.        .Arguments 20, "Long life to Frogs!"        '// Arguments of functions (must be the same in all functions).
  11.        .NumberOfLoops = 100                        '// Number of Loop to call them.
  12.        .Result = 2                                 '// This result should give functions.
  13.        .SetObject Me                               '// Object (needed to make the calls).
  14.        .TestIt                                     '// Execute the test and save it.
  15.  
  16.        .Explanation = "Second test"
  17.        .Result = 3
  18.        .Arguments 34, "It works good"
  19.        .ShowTest                                   '// Shows the txt file.
  20.    End With
  21.  
  22.    End                                             '// Exit.
  23. End Sub

Así podemos hacer varios test de una sola vez... :P

Esto es todo, espero que os haya gustado. :D
Estoy abierto a nuevas ideas y recomendaciones. ;)

DoEvents! :P


« Última modificación: 13 Febrero 2011, 02:00 am por Mr. Frog © » En línea

ntaryl

Desconectado Desconectado

Mensajes: 95



Ver Perfil
Re: [SRC] cFrogContest.cls [Beta]
« Respuesta #1 en: 7 Febrero 2011, 18:15 pm »

Amazing Bro   
+2  from me 


En línea

79137913


Desconectado Desconectado

Mensajes: 1.169


4 Esquinas


Ver Perfil WWW
Re: [SRC] cFrogContest.cls [Beta]
« Respuesta #2 en: 7 Febrero 2011, 19:07 pm »

HOLA!!!

Esta genial el cls, siempre es muy aburrido hacer testers.

Unica observacion es que no me gusta como devuelve los resultados (el dibujito , los cuadros) habria que hacerlo un poco mas lindo.

GRACIAS POR LEER!!!
« Última modificación: 7 Febrero 2011, 19:11 pm por 79137913 » En línea

"Como no se puede igualar a Dios, ya he decidido que hacer, ¡SUPERARLO!"
"La peor de las ignorancias es no saber corregirlas"

 79137913                          *Shadow Scouts Team*
raul338


Desconectado Desconectado

Mensajes: 2.633


La sonrisa es la mejor forma de afrontar las cosas


Ver Perfil WWW
Re: [SRC] cFrogContest.cls [Beta]
« Respuesta #3 en: 7 Febrero 2011, 19:13 pm »

Linda implementacion del TypeLibApplication, Aunque yo modificaría y pondría a ordenar con QuickSort en lugar de BubbleSort :xD

A ver si lo usamos en los próximos retos :P
En línea

Psyke1
Wiki

Desconectado Desconectado

Mensajes: 1.089



Ver Perfil WWW
Re: [SRC] cFrogContest.cls [Beta]
« Respuesta #4 en: 7 Febrero 2011, 19:26 pm »

Gracias :)
Raul, tengo explicación para eso, uso BubbleSort porque el tamaño del array a ordenar es ridículo (10 funciones, 20 como mucho... )
Entonces, de este modo no se nota tanta diferencia entre usar QuickSort o BubbleSort. ;)

DoEvents! :P
En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: [SRC] cFrogContest.cls [Beta]
« Respuesta #5 en: 7 Febrero 2011, 21:06 pm »

.
Por fin lo liberas.

Aun que el punto de que se necesita al menos un por form en el proyecto , eso no es del todo cierto se puede tener trantilamente un sub main() que cargue una clase y la misma llame a esta clase para su implementación.

* Las propiedades deberias bloquearlas si es que ya se llamo a el proceso TestIt()
* Me gusto la simplificacion de la funcio CallByNameEx
* Antes de hacer los test deberias hacer una comrovacion de llamar a las funciones si es que existen, y si cumplen la cantidad de parametros minimos, es decir Antes de hacer los test  esto para evitar hacer llamadas innesesarias.


P.D.: Te falto la referencia de TLI.TLIApplication

Temibles Lunas!¡.
En línea

The Dark Shadow is my passion.
Psyke1
Wiki

Desconectado Desconectado

Mensajes: 1.089



Ver Perfil WWW
Re: [SRC] cFrogContest.cls [Beta]
« Respuesta #6 en: 7 Febrero 2011, 21:25 pm »

.
Por fin lo liberas.

Aun que el punto de que se necesita al menos un por form en el proyecto , eso no es del todo cierto se puede tener trantilamente un sub main() que cargue una clase y la misma llame a esta clase para su implementación.

* Las propiedades deberias bloquearlas si es que ya se llamo a el proceso TestIt()
* Me gusto la simplificacion de la funcio CallByNameEx
* Antes de hacer los test deberias hacer una comrovacion de llamar a las funciones si es que existen, y si cumplen la cantidad de parametros minimos, es decir Antes de hacer los test  esto para evitar hacer llamadas innesesarias.


P.D.: Te falto la referencia de TLI.TLIApplication

Temibles Lunas!¡.
1.-Puse lo del Form porque pensé que sería más simple y cómodo, tambien puedes hacer una clase vacía como tú dices.
2.-Para bloquearlas pondré un boolean ;)
4.-Ook, haré eso para evitar dar vueltas sin motivo.
5.-Cierto, no lo puse porque modifiqué mucho, pero tienes razón, lo agregaré.

Muchas gracias por el comentario constructivo Black! :-*
En estos dias mejoraré la clase :D

DoEvents! :P
En línea

Edu


Desconectado Desconectado

Mensajes: 1.082


Ex XXX-ZERO-XXX


Ver Perfil
Re: [SRC] cFrogContest.cls [Beta]
« Respuesta #7 en: 11 Febrero 2011, 22:15 pm »

Bueno la proxima version podria ser que vs escribas las funciones en un textbox y con un boton diga la velocidad xD
Reto para ustedes, si es q son buenos programadores... xD Quiero ver si lo logran hacer..
En línea

Psyke1
Wiki

Desconectado Desconectado

Mensajes: 1.089



Ver Perfil WWW
Re: [SRC] cFrogContest.cls [Beta]
« Respuesta #8 en: 12 Febrero 2011, 01:18 am »

Bueno la proxima version podria ser que vs escribas las funciones en un textbox y con un boton diga la velocidad xD
Reto para ustedes, si es q son buenos programadores... xD Quiero ver si lo logran hacer..
¿Qué más da escribirlas en un Textbox que en el proyecto?, no le veo la finalidad ha hacerlo de ese modo. :huh:
En estos días arreglaré lo que me han comentado. :)

DoEvents! :P
« Última modificación: 12 Febrero 2011, 12:13 pm por Mr. Frog © » En línea

BlackZeroX
Wiki

Desconectado Desconectado

Mensajes: 3.158


I'Love...!¡.


Ver Perfil WWW
Re: [SRC] cFrogContest.cls [Beta]
« Respuesta #9 en: 12 Febrero 2011, 06:19 am »

.
@XXX-ZERO-XXX

Es demasiado trivial si sabes para que es esta clase y la forma de usar la misma.

Dulces Lunas!¡.
En línea

The Dark Shadow is my passion.
Páginas: [1] 2 Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[SRC] Check_Similar_Words [by Mr. Frog ©] « 1 2 »
Programación Visual Basic
Psyke1 15 6,072 Último mensaje 9 Enero 2011, 23:36 pm
por agus0
[SRC] FrogCheat v1.1 [by Mr. Frog ©] « 1 2 3 »
Programación Visual Basic
Psyke1 28 13,247 Último mensaje 6 Enero 2011, 18:13 pm
por ssccaann43 ©
[SRC] [Tip] AlignListBox [by Mr. Frog ©]
Programación Visual Basic
Psyke1 3 2,129 Último mensaje 13 Diciembre 2010, 03:36 am
por agus0
[SRC] cListBoxMultiAlign [by Mr. Frog ©] « 1 2 »
Programación Visual Basic
Psyke1 11 4,998 Último mensaje 16 Diciembre 2010, 20:40 pm
por Psyke1
[SRC] IIfEx [by Mr. Frog ©]
Programación Visual Basic
Psyke1 2 1,727 Último mensaje 11 Febrero 2011, 15:15 pm
por Psyke1
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines