Leaderboard
Popular Content
Showing content with the highest reputation on 11/23/2020 in all areas
-
Qick way to find last \ in a URL.
GokAy and 2 others reacted to JockoDundee for a topic
Update... The test results: tommytx : stmt length: 31 output:colors.php Time for 1000: 6.5914 each: 0.0066 mikell : stmt length: 31 output:colors.php Time for 1000: 6.5373 each: 0.0065 pathsplit: stmt length: 32 output:colors.php Time for 1000: 19.8721 each: 0.0199 chimp : stmt length: 43 output:colors.php Time for 1000: 4.4016 each: 0.0044 The code* tested: #include <File.au3> Global $p="shorty\wp-content\plugins\IDXSEO\css\colors.php" RunTest() ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func tommytx($s) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $s=StringSplit($s,"\") Return $s[$s[0]] EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func mikell($s) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Return StringRegExp($s,"[^\\]+$",1)[0] EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func pathsplit($s) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Return _PathSplit($s,"","","",$s)[3]&$s EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func chimp($s) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Return StringTrimLeft($s,StringInStr($s,'\',0,-1)) EndFunc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Func RunTest() ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ConsoleWrite("tommytx: length: 31 output:"& tommytx($p) &@CRLF) TimeIt(tommytx,1000) ConsoleWrite("mikell: length: 31 output:"& mikell($p) &@CRLF) TimeIt(mikell,1000) ConsoleWrite("pathsplit: length: 32 output:"& pathsplit($p) &@CRLF) TimeIt(pathsplit,1000) ConsoleWrite("chimp: length: 43 output:"& chimp($p) &@CRLF) TimeIt(chimp,1000) *code has been optimized for whitespace and identifiers - please respond with any further optimizations or objections to the current optimization.3 points -
Regex and character help, please (AutoIt loses no break spaces)
TheDcoder and one other reacted to JockoDundee for a topic
Isn’t Unicode Unisex by nature? Therefore is emasculation thru conversion therapy even possible?2 points -
set a pic ontop on a listview ??
AlienStar and one other reacted to pixelsearch for a topic
Does this other way of doing it satisfy your needs ? (Main GUI is less high in this script, so the resulting pic takes less place when displayed below) Also, what should happen when the user clicks on the "now-hidden" listview header ? #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test", 620, 140) $listview_st = GUICtrlCreateListView("#|sections", 30, 20, 579, 93) ControlDisable($hGUI, "", HWnd(_GUICtrlListView_GetHeader($listview_st))) ; Melba23's way GUICtrlCreateListViewItem("1|100", $listview_st) GUICtrlCreateListViewItem("2|200", $listview_st) $hGUI_Child = GUICreate("", 579, 25, 30, 20, $WS_CHILD, -1, $hGUI) $idPic = GUICtrlCreatePic("head_main.jpg", 0, 0, 579, 25) GUISetState(@SW_SHOW, $hGUI) GUISetState(@SW_SHOW, $hGUI_Child) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI_Child) GUIDelete($hGUI)2 points -
Check dog's poo. You will find the example code there !2 points
-
Hi, I'm developing CefAu3 project, it embed Chromium browser to your AutoIt program. I'm busy and can stop it. If you want to contribute, you can fork my project and build it yourself. Some Features: - Easy create CEF window - Multi-message loop - Interaction between AutoIt and JavaScript - Supports AutoIt binding - Supports user events... Github: https://github.com/wy3/cefau3 MiniBrowser: https://github.com/small-autoit/mb CEF project: https://bitbucket.org/chromiumembedded/cef Learn more: http://magpcss.org/ceforum/1 point
-
Ah, then: $zerowidthnonjoiner = ChrW(0x200C) $nonbreakspace = ChrW(0xA0) $grabbedtext = _ $nonbreakspace & "111" & $nonbreakspace & $zerowidthnonjoiner & "blah1..." & _ $nonbreakspace & "222" & $nonbreakspace & $zerowidthnonjoiner & "blah2..." & _ $nonbreakspace & "333" & $nonbreakspace & $zerowidthnonjoiner & "blah3..." & _ $nonbreakspace & "444" & $nonbreakspace & $zerowidthnonjoiner & "blah4..." & _ $nonbreakspace & "555" & $nonbreakspace & $zerowidthnonjoiner & "blah5..." ;~ $grabbedtext2 = StringRegExpReplace($grabbedtext, '(' & $nonbreakspace & ')(\d+)(' & $nonbreakspace & $zerowidthnonjoiner & ')', '{$2}') ; less verbose $grabbedtext2 = StringRegExpReplace($grabbedtext, '(\xA0)(\d+)(\xA0\x{200C})', '{$2}') Local $aChrW = StringToASCIIArray($grabbedtext) _NameIt($aChrW) _ArrayDisplay($aChrW, "Before") Local $aChrW2 = StringToASCIIArray($grabbedtext2) _NameIt($aChrW2) _ArrayDisplay($aChrW2, "After") Func _NameIt(ByRef $a) For $i = 0 To UBound($a) - 1 Switch $a[$i] Case 0xA0 $a[$i] = "NBS" Case 0x200B $a[$i] = "ZWS" Case 0x200C $a[$i] = "ZWNJ" Case 0x200D $a[$i] = "ZWJ" Case 0xFEFF $a[$i] = "ZWNBS" Case Else $a[$i] = ChrW($a[$i]) EndSwitch Next EndFunc In fact I misunderstood your requirements and your initial pattern was on par AFAICT. It remains that the content of your grabbed text may not contain what you expect. My snippet demonstrates that: 1) both NBSs and ZWNJ are correctly detected in an input string; 2) the regex correctly matches them as requested.1 point
-
Rectangular Selection in ListView
argumentum reacted to LarsJ for a topic
In the first version of the code there were a few errors. In the $WM_RBUTTONDOWN section of GuiListViewMRS.au3 that handles right-click, there are some right-click events that are simply not included. In the Virtual-MRS-Ex3.au3 example, a recalculation of the $MRS_aSubItems array is performed. However, the recalculation isn't performed in all cases. Both situations result in array subscript/dimension errors with subsequent crash of the code. I've made a quick update to correct these errors. I've also added a new example, Conventional-MRS-Ex3.au3, which is a copy of Virtual-MRS-Ex3.au3 but implemented as a conventional listview. 7z-file at bottom of first post is updated.1 point -
I think I understand what you mean (not exactly sure). But anyway here a stronger approach I would use : #include <GUIConstantsEx.au3> #include <Array.au3> _Main() Func _Main() Local $array[8] = ["Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri"] $hGUI = GUICreate("", 500, 300) $listview = GUICtrlCreateListView("categories", 20, 20, 460, 180) $mMenu = GUICtrlCreateContextMenu($listview) Local $aMenuId[UBound($array)] For $i = 0 To UBound($array) - 1 $aMenuId[$i] = GUICtrlCreateMenuItem($array[$i], $mMenu) Next $idButton = GUICtrlCreateButton("OK", 200, 220, 100, 25) Local $idTemp = GUICtrlCreateMenuItem("end", $mMenu) _ArrayAdd($array, "end") _ArrayAdd($aMenuId, $idTemp) GUISetState(@SW_SHOW) While True $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_NONE ; not truly required but it will prevent triggering Case Else for nothing Case $GUI_EVENT_CLOSE Exit Case $idButton ConsoleWrite ("Button was pressed" & @CRLF) Case Else For $i = 0 To UBound($aMenuId) - 1 If $iMsg = $aMenuId[$i] Then MsgBox(0, "Menu Selection", $array[$i]) Next EndSwitch WEnd EndFunc ;==>_Main1 point
-
Searching specific content in Text file or AU3
seadoggie01 reacted to Nine for a topic
Sometimes I forget I have this running so I was always creating more and more instances. After few days I had like 8 instances of it. I do not see any usage of having more than 1 instance of this tool open.1 point -
1 point
-
Regex and character help, please (AutoIt loses no break spaces)
FrancescoDiMuro reacted to jchd for a topic
The code below shows that there is no emasculation of Unicode strings: $zerowidthnonjoiner = ChrW(0x200C) $nonbreakspace = ChrW(0xA0) $grabbedtext = _ $nonbreakspace & "111" & $nonbreakspace & $zerowidthnonjoiner & "blah1..." & _ $nonbreakspace & "222" & $nonbreakspace & $zerowidthnonjoiner & "blah2..." & _ $nonbreakspace & "333" & $nonbreakspace & $zerowidthnonjoiner & "blah3..." & _ $nonbreakspace & "444" & $nonbreakspace & $zerowidthnonjoiner & "blah4..." & _ $nonbreakspace & "555" & $nonbreakspace & $zerowidthnonjoiner & "blah5..." $grabbedtext2 = StringRegExpReplace($grabbedtext, '(?<=' & $nonbreakspace & ')([0-9]+?)(?=' & $nonbreakspace & $zerowidthnonjoiner & ')', '{$1}') Local $aChrW = StringToASCIIArray($grabbedtext) _NameIt($aChrW) _ArrayDisplay($aChrW, "Before") Local $aChrW2 = StringToASCIIArray($grabbedtext2) _NameIt($aChrW2) _ArrayDisplay($aChrW2, "After") Func _NameIt(ByRef $a) For $i = 0 To UBound($a) - 1 Switch $a[$i] Case 0xA0 $a[$i] = "NBS" Case 0x200B $a[$i] = "ZWS" Case 0x200C $a[$i] = "ZWNJ" Case 0x200D $a[$i] = "ZWJ" Case 0xFEFF $a[$i] = "ZWNBS" Case Else $a[$i] = ChrW($a[$i]) EndSwitch Next EndFunc Your regex was indeed not suited to the job. Then basic Clip* functions might convert (= emasculate) Unicode codepoints to Windows charset. You should be happier with _ClipBoard_{Get|Set}Data using $CF_UNICODETEXT explicitely. EDIT: after checking, it appears that ClipGet & ClipPut don't change the offending codepoints, so your other issue is elsewhere.1 point -
Proper etiquette & procedure to add to UDFs?
FrancescoDiMuro reacted to mLipok for a topic
Just post. We if you upload to the forum a brand new new UDF's I would be happy to take a look, check, and give feedback.1 point -
Proper etiquette & procedure to add to UDFs?
FrancescoDiMuro reacted to JockoDundee for a topic
post a little teaser, I’m sure you’ll get some stylistic feedback...1 point -
is a small variation that saves 2 bytes allowed on my previous post? Local $dog = "shorty\wp-content\plugins\IDXSEO\css\colors.php" MsgBox(0, '', StringTrimLeft($dog, StringInStr($dog, '\', 0, -1))) p.s. in versions that uses an array, if you want to save some bytes you can avoid using the $cat variable like this: Local $dog = "shorty\wp-content\plugins\IDXSEO\css\colors.php" Msgbox(0,"", StringRegExp($dog, "[^\\]+$", 1)[0])1 point
-
Damn again. Such a nice article .... I don't know whether to go to sleep today because I probably wouldn't fall asleep anyway, without reading, analyzing, understanding, my brain would just explode. This is so exciting. Thanks will try to read your article next few days, I hope I will be able to understand all, just at first reading. Regards, mLipok1 point
-
If that simple workaround doesn't work then you'll need to get the resolution of the monitor your window is in and apply the proper scaling to it like the highest DPI is 125% so you need to take the coordinates and scale them by 125% so x = 100 becomes x= 80 y = 50 becomes (50 / 1.25)= 40 it gets to be a pain in the butt because its not alway whole number ex x = 61 / 1.25 = 48.8 so is it pixel 48 or 49 or both?1 point
-
Use _StrinBetween: #include <String.au3> #include <Array.au3> Global $sMyFile = @ScriptDir & '\MyHtmlTest.html' $sText=FileRead($sMyFile) $aLinks=_StringBetween($sText,"a href='","'",$STR_ENDNOTSTART) $aLinks = _ArrayUnique($aLinks) _ArrayDisplay($aLinks)1 point