Search the Community
Showing results for tags 'Snippet'.
-
Hi, i'v just uploaded my latest project: Simple Snippet Manager to the Downloads. area : The intended usage is to select a Snippet, and to copy it's contents into your favorite Editor. The Copy/Paste process happens over the (windows)Clipboard. The previous clipboard content is not restored. There is a time limit of 60 seconds, in which the pasting of the text is allowed (starting when the App window gets inactive). The Hotkey is reenabled, when the main Window is activated. This is a File/Folder based manager. The App is configured to hold 4000 files and 400 folders with searching depth of 5 sub-folders. The root folder is freely selectable, but it should be a Folder with writing permission. Please install the App in a folder with Writing permission, too. This App only uses an .ini file to save it's configuration, which has to be in the same folder as the App. First configuration: 1. Open the config Window. 2. Enter the Language name, create or seek a root folder, enter an extension. 3. Click on Set button. 4. Click on the Exit button. The Language configuration is done, adding files or folders are needed: 1. Select the language from the dropbox list, and click on Get Lang button. 2a. Right Click on the root folder, chose New folder to add categories. 2b. or chose New/Edit file to open the builtin text editor 3. Paste or Write a snippet-code, enter a filename and save it. (Repeat the 3. as needed) Usage: Select a language, then click on Get Lang button. Choose a file with the left mouse button. Check if the code was loaded in the Textarea at the bottom. Switch to your Sourcecode editor, and press the Hotkey (default= Ctrl/Strg b) to copy and paste the text. There is a time limit of 60 seconds, after the main window gets inactive, in which the copy&pasting is allowed. Changelog: V1.02 (24.06.2020) Addition: Undocumented ini setting: StartLoadLastUsedLanguage Setting this to 1 (default value) will now reload the Last used language at start. Last used language counts for the Language, selected with [Get Lang] button. The [Config] button will delete the last used language. LastUsedLanguageNr, LastUsedLanguageName ini settings are used internaly for the above function. Added version string to the main Window title. V1.01 (23.06.2020) Bugfix : Starting the App without the ini file now sets the correct starting Hotkey (Ctrl b) Addition: Clipboard is saved, before pasting, and restored after pasting. (May work with text data only. p.s. untested!)
-
Version 1.02
526 downloads
Simple Snippet Manager (AutoIt v3.3.14.5) The intended usage is to select a Snippet, and to copy it's contents into your favorite Editor. The Copy/Paste process happens over the (windows)Clipboard. The previous clipboard content is not restored. There is a time limit of 60 seconds, in which the pasting of the text is allowed (starting when the App window gets inactive). The Hotkey is reenabled, when the main Window is activated. This is a File/Folder based manager. The App is configured to hold 4000 files and 400 folders with searching depth of 5 sub-folders. The root folder is freely selectable, but it should be a Folder with writing permission. Please install the App in a folder with Writing permission, too. This App only uses an .ini file to save it's configuration, which has to be in the same folder as the App. First configuration: 1. Open the config Window. 2. Enter the Language name, create or seek a root folder, enter an extension. 3. Click on Set button. 4. Click on the Exit button. The Language configuration is done, adding files or folders are needed: 1. Select the language from the dropbox list, and click on Get Lang button. 2a. Right Click on the root folder, chose New folder to add categories. 2b. or chose New/Edit file to open the builtin text editor 3. Paste or Write a snippet-code, enter a filename and save it. (Repeat the 3. as needed) Usage: Select a language, then click on Get Lang button. Choose a file with the left mouse button. Check if the code was loaded in the Textarea at the bottom. Switch to your sourcecode editor, and press the Hotkey (default= Ctrl/Strg b) to copy and paste the text. There is a timelimit of 60 seconds, after the main window gets inactive, in which the copy&pasting is allowed. The Download includes: 32 + 64bit exe, sourcecode, icon, read me text and 2 Instructional Helpfiles in Html and PDF format. -
Hi guys!, recently i needed to measure two functions and detect fastest one then i decided to write and share this tiny script for compare, measure and detect fastest functions easily. It's such as snippets, i hope you find it useful :)❤ #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 #include-once ; #FUNCTION# ==================================================================================================================== ; Name...........: _FuncSpeedComparator ; Description ...: Compares and measures speed of two functions and shows fastest one. ; Syntax.........: _FuncSpeedComparator($s1stFunc, $s2ndFunc [,$iCallNum, $iResultType]) ; Parameters ....: $s1stFunc - First function that should be compared and measured ; $s2ndFunc - Second function that should be compared and measured ; $iCallNum - [Optional] Number of times function should be called ; Default value is 100 ; $iResultType - [Optional] Type of output must be one of the following numbers: ; 1 ; Results will written in AutoIt Console Output ; 2 ; Results will be as a Message Box ; 3 ; Results will written in AutoIt Console Output and then shows as a Message Box ; Default value is 1 ; Return values .: Success - Returns string ; Failure - Returns False or empty string ; Author ........: Colduction (Ho3ein) ; Modified.......: ; Remarks .......: Function names should be written as string (inside of two Double Quotation or Quotation) to be executed and be measured ; Example .......; _FuncSpeedComparator('ConsoleWrite("10101010101")', 'ConsoleWrite("Hello World!")', 500, 3) ; =============================================================================================================================== Func _FuncSpeedComparator($s1stFunc = "", $s2ndFunc = "", $iCallNum = 100, $iResultType = 1) If Not StringRegExp($s1stFunc, "^[a-zA-Z0-9_]+\x28(.*?)\x29$") Or Not StringRegExp($s2ndFunc, "^[a-zA-Z0-9_]+\x28(.*?)\x29$") Or Not StringRegExp($iCallNum, "^\p{Nd}*$") Or Not StringRegExp($iResultType, "^\p{Nd}*$") Then ; Human mistake preventative stage. Return False Else ; Measure stage. ;; First function measurement. Local $hTimer_1stFunc = TimerInit() For $i = 1 To $iCallNum Execute($s1stFunc) Next Local $iDiff_1stFunc = TimerDiff($hTimer_1stFunc) ;; Second function measurement. Local $hTimer_2ndFunc = TimerInit() For $i = 1 To $iCallNum Execute($s2ndFunc) Next Local $iDiff_2ndFunc = TimerDiff($hTimer_2ndFunc) ; Fastest function detector stage. Local $sFastestFunc = "" If $iDiff_1stFunc = $iDiff_2ndFunc Then $sFastestFunc = "Both of them" ElseIf $iDiff_1stFunc < $iDiff_2ndFunc Then $sFastestFunc = StringRegExpReplace($s1stFunc, "(\x28).*", "") Else $sFastestFunc = StringRegExpReplace($s2ndFunc, "(\x28).*", "") EndIf ; Results stage. Local $sResultText = @CRLF & '#Fastest Function: "' & $sFastestFunc & '"' & @CRLF & @CRLF & '1) "' & StringRegExpReplace($s1stFunc, "(\x28).*", "") & '" time elapsed: (' & $iDiff_1stFunc & ") ms" & @CRLF & '2) "' & StringRegExpReplace($s2ndFunc, "(\x28).*", "") & '" time elapsed: ' & "(" & $iDiff_2ndFunc & ") ms" & @CRLF If $iResultType = 1 Or Not StringRegExp($iResultType, '^[1|2|3]{1}$') Then ; Output as ConsoleWrite. ConsoleWrite($sResultText) ElseIf $iResultType = 2 Then ; Output as MsgBox. MsgBox(64, "Result: " & $sFastestFunc, $sResultText) ElseIf $iResultType = 3 Then ; Output as both ConsoleWrite & MsgBox. ConsoleWrite($sResultText) MsgBox(64, "Result: " & $sFastestFunc, $sResultText) EndIf EndIf EndFunc ;==>_FuncSpeedComparator _FuncSpeedComparator.au3
-
- speedtest
- comparator
-
(and 2 more)
Tagged with:
-
Hi. I like to use au3 abbreviations. 'mb2' is often used. But I don't remember them very long. So I wanted to have a little tool looking for it. This tool is embedded as a command inside SciTE. First the tool itself: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Comment=Looks for an au3-abbreviation of a word in Clipboard or $CmdLine. #AutoIt3Wrapper_Res_Description=Looks for an au3-abbreviation of a word in Clipboard or $CmdLine. #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #AutoIt3Wrapper_Res_LegalCopyright=Simpel #AutoIt3Wrapper_Res_Language=1031 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <File.au3> Global $Ini = @ScriptDir & "\au3abbrev.ini" Global $au3abbrev = "PUT IN HERE THE PATH TO\au3abbrev.properties" ; mine is at …\AutoIt3\SciTE\au3abbrev.properties Global $aGetEntries Global $sSearch, $sOutput FileCopy($au3abbrev, $Ini, 1) ; make an ini from the properties file _FileWriteToLine($Ini, 1, "[Dictionary]") ; inserting '[Dictionary]' at first line, to make ini searchable #Region - Look for the right searchstring If StringLeft($CmdLineRaw, 13) = "/ErrorStdOut " Then ; if not compiled but run with F5 to test $sSearch = ClipGet() ElseIf $CmdLineRaw <> "" Then $sSearch = $CmdLineRaw ElseIf ClipGet() <> "" Then $sSearch = ClipGet() Else MsgBox(0, 'Fehler', "Kein Wort zum Suchen gefunden.") ; error Exit EndIf #EndRegion _GetDefinition() $sSearch = _Clean($sSearch) $sOutput = _Search($sSearch) MsgBox(0, 'au3abbrev.properties', "Ergebnisse für '" & $sSearch & "':" & @CRLF & @CRLF & $sOutput) Exit #Region - Functions Func _GetDefinition() If FileExists($Ini) Then $aGetEntries = IniReadSection($Ini, "Dictionary") If @error Then MsgBox(0, 'Fehler', "Keine Sektion [Dictionary] gefunden.") ; if inserting of "[Dictionary]" failed Exit EndIf EndIf EndFunc Func _Search($sInput) Local $iCounter = 1 Local $sfOutput For $i = 1 To $aGetEntries[0][0] If StringInStr($aGetEntries[$i][1], $sInput) Then ; something is found $sfOutput = $sfOutput & _Clean($aGetEntries[$i][0]) & @TAB & _Clean($aGetEntries[$i][1]) & @CRLF & @CRLF $iCounter = $iCounter + 1 EndIf Next If $sfOutput = "" Then $sfOutput = "KEINE ÜBEREINSTIMMUNG" ; no matches found EndIf Return $sfOutput EndFunc Func _Clean($sData) $sData = StringReplace($sData, "|", "") ; erases "|" because it causes the array to jump to the next entry $sData = StringReplace($sData, '"', "") ; erases '"' because it sometimes causes the array to jump to the next entry Return $sData EndFunc #EndRegion And now the part at SciTEUser: # 41 LookAU3Abbrev command.41.*="H:\_Conrad lokal\Downloads\AutoIt3\_COX\AU3-Abkuerzung.exe" "$(CurrentSelection)" command.name.41.*=Look Abbrev command.shortcut.41.*=Ctrl+Shift+Alt+A command.save.before.41.$(au3)=2 So I mark a regular AutoIt command inside SciTE (with double clicking) and press Ctrl+Shift+Alt+A. I will get a messagebox as answer what abbreviations will contain my sended command. But be careful, not all of these listed abbreviations will expand with space while coding. Abbreviations you want to use have the be declared inside the au3abbrev.keyword.properties(?) Any suggestions? Regards, Conrad
-
Hi Is anyone aware of some form of snippet manager for Autoit that works in a similar way to some of the Visual Studio Snippet Managers. Anything that I could right click and select from a list of prepared Functions and just insert into my scripts.. Thanks