Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/20/2017 in all areas

  1. For who wants it: ; Unicode Normalization Forms Global Enum $UNF_NormC = 1, $UNF_NormD, $UNF_NormKC = 5, $UNF_NormKD Func _UNF_Change($sIn, $iForm) If $iForm = $UNF_NormC Or $iForm = $UNF_NormD Or $iForm = $UNF_NormKC Or $iForm = $UNF_NormKD Then Local $aRet = DllCall("Normaliz.dll", "int", "NormalizeString", "int", $iForm, "wstr", $sIn, "int", -1, "ptr", 0, "int", 0) Local $tOut = DllStructCreate("wchar[" & $aRet[0] & "]") $aRet = DllCall("Normaliz.dll", "int", "NormalizeString", "int", $iForm, "wstr", $sIn, "int", -1, "ptr", DllStructGetPtr($tOut, 1), "int", $aRet[0]) Return DllStructGetData($tOut, 1) Else SetError(1, 0, $sIn) EndIf EndFunc _Example() Func _Example() Local $sStringToCheck1 = 'Jeżeli' Local $sStringToCheck2 = 'Jeżeli' MsgBox(0, 'Binary', StringToBinary($sStringToCheck1) & @CRLF & StringToBinary($sStringToCheck2)) MsgBox(0, 'Using ==', $sStringToCheck1 == $sStringToCheck2) MsgBox(0, 'Using =', $sStringToCheck1 = $sStringToCheck2) MsgBox(0, 'Using StringCompare', StringCompare($sStringToCheck1, $sStringToCheck2) ? 'Distinct' : 'Same') MsgBox(0, '== after normalization', _UNF_Change($sStringToCheck1, $UNF_NormC) == _UNF_Change($sStringToCheck2, $UNF_NormC)) EndFunc
    2 points
  2. I got me a GED and that proves I can read and write. To me 1+1+1+1+1+1 is as linear as algebra gets. Then again, is an uneducated guess.
    1 point
  3. linear algebra isn't the algebra you learn in 8th grade... lol
    1 point
  4. 1 point
  5. Well I meant : check the array before the loop , so you can see the results/errors $string = _oHTTPGet("https://www.autoitscript.com/site/post-sitemap.xml") $string = StringRegExpReplace($string, '(?s)[\n\r\t\v]', '') $string = StringStripWS($string, 7) $aData = _StringBetween($string, '<loc>','</loc>') If IsArray($aData) Then For $j = 0 To UBound($aData) - 1 ConsoleWrite("Line : " & @ScriptLineNumber & " : " & $aData[$j] & @CRLF) $string2 = _oHTTPGet($aData[$j]) $string2 = StringRegExpReplace($string2, '(?s)[\n\r\t\v]', '') $string2 = StringStripWS($string2, 7) $aPostData = _StringBetween($string2, '</head>','<footer') If IsArray($aPostData) Then For $s = 0 To UBound($aPostData) - 1 $StringBetw2 = _StringBetween($aPostData[$s], '<div class="entry-content','<!-- .entry-content -->') If IsArray($StringBetw2) Then For $i = 0 To UBound($StringBetw2) - 1 $StringBetw2 = StringRegExpReplace($StringBetw2[$i], "(?is)(<script[^>]+javascript.*?/script>)", "") $StringBetw2 = StringRegExpReplace($StringBetw2, '(?s)<.*?>', "" & @CRLF) $StringBetw2 = StringRegExpReplace($StringBetw2, '( )+', "") ConsoleWrite("Line : " & @ScriptLineNumber & " : " & $StringBetw2 & @CRLF) Next Else ConsoleWrite("Line : " & @ScriptLineNumber & " : " & " Problem $StringBetw2" & @CRLF) EndIf Next Else ConsoleWrite("Line : " & @ScriptLineNumber & " : " & " Problem $aPostData" & @CRLF) EndIf Next Else ConsoleWrite("Line : " & @ScriptLineNumber & " : " & " Problem $aData" & @CRLF) EndIf
    1 point
  6. Do you really need that? _Example() Func _Example() Local $sStringToCheck1 = 'Jeżeli' Local $sStringToCheck2 = 'Jeżeli' MsgBox(0, 'Binary', StringToBinary($sStringToCheck1) & @CRLF & StringToBinary($sStringToCheck2)) MsgBox(0, 'Using ==', $sStringToCheck1 == $sStringToCheck2) MsgBox(0, 'Using =', $sStringToCheck1 = $sStringToCheck2) MsgBox(0, 'Using StringCompare', StringCompare($sStringToCheck1, $sStringToCheck2) ? 'Distinct' : 'Same') EndFunc
    1 point
  7. Both string use the same encoding but they differ in Unicode normalization form. Unicode Normalization Form: see https://r12a.github.io/scripts/tutorial/part3 and search for "Precomposed vs. decomposed" to see how this works in Latin scripts. Read about Windows support: https://msdn.microsoft.com/en-us/library/windows/desktop/dd374126(v=vs.85).aspx Change normalization form of a string: https://msdn.microsoft.com/en-us/library/windows/desktop/dd319093(v=vs.85).aspx
    1 point
  8. ...algebra, what is "algebra" ????? =P
    1 point
  9. @Earthshine I was thinking that your comment or question is a little stupid because if you ask why do you need my software if you can achieve the same task in some other way it's like asking why does Google Chrome exist if Internet Xplorer exist or why do you speak English if Spanish exist or many other similar things that do the same thing of other do or even not needed things that exist that make your life easier Well I am not trying to offend but if my software is useless to you just ignore it ok
    1 point
  10. The truly useless key nowadays, is the "Scroll Lock". So I use as a "play a macro ON" key. In this case for speaker volume control. #include <WinAPIvkeysConstants.au3> Global $hDLL = DllOpen("user32.dll") OnAutoItExitRegister("OnAutoItExit") Func OnAutoItExit() DllClose($hDLL) EndFunc main() Func main() Local $iScrollState = BitAND(_WinAPI_Key_GetState($VK_SCROLL, $hDLL), 1) If Not $iScrollState Then Send("{SCROLLLOCK}") $iScrollState = BitAND(_WinAPI_Key_GetState($VK_SCROLL, $hDLL), 1) If Not $iScrollState Then Exit MsgBox(262144+16, StringTrimRight(@ScriptName,4), 'failed to turn on "Scroll Lock"',5) If $iScrollState Then Send("{SCROLLLOCK}") $iScrollState = BitAND(_WinAPI_Key_GetState($VK_SCROLL, $hDLL), 1) If $iScrollState Then Exit MsgBox(262144+16, StringTrimRight(@ScriptName,4), 'failed to turn off "Scroll Lock"',5) ; the above code is to make sure we are affecting the keyboard $iScrollState = BitAND(_WinAPI_Key_GetState($VK_SCROLL, $hDLL), 1) Local $iScrollStateWas = $iScrollState While 1 $iScrollState = BitAND(_WinAPI_Key_GetState($VK_SCROLL, $hDLL), 1) If $iScrollStateWas <> $iScrollState Then $iScrollStateWas = $iScrollState If $iScrollState Then ToolTip("SCROLLLOCK is ON") HotKeySet("{PAUSE}","f_PAUSE") HotKeySet("{UP}","f_UP") HotKeySet("{DOWN}","f_DOWN") HotKeySet("{ESC}","f_ESC") Else HotKeySet("{PAUSE}") HotKeySet("{UP}") HotKeySet("{DOWN}") HotKeySet("{ESC}") ToolTip("") EndIf EndIf Sleep(50) WEnd EndFunc Func f_PAUSE() Send("{VOLUME_MUTE}") ToolTip("VOLUME_MUTE") Send("{SCROLLLOCK OFF}") ; return keyboard use EndFunc ; by {SCROLLLOCK OFF} Func f_UP() Send("{VOLUME_UP}") ToolTip("VOLUME_UP") EndFunc Func f_DOWN() Send("{VOLUME_DOWN}") ToolTip("VOLUME_DOWN") EndFunc Func f_ESC() Exit ; just in case you hide the Tray icon EndFunc Func _WinAPI_Key_GetState($vKey, $vDLL = 'user32.dll') ; read help on _WinAPI_GetAsyncKeyState() and DllOpen() Local $aRet = DllCall($vDLL, 'short', 'GetKeyState', 'int', $vKey) If @error Then Return SetError(@error, @extended, 0) Return $aRet[0] EndFunc ;==>_WinAPI_GetKeyState Func _WinAPI_Key_Pressed($vKey, $vDLL = 'user32.dll') ; read help on _IsPressed(), but use Virtual-Key Codes (WinAPIvkeysConstants.au3) Local $a_R = DllCall($vDLL, "short", "GetAsyncKeyState", "int", $vKey) If @error Then Return SetError(@error, @extended, False) Return BitAND($a_R[0], 0x8000) <> 0 EndFunc ;==>_IsPressed Also here is the version of _IsPressed() I use.
    1 point
  11. You have to set proper encoding for the ini before writing to it. Maybe like this: Example() Func Example() ; Set proper encoding for the ini file FileClose(FileOpen("emoji.ini", 32 + 1 + 8)) ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 200, 200) Local $hinput = GUICtrlCreateInput("", 25, 25, 150, 25) Local $idOK = GUICtrlCreateButton("OK", 75, 100, 50, 25) ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case -3 ExitLoop Case $idOK $emoji = GUICtrlRead($hinput, 1) IniWrite("emoji.ini", "1", "emoji", $emoji) MsgBox(0, "", IniRead("emoji.ini", "1", "emoji", "")) EndSwitch WEnd ; Delete the previous GUI and all controls. GUIDelete($hGUI) EndFunc
    1 point
  12. I know I disappointed some of you guys with this version as you were waiting for the requested features like Sliders, InputBox, Support for tabbing through controls and other stuff. I spent a lot of time for other improvements and got tired of trying to find ways to get stuff to work I tried adding many other things like fully transparent controls, but ended up building in so many workarounds and it still didn't fully work as I wanted to.. I know there are examples for sliders etc. but it gets too complicated and too time consuming when trying to build it into the UDF for easy usage. These are the things on my ToDo List at the moment but I can't tell if or when I will built them in. Windows 10 Style Sliders (Like the volume slider) Some sort of modern looking tab/menu. Simple Inputbox (low prio) Support for tabbing through controls Maybe someone is interested in helping out
    1 point
×
×
  • Create New...