Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/12/2021 in all areas

  1. Jon

    AutoIt v3.3.15.3 Beta

    AutoIt v3.3.15.3 Beta View File 3.3.15.3 (16th May, 2020) (Beta) AutoIt: - Added #3681: Lang Variable prefix "o". - Fixed #2915: Map memory leak. - Fixed: Map errors with index < 0. UDFs: - Changed #3620: Removed "stable" from _ArraySort function header. - Added #3670: DriveGetDrive() @error doc clarification. - Added #3574: GuiCtrlCreateInput() Doc $ES_AUTOHSCROLL precision. - Fixed: Problem with _WinAPI_GetFontResourceInfo & _WinAPI_GetFontMemoryResourceInfo - Fixed #3728: Added optional parameter to force single column 2D array to 1D. - Fixed #3678: Amended Help file to show that function with no text blanks a line, not removes it. - Fixed #3757: Added note to GUICtrlListView_SetColor* pages about need to use BGR format. - Fixed #3697: _WinAPI_GetOverlappedResult() failure. Submitter Jon Submitted 05/16/2020 Category Beta  
    1 point
  2. This should have been wrapped in a function and run as such. Otherwise the results are not real life results. Resulting in misconceptions on expectation of functionality. Nevertheless, all these are sub millisecond run. So much so that I have to run'em 1000 times to get a steady above millisecond measurement.
    1 point
  3. I’m wondering as well. On the other hand, there are use cases where even a single extra assignment or function call in a routine can add up to minutes or hours of added execution time. Perhaps, you recall the curious case of the “Four Pillars of Destiny”: Those type of CPU only programs are rare, but valid. In a similar scenario, if one was faced with a conversion of huge text files containing only binary strings, it might make a difference if one algorithm was 10x faster. Still, for myself I could see myself using your algorithm, in a normal scenario, just from a pragmatic point of view.
    1 point
  4. Many things will be impacting it. Baseline makes a big difference. Is the environment the same being ran? My baseline was just closing down every other process so they could be ran independently. GOod enough for me. I ran a few test with the internet open and there was 1-2 second difference in the numbers. Is it being compiled or ran through SciTE? How is the program/code being prioritized with the cpu? Version of windows? To really understand it would need to be broken down entirely. How the compiler, assembly and processor. Each thing could be impacting it significantly, the software, hardware, firmware and variation of versions. I dont think I'm really qualified to say, if I did say, everything(programs,software,hardware) else impacting it without a proper baseline. is the simple answer. Until that point is reached, then the baselines are not accurate enough to really determine which is faster. I think a easy way to do a proper baseline might be run windows in safe mode? Is that still possible? never tried in this version of windows.. lol
    1 point
  5. I've seen that. I've given up trying to sort out why in some cases a X86 script is faster than X64 or vice-versa. There are way too many parameters involved and unless I feel speed a must-have, I don't care anymore.
    1 point
  6. 32-bit: Based on code from: Chimp Check: AA 170 1000000 Iterations in 2.9068673 Seconds Based on code from: JockoDundee Check: AA 170 1000000 Iterations in 2.5073343 Seconds 64-bit: Based on code from: Chimp Check: AA 170 1000000 Iterations in 2.7761728 Seconds Based on code from: JockoDundee Check: AA 170 1000000 Iterations in 2.2305445 Seconds
    1 point
  7. Are you saying that the example, as provided above, works with other IP addresses? If so, I seriously doubt that. 😉 Your example does not initialize Winsock before trying to make the connection. If you would've added error checking after the line that executes your __netcode_TCPConnect() function, you would've seen that you received a 10093 Winsock error. That error basically means that Winsock was not initialized. If you run the modified example below, as is, you will see the error. If you uncomment the TCPStartup() and TCPShutdown functions and run it again, it returns a socket handle -- at least it does for me. TCPStartup() is equivalent to calling the wsastartup Winsock API. Global $__net_hWs2_32 = -1 ;~ TCPStartup() ;added by TheXman Global $hSocket = __netcode_TCPConnect("108.174.11.65", 443) If @error Then Exit MsgBox(0, "ERROR", "__netcode_TCPConnect failed with @error = " & @error) ;added by TheXman MsgBox(0, "", $hSocket) ;~ TCPShutdown() ;added by TheXman Func __netcode_TCPConnect($sIP, $sPort, $nAdressFamily = 2) if $__net_hWs2_32 = -1 Then $__net_hWs2_32 = DllOpen('Ws2_32.dll') ; create socket Local $arGen = DllCall($__net_hWs2_32, "uint", "socket", "int", $nAdressFamily, "int", 1, "int", 6) Local $hSocket = $arGen[0] ; create ip and port struct ; ~ todo IPv6 support here Local $tDataBuffer = DllStructCreate("short; ushort; uint; char[8]") DllStructSetData($tDataBuffer, 1, 2) $arGen = DllCall($__net_hWs2_32, "ushort", "htons", "ushort", $sPort) DllStructSetData($tDataBuffer, 2, $arGen[0]) $arGen = DllCall($__net_hWs2_32, "uint", "inet_addr", "str", $sIP) DllStructSetData($tDataBuffer, 3, $arGen[0]) ; connect $arGen = DllCall($__net_hWs2_32, "int", "connect", "uint", $hSocket, "ptr", DllStructGetPtr($tDataBuffer), "int", DllStructGetSize($tDataBuffer)) if $arGen[0] <> 0 Then Return SetError(__netcode_WSAGetLastError(), 0, -1) Return $hSocket EndFunc Func __netcode_WSAGetLastError() If $__net_hWs2_32 = -1 Then $__net_hWs2_32 = DllOpen('Ws2_32.dll') Local $iRet = DllCall($__net_hWs2_32, "int", "WSAGetLastError") If @error Then SetExtended(1) Return 0 EndIf Return $iRet[0] EndFunc
    1 point
  8. Unions in Autoit can be tricky. I learned the hard way in my HTTPAPI UDF. To give credit where credit is due, @Danyfirex is the one that helped me understand it. Of course, I don't have a way to test this other than how I did it in the example below. The tricky part is getting the alignment of the union correct. As you sort of stated, the size of the largest data type in the union determines the union's alignment. And whether you are running as 32 or 64 bit can make a difference. In 32-bit mode, the largest data type in your union is 4 bytes. So the alignment should start on a multiple of 4. The size of the struct before the union, in 32-bit mode, is 28 bytes. Since 28 is a multiple of 4, no alignment adjustment needs to be done. The size of the struct, in 64-bit mode, is 32 bytes and the largest union data type is 8 bytes. So, again, no adjustment to the alignment needs to be done. Again, I haven't been able to test it to make sure that I have everything correct, but I think it looks right. Also, there's more than 1 way to do this in AutoIt. This is just the way that I chose because it seems the most straight forward. This should work in both 32 & 64 bit scripts. So when you implement it in your real script, you would use the appropriate struct (WORD/SENTENCE, MARK/PLAY, or NAME) depending on the event type you are working with. #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 -w 6 -d #AutoIt3Wrapper_UseX64=N ;N = 32-bit / Y = 64-bit #include <Constants.au3> #include <WinAPIDiag.au3> #cs typedef struct { espeak_EVENT_TYPE type; //ENUM unsigned int unique_identifier; // message identifier (or 0 for key or character) int text_position; // the number of characters from the start of the text int length; // word length, in characters (for espeakEVENT_WORD) int audio_position; // the time in mS within the generated speech output data int sample; // sample id (internal use) void* user_data; // pointer supplied by the calling program union { int number; // used for WORD and SENTENCE events. const char *name; // used for MARK and PLAY events. UTF8 string char string[8]; // used for phoneme names (UTF8). Terminated by a zero byte unless the name needs the full 8 bytes. } id; } espeak_EVENT; #ce ;ESPEAK EVENT BASE STRUCT Global $gtag_ESPEAK_EVENT = _ "struct;" & _ "int type;" & _ "uint uid;" & _ "int textPosition;" & _ "int length;" & _ "int audioPosition;" & _ "int sample;" & _ "ptr userData;" & _ "endstruct;" ;ESPEAK ID UNION STRUCTs Global $gtag_ESPEAK_EVENT_UNION_ID_INT = _ "struct;" & _ "int id;" & _ "endstruct;" Global $gtag_ESPEAK_EVENT_UNION_ID_PTR = _ "struct;" & _ "ptr id;" & _ "endstruct;" Global $gtag_ESPEAK_EVENT_UNION_ID_CHAR = _ "struct;" & _ "char id[8];" & _ "endstruct;" ;ESPEAK EVENT STRUCTs with Unions Global $gtag_ESPEAK_EVENT_WORD_SENTENCE = _ $gtag_ESPEAK_EVENT & _ $gtag_ESPEAK_EVENT_UNION_ID_INT Global $gtag_ESPEAK_EVENT_MARK_PLAY = _ $gtag_ESPEAK_EVENT & _ $gtag_ESPEAK_EVENT_UNION_ID_PTR Global $gtag_ESPEAK_EVENT_NAME = _ $gtag_ESPEAK_EVENT & _ $gtag_ESPEAK_EVENT_UNION_ID_CHAR example() Func example() Local $tEspeakEvent $tEspeakEvent = DllStructCreate($gtag_ESPEAK_EVENT) If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "Error creating $gtag_ESPEAK_EVENT - @error = " & @error) _WinAPI_DisplayStruct($tEspeakEvent,$gtag_ESPEAK_EVENT, "ESPEAK_EVENT_" & (@AutoItX64 ? " 64bit" : " 32bit")) $tEspeakEvent = DllStructCreate($gtag_ESPEAK_EVENT_WORD_SENTENCE) If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "Error creating $gtag_ESPEAK_EVENT_WORD_SENTENCE - @error = " & @error) _WinAPI_DisplayStruct($tEspeakEvent,$gtag_ESPEAK_EVENT_WORD_SENTENCE, "ESPEAK_EVENT_WORD_SENTENCE" & (@AutoItX64 ? " 64bit" : " 32bit")) $tEspeakEvent = DllStructCreate($gtag_ESPEAK_EVENT_MARK_PLAY) If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "Error creating $gtag_ESPEAK_EVENT_MARK_PLAY - @error = " & @error) _WinAPI_DisplayStruct($tEspeakEvent,$gtag_ESPEAK_EVENT_MARK_PLAY, "ESPEAK_EVENT_MARK_PLAY" & (@AutoItX64 ? " 64bit" : " 32bit")) $tEspeakEvent = DllStructCreate($gtag_ESPEAK_EVENT_NAME) If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "Error creating $gtag_ESPEAK_EVENT_NAME - @error = " & @error) _WinAPI_DisplayStruct($tEspeakEvent,$gtag_ESPEAK_EVENT_NAME, "ESPEAK_EVENT_NAME" & (@AutoItX64 ? " 64bit" : " 32bit")) EndFunc
    1 point
  9. DigDeep

    Date Format change

    All great responses. I just tried out with another way and works too. We can move the last ones as we want the format to be. $Date = "2016-02-10" MsgBox(0, '', StringRegExpReplace($Date, "(\d{4})-(\d{2})-(\d{2})", "${2}/${3}/${1}")) ; "${2}/${3}/${1}" = "${MM}/${DD}/${YYYY}" Thanks all.
    1 point
  10. Jon

    Aut2exe_x64.exe

    What about /omfg-itz-teh-x64
    1 point
×
×
  • Create New...