Probiere mal
[autoit]Runas ("Benutzername", "Domäne", "Kennwort", 0, '"C:\Program Files\WinRAR\WinRAR.exe"')
[/autoit]Gruß,
UEZ
Probiere mal
[autoit]Runas ("Benutzername", "Domäne", "Kennwort", 0, '"C:\Program Files\WinRAR\WinRAR.exe"')
[/autoit]Gruß,
UEZ
FileReadLine
FileWriteLine
könnten dir helfen.
Gruß,
UEZ
Probiere mal dies aus: Network Interface Info, Statistics, and Traffic oder Traffic Metter
Gruß,
UEZ
Es kommt auf die Anwendung an. Z.B. kannst du _ArrayDisplay in einer WM Funktion vergessen, wenn du ein Array debuggen willst.
Oder du könntest den Output in eine Datei "pumpen", etc.
Du könntest auch die Ausgabe mit $iItemLimit limitieren, wobei momentan nicht ein Bereich angegeben werden kann.
64D erinnert mich an Analysis über den R^n Raum...arbeite daran. ![]()
Gruß,
UEZ
Freut mich, dass euch die UDF gefallen hat.
Manchmal sehr nützlich...
Gruß,
UEZ
Hier eine kleine UDF, um ein Array in der Console auszugeben.
_ArrayDisplayConsole:
#include-once
#include <String.au3>
; #FUNCTION# ====================================================================================================================
; Name ..........: _ArrayDisplayConsole
; Description ...: Displays given 1D or 2D array in the console only
; Syntax ........: _ArrayDisplayConsole($avArray[, $iColumnWidth = 24[, $iItemLimit = -1[, $bDisplayCRNo = True[,
; $bDisplayValueBorders = False[, $sValueBorderChar = "*"[, $bShowBorder = False[, $sBorderChar = "|"[,
; $bCenter = False]]]]]]]])
; Parameters ....: $avArray - Array to display
; $iColumnWidth - [optional] String length of each cell
; $iItemLimit - [optional] Maximum number of lines (rows) to show
; $bDisplayCRNo - [optional] Display column / row numbers
; $bDisplayValueBorders - [optional] Display border around the array value to see any white space
; $sValueBorderChar - [optional] value border character
; $bShowBorder - [optional] show the border of the cell
; $sBorderChar - [optional] border of the cell
; $bCenter - [optional] center the text in the columns
; Return values .: Success - 1
; Failure - 0, sets @error:
; | 1 - $avArray is not an array
; | 2 - $avArray has too many dimensions (only up to 2D supported)
; Author ........: UEZ
; Version .......: 0.92 build 2015-01-25 beta
; Modified ......:
; Remarks .......: If an array is found within the array it will be displayed as [ARRAY PTR]
; Related .......: UBound, IsArray, StringFormat, StringLeft, StringLen, ConsoleWrite
; Link ..........:
; Example .......: No
; ===============================================================================================================================
Func _ArrayDisplayConsole($avArray, $iColumnWidth = 24, $iItemLimit = -1, $bDisplayCRNo = True, $bDisplayValueBorders = False, $sValueBorderChar = "*", $bShowBorder = False, $sBorderChar = "|", $bCenter = False)
If Not IsArray($avArray) Then Return SetError(1, 0, 0)
Local $iDimension = UBound($avArray, 0), $iUBound = UBound($avArray, 1) - 1, $iSubMax = UBound($avArray, 2) - 1
If $iDimension > 2 Then Return SetError(2, 0, 0)
If $iColumnWidth < 1 Or $iColumnWidth = Default Then $iColumnWidth = 24
Local $iH, $iW, $iLenUBound = StringLen($iUBound), $sText, $iBorder = 1, $sArray = "[ARRAY PTR]"
If $bShowBorder Then
$iBorder = 0
Else
$sBorderChar = ""
EndIf
If $bDisplayCRNo And $iSubMax > -1 Then
ConsoleWrite(StringFormat("%-" & $iLenUBound + 2 & "s", " "))
For $iW = 0 To $iSubMax
$sText = "[" & StringLeft($iW, $iColumnWidth) & "]"
Switch $bCenter
Case True
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", _StringRepeat(" ", $iColumnWidth / 2 - 1) & $sText) & $sBorderChar )
Case False
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", $sText) & $sBorderChar)
EndSwitch
Next
ConsoleWrite(@CRLF)
EndIf
If $iItemLimit > 0 Then $iUBound = $iItemLimit - 1
Switch $iDimension
Case 1
For $iH = 0 To $iUBound
If $bDisplayCRNo Then ConsoleWrite(StringFormat("[%0" & $iLenUBound & "s] ", StringLeft($iH, $iColumnWidth)))
If $bDisplayValueBorders Then
Switch IsArray($avArray[$iH])
Case False
$sText = $sValueBorderChar & StringLeft($avArray[$iH], $iColumnWidth) & $sValueBorderChar
Case True
$sText = StringLeft($sArray, $iColumnWidth) & $sValueBorderChar
EndSwitch
Switch $bCenter
Case True
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", _StringRepeat(" ", ($iColumnWidth - StringLen($sText) + $sBorderChar) / 2) & $sText) & $sBorderChar)
Case False
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", $sText) & $sBorderChar)
EndSwitch
Else
Switch IsArray($avArray[$iH])
Case False
$sText = StringLeft($avArray[$iH], $iColumnWidth)
Case True
$sText = StringLeft($sArray, $iColumnWidth)
EndSwitch
Switch $bCenter
Case True
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", _StringRepeat(" ", ($iColumnWidth - StringLen($sText) + $sBorderChar) / 2) & $sText) & $sBorderChar)
Case False
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", $sText) & $sBorderChar)
EndSwitch
EndIf
ConsoleWrite(@CRLF)
Next
Case 2
For $iH = 0 To $iUBound
If $bDisplayCRNo Then ConsoleWrite(StringFormat("[%0" & $iLenUBound & "s]", StringLeft($iH, $iColumnWidth)))
For $iW = 0 To $iSubMax
If $bDisplayValueBorders Then
Switch IsArray($avArray[$iH][$iW])
Case False
$sText = $sValueBorderChar & StringLeft($avArray[$iH][$iW], $iColumnWidth) & $sValueBorderChar
Case True
$sText = $sValueBorderChar & StringLeft($sArray, $iColumnWidth) & $sValueBorderChar
EndSwitch
Switch $bCenter
Case True
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", _StringRepeat(" ", ($iColumnWidth - StringLen($sText) + 1) / 2) & $sText) & $sBorderChar)
Case False
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", $sText) & $sBorderChar)
EndSwitch
Else
Switch IsArray($avArray[$iH][$iW])
Case False
$sText = StringLeft($avArray[$iH][$iW], $iColumnWidth)
Case True
$sText = StringLeft($sArray, $iColumnWidth)
EndSwitch
Switch $bCenter
Case True
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", _StringRepeat(" ", ($iColumnWidth - StringLen($sText) + 1) / 2) & $sText) & $sBorderChar)
Case False
ConsoleWrite(StringFormat("%-" & $iColumnWidth + $sBorderChar & "s", $sText) & $sBorderChar)
EndSwitch
EndIf
Next
ConsoleWrite(@CRLF)
Next
EndSwitch
ConsoleWrite(@CRLF)
Return 1
EndFunc
Beispiel:
[autoit]
#include "_ArrayDisplayConsole.au3"
Global $avArray0[1] = ["Test"]
[/autoit][autoit][/autoit][autoit]Global $avArray1[3][5] = [["Andy", "Eukalyptus", "BugFix", "Oscar", "minx"], _
["Tweaky", "AsperinJunkie", "pee", "", $avArray0], _
["water", "Sprenger120", "chesstiger", "GunFood", "Techmix"]]
_ArrayDisplayConsole($avArray1, 28, -1, True, False, "*", True, "|", True)
[/autoit][autoit][/autoit][autoit]ConsoleWrite(@CRLF)
[/autoit][autoit][/autoit][autoit]Global $avArray2[6] = ["Cheater Dieter", "Mars", $avArray0, "funkey", "name22", "Raupi"]
_ArrayDisplayConsole($avArray2, 15)
Global $avArray3 = StringSplit(WinGetClassList("", ""), @LF)
_ArrayDisplayConsole($avArray3, 20)
Gruß,
UEZ
Habe leider keinen Full HD Monitor... ![]()
Gruß,
UEZ
Das Ganze ein bissl bunt:
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
#include <GDIPlus.au3>
#include <GUIConstants.au3>
Opt('GUIOnEventMode', 1)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_Startup()
[/autoit] [autoit][/autoit] [autoit]; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]; > Hier kannst du herumspielen! ![]()
Global Const $iWidth = 1024
Global Const $iHeight = 768
Global Const $fA = -70
Global Const $fB = 100
Global Const $fC = -100
Global Const $iNum = 100000
Func Term($fA, $fB, $fC, $fX, $fY)
Return $fY - SIGN($fX) * Abs($fB * $fX - $fC) ^ 0.5
EndFunc
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]Global Const $fU = $iWidth / 2
Global Const $fV = $iHeight / 2
Global $hGUI, $hGraphics, $i, $fX, $fY, $fX2, $fY2, $iR, $iG, $iB
[/autoit] [autoit][/autoit] [autoit]; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]$hGUI = GUICreate('Hüpfer [Make-Grafik]', $iWidth, $iHeight)
GUISetOnEvent($GUI_EVENT_CLOSE, GUI_EVENT_CLOSE)
GUISetState()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBrush = _GDIPlus_BrushCreateSolid(0)
_GDIPlus_GraphicsClear($hGraphics, 0xFF181818)
[/autoit] [autoit][/autoit] [autoit]; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]For $i = 1 To $iNum
_GDIPlus_GraphicsFillRect($hGraphics, $fU + $fX, $fV + $fY, 1, 1, $hBrush)
$fX2 = Term($fA, $fB, $fC, $fX, $fY)
$fY2 = $fA - $fX
$fX = $fX2
$fY = $fY2
$iR = 0x10000 * Int(Abs($fY) > 0xFF ? 0xFF : Abs($fY))
$iG = 0x100 * Int(Abs($fY2) > 0xFF ? 0xFF : Abs($fY2))
$iB = Int(Abs($fX) > 0xFF ? 0xFF : Abs($fX))
_GDIPlus_BrushSetSolidColor($hBrush, 0x80000000 + $iR + $iG + $iB)
Next
ConsoleWrite('! Finish' & @CRLF)
[/autoit] [autoit][/autoit] [autoit]While Sleep(1000)
WEnd
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit] [autoit][/autoit] [autoit]Func SIGN($fValue)
Return ($fValue < 0 ? -1 : ($fValue > 0) ? 1 : 0)
EndFunc
Func GUI_EVENT_CLOSE()
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_Shutdown()
Exit
EndFunc
; ++++++++++ +++++++++ ++++++++ +++++++ ++++++ +++++ ++++ +++ ++ +
[/autoit]Danke für's Teilen!
Gruß,
UEZ
Schaue dir doch mal in der Hilfedatei _WinAPI_ShellExtractIcon an.
Gruß,
UEZ
Ich will meine Version einfach auch mal posten:
[autoit]
Global $aZahlen = FillArray()
Global $iSumme = 0
For $i = 0 To UBound($aZahlen) - 1
ConsoleWrite($aZahlen[$i] & @CRLF)
$iSumme += $aZahlen[$i]
Next
ConsoleWrite("Summe = " & $iSumme & @CRLF)
Func FillArray($iZahlen = 8, $iMax = 50)
Local $aZahlen[$iZahlen], $iSumme = Random(1, Int(($iMax - $iZahlen) / $iZahlen), 1), $i = 1
$aZahlen[0] = $iSumme
Do
$r = Random(1, Int(($iMax - $iSumme - $i) / 2) < 2 ? 2 : Int(($iMax - $iSumme - $i) / 2), 1)
If $r + $iSumme < $iMax Then
$iSumme += $r
$aZahlen[$i] = $r
$i += 1
EndIf
Until $i = $iZahlen
If $iMax - $iSumme Then $aZahlen[Random(0, $iZahlen - 1, 1)] += $iMax - $iSumme
Return $aZahlen
EndFunc
Keine Ahnung wie die Normalverteilung aussieht.
Gruß,
UEZ
Update auf v0.98 build 2015-01-15 beta:
Gruß,
UEZ
Gruß,
UEZ
Hast es mit der neusten Beta probiert? Eigentlich sollte es ab der Version 3.3.12.0 funzen.
Gruß,
UEZ
Du kannst die _GDIPlus_GIFAnim.au3 von hier benutzen.
Beispiel zum Extrahieren:
[autoit]
#AutoIt3Wrapper_Version=b
#include <Array.au3>
#include "_GDIPlus_GIFAnim.au3"
_GDIPlus_Startup()
Global $binGif = Binary(FileRead("BoingRed v2.1.gif"))
Global $hGIFImage = _GDIPlus_BitmapCreateFromMemory($binGif)
Global Const $iAnimDimCount = _GDIPlus_GIFAnimGetFrameDimensionsCount($hGIFImage), _
$tGUID = _GDIPlus_GIFAnimGetFrameDimensionsList($hGIFImage, $iAnimDimCount), _
$iAnimFrameCount = _GDIPlus_GIFAnimGetFrameCount($hGIFImage, $tGUID), _
$aFrameDelays = _GDIPlus_GIFAnimGetFrameDelaysFromBinFile($binGif, $iAnimFrameCount)
ConsoleWrite("Extracting " & Int($iAnimFrameCount) + 1 & " frames to disk and resizing each frame to 32x32 pixels..." & @CRLF)
[/autoit][autoit][/autoit][autoit]_GDIPlus_GIFAnimExtractAllFrames($hGIFImage, @ScriptDir & "\BoingRed v2.1_frames\BoingRed.gif", 85, 32, 32, 2, 1)
;~ FileWrite("c:\Temp\GIFAnim.delay.txt", _ArrayToString($aFrameDelays))
_GDIPlus_BitmapDispose($hGIFImage)
_GDIPlus_Shutdown()
ConsoleWrite("Done." & @CRLF)
Gruß,
UEZ
$s1 = "foo"
$s2 = ""
MsgBox(0, "Test", StringLen($s1) ? StringLen($s2) ? $s1 & " -- " & $s2 : $s1 : $s2)
[/autoit]Gruß,
UEZ
Versuches es mal damit:
[autoit]StringRegExpReplace($s_xmlline, "(?im).*>(.+)<\/.*", "$1")
[/autoit]Gruß,
UEZ
Ich vermute eher, dass es die CPU ist, die bestimmte Befehle in den schnellen Cache legt, um wiederkehrende Prozessor Code schneller ablaufen zu lassen.
Ich könnte ja dir meine komplilierte Exe geben und die sollte sich theoretisch nicht von deiner Version in Bezug auf Geschwindigkeit unterscheiden.
Resultat von Post#13
>Result with AutoIt 3.3.13.19 x64.
>CPU: Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz X64
>RAM: 4.28/7.43 GB
>OS: WIN_81 (9600) X64
>Parameter: 100
+Func For (1) needs for 4095 runs 519.66 ms (Average: 0.1269 ms) --> 1.0x
!Func While (2) needs for 4095 runs 685.15 ms (Average: 0.1673 ms) --> 1.3x
-Func Do (3) needs for 4095 runs 671.51 ms (Average: 0.1640 ms) --> 1.3x
Gruß,
UEZ
Ich habe mir die 1 Test Funktion mal näher angeschaut und es sieht so aus, als ob der Prozessor die "leere" For/Next Schleife anders ausführt als die anderen 2 Funktionen, die in der Schleife die Variable hochzählen.
Ergo:
[autoit]
Func _TestFunc_1($vParam = False);funktion 1
Local $j = 0
For $i = 1 To $vParam
$j += 1
Next
EndFunc ;==>_TestFunc_1
Das Resultat sieht dann bei mir anders aus!
>Result with AutoIt 3.3.12.0 x64.
>CPU: Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz X64
>RAM: 4.25/7.43 GB
>OS: WIN_81 (9600) X64
>Parameter: 1000
+Func For (1) needs for 4095 runs 710.43 ms (Average: 0.1735 ms) --> 1.0x
-Func While (2) needs for 4095 runs 1997.82 ms (Average: 0.4879 ms) --> 2.8x
!Func Do (3) needs for 4095 runs 2062.90 ms (Average: 0.5038 ms) --> 2.9x
Das würde bedeuten, dass mein Prozessor die nichts tuende Schleife einfach ignoriert und deshalb es zu dem Faktor 12 kommt.
Gruß,
UEZ
Hier meine Werte:
>Result with AutoIt 3.3.12.0 x86.
>CPU: Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz X64
>RAM: 4.31/7.43 GB
>OS: WIN_81 (9600) X64
>Parameter: 1000
+Func For (1) needs for 4095 runs 258.87 ms (Average: 0.0632 ms) --> 1.0x
-Func While (2) needs for 4095 runs 2755.07 ms (Average: 0.6728 ms) --> 10.6x
!Func Do (3) needs for 4095 runs 2764.77 ms (Average: 0.6752 ms) --> 10.7x
>Result with AutoIt 3.3.13.19 x86.
>CPU: Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz X64
>RAM: 4.24/7.43 GB
>OS: WIN_81 (9600) X64
>Parameter: 1000
+Func For (1) needs for 4095 runs 184.77 ms (Average: 0.0451 ms) --> 1.0x
-Func While (2) needs for 4095 runs 2145.54 ms (Average: 0.5239 ms) --> 11.6x
!Func Do (3) needs for 4095 runs 2198.83 ms (Average: 0.5370 ms) --> 11.9x
>Result with AutoIt 3.3.12.0 x64.
>CPU: Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz X64
>RAM: 4.24/7.43 GB
>OS: WIN_81 (9600) X64
>Parameter: 1000
+Func For (1) needs for 4095 runs 159.08 ms (Average: 0.0388 ms) --> 1.0x
-Func While (2) needs for 4095 runs 1883.34 ms (Average: 0.4599 ms) --> 11.8x
!Func Do (3) needs for 4095 runs 1928.14 ms (Average: 0.4709 ms) --> 12.1x
>Result with AutoIt 3.3.13.19 x64.
>CPU: Intel(R) Core(TM) i5-4300U CPU @ 1.90GHz X64
>RAM: 4.24/7.43 GB
>OS: WIN_81 (9600) X64
>Parameter: 1000
+Func For (1) needs for 4095 runs 153.76 ms (Average: 0.0375 ms) --> 1.0x
-Func While (2) needs for 4095 runs 1867.55 ms (Average: 0.4561 ms) --> 12.1x
!Func Do (3) needs for 4095 runs 1874.19 ms (Average: 0.4577 ms) --> 12.2x
Alles anzeigen
Die Beta x64 scheint die schnellste Version zu sein.
Gruß,
UEZ
Auf meinem Win 8.1 Notebook läuft's auch nicht.
Fehler: "Error ARB Extension".
Kompatibilitätsmodis: WinXP, Win7 funzt es auch nicht.
Gruß,
UEZ