Jump to content

JockoDundee

Active Members
  • Posts

    1,239
  • Joined

  • Last visited

  • Days Won

    35

Reputation Activity

  1. Like
    JockoDundee got a reaction from Xandy in Bring the window to the front of the screen   
    Post code, or it didn’t happen.
  2. Like
    JockoDundee got a reaction from lee321987 in removing unused #include?   
    Ok.

    I can see your confusion and I sympathize, at the same time and as you can see above, redundant can be used in a way that is not wholly synonymous with superfluous.  
    To wit, redundant applied to the subject at hand could mean #includes that are repeated; as is not an uncommon usage, for example:

    Redundant, used in that sense, draws a clear, if subtle distinction with superfluous; for instance an #include that is merely extraneous, as opposed to duplicative. Support for this parochial usage of superfluous in this sense is also extant.
    If we apply our faculties for discernment fully, we would see that the OP is specifically referring to the use case most precisely defined as superfluous, (although, I do not deny that being superfluous always carries an unshakeable taint of redundancy).
    Moreover, the usage is not purely pedantic;  the logic for a tool designed to root out just duplicative includes instead of extraneous includes could diverge greatly; namely the in the former case one could merely scan #include statements and without further investigation into their contents, be determinative.
    Penultimately, and by way of an excuse, I would like to note that in my original post, the word superfluous was intentionally emphasized.
    And as is evident, the language mirrors your statement in my rejoinder, clearly intending to make the distinction between the two adjectives (to which you very astutely were aware of, at least on some level )
    Finally, and IMHO, when we are presented with such clues, we should do our best to indulge our conversational partner by striving to look for their intended meaning with an earnest effort; and avoid the temptation of issuing a reflexively puerile response.
  3. Thanks
  4. Like
    JockoDundee reacted to Danp2 in FileMove error logic   
    I think your mistake is that you are checking @error instead of the return value from the function call. Try this --
    $sBasePath = "F:\Home Videos 2nd\" $sRenameFile = "test 2.mp4" $NewPath = "F:\Home Videos 2nd\testChange.mp4" $NewPathERROR = "F:\Home Videos 2nd\testChange_1.mp4" $iResult = FileMove($sBasePath & $sRenameFile, $NewPath) If Not $iResult Then ConsoleWrite("! Rename - " & $NewPath & " - " & $iResult & @CRLF) $iResult = FileMove($sBasePath & $sRenameFile, $NewPathERROR, 1) ConsoleWrite("> Rename - " & $NewPathERROR & " - " & $iResult & @CRLF) EndIf  
  5. Thanks
    JockoDundee got a reaction from Subz in append array to the end of a file or line   
    You can also use _FileWriteFromArray.
    To append you need to open the file using FileOpen with $FO_APPEND and use that handle with _FileWriteFromArray.
  6. Thanks
    JockoDundee reacted to Subz in append array to the end of a file or line   
    You can use _ArraytoString with @CRLF as the delimiter, then use FileWriteToLine.
  7. Thanks
    JockoDundee reacted to Danyfirex in [Solved] I need help dealing with a C++ DLL [ pointer to pointer ]   
    Hello. Please next time share a runnable code. Here is an example I wrote years ago.
     
    #include <Array.au3> Global Enum $LIBUSB_SUCCESS = 0 Global $g_sLibName = @AutoItX64 ? "iLibUSB.dll" : "iLibUSB_32.dll" Global $g_hlibusb = DllOpen($g_sLibName) _Test() Func _Test() _libusb_init() Local $ahDevicesList = _libusb_get_device_list() _ArrayDisplay($ahDevicesList) _libusb_free_device_list($ahDevicesList) _libusb_exit() EndFunc ;==>_Test Func _libusb_exit($hContext = 0) DllCall($g_hlibusb, "none", "libusb_exit", "ptr", $hContext) If @error Then Return SetError(1, 0, 0) Return 1 EndFunc ;==>_libusb_exit Func _libusb_free_device_list(ByRef $ahDevicesList, $iUnref_Devices = 1) If Not IsArray($ahDevicesList) Or Not UBound($ahDevicesList) Then Return SetError(1, 0, 0) Local $hDeviceList = (UBound($ahDevicesList, 2) = 4) ? $ahDevicesList[0][0] : $ahDevicesList[0] If Not $hDeviceList Then Return SetError(1, 0, 0) Local $aCall = DllCall($g_hlibusb, "none", "libusb_free_device_list", "ptr", $hDeviceList, "int", $iUnref_Devices) If @error Then Return SetError(1, 0, 0) Return 1 EndFunc ;==>_libusb_free_device_list Func _libusb_get_device_list($hContext = 0) Local $aCall = DllCall($g_hlibusb, "int", "libusb_get_device_list", "ptr", $hContext, "ptr*", 0) If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) Local $tlibusb_device_list = DllStructCreate("ptr[" & $aCall[0] & "]", $aCall[2]) Local $ahDevicesList[$aCall[0] + 1] $ahDevicesList[0] = $aCall[2] ;store libusb_device pointer For $i = 1 To $aCall[0] $ahDevicesList[$i] = DllStructGetData($tlibusb_device_list, 1, $i) Next Return $ahDevicesList EndFunc ;==>_libusb_get_device_list Func _libusb_init($bNewhContext = False) If Not $g_hlibusb Then Return SetError(1, 0, -1) Local $sParamType = ($bNewhContext) ? "ptr*" : "ptr" Local $aCall = DllCall($g_hlibusb, "int", "libusb_init", $sParamType, 0) If @error Or Not $aCall[0] = $LIBUSB_SUCCESS Then Return SetError(1, 0, 0) Return $aCall[1] EndFunc ;==>_libusb_init  
    PD: I like your website. It's nice.
    Saludos
  8. Haha
    JockoDundee got a reaction from SkysLastChance in (Solved) Need help with Variabel to numbers   
    I could see this coming in handy
  9. Like
    JockoDundee got a reaction from TheDcoder in ProcessExists() documentation question   
    This topic discussed to the fullest extent of the law here:
     
  10. Like
    JockoDundee got a reaction from Musashi in ProcessExists() documentation question   
    This topic discussed to the fullest extent of the law here:
     
  11. Haha
    JockoDundee reacted to Jos in Secondary GUI does not create events   
    Yea right ...  copied the wrong line in my answer ...   
  12. Thanks
    JockoDundee reacted to Musashi in Automatically fill one input box with text from another input box   
    Try this :
    #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### $Form1_1 = GUICreate("Form1", 372, 218, 192, 124) GUISetBkColor(0x008080) $idUsername = GUICtrlCreateInput("Username", 35, 56, 305, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $idUseremail = GUICtrlCreateInput("email", 35, 84, 305, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_LOWERCASE,$ES_READONLY)) $idPassword = GUICtrlCreateInput("password", 35, 112, 305, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Computer = GUICtrlCreateLabel("Computer Setup", 80, 8, 213, 34) GUICtrlSetFont(-1, 18, 400, 0, "Showcard Gothic") $Exit = GUICtrlCreateButton("Exit", 216, 168, 123, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idUsername GUICtrlSetData($idUseremail, GUICtrlRead($idUsername) & "@email.com") Case $Exit Exit EndSwitch WEnd Edit : @anutt217
    Explanation :
    GUICtrlCreateInput returns a controlID on success, not the data (in this case e.g. not the 'username') itself. To read or set the data you have to use GUICtrlRead or GUICtrlSetData.
  13. Thanks
    JockoDundee reacted to mikell in word find chars like regexp   
    So did you try this ?
    "([0-9]*)[ ][ ]*"
  14. Haha
    JockoDundee reacted to Werty in About unordered, ever-changing cookies and my regex pattern?   
    hwȳ dost thou twēo
    ...if you are really old.
    (i apologise for all of us for the off topic 😛 )
  15. Thanks
    JockoDundee reacted to mikell in About unordered, ever-changing cookies and my regex pattern?   
    #Include <Array.au3> Global $Cookie[4] = ["Cookie: CookieCode001=a%3A4%3A%7Bi%3A0%%3A0%3B%7D; PHPSESSID=aaq4rde1ir38ei0bpmdr2hq2b7", _ "Cookie: PHPSESSID=aaq4rde1ir38ei0bpmdr2hq2b7; CookieCode002=b%3A4%3A%7Bi%3A0%%3A0%3B%7D", _ "Cookie: PHPSESSID=orju6tvclk878bsdp8l3uo9ri2", _ "Cookie: PHPSESSID=ppmgeudm7cdtnsk18fevp49743"] For $i = 0 To 3 $CookieRegExp = StringRegExp($Cookie[$i], '(\w+)=([a-z%0-9A-Z]+(?:; )?)', 3) If IsArray($CookieRegExp) Then ; _ArrayDisplay($CookieRegExp) $txt = "" For $j = 0 To UBound($CookieRegExp)-1 step 2 $txt &= $CookieRegExp[$j] & "=" & $CookieRegExp[$j+1] Next ConsoleWrite("Cookies : " & $txt & @CRLF) EndIf Next Edit
    Doubts, you still have ?
  16. Haha
    JockoDundee reacted to mikell in About unordered, ever-changing cookies and my regex pattern?   
    Why have you doubts ?
    BTW the [^;]* thing is currently useless
  17. Haha
    JockoDundee reacted to Earthshine in About unordered, ever-changing cookies and my regex pattern?   
    Why dost thou doubt?
  18. Thanks
    JockoDundee got a reaction from youtuber in About unordered, ever-changing cookies and my regex pattern?   
    Why does thee doubt ?
  19. Thanks
    JockoDundee got a reaction from youtuber in About unordered, ever-changing cookies and my regex pattern?   
    What are your doubts?
  20. Like
    JockoDundee got a reaction from mixim in Help me please for StringRegExpReplace   
    Well, if you insist:
    $string=StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace(StringRegExpReplace($string, "Ğ", "G"), "İ", "I"), "Ş", "S"), "ğ", "g"), "ı", "i"),"ş", "s") *not tested
  21. Like
    JockoDundee reacted to TheDcoder in EasyCodeIt - cross-platform AutoIt implementation   
    @JockoDundee It's favoring the "more logical" approach of inversion before exponentiation
    > ./eci /tmp/controversy.txt { "op": "Raise", "args": [ { "op": "Invert", "args": [ 3.0 ] }, 2.0 ] } Here is the precedence used by the parser (starting from lowest to highest):
    /* Operators */ %precedence '?' %precedence ':' %left AND "And" OR "Or" %left LT '<' GT '>' LTE "<=" GTE ">=" EQU '=' NEQ "<>" SEQU "==" %left '&' %left '+' '-' %left '*' '/' %left '^' %left NOT "Not" %precedence INVERSION %precedence '.' /* WORKAROUND: Bison can't handle "sandwhich" operators which surround the 2nd part of a binary expression */ %precedence '[' %precedence '(' %precedence GROUPING  
  22. Haha
    JockoDundee got a reaction from TheDcoder in EasyCodeIt - cross-platform AutoIt implementation   
    But what say your parser to the controversial, yet simple expression:
    -3^2
    I would try it myself, but I’m driving
  23. Haha
    JockoDundee got a reaction from TheDcoder in AutoIt Snippets   
    No worries, I just assumed that _ConsoleEraseLine() accidentally ate one of its own lines
  24. Haha
    JockoDundee got a reaction from CarlD in AutoIt Snippets   
    No worries, I just assumed that _ConsoleEraseLine() accidentally ate one of its own lines
  25. Sad
    JockoDundee got a reaction from CarlD in AutoIt Snippets   
    I think it would work now.
    However, my objection was due to the IsInt() statement in your original code:

    a line which no longer exists in the refactored code.
    What was that line supposed to do?
×
×
  • Create New...