Leaderboard
Popular Content
Showing content with the highest reputation on 09/13/2017 in all areas
-
Please Spare me for errors M totally Raw At programming stuffs So please forgive me Coming to udf Why was it required: Udf Already Available had to start with an extension and ws a bit tricky to be used also it was a bit obsolute What Are Functionalities of new udf: not much but a better way of interacting and userfriendliness, using external exe which can workaround with many other browsers Requirements: Chromedriver.exe(available freely)(Chrome)(Please Use version 2.28 as further versions/Previous versions sometime create problems) Geckodriver.exe(available freely)(Mozilla FF)There are some problems with this version m working to resolve same and make udf work with both browsers JSON UDF Browserudf.au3 Example Script For facebook Login Quite Simple to use #Include <browserudf.au3> $id=Browser_Setings(9515,"D:\Desktop\Vinfur\chromedriver.exe") $session=Browser_create_session() Browser_openurl($session,"https://www.facebook.com/") $element=Browser_getelement($session,"name","email") browser_setelement($session,$element,"Username type here") $element=Browser_getelement($session,"id","pass") browser_setelement($session,$element,"Password") $element=Browser_getelement($session,"id","u_0_r") browser_actions_click($session,$element) Browser_Setings_close($id) I Know There are thousands of bugs so please go on correcting me so that i will improve and also udf And Also Sorry that i didnt make any error checking mechanism for any function but as i couldnt get all errors listed/documented anywhere so i will update it as we go ahead and one more thanks to1 point
-
Haven't had much time to code recently. However the following thread inspired me. The debate about linear, parallel and binary search methods was rather interesting and, in an attempt to be diplomatic, I decided to combine @jchd's suggestion with @LarsJ's binary search example. I decided that the binary search algorithm required modification to make it more linear. As usual, 'if you invent something, it probably already exists and if it already exists, it exists for a reason'. My first attempt was not all that good. The code worked but was really a mess. I blame peer pressure (to post an example of a parallel search method). I will delete that old code in due course. With a little memory jogging and a glance at the help file, the solution turned out to be quite easy: I just needed a better understanding of Euler. Further modification will be needed to work with more complicated unicode strings. The output could be returned as an array or a delimitered string. I'm not so interested in those details. I'm just going to post the algorithm for now and anyone, who wants to, can modify it to suit their needs. Both arrays must contain at least 1 element. Local $aFoo = [0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,19,20,23,24,26,30,35,39,40,41] Local $aBar = [0,1,5,6,7,8,9,10,11,12,13,14,17,18,19,21,24,25,26,27,34,35,38,40] ParallelExponetialSearch($aFoo, $aBar) ; Compares two lists - returning positive matches. Each input array must be unique (individually) and in alphabetical order. Func ParallelExponetialSearch($aFoo, $aBar) Local $sFind, _ $iMin_F = -1, $iMax_F = UBound($aFoo) -1, $Lo_F = $iMin_F, $Hi_F, _ $iMin_B = -1, $iMax_B = UBound($aBar) -1, $Lo_B = $iMin_B, $Hi_B While $iMin_F < $iMax_F And $iMin_B < $iMax_B ; Toggle Arrays - Which array has most untested elements? This is the one we want to search next, ; so we can bypass more comparisons because (in theory) mismatches have a greater chance of being skipped. If $iMax_F - $iMin_F >= $iMax_B - $iMin_B Then ; $aFoo has more (or an equal number of) untested elements $Hi_F = $iMax_F $iMin_B += 1 $sFind = $aBar[$iMin_B] While $Lo_F < $Hi_F ; search $aFoo For $i = 0 To Floor(Log($Hi_F - $Lo_F) / Log(2)) $Lo_F = $iMin_F + 2^$i If $aFoo[$Lo_F] = $sFind Then $iMin_F = $Lo_F ; each match should be added to the output [perhaps an array] ConsoleWrite($sFind & " found at $aFoo[" & $Lo_F & "] = $aBar[" & $iMin_B & "]" & @LF) ExitLoop 2 ElseIf $aFoo[$Lo_F] > $sFind Then $Hi_F = $Lo_F -1 $iMin_F += Floor(2^($i -1)) $Lo_F = $iMin_F ContinueLoop 2 EndIf Next $iMin_F = $Lo_F ; minimum increment is one WEnd Else ; $aBar has more untested elements $Hi_B = $iMax_B $iMin_F += 1 $sFind = $aFoo[$iMin_F] While $Lo_B < $Hi_B ; search $aBar For $i = 0 To Floor(Log($Hi_B - $Lo_B) / Log(2)) $Lo_B = $iMin_B + 2^$i If $aBar[$Lo_B] = $sFind Then $iMin_B = $Lo_B ; each match should be added to the output [perhaps an array] ConsoleWrite($sFind & " found at $aFoo[" & $iMin_F & "] = $aBar[" & $Lo_B & "]" & @LF) ExitLoop 2 ElseIf $aBar[$Lo_B] > $sFind Then $Hi_B = $Lo_B -1 $iMin_B += Floor(2^($i -1)) $Lo_B = $iMin_B ContinueLoop 2 EndIf Next $iMin_B = $Lo_B ; minimum increment is one WEnd EndIf WEnd EndFunc ;==> ParallelExponetialSearch I hope this will be useful to someone. I believe it deserved a thread of its own!1 point
-
Ohhh Danyfirex Last gift $array = StringRegExp($response, '(\d+\.\d+)', 3) But reading the helpfile is not such a bad idea1 point
-
1 point
-
quick use for src Func browser_get_attribute($session, $elementid,$attribute) $source = _BrowserGET($baseurl & "/session/" & $session & "/element/" & $elementid & "/attribute/"&$attribute) $json = _JSONDecode($source) $result = _JSONGet($json, "value") Return $result EndFunc ;==>browser_get_Elementvalue Add this in ur script and try once if it works, i havnt tested it yet1 point
-
No worries, glad we got there in the end :-)1 point
-
#include <Array.au3> ;Memory info returned as a string and an array $memoryInfo = _getMemoryInfo() msgbox(0,"Memory Info",$memoryInfo[0]) _ArrayDisplay($memoryInfo[1],"Memory as an Array") Local $newArray[7] $newArray = $memoryInfo[1] msgbox(0,"Test element",$newArray[0]) _ArrayDisplay($newArray) Func _getMemoryInfo() Local $newArray[7] Local $array = MemGetStats() $newArray[0] = $array[0] ;% of memory in use $newArray[1] = Round($array[1]/1024 * 0.001,2) ;Total physical RAM $newArray[2] = Round($array[2]/1024 * 0.001,2) ;Availaible physical RAM $newArray[3] = Round($array[3]/1024 * 0.001,2) ;Total pagefile $newArray[4] = Round($array[4]/1024 * 0.001,2) ;Available pagefile $newArray[5] = Round($array[5]/1024 * 0.001,2) ;Total virtual $newArray[6] = Round($array[6]/1024 * 0.001,2) ;Available virtual $memoryUsage = $newArray[1] - $newarray[2] $pagefileUsage = $newArray[3] - $newarray[4] ;Output/Return Local $returnArray[2] $returnArray[0] = "Memory: " & $memoryUsage & " GB/" & $newArray[1] & " GB " & @CRLF & "Pagefile: " & $pagefileUsage & " GB/" & $newArray[3] & " GB " $returnArray[1] = $newArray return $returnArray EndFunc1 point
-
i'm not sure to understand.... Local $coord = ["38/1,42/1,4367/100", "9/1,2332/100,8/1"] Local $sCalcExpression = "/(60*60)" For $i = 0 To UBound($coord) - 1 $sVal = StringRegExpReplace($coord[$i], ".*(?:^|,)(\d+\/100)\b.*", "$1") $sRes = Execute($sVal & $sCalcExpression) ConsoleWrite($sVal & $sCalcExpression & " = " & $sRes & @CRLF) Next1 point
-
Section has been added to the wiki1 point
-
When you search the web for "gmail attachment noname" you get a lot of hits. Seems it is a problem with gmail1 point
-
The possible error codes are documented in the header of the respective function in the UDF - or in the help file that comes with the download.1 point
-
IIRC we discussed this issue some time ago:1 point
-
OutlookEX UDF - Help & Support (III)
Skysnake reacted to tourism123 for a topic
I tried but it didn't work. I find 2 link. I think it can help but I do not understand much. http://stackoverflow.com/questions/32900976/prevent-winmail-dat-in-outlook-for-gmail-accounts https://blogs.msdn.microsoft.com/stephen_griffin/2008/08/04/forcing-plain-text-with-mapi/ Edit: All my problems have been resolved by DisableTNEF. I fixed it by following the link, it show ok. @water, thank you https://support.microsoft.com/en-us/help/958012/winmail.dat-sent-as-an-email-attachment-in-outlook-2007-and-20101 point -
Maybe this sheds some light onto the subject: https://support.mozilla.org/t5/Basics/What-is-the-winmail-dat-attachment/ta-p/15886 Edit: Or even better: https://www.lifewire.com/prevent-sending-winmail-dat-attachments-11737171 point
-
Disconnected Recordset. I will never get famous for writing nice code !! But I definitely get there, because of the nice intro's I make How much more minimalistic can we get !! Creating a Database and not having to use a DB file or an ODBC, or DNS less connection, or Queries. This means there is no dependency on any external DLL's or what so ever. I have used the technique of a Disconnected Recordset. For those who don' t know what I mean : #include <GUIConstants.au3> #include <GuiListView.au3> Dim $oMyError, $ador Local $listview, $Items, $item1, $item2 Const $adVarChar = 200 Const $MaxCharacters = 255 Const $field1 = "Name" Const $Field2 = "Memo" ; Initializes COM handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $ador = ObjCreate( "ADOR.Recordset" ) ; Create a disconnected ADOR Object with the Beta version With $ador .Fields.append ($field1, $adVarChar, $MaxCharacters) .Fields.append ($Field2, $adVarChar, $MaxCharacters) ;.CursorType = "adOpenDynamic" ;.CursorLocation = "AdUseClient" .Open EndWith GUICreate("No ODBC no DNS no DB no Query 1.0", 600, 400, (@DesktopWidth/2)-300, _ (@DesktopHeight/2)-350, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $listview = GUICtrlCreateListView ("Names |Comments ",10,10,200,350) $btn_1 = GUICtrlCreateButton ("Build the DB", 10, 365, 110, 20) $btn_2 = GUICtrlCreateButton ("Refresh", 130, 365, 110, 20) GUISetState() With $ador .AddNew .Fields(0).Value = "AutoIT" $item1= .Fields(0).Value .Fields(1).Value = "Isn't it great !!" $item2= .Fields(1).Value $items=GUICtrlCreateListViewItem($item1&"|"&$item2,$listview) .AddNew .Fields(0).Value = "ptrex" $item1= .Fields(0).Value .Fields(1).Value = "Or am I great ?" $item2= .Fields(1).Value $items=GUICtrlCreateListViewItem($item1&"|"&$item2,$listview) EndWith While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $btn_1 _Build_DB() Case $msg = $btn_2 _Refresh() EndSelect WEnd Exit Func _Build_DB () If not IsObj($ador) Then MsgBox(0,"Error","Cannot create Object") EndIf With $ador For $i = 0 To 49 .AddNew .Fields(0).Value = "Name" & $i+1 $item1= .Fields(0).Value .Fields(1).Value = "Added some more" $item2= .Fields(1).Value $items=GUICtrlCreateListViewItem($item1&"|"&$item2,$listview) Next EndWith EndFunc Func _Refresh() _GUICtrlListViewDeleteAllItems ($listview) _Build_DB() EndFunc ; This is Sven P's custom error handler added by ptrex Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc ADOR_example.au3 And for those who thought who that DNS less connections was the ultimate Enjoy !!1 point